From 3f2a17b2f0a0bf00e06e7fb77c182e36e2eeac84 Mon Sep 17 00:00:00 2001 From: Alex Klimenkov Date: Wed, 31 Jul 2024 17:53:38 +0300 Subject: [PATCH] [update] version 7.1.0 --- README.md | 4 +- bower.json | 2 +- codebase/dhtmlxscheduler.css | 2 +- codebase/dhtmlxscheduler.d.ts | 54 +- codebase/dhtmlxscheduler.es.d.ts | 54 +- codebase/dhtmlxscheduler.es.js | 13424 ++++++---- codebase/dhtmlxscheduler.es.js.map | 2 +- codebase/dhtmlxscheduler.js | 170 +- codebase/dhtmlxscheduler.js.map | 2 +- codebase/sources/dhtmlxscheduler.css | 126 +- codebase/sources/dhtmlxscheduler.es.js | 20966 +++++++++------- codebase/sources/dhtmlxscheduler.es.js.map | 2 +- codebase/sources/dhtmlxscheduler.js | 20966 +++++++++------- codebase/sources/dhtmlxscheduler.js.map | 2 +- codebase/sources/less/package.json | 2 +- codebase/sources/less/src/agenda_legacy.less | 1 + codebase/sources/less/src/lightbox.less | 38 +- codebase/sources/less/src/misc.less | 44 + .../less/src/themes/contrast_black.less | 2 + codebase/sources/less/src/themes/dark.less | 1 + .../sources/less/src/themes/variables.less | 3 + package.json | 2 +- whatsnew.md | 16 + 23 files changed, 33373 insertions(+), 22512 deletions(-) diff --git a/README.md b/README.md index 32a031b..325b4b2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dhtmlxScheduler # [![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/) -[![npm: v.7.0.5](https://img.shields.io/badge/npm-v.7.0.5-blue.svg)](https://www.npmjs.com/package/dhtmlx-scheduler) +[![npm: v.7.1.0](https://img.shields.io/badge/npm-v.7.1.0-blue.svg)](https://www.npmjs.com/package/dhtmlx-scheduler) [![License: GPL v2](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) [DHTMLX Scheduler](https://dhtmlx.com/docs/products/dhtmlxScheduler) is a JavaScript library that allows you to add a Google-like scheduler to your web app or website. @@ -87,7 +87,7 @@ scheduler.parse([ ## License ## -dhtmlxScheduler v.7.0.5 Standard +dhtmlxScheduler v.7.1.0 Standard To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com diff --git a/bower.json b/bower.json index b2e5e3d..7e8ab39 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "scheduler", - "version": "7.0.5", + "version": "7.1.0", "homepage": "https://dhtmlx.com/docs/products/dhtmlxScheduler/", "description": "JavaScript event calendar. Allows to manage events and appointments in different views", "main": [ diff --git a/codebase/dhtmlxscheduler.css b/codebase/dhtmlxscheduler.css index b4d2e5d..73319f1 100644 --- a/codebase/dhtmlxscheduler.css +++ b/codebase/dhtmlxscheduler.css @@ -1 +1 @@ -@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuOKfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZg.ttf) format("truetype")}:root{--dhx-scheduler-theme: terrace;--dhx-scheduler-font-family: Inter, Helvetica, Arial, sans-serif;--dhx-scheduler-font-size: 14px;--dhx-scheduler-heading-font-size: calc(var(--dhx-scheduler-font-size) + 2px);--dhx-scheduler-heading-font-weight: 600;--dhx-scheduler-important-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-important-line-height: 142%;--dhx-scheduler-important-font-weight: 500;--dhx-scheduler-regular-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-regular-font-weight: 400;--dhx-scheduler-regular-line-height: 142%;--dhx-scheduler-caption-font-size: calc(var(--dhx-scheduler-font-size) - 2px);--dhx-scheduler-caption-font-weight: 400;--dhx-scheduler-caption-line-height: 132%;--dhx-scheduler-base-colors-primary: #537CFA;--dhx-scheduler-base-colors-primary-hover: #4269E0;--dhx-scheduler-base-colors-primary-active: #3365fb;--dhx-scheduler-base-colors-primary-lighter: #537cfa33;--dhx-scheduler-base-colors-warning: #FAB936;--dhx-scheduler-base-colors-error: #E3334E;--dhx-scheduler-base-colors-error-hover: #D3233E;--dhx-scheduler-base-colors-error-active: #C3132E;--dhx-scheduler-base-colors-error-lighter: #E3334E33;--dhx-scheduler-base-colors-error-text: #FFFFFF;--dhx-scheduler-base-colors-success: #1BC297;--dhx-scheduler-base-colors-secondary: rgba(0, 0, 0, .04);--dhx-scheduler-base-colors-secondary-hover: rgba(0, 0, 0, .1);--dhx-scheduler-base-colors-white: #FFFFFF;--dhx-scheduler-base-colors-select: #EFF3FF;--dhx-scheduler-base-colors-hover-color: #e0e0e0;--dhx-scheduler-base-colors-border: #D0DBE3;--dhx-scheduler-base-colors-icons: #A1A4A6;--dhx-scheduler-base-colors-icons-active: #8b8e90;--dhx-scheduler-base-colors-icons-hover: #76787a;--dhx-scheduler-base-colors-disabled: #E9E9E9;--dhx-scheduler-base-colors-readonly: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-base-colors-text-light: #44494E;--dhx-scheduler-base-colors-text-base: #23272A;--dhx-scheduler-base-colors-background: #FFFFFF;--dhx-scheduler-container-background: var(--dhx-scheduler-base-colors-background);--dhx-scheduler-container-color: var(--dhx-scheduler-base-colors-text-base);--dhx-scheduler-container-background-alt: rgba(0, 0, 0, .4);--dhx-scheduler-base-transition: .2s ease;--dhx-scheduler-box-shadow-s: 0px 4px 24px 0px rgba(44, 47, 60, .08);--dhx-scheduler-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-scheduler-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-scheduler-base-module: 4px;--dhx-scheduler-base-padding: 4px;--dhx-scheduler-border-radius: var(--dhx-scheduler-base-module);--dhx-scheduler-event-colors-primary: #537CFA;--dhx-scheduler-event-text-primary: rgba(255, 255, 255, .9);--dhx-scheduler-toolbar-height: 40px;--dhx-scheduler-transition: all .3s;--dhx-scheduler-navline-font-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-default-border: 1px solid var(--dhx-scheduler-base-colors-border);--dhx-scheduler-header-border: var(--dhx-scheduler-default-border);--dhx-scheduler-halfhour-border: 1px dotted var(--dhx-scheduler-base-colors-border);--dhx-scheduler-event-background-primary: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-event-blue: linear-gradient(180deg, #527CFF 0%, #9751FC 100%);--dhx-scheduler-event-green: linear-gradient(180deg, #12D979 0%, #1ECDEB 100%);--dhx-scheduler-event-violet: linear-gradient(180deg, #D071EF 0%, #EE71D5 100%);--dhx-scheduler-event-yellow: linear-gradient(180deg, #FFB725 0%, #FFBB25 31.25%, #FAEA27 100%);--dhx-scheduler-event-title-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-event-title-line-height: var(--dhx-scheduler-caption-line-height);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-regular-font-size);--dhx-scheduler-event-text-line-height: var(--dhx-scheduler-regular-line-height);--dhx-scheduler-event-text-font-weight: var(--dhx-scheduler-regular-font-weight);--dhx-scheduler-event-bar-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-event-bar-line-height: var(--dhx-scheduler-caption-line-height);--dhx-scheduler-event-menu-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-event-menu-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-event-background: var(--dhx-scheduler-event-blue);--dhx-scheduler-event-border: none;--dhx-scheduler-event-color: var(--dhx-scheduler-event-text-primary);--dhx-scheduler-event-line-text: var(--dhx-scheduler-container-color);--dhx-scheduler-event-marker-color: var(--dhx-scheduler-event-background);--dhx-scheduler-popup-background: var(--dhx-scheduler-container-background);--dhx-scheduler-popup-color: var(--dhx-scheduler-container-color);--dhx-scheduler-popup-border: none;--dhx-scheduler-popup-border-radius: var(--dhx-scheduler-border-radius);--dhx-scheduler-control-height: 32px;--dhx-scheduler-checkbox-height: 20px;--dhx-scheduler-lightbox_font-family: var(--dhx-scheduler-font-family);--dhx-scheduler-lightbox-font-size: var(--dhx-scheduler-important-font-size);--dhx-scheduler-lightbox-font-weight: var(--dhx-scheduler-important-font-weight);--dhx-scheduler-lightbox-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-lightbox-border: var(--dhx-scheduler-popup-border);--dhx-scheduler-lightbox-control-border: var(--dhx-scheduler-default-border);--dhx-scheduler-lightbox-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-lightbox-title-background: var(--dhx-scheduler-base-colors-select);--dhx-scheduler-lightbox-title-color: var(--dhx-scheduler-lightbox-color);--dhx-scheduler-lightbox-title-font-size: var(--dhx-scheduler-heading-font-size);--dhx-scheduler-lightbox-max-width: 496px;--dhx-scheduler-lightbox-wide-max-width: 738px;--dhx-scheduler-lightbox-width: var(--dhx-scheduler-lightbox-max-width);--dhx-scheduler-scale-color: var(--dhx-scheduler-container-color);--dhx-scheduler-timescale-background: var(--dhx-scheduler-container-background);--dhx-scheduler-timescale-today-background: var(--dhx-scheduler-base-colors-select);--dhx-scheduler-hours-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-hours-font-weight: var(--dhx-scheduler-caption-font-weight);--dhx-scheduler-inactive-month-color: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-month-header-color: var(--dhx-scheduler-container-color);--dhx-scheduler-month-day-header-padding: var(--dhx-scheduler-base-padding) calc(var(--dhx-scheduler-base-padding) * 2);--dhx-scheduler-month-event-marker-size: calc(var(--dhx-scheduler-base-module) * 2);--dhx-scheduler-list-line-height: 36px;--dhx-scheduler-agenda-date-column-width: 188px;--dhx-scheduler-grid-event-background: transparent;--dhx-scheduler-grid-event-text: initial;--dhx-scheduler-timeline-folder-background: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-timeline-folder-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-blocked-time-background: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-today-marker-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-datepicker-width: 250px;--dhx-scheduler-datepicker-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-datepicker-family: var(--dhx-scheduler-font-family);--dhx-scheduler-datepicker-cell-size: 28px;--dhx-scheduler-datepicker-header-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-datepicker-header-font-weight: 500;--dhx-scheduler-datepicker-padding: 5px;--dhx-scheduler-datepicker-inactive-month-color: var(--dhx-scheduler-inactive-month-color);--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-datepicker-today-color: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-datepicker-today-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-datepicker-weekend-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-datepicker-weekend-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-datepicker-disabled-color: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-datepicker-disabled-background: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-datepicker-hover-color: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-datepicker-hover-background: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-datepicker-prevnext-color: var(--dhx-scheduler-inactive-month-color);--dhx-scheduler-datepicker-prevnext-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-btn-outline-background: transparent;--dhx-scheduler-btn-outline-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-outline-border-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-outline-background-hover: var(--dhx-scheduler-base-colors-primary-lighter);--dhx-scheduler-btn-outline-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-outline-border-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-outline-background-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-outline-color-active: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-outline-border-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-outline-background-disabled: transparent;--dhx-scheduler-btn-outline-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-outline-border-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-text-transform: none;--dhx-scheduler-xy-scale_width: 50px;--dhx-scheduler-xy-bar_height: 24;--dhx-scheduler-xy-month_head_height: 26;--dhx-scheduler-xy-scale_height: 24px;--dhx-scheduler-xy-scroll_width: 18px;--dhx-scheduler-info-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-info-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-info-border: var(--dhx-scheduler-popup-border);--dhx-scheduler-info-shadow: var(--dhx-scheduler-box-shadow-m);--dhx-scheduler-modal-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-modal-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-modal-border: var(--dhx-scheduler-popup-border);--dhx-scheduler-modal-padding: 16px;--dhx-scheduler-modal-width: 320px;--dhx-scheduler-modal-border-radius: var(--dhx-scheduler-popup-border-radius)}:root[data-scheduler-theme=dark]{--dhx-scheduler-theme: dark;--dhx-scheduler-base-colors-disabled: #3d3d3d;--dhx-scheduler-base-colors-text-light: #AAA;--dhx-scheduler-base-colors-text-base: rgba(255, 255, 255, .9);--dhx-scheduler-base-colors-background: #000000;--dhx-scheduler-base-colors-border: #4B4B4B;--dhx-scheduler-navline-font-color: var(--dhx-scheduler-base-colors-text-base);--dhx-scheduler-base-colors-primary: #3B72F8;--dhx-scheduler-base-colors-primary-hover: #1D5AEE;--dhx-scheduler-base-colors-primary-active: #0e50ea;--dhx-scheduler-base-colors-primary-lighter: #3B72F833;--dhx-scheduler-base-colors-error: #EB284F;--dhx-scheduler-base-colors-error-hover: #D9264A;--dhx-scheduler-base-colors-error-active: #ba0a24;--dhx-scheduler-base-colors-error-lighter: #EB284F33;--dhx-scheduler-base-colors-select: #2A2A2A;--dhx-scheduler-base-colors-hover-color: #2A2A2A;--dhx-scheduler-base-colors-icons: #AAAAAA;--dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-popup-background: #1B1B1C;--dhx-scheduler-popup-border: 1px solid #4B4B4B;--dhx-scheduler-btn-font-weight: 600}:root[data-scheduler-theme=flat]{--dhx-scheduler-theme: flat;--dhx-scheduler-font-family: Segoe UI,Arial,san-serif;--dhx-scheduler-base-colors-primary: #0288D1;--dhx-scheduler-base-colors-primary-hover: #007cbf;--dhx-scheduler-base-colors-primary-active: #00659b;--dhx-scheduler-base-colors-primary-lighter: #edf8ff;--dhx-scheduler-event-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-base-colors-border: #cecece;--dhx-scheduler-halfhour-border: 1px solid #e8e8e8;--dhx-scheduler-event-title-font-size: 12px;--dhx-scheduler-event-text-font-size: 14px;--dhx-scheduler-event-text-font-weight: 500;--dhx-scheduler-heading-font-size: 22px;--dhx-scheduler-heading-font-weight: 300;--dhx-scheduler-caption-font-size: 14px;--dhx-scheduler-caption-font-weight: 400;--dhx-scheduler-hours-font-size: 12px;--dhx-scheduler-scale-color: #767676;--dhx-scheduler-border-radius: 0;--dhx-scheduler-timeline-folder-background: #ebeced;--dhx-scheduler-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-scheduler-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-scheduler-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-scheduler-config-form_wide: 1;--dhx-scheduler-xy-scale_height: 35px}:root[data-scheduler-theme=flat] .dhx_cal_navline{--dhx-scheduler-btn-outline-border-color: transparent;--dhx-scheduler-btn-outline-border-hover: transparent;--dhx-scheduler-btn-outline-border-color-disabled: transparent}:root[data-scheduler-theme=flat] .dhx_scale_hour{justify-content:center}:root[data-scheduler-theme=flat] .dhx_cal_tab{min-width:90px}:root[data-scheduler-theme=flat] .dhx_cal_navline>div{order:1}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_next_button{order:6}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_today_button{order:5;border-color:transparent}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_prev_button{order:4}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_date{order:3}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_date{margin-left:auto;margin-right:auto}:root[data-scheduler-theme=flat] .dhx_data_table.folder .dhx_matrix_cell{border-right:0}:root[data-scheduler-theme=flat] .dhx_timeline_scale_header{border-right:none}:root[data-scheduler-theme=flat] .dhx_cal_container_rtl .dhx_timeline_scale_header{border-left:unset}:root[data-scheduler-theme=flat] .dhx_scale_hour{display:flex;flex-direction:row}:root[data-scheduler-theme=flat] .dhx_scale_hour .dhx_scale_h{font-size:22px;line-height:44px;font-weight:lighter}:root[data-scheduler-theme=flat] .dhx_scale_hour .dhx_scale_m{font-size:11px;line-height:35px;align-self:end;font-weight:lighter;transform:translateY(-2px)}:root[data-scheduler-theme=material]{--dhx-scheduler-theme: material;--dhx-scheduler-font-family: Roboto, Helvetica, Arial, sans-serif;--dhx-scheduler-base-colors-primary: #0288D1;--dhx-scheduler-base-colors-primary-hover: #007cbf;--dhx-scheduler-base-colors-primary-active: #00659b;--dhx-scheduler-base-colors-primary-lighter: #edf8ff;--dhx-scheduler-event-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-base-colors-border: #e0e0e0;--dhx-scheduler-event-title-font-size: calc(var(--dhx-scheduler-font-size) - 2px);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-event-text-font-weight: 500;--dhx-scheduler-heading-font-size: 20px;--dhx-scheduler-caption-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-caption-font-weight: 500;--dhx-scheduler-btn-font-weight: 500;--dhx-scheduler-heading-font-weight: 500;--dhx-scheduler-hours-font-size: calc(var(--dhx-scheduler-font-size) - 2px);--dhx-scheduler-base-colors-text-base: rgba(0, 0, 0, .75);--dhx-scheduler-header-border: 1px solid transparent;--dhx-scheduler-scale-color: rgba(0, 0, 0, .54);--dhx-scheduler-border-radius: 0;--dhx-scheduler-btn-text-transform: uppercase;--dhx-scheduler-btn-padding: 1px 20px 0;--dhx-scheduler-halfhour-border: none;--dhx-scheduler-timeline-folder-background: #ebeced;--dhx-scheduler-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-scheduler-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-scheduler-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-scheduler-lightbox-title-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-lightbox-title-color: #FFFFFF;--dhx-scheduler-lightbox-title-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-lightbox-wide-max-width: 540px;--dhx-scheduler-config-form_wide: 1}:root[data-scheduler-theme=material] .dhx_scale_hour{justify-content:center}:root[data-scheduler-theme=material] .dhx_cal_tab{min-width:90px}:root[data-scheduler-theme=material] .dhx_cal_navline>div{order:1}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_next_button{order:6}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_today_button{order:5;border-color:transparent}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_prev_button{order:4}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_date{order:3}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_date{margin-left:auto;margin-right:auto}:root[data-scheduler-theme=material] .dhx_data_table.folder .dhx_matrix_cell{border-right:0}:root[data-scheduler-theme=material] .dhx_timeline_scale_header{border-right:none}:root[data-scheduler-theme=material] .dhx_cal_container_rtl .dhx_timeline_scale_header{border-left:unset}:root[data-scheduler-theme=material] .dhx_cal_scale_placeholder{position:absolute;z-index:2;box-shadow:0 3px 5px #0000001a;left:0;pointer-events:none}:root[data-scheduler-theme=material] .dhx_year_box .dhx_year_month{font-weight:500;color:var(--dhx-scheduler-base-colors-primary)}:root[data-scheduler-theme=material] .dhx_year_box .dhx_month_head.dhx_year_event:after{content:none}:root[data-scheduler-theme=material] .dhx_year_box .dhx_year_event{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-hover-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-hover-background)}:root[data-scheduler-theme=material] .dhx_cal_ltitle{font-weight:400;text-transform:uppercase}:root[data-scheduler-theme=material] .dhx_cal_ltitle_controls{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-lightbox-title-color)}:root[data-scheduler-theme=material] .dhx_timeline_scale_header{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%}:root[data-scheduler-theme=contrast-white]{--dhx-scheduler-theme: contrast-white;--dhx-scheduler-base-colors-disabled: #C2C2C2;--dhx-scheduler-base-colors-text-light: #303030;--dhx-scheduler-base-colors-text-base: #303030;--dhx-scheduler-base-colors-background: #FFFFFF;--dhx-scheduler-base-colors-border: #4D595B;--dhx-scheduler-base-colors-primary: #0A47CD;--dhx-scheduler-base-colors-primary-hover: #093fb3;--dhx-scheduler-base-colors-primary-active: #08379b;--dhx-scheduler-base-colors-primary-lighter: #0A47CD;--dhx-scheduler-event-background: #0A47CD;--dhx-scheduler-event-color: #FFF;--dhx-scheduler-event-border: 1px solid rgba(0, 0, 0, .1);--dhx-scheduler-base-colors-warning: #FCBA2E;--dhx-scheduler-base-colors-success: #77D257;--dhx-scheduler-base-colors-error: #FFA7A0;--dhx-scheduler-base-colors-error-hover: #d88d88;--dhx-scheduler-base-colors-error-active: #cd8984;--dhx-scheduler-base-colors-error-lighter: #FFA7A0;--dhx-scheduler-base-colors-error-text: #141414;--dhx-scheduler-btn-color: #FFFFFF;--dhx-scheduler-btn-color-hover: #FFFFFF;--dhx-scheduler-btn-color-active: #FFFFFF;--dhx-scheduler-base-colors-select: #E7E5E5;--dhx-scheduler-base-colors-hover-color: #E7E5E5;--dhx-scheduler-base-colors-icons: #303030;--dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-popup-background: #FFF;--dhx-scheduler-popup-border: 1px solid #4D595B;--dhx-scheduler-font-size: 16px;--dhx-scheduler-heading-font-size: 24px;--dhx-scheduler-important-font-size: 16px;--dhx-scheduler-regular-font-size: 16px;--dhx-scheduler-caption-font-size: 16px;--dhx-scheduler-btn-outline-color-hover: #FFFFFF;--dhx-scheduler-btn-outline-color-active: #FFFFFF}:root[data-scheduler-theme=contrast-black]{--dhx-scheduler-theme: contrast-black;--dhx-scheduler-base-colors-disabled: #3d3d3d;--dhx-scheduler-base-colors-text-light: #cfcfcf;--dhx-scheduler-base-colors-text-base: #FFFFFFCC;--dhx-scheduler-base-colors-background: #141414;--dhx-scheduler-base-colors-border: rgba(255, 255, 255, .8);--dhx-scheduler-base-colors-primary: #A395FF;--dhx-scheduler-base-colors-primary-hover: #C5BCFF;--dhx-scheduler-base-colors-primary-active: #C5BCFF;--dhx-scheduler-base-colors-primary-lighter: #C5BCFF;--dhx-scheduler-event-background: #A395FF;--dhx-scheduler-event-color: #141414;--dhx-scheduler-event-border: 1px solid rgba(0, 0, 0, .1);--dhx-scheduler-base-colors-warning: #694E02;--dhx-scheduler-base-colors-success: #115700;--dhx-scheduler-base-colors-error: #FFA7A0;--dhx-scheduler-base-colors-error-hover: #fb9891;--dhx-scheduler-base-colors-error-active: #fe8b83;--dhx-scheduler-base-colors-error-lighter: #ffa6a03e;--dhx-scheduler-base-colors-error-text: #141414;--dhx-scheduler-btn-color: #141414;--dhx-scheduler-btn-color-hover: #141414;--dhx-scheduler-btn-color-active: #141414;--dhx-scheduler-base-colors-select: #2A2A2A;--dhx-scheduler-base-colors-hover-color: #2A2A2A;--dhx-scheduler-base-colors-icons: #AAAAAA;--dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-popup-background: #1B1B1C;--dhx-scheduler-popup-border: 1px solid #4B4B4B;--dhx-scheduler-font-size: 16px;--dhx-scheduler-heading-font-size: 24px;--dhx-scheduler-important-font-size: 16px;--dhx-scheduler-regular-font-size: 16px;--dhx-scheduler-caption-font-size: 16px;--dhx-scheduler-btn-outline-color-hover: #141414;--dhx-scheduler-btn-outline-color-active: #141414}@font-face{font-family:dhx-scheduler-icons;src:url(data:font/woff;base64,d09GRgABAAAAAAh0AAsAAAAAEBwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPwAAAGA97Us7Y21hcAAAAYQAAADjAAADMPMkIBtnbHlmAAACaAAAA0IAAAaMK6vwRWhlYWQAAAWsAAAALAAAADZYpKBVaGhlYQAABdgAAAAbAAAAJAJpATlobXR4AAAF9AAAABQAAABsHbAAAGxvY2EAAAYIAAAAOAAAADgWjBgkbWF4cAAABkAAAAAfAAAAIAExAD1uYW1lAAAGYAAAAUEAAAKazYPp33Bvc3QAAAekAAAAzwAAATGzVblzeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGGUZJzAwMrAwLCP4RKQ1ILSExj4GHwZGJgYWJkZsIKANNcUhgMfGT8qMuoAudKM7mBhRhRFTAAf7QmqAHic7dJZbsIwGEXhY2IChDDP6UDz3lV1QX3qYzfpFVDf/1ZdRSN9tmwlR8IGmAJN9V5lSF8k9HzW3RT7DV3sZz7inaz9Mj4edUwa6zrHOKnv5lpsmTH/Wy3qqmNJz4o1G7bs6mrPgSMnzly41rdvDDXR8v/0GtL372rUKVuc+8TQ3Jjur2TTTZSp6W5La2ieGZrnhuaFRbOzaC4tmr1Fc2Xou7VFc2P6v5StocbO9MvK3lDjYKhxNNQ4GWqcDTUuFs2rod7NUG8w1Hsy1Hs21Hsx1Hs11LtbnMmbofZoDD/W808GAHicjVS9T9tAFH8HmEscO26+sK6BlNglRgoNlfNhJWlt9SNZ/AfA0oohW6f+AdlYiNSO/gOoOqIwdWkXBiSGDl3Yqkq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8jr/kRv/nBxYtt26pyvJSQmQI7TncnTiIxYTCO050U6nWvYAb7mRtDvcqEdazkmSrHFKiSta3SqmUOQ2LKTH5l48wXkLLMKZ6iyNmIOZnJamIuZrG8s565xEt6k8vth7w85LUS54EzNj903nYe2mP7sXz3xWaP9eO5feoxl8W5cRJ/qs0bW0WV3cqlqqcCFVTX5jX2ZcjlL9KsHJLOkN7Wo4dylqT62aRKlqpApRL5WKpv69vGFlnz338pgMi3SwIQ8AyArwKtXw5lEJcHRJaopGTGCkbz9agy85sDiKpaKM+/pqvyalweEG25gPUHmC/14gd+TEyKgknqQKKuIB/GbczSFGj/G+WPNJYNdo7Jbver7Yp6ACurX10bhou2dQU2Goj9JNyf7/9w20cl/8s+b+lydyqZKFViZtj4YUAsXhOJBP7HJObwIomCfHFl0MgiP5V6rMtgbljXJyYuHYhFPj2IpC6j93bJZxs6wnAQ1OB4j2hEeZbo1OBtc8P6N2KyyNuDDHj/kQk//+S07i/9Lj5WBSK6K6GsEnAuHxiuZOW9veJ3/aCUxNns1tuWkifMKFY5hDk/TbmFvao3Xrg2R86oSMSmEb4g6DqqNofNxtc92Rq4bjnRw0oBIuRcESRWEsDyj/x4swzmtgvkXSBQPyXzwt8WhrGzth3N/KRyTbylglzj7OmXLm6CvXJXfiVPsJpxHI0LJVnJP6qpz71AoOPX4gi5jYON7ctL1XrGuj6V/F4q2jU7l01AwcAhIKGgr3JP4uAREJHmZd3243y53u4P/XE7taZOrAjfK+fqnHgTep1WkBSijgap12YE4s2zszIAmwGpDxHh37cjPuXAIaHi0KHaRGXgWEsVBye4LZ3YUEWW9OKsluZ5eZuxTOODXq50D13SQZpMiYJDYkudHHo15uvY85s3EYv5OUGH/3sNXcuosGhlC4yjMg4LtFoAAA==) format("woff2")}.scheduler_icon:before,.dhx_menu_icon:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.scheduler_icon.alert:before,.dhx_menu_icon.icon_alert:before{content:""}.scheduler_icon.arrow_down:before,.dhx_menu_icon.icon_arrow_down:before{content:""}.scheduler_icon.arrow_left:before,.dhx_menu_icon.icon_arrow_left:before{content:"";font-size:24px}.scheduler_icon.arrow_right:before,.dhx_menu_icon.icon_arrow_right:before{content:"";font-size:24px}.scheduler_icon.arrow_up:before,.dhx_menu_icon.icon_arrow_up:before{content:""}.scheduler_icon.calendar:before,.dhx_menu_icon.icon_calendar:before{content:""}.scheduler_icon.cancel:before,.dhx_menu_icon.icon_cancel:before{content:""}.scheduler_icon.check:before,.dhx_menu_icon.icon_check:before{content:""}.scheduler_icon.chevron_down:before,.dhx_menu_icon.icon_chevron_down:before{content:"";font-size:24px}.scheduler_icon.chevron_left:before,.dhx_menu_icon.icon_chevron_left:before{content:"";font-size:24px}.scheduler_icon.chevron_right:before,.dhx_menu_icon.icon_chevron_right:before{content:"";font-size:24px}.scheduler_icon.chevron_up:before,.dhx_menu_icon.icon_chevron_up:before{content:"";font-size:24px}.scheduler_icon.clock:before,.dhx_menu_icon.icon_clock:before{content:""}.scheduler_icon.close:before,.dhx_menu_icon.icon_close:before{content:""}.scheduler_icon.delete:before,.dhx_menu_icon.icon_delete:before{content:"";font-size:18px}.scheduler_icon.details:before,.dhx_menu_icon.icon_details:before{content:""}.scheduler_icon.dots_h:before,.dhx_menu_icon.icon_dots_h:before{content:""}.scheduler_icon.dots_v:before,.dhx_menu_icon.icon_dots_v:before{content:""}.scheduler_icon.drag_horizontal:before,.dhx_menu_icon.icon_drag_horizontal:before{content:""}.scheduler_icon.drag_vertical:before,.dhx_menu_icon.icon_drag_vertical:before{content:""}.scheduler_icon.drag:before,.dhx_menu_icon.icon_drag:before{content:""}.scheduler_icon.edit:before,.dhx_menu_icon.icon_edit:before{content:""}.scheduler_icon.form:before,.dhx_menu_icon.icon_form:before{content:""}.scheduler_icon.iclose:before,.dhx_menu_icon.icon_iclose:before{content:""}.scheduler_icon.loading:before,.dhx_menu_icon.icon_loading:before{content:""}.scheduler_icon.menu:before,.dhx_menu_icon.icon_menu:before{content:""}.scheduler_icon.menu_down:before,.dhx_menu_icon.icon_menu_down:before{content:""}.scheduler_icon.menu_right:before,.dhx_menu_icon.icon_menu_right:before{content:""}.scheduler_icon.ok:before,.dhx_menu_icon.icon_ok:before{content:""}.scheduler_icon.plus:before,.dhx_menu_icon.icon_plus:before{content:""}.scheduler_icon.save:before,.dhx_menu_icon.icon_save:before{content:""}.scheduler_icon.sort_asc:before,.dhx_menu_icon.icon_sort_asc:before{content:""}.scheduler_icon.sort_desc:before,.dhx_menu_icon.icon_sort_desc:before{content:""}.button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer}.button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.button-outline{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.button-danger{--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error-text);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active)}.button-danger-outline{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-lighter);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-base-colors-icons)}.button-danger-link{padding:6px 0;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.button-link{padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.button-icon{min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.button-icon:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.button-icon:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.button-icon:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_cal_btn,.dhx_cal_btn_danger,.dhx_cal_btn_outline,.dhx_cal_btn_danger_outline,.dhx_cal_btn_danger_link,.dhx_btn_set,.dhx_cal_tab,.dhx_qi_big_icon,.dhx_cal_today_button,.dhx_cal_tab_standalone{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer}.dhx_cal_btn:hover,.dhx_cal_btn_danger:hover,.dhx_cal_btn_outline:hover,.dhx_cal_btn_danger_outline:hover,.dhx_cal_btn_danger_link:hover,.dhx_btn_set:hover,.dhx_cal_tab:hover,.dhx_qi_big_icon:hover,.dhx_cal_today_button:hover,.dhx_cal_tab_standalone:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_btn:active,.dhx_cal_btn_danger:active,.dhx_cal_btn_outline:active,.dhx_cal_btn_danger_outline:active,.dhx_cal_btn_danger_link:active,.dhx_btn_set:active,.dhx_cal_tab:active,.dhx_qi_big_icon:active,.dhx_cal_today_button:active,.dhx_cal_tab_standalone:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_btn:disabled,.dhx_cal_btn_danger:disabled,.dhx_cal_btn_outline:disabled,.dhx_cal_btn_danger_outline:disabled,.dhx_cal_btn_danger_link:disabled,.dhx_btn_set:disabled,.dhx_cal_tab:disabled,.dhx_qi_big_icon:disabled,.dhx_cal_today_button:disabled,.dhx_cal_tab_standalone:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.scheduler_popup_button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer}.scheduler_popup_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.scheduler_popup_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.scheduler_popup_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.scheduler_popup_button:not(.scheduler_ok_button){--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.scheduler_ok_button{--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error-text);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active)}.dhx_cal_btn_outline,.dhx_cal_btn_danger_outline{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.dhx_cal_button_danger,.dhx_cal_button_danger_outline{--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error-text);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active)}.dhx_cal_button_link,.dhx_qi_big_icon{padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;user-select:none}.dhx_cal_container{position:relative;overflow:hidden;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size);line-height:110%;display:flex;flex-direction:column;background-color:var(--dhx-scheduler-container-background);color:var(--dhx-scheduler-container-color);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}.dhx_cal_container div[role=button]{cursor:pointer}.dhx_cal_container.dhx_cal_container_rtl{direction:rtl}.dhx_cal_container,.dhx_cal_container *{box-sizing:border-box}.dhx_cal_container div{-webkit-user-select:none;user-select:none}.dhx_cal_data,.dhx_cal_event,.dhx_cal_event_clear,.dhx_cal_event_line{touch-action:pan-y}.dhx_cal_navline{position:relative;display:flex;align-items:center;flex-wrap:wrap;row-gap:8px;justify-content:space-between;font-weight:var(--dhx-scheduler-important-font-weight);padding:12px;min-height:var(--dhx-scheduler-toolbar-height);color:var(--dhx-scheduler-navline-font-color)}.dhx_cal_navline_flex .dhx_cal_navbar_rows_container{display:flex;align-items:center;flex-direction:column;box-sizing:border-box;flex-grow:1;gap:12px;height:100%}.dhx_cal_navline_flex .dhx_cal_date{width:auto;margin-left:auto;margin-right:auto}.dhx_cal_navline_flex .dhx_cal_today_button{order:unset}.dhx_cal_navline_flex .dhx_cal_navbar_row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding:0 1vw;box-sizing:border-box;height:100%;width:100%;flex-grow:1;flex-shrink:1}.dhx_cal_navline_flex .dhx_cal_line_spacer{display:block;width:auto;flex-grow:1}@media only screen and (max-width: 1023px){.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button,.dhx_cal_navline_flex .dhx_cal_tab,.dhx_cal_navline_flex .dhx_cal_tab.active,.dhx_cal_navline_flex .dhx_cal_today_button{height:2.5vw;line-height:2.5vw}}@media only screen and (max-width: 840px){.dhx_cal_navline_flex{--dhx-scheduler-btn-padding: 0 12px}.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button,.dhx_cal_navline_flex .dhx_cal_tab,.dhx_cal_navline_flex .dhx_cal_tab.active,.dhx_cal_navline_flex .dhx_cal_today_button{height:4vw;line-height:4vw}}@media only screen and (max-width: 480px){.dhx_cal_navline_flex{--dhx-scheduler-btn-padding: 0 4px}.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button{width:2rem}}@media only screen and (max-width: 480px){.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button,.dhx_cal_navline_flex .dhx_cal_tab,.dhx_cal_navline_flex .dhx_cal_tab.active,.dhx_cal_navline_flex .dhx_cal_today_button{height:6vw;line-height:6vw}}.dhx_cal_tab:not(.active),.dhx_cal_tab_standalone:not(.active),.dhx_cal_today_button:not(.active){--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.dhx_cal_tab_segmented{border-left-style:none;border-radius:0}.dhx_cal_tab_segmented.dhx_cal_tab_first{border-left-style:solid;border-radius:var(--dhx-scheduler-border-radius) 0px 0px var(--dhx-scheduler-border-radius);margin-left:4px}.dhx_cal_tab_segmented.dhx_cal_tab_last{border-radius:0px var(--dhx-scheduler-border-radius) var(--dhx-scheduler-border-radius) 0px;margin-right:4px}.dhx_cal_container_rtl .dhx_cal_tab_segmented.dhx_cal_tab_first{border-left-style:none;border-radius:0px var(--dhx-scheduler-border-radius) var(--dhx-scheduler-border-radius) 0px;margin-right:4px;margin-left:unset}.dhx_cal_container_rtl .dhx_cal_tab_segmented.dhx_cal_tab_last{border-radius:var(--dhx-scheduler-border-radius) 0px 0px var(--dhx-scheduler-border-radius);border-left-style:solid;margin-right:unset;margin-left:4px}.dhx_cal_container_rtl .dhx_cal_date{margin-right:unset;margin-left:auto}.dhx_cal_container_rtl .dhx_cal_header{border-left:var(--dhx-scheduler-default-border);border-right:none}.dhx_cal_tab_standalone{border-radius:var(--dhx-scheduler-border-radius);margin:0 4px}.dhx_cal_header{height:21px;border-top:var(--dhx-scheduler-header-border);border-right:var(--dhx-scheduler-header-border);position:relative;overflow:hidden}.dhx_scale_bar{position:absolute}.dhx_cal_date{text-align:center;position:relative;margin-right:auto;font-size:var(--dhx-scheduler-heading-font-size);line-height:150%;font-weight:var(--dhx-scheduler-heading-font-weight);flex-shrink:0}.dhx_cal_data{position:relative;flex:1;overflow-y:auto;overflow-x:hidden;border-top:var(--dhx-scheduler-default-border)}.dhx_scale_holder{position:absolute}.dhx_cal_today_button{margin-right:5px;order:-1}.dhx_cal_prev_button,.dhx_cal_next_button{order:0;width:20px;height:20px;background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent;font-size:24px}.dhx_cal_prev_button:hover,.dhx_cal_next_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_prev_button:active,.dhx_cal_next_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_prev_button:disabled,.dhx_cal_next_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_cal_prev_button:hover,.dhx_cal_next_button:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.dhx_cal_prev_button:active,.dhx_cal_next_button:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.dhx_cal_prev_button:disabled,.dhx_cal_next_button:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_cal_prev_button:before,.dhx_cal_next_button:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_prev_button:before{content:"";font-size:24px}.dhx_cal_next_button:before{content:"";font-size:24px}.dhx_cal_container_rtl .dhx_cal_prev_button:before{content:"";font-size:24px}.dhx_cal_container_rtl .dhx_cal_next_button:before{content:"";font-size:24px}.scheduler_container_resize_watcher{background:transparent;width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;pointer-events:none;border:0;box-sizing:border-box;opacity:0}.dhx_title_datepicker_container{z-index:2;position:absolute}.dhx_expand_icon{position:absolute;top:0;right:2px;cursor:pointer;z-index:4}.dhx_marked_timespan{position:absolute;width:100%;margin-left:0;display:flex;justify-content:center;align-items:center}.dhx_time_block{position:absolute;width:100%;background:var(--dhx-scheduler-blocked-time-background);z-index:1;opacity:.6}.dhx_time_block_reset{opacity:1}.dhx_scheduler_month .dhx_marked_timespan,.dhx_mini_calendar .dhx_marked_timespan{display:none}.dhx_timeline_table_wrapper .dhx_marked_timespan{z-index:1}.dhx_timeline_table_wrapper .dhx_time_block{z-index:2}.dhx_timeline_table_wrapper .dhx_cal_event_line{z-index:1}.dhx_timeline_table_wrapper .dhx_timeline_scrollable_data{overflow-x:auto}.dhx_now_time{width:100%;height:2px;background:var(--dhx-scheduler-today-marker-color);opacity:.5;box-shadow:0 1px 0 1px var(--dhx-scheduler-today-marker-color)}.dhx_matrix_now_time{background:var(--dhx-scheduler-today-marker-color);opacity:.5}.dhx_minical_icon{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent;cursor:pointer;font-size:24px}.dhx_minical_icon:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_minical_icon:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_minical_icon:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_minical_icon:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.dhx_minical_icon:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.dhx_minical_icon:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_minical_icon:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_minical_icon:before{content:""}.dhx_scale_ignore{display:none!important}.dhx_drag_placeholder{font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size)}.dhx_hidden{display:none!important}.common_input{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.common_input:focus,.common_input:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.common_input:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.one_line_input{height:var(--dhx-scheduler-control-height)}.dhx_cal_cover,.dhx_cal_cover *{box-sizing:border-box}.dhx_cal_cover{width:100%;height:100%;position:fixed;z-index:14;top:0;left:0;background-color:#0006;display:flex;justify-content:center;align-items:center;overflow:auto}.dhx_cal_light{margin-top:auto;margin-bottom:auto;width:max-content;max-width:var(--dhx-scheduler-lightbox-width);height:auto;-webkit-tap-highlight-color:transparent;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);position:absolute;z-index:15;font-family:var(--dhx-scheduler-lightbox_font-family);font-size:var(--dhx-scheduler-lightbox-font-size);font-weight:var(--dhx-scheduler-lightbox-font-weight);line-height:142%;border:var(--dhx-scheduler-lightbox-border);border-radius:var(--dhx-scheduler-popup-border-radius)}.dhx_cal_light.dhx_cal_light_wide{--dhx-scheduler-lightbox-width: var(--dhx-scheduler-lightbox-wide-max-width)}.dhx_cal_light textarea,.dhx_cal_light input,.dhx_cal_light select{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.dhx_cal_light textarea:focus,.dhx_cal_light input:focus,.dhx_cal_light select:focus,.dhx_cal_light textarea:focus-visible,.dhx_cal_light input:focus-visible,.dhx_cal_light select:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_cal_light textarea:disabled,.dhx_cal_light input:disabled,.dhx_cal_light select:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_light input,.dhx_cal_light select{height:var(--dhx-scheduler-control-height)}.dhx_cal_light input[type=select],.dhx_cal_light input[type=checkbox]{height:var(--dhx-scheduler-checkbox-height)}.dhx_cal_light .dhx_time{display:none}.dhx_cal_ltitle{font-size:var(--dhx-scheduler-lightbox-title-font-size);font-weight:var(--dhx-scheduler-heading-font-weight);line-height:142%;background:var(--dhx-scheduler-lightbox-title-background);color:var(--dhx-scheduler-lightbox-title-color);border-bottom:var(--dhx-scheduler-default-border);padding:calc(var(--dhx-scheduler-base-padding) * 3) calc(var(--dhx-scheduler-base-padding) * 3);overflow:hidden;white-space:nowrap;display:flex;flex-direction:row;justify-content:space-between;gap:calc(var(--dhx-scheduler-base-padding) * 2);border-top-right-radius:var(--dhx-scheduler-popup-border-radius);border-top-left-radius:var(--dhx-scheduler-popup-border-radius)}.dhx_cal_ltitle .dhx_mark{display:none}.dhx_cal_ltitle .dhx_cal_ltitle_descr{overflow:hidden;text-overflow:ellipsis}.dhx_cal_ltitle .dhx_cal_ltitle_controls{cursor:pointer}.dhx_cal_larea{border:none;padding:0 12px 4px;height:auto;gap:calc(var(--dhx-scheduler-base-padding) * 2)}.dhx_btn_inner.dhx_delete_btn{display:block!important}.dhx_btn_inner.dhx_delete_btn:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_btn_inner.dhx_delete_btn:before{content:"";font-size:18px}.dhx_cal_light_rtl{direction:rtl}.dhx_cal_light_wide.dhx_cal_light_rtl .dhx_custom_button{right:auto;left:calc(var(--dhx-scheduler-base-padding) * 2)}.dhx_lightbox_time_select{min-width:80px}.dhx_lightbox_day_select{min-width:60px}.dhx_lightbox_month_select{min-width:110px}.dhx_lightbox_year_select{min-width:77px}.dhx_cal_light_wide .dhx_cal_larea{display:flex;flex-direction:column;padding-top:12px;gap:12px}.dhx_cal_light_wide .dhx_wrap_section{display:flex;flex:0;position:relative}.dhx_cal_light_wide .dhx_cal_lsection{width:120px;justify-content:start;align-items:start;flex-shrink:0;margin-top:0;margin-bottom:0;padding:4px 8px}.dhx_cal_light_wide .dhx_custom_button{position:absolute;left:auto;right:calc(var(--dhx-scheduler-base-padding) * 2)}.dhx_cal_light_wide .dhx_cal_ltext{flex:1}.dhx_cal_light_wide .dhx_section_time{justify-content:start}.dhx_cal_light_wide .dhx_fullday{margin-left:unset}.dhx_cal_lcontrols{display:flex;flex-direction:row-reverse;gap:calc(var(--dhx-scheduler-base-padding)*2);padding:12px}.dhx_cal_lcontrols .dhx_btn_set{display:flex;flex-direction:row;gap:var(--dhx-scheduler-base-padding)}.dhx_cal_lcontrols .dhx_btn_set.dhx_delete_btn_set{padding:6px 0;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_cal_lcontrols .dhx_btn_set:not(.dhx_save_btn_set,.dhx_delete_btn_set){--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.dhx_cal_lcontrols .dhx_btn_set .dhx_btn_inner{display:none}.dhx_cal_lcontrols .dhx_cal_lcontrols_push_right{margin-left:auto}.dhx_cal_ltext textarea{width:100%;height:100%;resize:none;font-family:var(--dhx-scheduler-lightbox_font-family);font-size:var(--dhx-scheduler-lightbox-font-size);font-weight:var(--dhx-scheduler-lightbox-font-weight);line-height:142%}.dhx_section_time_spacer,.dhx_lightbox_minical_spacer{visibility:hidden;flex-basis:100%;height:0}.dhx_section_time{--dhx-scheduler-lightbox-time-font-size: var(--dhx-scheduler-important-font-size);--dhx-scheduler-lightbox-time-font-weight: var(--dhx-scheduler-important-font-weight);font-size:var(--dhx-scheduler-lightbox-time-font-size);font-weight:var(--dhx-scheduler-lightbox-time-font-weight);line-height:142%;display:flex;flex-wrap:wrap;align-items:center;gap:calc(var(--dhx-scheduler-base-padding) * 2);row-gap:var(--dhx-scheduler-base-padding)}.dhx_section_time .dhx_section_time_icon{width:calc(var(--dhx-scheduler-base-module) * 2);height:calc(var(--dhx-scheduler-base-module) * 2);border-radius:2px;background:var(--dhx-scheduler-base-colors-primary)}.dhx_fullday{margin-left:auto}.dhx_cal_light_rtl .dhx_fullday{margin-left:unset;margin-right:auto}.dhx_cal_lsection label{font-weight:var(--dhx-scheduler-heading-font-weight);display:flex;align-items:center;gap:4px}.dhx_cal_lsection{display:flex;margin-top:12px;margin-bottom:4px}.dhx_cal_lsection .dhx_custom_button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled);order:1;margin-left:auto;margin-right:unset}.dhx_cal_lsection .dhx_custom_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_lsection .dhx_custom_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_lsection .dhx_custom_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_cal_light_rtl .dhx_custom_button{margin-left:unset;margin-right:auto}.dhx_cal_checkbox{display:flex;gap:var(--dhx-scheduler-base-padding)}.dhx_cal_wide_checkbox{padding:4px 0}.dhx_cal_radio input{margin:var(--dhx-scheduler-base-padding)}.dhx_cal_radio_item{display:flex;gap:var(--dhx-scheduler-base-padding);align-items:center}.dhx_cal_radio{display:flex;gap:4px}.dhx_cal_radio_vertical{flex-direction:column;overflow:auto;--dhx-scheduler-control-height: 20px}.dhx_multi_select_control{display:flex;gap:4px}.dhx_multi_select_control_vertical{flex-direction:column}.dhx_multi_select_control label{display:flex;align-items:center;gap:4px}.dhx_cal_template{position:relative;padding-top:4px;padding-bottom:4px}.dhx_form_repeat{overflow:hidden;flex-grow:1}.dhx_form_repeat form{display:flex;flex-direction:column;gap:12px;padding:12px}.dhx_form_repeat input,.dhx_form_repeat select{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin:0 4px}.dhx_form_repeat input:focus,.dhx_form_repeat select:focus,.dhx_form_repeat input:focus-visible,.dhx_form_repeat select:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_form_repeat input:disabled,.dhx_form_repeat select:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_form_repeat label{display:inline-flex;align-items:center;vertical-align:top;gap:4px}.dhx_form_repeat #dhx_repeat_year,.dhx_form_repeat #dhx_repeat_month,.dhx_form_repeat #dhx_repeat_week,.dhx_form_repeat #dhx_repeat_day,.dhx_form_repeat .dhx_repeat_right{display:flex;flex-direction:column;gap:4px}.dhx_form_repeat #dhx_repeat_month>div,.dhx_form_repeat #dhx_repeat_week>div{display:flex;gap:8px}.dhx_repeat_left{display:flex;flex-wrap:wrap;gap:12px}.dhx_repeat_divider{background:var(--dhx-scheduler-base-colors-border);height:1px}.dhx_repeat_text{width:28px;border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.dhx_repeat_text:focus,.dhx_repeat_text:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_repeat_text:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_repeat_date,.dhx_form_repeat select{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.dhx_repeat_date:focus,.dhx_form_repeat select:focus,.dhx_repeat_date:focus-visible,.dhx_form_repeat select:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_repeat_date:disabled,.dhx_form_repeat select:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_light .dhx_readonly{color:var(--dhx-scheduler-base-colors-readonly)}.dhx_lightbox_minical{display:flex;gap:8px;align-items:center}.dhx_lightbox_minical .dhx_lightbox_minical_spacer{display:flex;align-items:center;justify-content:center}.dhx_lightbox_minical .dhx_minical_input{max-width:165px}.dhx_lightbox_minical .dhx_lightbox_time_select{width:95px}.dhx_scale_text_styles{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%}.dhx_scale_bar{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%;display:flex;box-sizing:border-box;height:100%;justify-content:center;align-items:baseline;padding:var(--dhx-scheduler-base-padding);border-left:var(--dhx-scheduler-header-border);overflow:hidden}.dhx_scale_holder{border-right:var(--dhx-scheduler-default-border);background:var(--dhx-scheduler-timescale-background);box-sizing:border-box}.dhx_scale_holder_now{--dhx-scheduler-timescale-background: var(--dhx-scheduler-timescale-today-background);position:absolute}.dhx_cal_container_rtl .dhx_scale_bar{border-left:none;border-right:var(--dhx-scheduler-header-border)}.dhx_cal_container_rtl .dhx_scale_holder{border-right:none;border-left:var(--dhx-scheduler-default-border)}.dhx_scale_hour{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%;font-size:var(--dhx-scheduler-hours-font-size);font-weight:var(--dhx-scheduler-hours-font-weight);border-bottom:var(--dhx-scheduler-default-border);display:flex;flex-direction:column;align-items:center;justify-content:start;padding:var(--dhx-scheduler-base-padding);box-sizing:border-box}.dhx_scale_time_slot{box-sizing:border-box;border-bottom:var(--dhx-scheduler-default-border)}.dhx_scale_time_slot.dhx_scale_time_slot_hour_start{border-bottom:var(--dhx-scheduler-halfhour-border)}.dhx_drag_marker{width:100%;opacity:.5;background-color:var(--dhx-scheduler-base-colors-border);position:absolute;box-sizing:border-box;border-top:var(--dhx-scheduler-default-border);border-bottom:var(--dhx-scheduler-default-border)}.dhx_multi_day{position:relative;border-top:var(--dhx-scheduler-default-border)}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:50%;font-size:32px;border-bottom:var(--dhx-scheduler-default-border);border-right:var(--dhx-scheduler-default-border);background-repeat:no-repeat;display:flex;justify-content:center;align-items:center}.dhx_multi_day_icon:before,.dhx_multi_day_icon_small:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_multi_day_icon:before,.dhx_multi_day_icon_small:before{content:""}.dhx_multi_day_icon_small{font-size:16px}.dhx_cal_container_rtl .dhx_multi_day_icon,.dhx_cal_container_rtl .dhx_multi_day_icon_small{border-right:none;border-left:var(--dhx-scheduler-default-border)}.dhx_scheduler_event_base{background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);display:flex;padding:2px var(--dhx-scheduler-base-module);border:var(--dhx-scheduler-event-border);position:absolute;box-sizing:border-box;font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);font-weight:var(--dhx-scheduler-event-text-font-weight);--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-color)}.dhx_title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dhx_cal_event{border-radius:var(--dhx-scheduler-border-radius);flex-direction:column;background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);display:flex;padding:2px var(--dhx-scheduler-base-module);border:var(--dhx-scheduler-event-border);position:absolute;box-sizing:border-box;font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);font-weight:var(--dhx-scheduler-event-text-font-weight);--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-color)}.dhx_cal_event .dhx_title{font-size:var(--dhx-scheduler-event-title-font-size);line-height:var(--dhx-scheduler-event-title-line-height);max-height:21px}.dhx_cal_event .dhx_body{font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);flex:1;gap:4px;overflow:hidden;text-overflow:ellipsis}.dhx_cal_event .dhx_event_move.dhx_header{display:none}.dhx_cal_event .dhx_event_resize{cursor:ns-resize}.dhx_cal_event .dhx_resize_denied{display:none!important}.dhx_cal_event .dhx_footer{position:absolute;bottom:2px;opacity:0}.dhx_cal_event .dhx_menu_icon{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-text)}.dhx_cal_event .dhx_menu_icon.icon_delete{margin-left:-2px}.dhx_cal_event.dhx_cal_select_menu{padding:8px 2px;box-shadow:var(--dhx-scheduler-box-shadow-s);--dhx-scheduler-event-background: var(--dhx-scheduler-event-menu-background);--dhx-scheduler-event-color: var(--dhx-scheduler-event-menu-color)}.dhx_cal_event.dhx_cal_select_menu .dhx_body{display:flex;flex-direction:column;gap:4px;align-items:center}.dhx_cal_event textarea.dhx_cal_editor{width:100%;height:100%;padding:0;margin:0;overflow:auto;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size)}.dhx_cal_event_cascade{--dhx-scheduler-event-border: 1px solid rgba(0, 0, 0, .05)}.dhx_cal_editor{z-index:10}.dhx_cal_event .dhx_footer,.dhx_cal_event .dhx_select_menu_footer{height:calc(var(--dhx-scheduler-base-module) * 2);border-width:0;position:relative;margin-left:auto;margin-right:auto}.dhx_cal_event .dhx_footer:before,.dhx_cal_event .dhx_select_menu_footer:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_event .dhx_footer:before,.dhx_cal_event .dhx_select_menu_footer:before{content:""}.dhx_cal_event.dhx_cal_event_drag .dhx_event_resize.dhx_footer,.dhx_cal_event.dhx_cal_event_selected .dhx_event_resize.dhx_footer,.dhx_cal_event:hover .dhx_event_resize.dhx_footer{opacity:1;background-color:transparent}.dhx_cal_event_line{background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);display:flex;padding:2px var(--dhx-scheduler-base-module);border:var(--dhx-scheduler-event-border);position:absolute;box-sizing:border-box;font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);font-weight:var(--dhx-scheduler-event-text-font-weight);--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-color);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-event-bar-font-size);--dhx-scheduler-event-text-line-height: var(--dhx-scheduler-event-bar-line-height);cursor:pointer;align-items:center;z-index:1;overflow:hidden;padding-left:12px;white-space:nowrap}.dhx_cal_event_line.dhx_cal_event_line_end{border-top-right-radius:var(--dhx-scheduler-border-radius);border-bottom-right-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_event_line.dhx_cal_event_line_start{border-top-left-radius:var(--dhx-scheduler-border-radius);border-bottom-left-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_event_line.dhx_cal_event--small{padding-left:8px}.dhx_cal_event_line.dhx_cal_event--xsmall{padding-left:4px}.dhx_cal_container_rtl .dhx_cal_event_line{border-top-right-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:unset;border-bottom-left-radius:unset}.dhx_cal_container_rtl .dhx_cal_event_line.dhx_cal_event_line_end{border-top-left-radius:var(--dhx-scheduler-border-radius);border-bottom-left-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_container_rtl .dhx_cal_event_line.dhx_cal_event_line_start{border-top-right-radius:var(--dhx-scheduler-border-radius);border-bottom-right-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_event.dhx_cal_event--xsmall,.dhx_cal_event.dhx_cal_event--small{flex-direction:row-reverse;justify-content:space-between;--dhx-scheduler-event-title-font-size: var(--dhx-scheduler-event-bar-font-size);--dhx-scheduler-event-title-line-height: var(--dhx-scheduler-event-bar-line-height);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-event-bar-font-size);--dhx-scheduler-event-text-line-height: var(--dhx-scheduler-event-bar-line-height);gap:4px;padding-top:2px;padding-bottom:1px}.dhx_cal_event.dhx_cal_event--xsmall .dhx_title,.dhx_cal_event.dhx_cal_event--small .dhx_title{display:flex;justify-content:end}.dhx_cal_event.dhx_cal_event--xsmall .dhx_body,.dhx_cal_event.dhx_cal_event--small .dhx_body{flex-grow:2}.dhx_cal_event.dhx_cal_event--xsmall .dhx_footer,.dhx_cal_event.dhx_cal_event--small .dhx_footer,.dhx_cal_event.dhx_cal_event--xsmall .dhx_select_menu_footer,.dhx_cal_event.dhx_cal_event--small .dhx_select_menu_footer{position:absolute;bottom:0;left:4px;width:100%;transform:translateY(50%)}.dhx_cal_month_table{overflow:hidden}.dhx_cal_month_row{display:flex}.dhx_cal_month_cell{box-sizing:border-box;background:var(--dhx-scheduler-timescale-background);border-right:var(--dhx-scheduler-default-border);border-bottom:var(--dhx-scheduler-default-border);display:flex;flex-direction:column}.dhx_cal_month_cell.dhx_now{--dhx-scheduler-timescale-background: var(--dhx-scheduler-timescale-today-background)}.dhx_month_body_border,.dhx_month_head_border{border-left:var(--dhx-scheduler-default-border)}.dhx_cal_container_rtl .dhx_cal_month_cell{border-left:var(--dhx-scheduler-default-border);border-right:none}.dhx_cal_container_rtl .dhx_month_body_border,.dhx_cal_container_rtl .dhx_month_head_border{border-left:none;border-right:var(--dhx-scheduler-default-border)}.dhx_month_head{box-sizing:border-box;display:flex;flex-shrink:0;color:var(--dhx-scheduler-month-header-color);justify-content:end;align-items:flex-start;align-self:stretch;padding:var(--dhx-scheduler-month-day-header-padding)}.dhx_month_body{flex-grow:1;padding:var(--dhx-scheduler-base-padding) calc(var(--dhx-scheduler-base-padding) * 2);box-sizing:border-box;position:relative}.dhx_before,.dhx_after{--dhx-scheduler-month-header-color: var(--dhx-scheduler-inactive-month-color)}.dhx_month_link{position:absolute;text-align:right;cursor:pointer;padding-right:10px}.dhx_month_link a:hover{text-decoration:underline}.dhx_global_tip{font-family:var(--dhx-scheduler-font-family);line-height:110%;background-color:var(--dhx-scheduler-container-background);color:var(--dhx-scheduler-container-color);text-align:center;font-size:20px;position:fixed;top:60px;right:20px;z-index:14;padding:20px 30px;width:190px;background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);border:var(--dhx-scheduler-popup-border);box-shadow:var(--dhx-scheduler-box-shadow-m)}@media (-moz-touch-enabled){.dhx_cal_container{-webkit-user-select:none;user-select:none;-moz-user-select:none}}.dhx_cal_event_clear{box-sizing:border-box;padding:var(--dhx-scheduler-base-padding) calc(var(--dhx-scheduler-base-padding) * 2);font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);display:flex;justify-content:start;align-items:center;gap:var(--dhx-scheduler-base-padding);cursor:pointer;flex-wrap:nowrap;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dhx_cal_event_clear_date{font-weight:700}.dhx_cal_event_line_content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dhx_cal_event_marker{display:block;flex-shrink:0;border-radius:var(--dhx-scheduler-month-event-marker-size);width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);background:var(--dhx-scheduler-event-background);margin-top:-1px}.dhx_cal_event_clear:before{content:"";display:block;flex-shrink:0;border-radius:var(--dhx-scheduler-month-event-marker-size);width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);background:var(--dhx-scheduler-event-background);margin-top:-1px}.dhx_cal_event_line .dhx_event_resize{cursor:ew-resize;position:absolute;top:0;height:100%;display:none;justify-content:center;align-items:center}.dhx_cal_event_line .dhx_event_resize:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_event_line .dhx_event_resize:before{content:""}.dhx_cal_event_line:hover .dhx_event_resize{display:flex}.dhx_event_resize_end{right:0}.dhx_event_resize_start{left:0}.dhx_cal_container_rtl .dhx_event_resize_start{left:auto;left:unset;right:0}.dhx_cal_container_rtl .dhx_event_resize_end{right:auto;right:unset;left:0}.dhx_cal_quick_info{--dhx-scheduler-quick-info-font-size: var(--dhx-regular-font-size);position:absolute;z-index:8;font-size:var(--dhx-scheduler-quick-info-font-size);background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);border:var(--dhx-scheduler-popup-border);padding:calc(var(--dhx-scheduler-base-padding)*2) calc(var(--dhx-scheduler-base-padding)*3);border-radius:var(--dhx-scheduler-border-radius);width:300px;display:flex;flex-direction:column;box-shadow:var(--dhx-scheduler-box-shadow-s);transition:left .5s ease,right .5s ease}.dhx_cal_qi_tcontrols{display:flex;justify-content:end;height:8px}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn{min-width:32px;height:32px;border-radius:50%;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent;width:unset;min-width:unset;padding:2px;font-size:18px;cursor:pointer;height:20px;position:relative;z-index:1}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_cal_qi_title,.dhx_cal_qi_controls,.dhx_cal_qi_content{padding:0 calc(var(--dhx-scheduler-base-padding) * 3)}.dhx_cal_qi_title{display:flex;flex-direction:column;gap:12px;padding-right:14px}.dhx_cal_qi_tcontent{font-size:var(--dhx-scheduler-heading-font-size);font-weight:var(--dhx-scheduler-heading-font-weight);line-height:150%;position:relative;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;overflow:hidden;flex-grow:0;text-overflow:ellipsis;white-space:nowrap}.dhx_cal_qi_tcontent>span{text-overflow:ellipsis;overflow:hidden}.dhx_cal_qi_tcontent:before{display:var(--dhx-scheduler-quick-info-dot-display, block);content:"";flex-shrink:0;width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);border-radius:2px;background:var(--dhx-scheduler-base-colors-primary)}.dhx_cal_qi_tdate{font-size:var(--dhx-scheduler-important-font-size);font-weight:var(--dhx-scheduler-important-font-weight);line-height:var(--dhx-scheduler-important-line-height)}.dhx_cal_qi_content{padding-top:16px;padding-bottom:8px}.dhx_cal_qi_controls{display:flex;flex-direction:row;justify-content:start;align-items:center;padding-top:8px;gap:12px;color:var(--dhx-scheduler-base-colors-primary)}.dhx_cal_qi_controls>div:first-child{margin-left:-3px}.dhx_menu_icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color)}.dhx_scheduler_year .dhx_cal_header{display:none}.dhx_scheduler_year .dhx_cal_data{padding:40px}.dhx_year_wrapper{display:flex;gap:40px;padding:12px;justify-content:center;align-items:baseline;flex-wrap:wrap}.dhx_year_box{--dhx-scheduler-month-day-header-padding: 8px 12px}.dhx_year_box .dhx_scale_bar{position:relative;width:var(--dhx-scheduler-datepicker-cell-size)}.dhx_year_box .dhx_month_head{position:relative}.dhx_year_box .dhx_month_head.dhx_year_event:after{content:"";width:4px;height:4px;border-radius:50%;position:absolute;bottom:2px;left:50%;transform:translate(-50%);background:var(--dhx-scheduler-event-marker-color)}.dhx_year_box .dhx_month_body{display:none}.dhx_year_month{text-align:center;padding:12px 0}.dhx_year_week{display:flex}.dhx_year_tooltip{position:absolute;padding:12px;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-event-title-font-size);background:var(--dhx-scheduler-popup-background);border-radius:var(--dhx-scheduler-popup-border-radius);border:var(--dhx-scheduler-popup-border);color:var(--dhx-scheduler-popup-color);box-shadow:var(--dhx-scheduler-box-shadow-m);display:flex;flex-direction:column;width:300px;gap:4px}.dhx_tooltip_line{border-radius:var(--dhx-scheduler-border-radius);background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);padding:4px;display:flex;cursor:pointer}.dhx_tooltip_rtl{direction:rtl}.dhx_timeline_scale_header{position:absolute;overflow:hidden;background-color:var(--dhx-scheduler-container-background);display:flex;justify-content:center;align-items:center;border-right:var(--dhx-scheduler-header-border);border-top:var(--dhx-scheduler-header-border)}.dhx_cal_container_rtl .dhx_timeline_scale_header{border-right:unset;border-left:var(--dhx-scheduler-header-border)}.dhx_timeline_label_wrapper{z-index:1}.dhx_timeline_label_col{position:relative}.dhx_timeline_label_row{position:absolute;left:0}.dhx_matrix_scell{overflow:hidden;text-align:center;border-bottom:var(--dhx-scheduler-default-border);border-right:var(--dhx-scheduler-default-border);color:var(--dhx-scheduler-scale-color)}.dhx_timeline_data_wrapper{position:absolute;z-index:0;left:0;top:0;width:100%}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:var(--dhx-scheduler-default-border);border-right:var(--dhx-scheduler-default-border);font-weight:500}.dhx_cal_container_rtl .dhx_matrix_cell,.dhx_cal_container_rtl .dhx_matrix_scell{border-right:none;border-left:var(--dhx-scheduler-default-border)}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto}.dhx_timeline_data_cell{position:absolute;top:0;height:100%}.dhx_timeline_label_wrapper{position:absolute;overflow:hidden;background:var(--dhx-scheduler-container-background)}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:var(--dhx-scheduler-timeline-folder-background);cursor:pointer}.dhx_matrix_scell .dhx_scell_level0{padding-left:4px}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px}.dhx_matrix_scell .dhx_scell_level2{padding-left:32px}.dhx_matrix_scell .dhx_scell_level3{padding-left:48px}.dhx_matrix_scell .dhx_scell_level4{padding-left:64px}.dhx_matrix_scell.folder{border-right-color:transparent;font-weight:700;text-align:left}.dhx_cal_container_rtl .dhx_matrix_scell.folder{border-right:var(--dhx-scheduler-default-border);border-left-color:transparent}.dhx_matrix_line{overflow:hidden}.dhx_matrix_scell.folder .dhx_scell_expand:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_matrix_scell.folder .dhx_scell_expand:before{content:"";font-size:24px}.dhx_matrix_scell.folder.closed .dhx_scell_expand{transform:rotate(-90deg)}.dhx_matrix_scell.folder,.dhx_timeline_label_row.dhx_row_folder{overflow:visible}.dhx_matrix_scell.folder>div{display:flex;align-items:center;height:inherit}.dhx_matrix_scell.folder .dhx_scell_expand{position:relative;flex-shrink:0}.dhx_matrix_scell.folder .dhx_scell_name{width:auto;color:var(--dhx-scheduler-timeline-folder-color);text-transform:uppercase;font-weight:500;max-height:100%}.dhx_matrix_scell.item .dhx_scell_name{padding-left:16px;text-align:left}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level0{padding-left:0;padding-right:4px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level1{padding-left:0;padding-right:20px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level2{padding-left:0;padding-right:32px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level3{padding-left:0;padding-right:48px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level4{padding-left:0;padding-right:63px}.dhx_cal_container_rtl .dhx_matrix_scell.folder .dhx_scell_expand{padding-right:0;padding-left:4px}.dhx_cal_container_rtl .dhx_matrix_scell.item .dhx_scell_name{padding-left:0;padding-right:12px;text-align:right}.dhx_matrix_scell.dhx_matrix_scell_columns,.dhx_timeline_scale_header{display:flex;justify-content:center;align-items:center}.dhx_matrix_scell_columns.dhx_treetimeline .dhx_scell_name{display:flex}.dhx_matrix_scell_columns.dhx_treetimeline .dhx_scell_level{flex-shrink:0}.dhx_matrix_scell_columns.dhx_treetimeline .dhx_timeline_label_column_first{flex-shrink:1;border-left-color:transparent}.dhx_second_scale_bar{border-bottom:var(--dhx-scheduler-header-border)}div.dhx_timeline_label_column,div.dhx_timeline_label_column_header{display:flex;justify-content:center;align-items:center;box-sizing:border-box;flex-grow:0;flex-shrink:0;height:100%;white-space:nowrap}div.dhx_timeline_label_column .dhx_timeline_label_content_wrapper,div.dhx_timeline_label_column_header .dhx_timeline_label_content_wrapper{display:inline-block;text-align:left}.dhx_timeline_label_column{border-left:var(--dhx-scheduler-header-border)}.dhx_timeline_label_column_header{border-left-color:transparent}.dhx_timeline_label_column:first-child{border-left:0}.dhx_cal_container_rtl .dhx_timeline_label_column{border-left:none;border-right:var(--dhx-scheduler-header-border)}.dhx_cal_container_rtl .dhx_timeline_label_column_header{border-right-color:transparent}.dhx_cal_container_rtl .dhx_timeline_label_column:first-child{border-right:0}.dhx_scheduler_map .dhx_cal_header,.dhx_scheduler_agenda .dhx_cal_header{height:auto}.dhx_agenda_line_header{clear:both;overflow:hidden}.dhx_agenda_line,.dhx_map_line{height:var(--dhx-scheduler-list-line-height);line-height:var(--dhx-scheduler-list-line-height);overflow:hidden;display:flex}.dhx_agenda_line .dhx_agenda_event_time,.dhx_map_line .dhx_agenda_event_time,.dhx_agenda_line .dhx_map_event_time,.dhx_map_line .dhx_map_event_time{flex-shrink:0;width:188px;text-align:center;border-right:var(--dhx-scheduler-default-border)}.dhx_agenda_line .dhx_event_icon,.dhx_map_line .dhx_event_icon{height:33px;width:33px;display:flex;align-items:center;justify-content:center}.dhx_agenda_line .dhx_event_icon path,.dhx_map_line .dhx_event_icon path{fill:var(--dhx-scheduler-base-colors-primary)}.dhx_agenda_line>div:first-child,.dhx_map_line>div:first-child{width:var(--dhx-scheduler-agenda-date-column-width);text-align:center}.dhx_agenda_line:nth-child(2n),.dhx_map_line:nth-child(2n){background:var(--dhx-scheduler-base-colors-select)}.dhx_map_area{height:100%}.dhx_map_head{display:flex;height:100%}.dhx_map_head>div{display:flex;justify-content:center;align-items:center;padding:0 var(--dhx-scheduler-base-padding)}.dhx_v_border{position:absolute;height:100%;border-left:var(--dhx-scheduler-default-border)}.dhx_week_agenda_wrapper{width:100%;height:100%;display:flex}.dhx_wa_column{flex:1;display:flex;flex-direction:column;border-right:var(--dhx-scheduler-default-border)}.dhx_wa_day_cont{flex-grow:0;flex-shrink:0;flex-basis:calc(100% / 3);display:flex;flex-direction:column;overflow-y:auto}.dhx_wa_column:last-child .dhx_wa_day_cont:nth-last-child(1),.dhx_wa_column:last-child .dhx_wa_day_cont:nth-last-child(2){flex-shrink:1}.dhx_wa_scale_bar{--dhx-scheduler-week-agenda-scale-height: 35px;--dhx-scheduler-week-agenda-scale-font-size: var(--dhx-scheduler-important-font-size);--dhx-scheduler-week-agenda-scale-font-weight: var(--dhx-scheduler-heading-font-weight);font-size:var(--dhx-scheduler-week-agenda-scale-font-size);font-weight:var(--dhx-scheduler-week-agenda-scale-font-weight);height:var(--dhx-scheduler-week-agenda-scale-height);line-height:var(--dhx-scheduler-week-agenda-scale-height);flex:0;background:var(--dhx-scheduler-base-colors-select);border-top:var(--dhx-scheduler-default-border);border-bottom:var(--dhx-scheduler-default-border);padding:4px;display:flex;align-items:center}.dhx_wa_day_data{flex:1;overflow:auto}.dhx_wa_ev_body{border-bottom:var(--dhx-scheduler-default-border);padding:4px}.dhx_wa_ev_body_rtl{direction:rtl}.dhx_wa_dnd{font-family:var(--dhx-scheduler-font-family);position:absolute;color:#000a;background-color:#faea27;border:1px solid #00000033;min-width:300px}.dhx_wa_ev_body.dhx_cal_event_selected{background-color:var(--dhx-scheduler-base-colors-select)}.dhx_grid_event{height:var(--dhx-scheduler-list-line-height);line-height:var(--dhx-scheduler-list-line-height);background:var(--dhx-scheduler-grid-event-background);color:var(--dhx-scheduler-grid-event-text)}.dhx_grid_event:nth-child(2n){--dhx-scheduler-grid-event-background: var(--dhx-scheduler-base-colors-select)}.dhx_grid_event.dhx_grid_event_selected{--dhx-scheduler-grid-event-background: var(--dhx-scheduler-base-colors-icons)}.dhx_grid_area td,.dhx_grid_line>div{padding-left:8px;padding-right:8px}.dhx_grid_line>div{text-align:center}.dhx_grid_area>table{border-collapse:collapse;width:100%;table-layout:fixed}.dhx_grid_area td{table-layout:fixed;text-align:center;height:var(--dhx-scheduler-list-line-height);line-height:var(--dhx-scheduler-list-line-height)}.dhx_cal_header>.dhx_grid_line{display:flex}.dhx_grid_v_border{position:absolute;border-right:var(--dhx-scheduler-default-border);width:1px;height:100%}.dhx_grid_view_sort{position:absolute;top:5px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:10px solid var(--dhx-scheduler-base-colors-text-light)}.dhx_grid_sort_asc .dhx_grid_view_sort{border-top:none;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:10px solid var(--dhx-scheduler-base-colors-text-light)}.dhx_scheduler_agenda .dhx_cal_header{display:none}.dhx_cal_agenda_day{--dhx-scheduler-agenda-date-width: 110px;--dhx-scheduler-agenda-event-date-width: 120px;display:flex;flex-direction:row;flex-wrap:nowrap;border-bottom:var(--dhx-scheduler-default-border)}.dhx_cal_agenda_day_header{padding:8px 12px;display:flex;flex-direction:column;gap:8px;flex-grow:0;flex-shrink:0;width:var(--dhx-scheduler-agenda-date-width);border-right:var(--dhx-scheduler-default-border)}.dhx_cal_agenda_day_events{padding:8px 12px;flex:1}.dhx_agenda_day_date{font-weight:500}.dhx_cal_agenda_event_line{display:flex;align-items:center;justify-content:start;gap:16px;padding:calc(var(--dhx-scheduler-base-padding)*2)}.dhx_cal_agenda_event_line_selected{background-color:var(--dhx-scheduler-base-colors-select)}.dhx_cal_agenda_event_line_marker{display:block;flex-shrink:0;border-radius:var(--dhx-scheduler-month-event-marker-size);width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);background:var(--dhx-scheduler-event-background);margin-top:-1px}.dhx_cal_agenda_event_line_time{font-weight:500;min-width:var(--dhx-scheduler-agenda-event-date-width);text-align:center}.dhx_cal_agenda_no_events{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.dhx_cal_datepicker{font-size:var(--dhx-scheduler-datepicker-font-size);font-family:var(--dhx-scheduler-datepicker-family);line-height:142%;font-weight:400;border:var(--dhx-scheduler-popup-border);background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);box-shadow:var(--dhx-scheduler-box-shadow-s);border-radius:var(--dhx-scheduler-popup-border-radius);padding:16px}.dhx_cal_datepicker,.dhx_cal_datepicker *,.dhx_mini_calendar,.dhx_mini_calendar *{box-sizing:border-box}.dhx_cal_datepicker_arrow{border:none;background:none;cursor:pointer}.dhx_cal_datepicker_arrow:focus{outline:none}.dhx_cal_datepicker_data,.dhx_year_grid{display:flex;flex-direction:column;justify-content:space-between;height:100%;padding:var(--dhx-scheduler-datepicker-padding);gap:8px;color:var(--dhx-scheduler-month-header-color)}.dhx_cal_datepicker_done{display:flex;justify-content:center;align-items:center}.dhx_cal_datepicker_header{color:var(--dhx-scheduler-base-colors-primary);display:flex;justify-content:space-between;align-items:center;padding:var(--dhx-scheduler-datepicker-padding)}.dhx_cal_datepicker_title{font-weight:var(--dhx-scheduler-datepicker-header-font-size);font-size:var(--dhx-scheduler-datepicker-header-font-size);background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_cal_datepicker_title:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_datepicker_title:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_datepicker_title:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_cal_datepicker_days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.dhx_cal_datepicker_dayname,.dhx_cal_datepicker_date{display:flex;align-items:center;justify-content:center;position:relative;transition:all .3s;margin-left:auto;margin-right:auto}.dhx_cal_datepicker_dayname{color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_datepicker_date{border-radius:50%;width:var(--dhx-scheduler-datepicker-cell-size);height:var(--dhx-scheduler-datepicker-cell-size);color:var(--dhx-scheduler-datepicker-cell-color);background:var(--dhx-scheduler-datepicker-cell-background)}.dhx_cal_datepicker_date.dhx_now{--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-timescale-today-background)}.dhx_cal_datepicker_weekend{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-weekend-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-weekend-background)}.dhx_cal_datepicker_date.dhx_before,.dhx_cal_datepicker_date.dhx_after{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-prevnext-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-prevnext-background)}.dhx_cal_datepicker_current{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-today-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-today-background)}.dhx_cal_datepicker_date:not(.dhx_before,.dhx_after):hover,.dhx_cal_datepicker_month:hover,.dhx_cal_datepicker_year:hover{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-hover-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-hover-background)}.dhx_cal_datepicker_months,.dhx_cal_datepicker_years{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.dhx_cal_datepicker_months{column-gap:12px}.dhx_cal_datepicker_years{column-gap:4px}.dhx_cal_datepicker_month,.dhx_cal_datepicker_year{display:flex;align-items:center;justify-content:center;height:var(--dhx-scheduler-datepicker-cell-size);border-radius:10px;padding:4px 8px;transition:background .3s;position:relative;color:var(--dhx-scheduler-datepicker-cell-color);background:var(--dhx-scheduler-datepicker-cell-background)}.dhx_cal_datepicker_done_btn{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_cal_datepicker_done_btn:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_datepicker_done_btn:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_datepicker_done_btn:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_datepicker_date_wrapper{position:relative}.dhx_datepicker_date_wrapper:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_datepicker_date_wrapper:before{content:""}.dhx_datepicker_date_wrapper:before{position:absolute;right:4px;top:8px;font-size:20px}.dhx_cal_datepicker_event.dhx_cal_datepicker_current,.dhx_cal_datepicker_event:hover{--dhx-scheduler-event-marker-color: var(--dhx-scheduler-datepicker-hover-color)}.dhx_cal_datepicker_event:after{content:"";width:4px;height:4px;border-radius:50%;position:absolute;bottom:2px;left:50%;transform:translate(-50%);background:var(--dhx-scheduler-event-marker-color)}.dhx_minical_popup{position:absolute;z-index:15}.dhx_mini_calendar{font-size:var(--dhx-scheduler-datepicker-font-size);font-family:var(--dhx-scheduler-datepicker-family);line-height:142%;font-weight:400;border:var(--dhx-scheduler-popup-border);background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);box-shadow:var(--dhx-scheduler-box-shadow-m);border-radius:var(--dhx-scheduler-popup-border-radius);--dhx-scheduler-datepicker-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-header-border: none}.dhx_mini_calendar .dhx_cal_month_row{height:35px!important}.dhx_mini_calendar .dhx_year_week{border-bottom:var(--dhx-scheduler-default-border)}.dhx_mini_calendar .dhx_scale_bar{position:static}.dhx_mini_calendar .dhx_year_month{font-weight:500;font-size:var(--dhx-scheduler-font-size)}.dhx_mini_calendar .dhx_month_body{display:none}.dhx_mini_calendar .dhx_cal_month_cell{display:flex;justify-content:center;align-items:center;border-radius:50%;border:none;background:var(--dhx-scheduler-popup-background)}.dhx_mini_calendar .dhx_month_head{border-radius:50%;color:var(--dhx-scheduler-datepicker-cell-color);background:var(--dhx-scheduler-datepicker-cell-background);width:30px!important;height:30px!important;padding:4px;justify-content:center;align-items:center;cursor:pointer}.dhx_mini_calendar div.dhx_month_head.dhx_year_event{background-color:#0288d133;color:#0288d1;font-weight:500}.dhx_mini_calendar div.dhx_month_head.dhx_calendar_click{background-color:#e5e5e5;color:#000000bf;font-weight:500}.dhx_mini_calendar .dhx_now .dhx_month_head{background-color:#f7f7f7}.dhx_mini_calendar .dhx_after .dhx_month_head,.dhx_mini_calendar .dhx_before .dhx_month_head{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-inactive-month-color)}.dhx_minical_input_wrapper{position:relative}.dhx_minical_input_wrapper:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_minical_input_wrapper:before{content:""}.dhx_minical_input_wrapper:before{pointer-events:none;position:absolute;right:5px;top:7px;font-size:20px}.scheduler_message_area{position:fixed;right:5px;width:250px;z-index:11}.scheduler-info{min-width:120px;padding:12px;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-regular-font-size);font-weight:var(--dhx-scheduler-regular-font-weight);line-height:var(--dhx-scheduler-regular-line-height);z-index:14;overflow:hidden;margin:5px 5px 10px;transition:all .5s ease;background:var(--dhx-scheduler-info-background);color:var(--dhx-scheduler-info-color);border:var(--dhx-scheduler-info-border);box-shadow:var(--dhx-scheduler-info-shadow)}.scheduler-info.hidden{height:0px;padding:0;border-width:0px;margin:0;overflow:hidden}.scheduler_modal_box{overflow:hidden;position:fixed;min-width:300px;width:var(--dhx-scheduler-modal-width);background:var(--dhx-scheduler-modal-background);box-shadow:var(--dhx-scheduler-box-shadow-l);border:var(--dhx-scheduler-modal-border);z-index:18;border-radius:var(--dhx-scheduler-modal-border-radius);font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size);line-height:150%}.scheduler_popup_text{color:var(--dhx-scheduler-base-colors-text-base)}.scheduler_popup_title{border-top-left-radius:var(--dhx-scheduler-modal-border-radius);border-top-right-radius:var(--dhx-scheduler-modal-border-radius);text-transform:uppercase;font-weight:var(--dhx-scheduler-heading-font-weight);padding:calc(var(--dhx-scheduler-modal-padding)/2) var(--dhx-scheduler-modal-padding);display:flex;justify-content:center;align-items:center}.scheduler_popup_text{padding:var(--dhx-scheduler-modal-padding);display:flex;justify-content:center;align-items:center}.scheduler_popup_controls{display:flex;flex-direction:row-reverse;padding:calc(var(--dhx-scheduler-modal-padding)/2) var(--dhx-scheduler-modal-padding);align-items:center;gap:12px}.scheduler-info,.scheduler_popup_button,.scheduler_button{-webkit-user-select:none;user-select:none;cursor:pointer}.scheduler_popup_text{overflow:hidden}div.dhx_modal_cover{background:#44494E;opacity:.2;position:fixed;z-index:17;left:0;top:0;width:100%;height:100%;border:none}.scheduler_popup_controls{border-radius:var(--dhx-scheduler-border-radius)}.scheduler_message_area .scheduler-error{--dhx-scheduler-info-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-info-color: var(--dhx-scheduler-base-colors-white)}.scheduler_message_area .scheduler-warning{--dhx-scheduler-info-background: var(--dhx-scheduler-base-colors-warning)}.scheduler_modal_box.scheduler-error .scheduler_popup_title{background:#d81b1b;border:1px solid #ff3c3c;color:#fff}.scheduler_modal_box.scheduler-error .scheduler_popup_title{background:#FFAB00;border:1px solid #FFAB00}.dhtmlXTooltip.tooltip{box-shadow:var(--dhx-scheduler-box-shadow-m);background-color:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);border:var(--dhx-scheduler-popup-border);cursor:default;padding:12px;position:fixed;z-index:9;opacity:1;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-regular-font-size);line-height:var(--dhx-scheduler-regular-line-height);font-weight:var(--dhx-scheduler-regular-font-weight)}.dhtmlXTooltip_rtl{direction:rtl}.dhx_focus_slot{background:var(--dhx-scheduler-base-colors-select);position:absolute;pointer-events:none;opacity:.5}.dhx_cal_container *:focus{outline-style:solid;outline-style:auto;outline-color:var(--dhx-scheduler-base-colors-select)}.dhx_no_select{-webkit-user-select:none;user-select:none}.dhx_drag_placeholder{z-index:10;opacity:.8}.dhx_drag_placeholder .dhx_cal_select_menu{display:none}.dhx_cal_light_readonly .dhx_section_time{display:block}.dhx_cal_light_readonly .dhx_section_time .dhx_section_time_spacer{visibility:visible}.dhx_cal_light_readonly .dhx_cal_lsection+div{padding-top:4px;padding-bottom:4px} +@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuOKfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf) format("truetype")}:root{--dhx-scheduler-theme: terrace;--dhx-scheduler-font-family: Inter, Helvetica, Arial, sans-serif;--dhx-scheduler-font-size: 14px;--dhx-scheduler-heading-font-size: calc(var(--dhx-scheduler-font-size) + 2px);--dhx-scheduler-heading-font-weight: 600;--dhx-scheduler-important-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-important-line-height: 142%;--dhx-scheduler-important-font-weight: 500;--dhx-scheduler-regular-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-regular-font-weight: 400;--dhx-scheduler-regular-line-height: 142%;--dhx-scheduler-caption-font-size: calc(var(--dhx-scheduler-font-size) - 2px);--dhx-scheduler-caption-font-weight: 400;--dhx-scheduler-caption-line-height: 132%;--dhx-scheduler-base-colors-primary: #537CFA;--dhx-scheduler-base-colors-primary-hover: #4269E0;--dhx-scheduler-base-colors-primary-active: #3365fb;--dhx-scheduler-base-colors-primary-lighter: #537cfa33;--dhx-scheduler-base-colors-warning: #FAB936;--dhx-scheduler-base-colors-error: #E3334E;--dhx-scheduler-base-colors-error-hover: #D3233E;--dhx-scheduler-base-colors-error-active: #C3132E;--dhx-scheduler-base-colors-error-lighter: #E3334E33;--dhx-scheduler-base-colors-error-text: #FFFFFF;--dhx-scheduler-base-colors-success: #1BC297;--dhx-scheduler-base-colors-secondary: rgba(0, 0, 0, .04);--dhx-scheduler-base-colors-secondary-hover: rgba(0, 0, 0, .1);--dhx-scheduler-base-colors-white: #FFFFFF;--dhx-scheduler-base-colors-select: #EFF3FF;--dhx-scheduler-base-colors-hover-color: #e0e0e0;--dhx-scheduler-base-colors-border: #D0DBE3;--dhx-scheduler-base-colors-icons: #A1A4A6;--dhx-scheduler-base-colors-icons-active: #8b8e90;--dhx-scheduler-base-colors-icons-hover: #76787a;--dhx-scheduler-base-colors-disabled: #E9E9E9;--dhx-scheduler-base-colors-readonly: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-base-colors-text-light: #44494E;--dhx-scheduler-base-colors-text-base: #23272A;--dhx-scheduler-base-colors-background: #FFFFFF;--dhx-scheduler-container-background: var(--dhx-scheduler-base-colors-background);--dhx-scheduler-container-color: var(--dhx-scheduler-base-colors-text-base);--dhx-scheduler-container-background-alt: rgba(0, 0, 0, .4);--dhx-scheduler-base-transition: .2s ease;--dhx-scheduler-box-shadow-s: 0px 4px 24px 0px rgba(44, 47, 60, .08);--dhx-scheduler-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-scheduler-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-scheduler-base-module: 4px;--dhx-scheduler-base-padding: 4px;--dhx-scheduler-border-radius: var(--dhx-scheduler-base-module);--dhx-scheduler-event-colors-primary: #537CFA;--dhx-scheduler-event-text-primary: rgba(255, 255, 255, .9);--dhx-scheduler-toolbar-height: 40px;--dhx-scheduler-transition: all .3s;--dhx-scheduler-navline-font-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-default-border: 1px solid var(--dhx-scheduler-base-colors-border);--dhx-scheduler-header-border: var(--dhx-scheduler-default-border);--dhx-scheduler-halfhour-border: 1px dotted var(--dhx-scheduler-base-colors-border);--dhx-scheduler-event-background-primary: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-event-blue: linear-gradient(180deg, #527CFF 0%, #9751FC 100%);--dhx-scheduler-event-green: linear-gradient(180deg, #12D979 0%, #1ECDEB 100%);--dhx-scheduler-event-violet: linear-gradient(180deg, #D071EF 0%, #EE71D5 100%);--dhx-scheduler-event-yellow: linear-gradient(180deg, #FFB725 0%, #FFBB25 31.25%, #FAEA27 100%);--dhx-scheduler-event-title-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-event-title-line-height: var(--dhx-scheduler-caption-line-height);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-regular-font-size);--dhx-scheduler-event-text-line-height: var(--dhx-scheduler-regular-line-height);--dhx-scheduler-event-text-font-weight: var(--dhx-scheduler-regular-font-weight);--dhx-scheduler-event-bar-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-event-bar-line-height: var(--dhx-scheduler-caption-line-height);--dhx-scheduler-event-menu-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-event-menu-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-event-background: var(--dhx-scheduler-event-blue);--dhx-scheduler-event-border: none;--dhx-scheduler-event-color: var(--dhx-scheduler-event-text-primary);--dhx-scheduler-event-line-text: var(--dhx-scheduler-container-color);--dhx-scheduler-event-marker-color: var(--dhx-scheduler-event-background);--dhx-scheduler-popup-background: var(--dhx-scheduler-container-background);--dhx-scheduler-popup-color: var(--dhx-scheduler-container-color);--dhx-scheduler-popup-border: none;--dhx-scheduler-popup-border-radius: var(--dhx-scheduler-border-radius);--dhx-scheduler-control-height: 32px;--dhx-scheduler-checkbox-height: 20px;--dhx-scheduler-lightbox_font-family: var(--dhx-scheduler-font-family);--dhx-scheduler-lightbox-font-size: var(--dhx-scheduler-important-font-size);--dhx-scheduler-lightbox-font-weight: var(--dhx-scheduler-important-font-weight);--dhx-scheduler-lightbox-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-lightbox-border: var(--dhx-scheduler-popup-border);--dhx-scheduler-lightbox-control-border: var(--dhx-scheduler-default-border);--dhx-scheduler-lightbox-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-lightbox-title-background: var(--dhx-scheduler-base-colors-select);--dhx-scheduler-lightbox-title-color: var(--dhx-scheduler-lightbox-color);--dhx-scheduler-lightbox-title-font-size: var(--dhx-scheduler-heading-font-size);--dhx-scheduler-lightbox-max-width: 496px;--dhx-scheduler-lightbox-wide-max-width: 738px;--dhx-scheduler-lightbox-width: var(--dhx-scheduler-lightbox-max-width);--dhx-scheduler-scale-color: var(--dhx-scheduler-container-color);--dhx-scheduler-timescale-background: var(--dhx-scheduler-container-background);--dhx-scheduler-timescale-today-background: var(--dhx-scheduler-base-colors-select);--dhx-scheduler-hours-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-hours-font-weight: var(--dhx-scheduler-caption-font-weight);--dhx-scheduler-inactive-month-color: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-month-header-color: var(--dhx-scheduler-container-color);--dhx-scheduler-month-day-header-padding: var(--dhx-scheduler-base-padding) calc(var(--dhx-scheduler-base-padding) * 2);--dhx-scheduler-month-event-marker-size: calc(var(--dhx-scheduler-base-module) * 2);--dhx-scheduler-list-line-height: 36px;--dhx-scheduler-agenda-date-column-width: 188px;--dhx-scheduler-grid-event-background: transparent;--dhx-scheduler-grid-event-text: initial;--dhx-scheduler-timeline-folder-background: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-timeline-folder-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-blocked-time-background: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-today-marker-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-datepicker-width: 250px;--dhx-scheduler-datepicker-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-datepicker-family: var(--dhx-scheduler-font-family);--dhx-scheduler-datepicker-cell-size: 28px;--dhx-scheduler-datepicker-header-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-datepicker-header-font-weight: 500;--dhx-scheduler-datepicker-padding: 5px;--dhx-scheduler-datepicker-inactive-month-color: var(--dhx-scheduler-inactive-month-color);--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-datepicker-today-color: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-datepicker-today-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-datepicker-weekend-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-datepicker-weekend-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-datepicker-disabled-color: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-datepicker-disabled-background: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-datepicker-hover-color: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-datepicker-hover-background: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-datepicker-prevnext-color: var(--dhx-scheduler-inactive-month-color);--dhx-scheduler-datepicker-prevnext-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-base-colors-disabled);--dhx-scheduler-btn-outline-background: transparent;--dhx-scheduler-btn-outline-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-outline-border-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-outline-background-hover: var(--dhx-scheduler-base-colors-primary-lighter);--dhx-scheduler-btn-outline-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-outline-border-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-outline-background-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-outline-color-active: var(--dhx-scheduler-base-colors-white);--dhx-scheduler-btn-outline-border-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-outline-background-disabled: transparent;--dhx-scheduler-btn-outline-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-outline-border-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-text-transform: none;--dhx-scheduler-xy-scale_width: 50px;--dhx-scheduler-xy-bar_height: 24;--dhx-scheduler-xy-month_head_height: 26;--dhx-scheduler-xy-scale_height: 24px;--dhx-scheduler-xy-scroll_width: 18px;--dhx-scheduler-info-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-info-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-info-border: var(--dhx-scheduler-popup-border);--dhx-scheduler-info-shadow: var(--dhx-scheduler-box-shadow-m);--dhx-scheduler-modal-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-modal-color: var(--dhx-scheduler-popup-color);--dhx-scheduler-modal-border: var(--dhx-scheduler-popup-border);--dhx-scheduler-modal-padding: 16px;--dhx-scheduler-modal-width: 320px;--dhx-scheduler-modal-border-radius: var(--dhx-scheduler-popup-border-radius);--dhx-scheduler-undo-delete-background: var(--dhx-scheduler-base-colors-text-base);--dhx-scheduler-undo-delete-color: var(--dhx-scheduler-event-color)}:root[data-scheduler-theme=dark]{--dhx-scheduler-theme: dark;--dhx-scheduler-base-colors-disabled: #3d3d3d;--dhx-scheduler-base-colors-text-light: #AAA;--dhx-scheduler-base-colors-text-base: rgba(255, 255, 255, .9);--dhx-scheduler-base-colors-background: #000000;--dhx-scheduler-base-colors-border: #4B4B4B;--dhx-scheduler-navline-font-color: var(--dhx-scheduler-base-colors-text-base);--dhx-scheduler-base-colors-primary: #3B72F8;--dhx-scheduler-base-colors-primary-hover: #1D5AEE;--dhx-scheduler-base-colors-primary-active: #0e50ea;--dhx-scheduler-base-colors-primary-lighter: #3B72F833;--dhx-scheduler-base-colors-error: #EB284F;--dhx-scheduler-base-colors-error-hover: #D9264A;--dhx-scheduler-base-colors-error-active: #ba0a24;--dhx-scheduler-base-colors-error-lighter: #EB284F33;--dhx-scheduler-base-colors-select: #2A2A2A;--dhx-scheduler-base-colors-hover-color: #2A2A2A;--dhx-scheduler-base-colors-icons: #AAAAAA;--dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-popup-background: #1B1B1C;--dhx-scheduler-popup-border: 1px solid #4B4B4B;--dhx-scheduler-btn-font-weight: 600;--dhx-scheduler-undo-delete-background: var(--dhx-scheduler-popup-background)}:root[data-scheduler-theme=flat]{--dhx-scheduler-theme: flat;--dhx-scheduler-font-family: Segoe UI,Arial,san-serif;--dhx-scheduler-base-colors-primary: #0288D1;--dhx-scheduler-base-colors-primary-hover: #007cbf;--dhx-scheduler-base-colors-primary-active: #00659b;--dhx-scheduler-base-colors-primary-lighter: #edf8ff;--dhx-scheduler-event-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-base-colors-border: #cecece;--dhx-scheduler-halfhour-border: 1px solid #e8e8e8;--dhx-scheduler-event-title-font-size: 12px;--dhx-scheduler-event-text-font-size: 14px;--dhx-scheduler-event-text-font-weight: 500;--dhx-scheduler-heading-font-size: 22px;--dhx-scheduler-heading-font-weight: 300;--dhx-scheduler-caption-font-size: 14px;--dhx-scheduler-caption-font-weight: 400;--dhx-scheduler-hours-font-size: 12px;--dhx-scheduler-scale-color: #767676;--dhx-scheduler-border-radius: 0;--dhx-scheduler-timeline-folder-background: #ebeced;--dhx-scheduler-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-scheduler-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-scheduler-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-scheduler-config-form_wide: 1;--dhx-scheduler-xy-scale_height: 35px}:root[data-scheduler-theme=flat] .dhx_cal_navline{--dhx-scheduler-btn-outline-border-color: transparent;--dhx-scheduler-btn-outline-border-hover: transparent;--dhx-scheduler-btn-outline-border-color-disabled: transparent}:root[data-scheduler-theme=flat] .dhx_scale_hour{justify-content:center}:root[data-scheduler-theme=flat] .dhx_cal_tab{min-width:90px}:root[data-scheduler-theme=flat] .dhx_cal_navline>div{order:1}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_next_button{order:6}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_today_button{order:5;border-color:transparent}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_prev_button{order:4}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_date{order:3}:root[data-scheduler-theme=flat] .dhx_cal_navline .dhx_cal_date{margin-left:auto;margin-right:auto}:root[data-scheduler-theme=flat] .dhx_data_table.folder .dhx_matrix_cell{border-right:0}:root[data-scheduler-theme=flat] .dhx_timeline_scale_header{border-right:none}:root[data-scheduler-theme=flat] .dhx_cal_container_rtl .dhx_timeline_scale_header{border-left:unset}:root[data-scheduler-theme=flat] .dhx_scale_hour{display:flex;flex-direction:row}:root[data-scheduler-theme=flat] .dhx_scale_hour .dhx_scale_h{font-size:22px;line-height:44px;font-weight:lighter}:root[data-scheduler-theme=flat] .dhx_scale_hour .dhx_scale_m{font-size:11px;line-height:35px;align-self:end;font-weight:lighter;transform:translateY(-2px)}:root[data-scheduler-theme=material]{--dhx-scheduler-theme: material;--dhx-scheduler-font-family: Roboto, Helvetica, Arial, sans-serif;--dhx-scheduler-base-colors-primary: #0288D1;--dhx-scheduler-base-colors-primary-hover: #007cbf;--dhx-scheduler-base-colors-primary-active: #00659b;--dhx-scheduler-base-colors-primary-lighter: #edf8ff;--dhx-scheduler-event-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-base-colors-border: #e0e0e0;--dhx-scheduler-event-title-font-size: calc(var(--dhx-scheduler-font-size) - 2px);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-event-text-font-weight: 500;--dhx-scheduler-heading-font-size: 20px;--dhx-scheduler-caption-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-caption-font-weight: 500;--dhx-scheduler-btn-font-weight: 500;--dhx-scheduler-heading-font-weight: 500;--dhx-scheduler-hours-font-size: calc(var(--dhx-scheduler-font-size) - 2px);--dhx-scheduler-base-colors-text-base: rgba(0, 0, 0, .75);--dhx-scheduler-header-border: 1px solid transparent;--dhx-scheduler-scale-color: rgba(0, 0, 0, .54);--dhx-scheduler-border-radius: 0;--dhx-scheduler-btn-text-transform: uppercase;--dhx-scheduler-btn-padding: 1px 20px 0;--dhx-scheduler-halfhour-border: none;--dhx-scheduler-timeline-folder-background: #ebeced;--dhx-scheduler-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-scheduler-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-scheduler-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-scheduler-lightbox-title-background: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-lightbox-title-color: #FFFFFF;--dhx-scheduler-lightbox-title-font-size: var(--dhx-scheduler-font-size);--dhx-scheduler-lightbox-wide-max-width: 540px;--dhx-scheduler-config-form_wide: 1}:root[data-scheduler-theme=material] .dhx_scale_hour{justify-content:center}:root[data-scheduler-theme=material] .dhx_cal_tab{min-width:90px}:root[data-scheduler-theme=material] .dhx_cal_navline>div{order:1}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_next_button{order:6}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_today_button{order:5;border-color:transparent}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_prev_button{order:4}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_date{order:3}:root[data-scheduler-theme=material] .dhx_cal_navline .dhx_cal_date{margin-left:auto;margin-right:auto}:root[data-scheduler-theme=material] .dhx_data_table.folder .dhx_matrix_cell{border-right:0}:root[data-scheduler-theme=material] .dhx_timeline_scale_header{border-right:none}:root[data-scheduler-theme=material] .dhx_cal_container_rtl .dhx_timeline_scale_header{border-left:unset}:root[data-scheduler-theme=material] .dhx_cal_scale_placeholder{position:absolute;z-index:2;box-shadow:0 3px 5px #0000001a;left:0;pointer-events:none}:root[data-scheduler-theme=material] .dhx_year_box .dhx_year_month{font-weight:500;color:var(--dhx-scheduler-base-colors-primary)}:root[data-scheduler-theme=material] .dhx_year_box .dhx_month_head.dhx_year_event:after{content:none}:root[data-scheduler-theme=material] .dhx_year_box .dhx_year_event{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-hover-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-hover-background)}:root[data-scheduler-theme=material] .dhx_cal_ltitle{font-weight:400;text-transform:uppercase}:root[data-scheduler-theme=material] .dhx_cal_ltitle_controls{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-lightbox-title-color)}:root[data-scheduler-theme=material] .dhx_timeline_scale_header{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%}:root[data-scheduler-theme=contrast-white]{--dhx-scheduler-theme: contrast-white;--dhx-scheduler-base-colors-disabled: #C2C2C2;--dhx-scheduler-base-colors-text-light: #303030;--dhx-scheduler-base-colors-text-base: #303030;--dhx-scheduler-base-colors-background: #FFFFFF;--dhx-scheduler-base-colors-border: #4D595B;--dhx-scheduler-base-colors-primary: #0A47CD;--dhx-scheduler-base-colors-primary-hover: #093fb3;--dhx-scheduler-base-colors-primary-active: #08379b;--dhx-scheduler-base-colors-primary-lighter: #0A47CD;--dhx-scheduler-event-background: #0A47CD;--dhx-scheduler-event-color: #FFF;--dhx-scheduler-event-border: 1px solid rgba(0, 0, 0, .1);--dhx-scheduler-base-colors-warning: #FCBA2E;--dhx-scheduler-base-colors-success: #77D257;--dhx-scheduler-base-colors-error: #FFA7A0;--dhx-scheduler-base-colors-error-hover: #d88d88;--dhx-scheduler-base-colors-error-active: #cd8984;--dhx-scheduler-base-colors-error-lighter: #FFA7A0;--dhx-scheduler-base-colors-error-text: #141414;--dhx-scheduler-btn-color: #FFFFFF;--dhx-scheduler-btn-color-hover: #FFFFFF;--dhx-scheduler-btn-color-active: #FFFFFF;--dhx-scheduler-base-colors-select: #E7E5E5;--dhx-scheduler-base-colors-hover-color: #E7E5E5;--dhx-scheduler-base-colors-icons: #303030;--dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-popup-background: #FFF;--dhx-scheduler-popup-border: 1px solid #4D595B;--dhx-scheduler-font-size: 16px;--dhx-scheduler-heading-font-size: 24px;--dhx-scheduler-important-font-size: 16px;--dhx-scheduler-regular-font-size: 16px;--dhx-scheduler-caption-font-size: 16px;--dhx-scheduler-btn-outline-color-hover: #FFFFFF;--dhx-scheduler-btn-outline-color-active: #FFFFFF}:root[data-scheduler-theme=contrast-black]{--dhx-scheduler-theme: contrast-black;--dhx-scheduler-base-colors-disabled: #3d3d3d;--dhx-scheduler-base-colors-text-light: #cfcfcf;--dhx-scheduler-base-colors-text-base: #FFFFFFCC;--dhx-scheduler-base-colors-background: #141414;--dhx-scheduler-base-colors-border: rgba(255, 255, 255, .8);--dhx-scheduler-base-colors-primary: #A395FF;--dhx-scheduler-base-colors-primary-hover: #C5BCFF;--dhx-scheduler-base-colors-primary-active: #C5BCFF;--dhx-scheduler-base-colors-primary-lighter: #C5BCFF;--dhx-scheduler-event-background: #A395FF;--dhx-scheduler-event-color: #141414;--dhx-scheduler-event-border: 1px solid rgba(0, 0, 0, .1);--dhx-scheduler-base-colors-warning: #694E02;--dhx-scheduler-base-colors-success: #115700;--dhx-scheduler-base-colors-error: #FFA7A0;--dhx-scheduler-base-colors-error-hover: #fb9891;--dhx-scheduler-base-colors-error-active: #fe8b83;--dhx-scheduler-base-colors-error-lighter: #ffa6a03e;--dhx-scheduler-base-colors-error-text: #141414;--dhx-scheduler-btn-color: #141414;--dhx-scheduler-btn-color-hover: #141414;--dhx-scheduler-btn-color-active: #141414;--dhx-scheduler-base-colors-select: #2A2A2A;--dhx-scheduler-base-colors-hover-color: #2A2A2A;--dhx-scheduler-base-colors-icons: #AAAAAA;--dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light);--dhx-scheduler-popup-background: #1B1B1C;--dhx-scheduler-undo-delete-background: var(--dhx-scheduler-popup-background);--dhx-scheduler-undo-delete-color: var(--dhx-scheduler-base-colors-text-base);--dhx-scheduler-popup-border: 1px solid #4B4B4B;--dhx-scheduler-font-size: 16px;--dhx-scheduler-heading-font-size: 24px;--dhx-scheduler-important-font-size: 16px;--dhx-scheduler-regular-font-size: 16px;--dhx-scheduler-caption-font-size: 16px;--dhx-scheduler-btn-outline-color-hover: #141414;--dhx-scheduler-btn-outline-color-active: #141414}@font-face{font-family:dhx-scheduler-icons;src:url(data:font/woff;base64,d09GRgABAAAAAAh0AAsAAAAAEBwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPwAAAGA97Us7Y21hcAAAAYQAAADjAAADMPMkIBtnbHlmAAACaAAAA0IAAAaMK6vwRWhlYWQAAAWsAAAALAAAADZYpKBVaGhlYQAABdgAAAAbAAAAJAJpATlobXR4AAAF9AAAABQAAABsHbAAAGxvY2EAAAYIAAAAOAAAADgWjBgkbWF4cAAABkAAAAAfAAAAIAExAD1uYW1lAAAGYAAAAUEAAAKazYPp33Bvc3QAAAekAAAAzwAAATGzVblzeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxg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kifMKFY5hDk/TbmFvao3Xrg2R86oSMSmEb4g6DqqNofNxtc92Rq4bjnRw0oBIuRcESRWEsDyj/x4swzmtgvkXSBQPyXzwt8WhrGzth3N/KRyTbylglzj7OmXLm6CvXJXfiVPsJpxHI0LJVnJP6qpz71AoOPX4gi5jYON7ctL1XrGuj6V/F4q2jU7l01AwcAhIKGgr3JP4uAREJHmZd3243y53u4P/XE7taZOrAjfK+fqnHgTep1WkBSijgap12YE4s2zszIAmwGpDxHh37cjPuXAIaHi0KHaRGXgWEsVBye4LZ3YUEWW9OKsluZ5eZuxTOODXq50D13SQZpMiYJDYkudHHo15uvY85s3EYv5OUGH/3sNXcuosGhlC4yjMg4LtFoAAA==) format("woff2")}.scheduler_icon:before,.dhx_menu_icon:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.scheduler_icon.alert:before,.dhx_menu_icon.icon_alert:before{content:""}.scheduler_icon.arrow_down:before,.dhx_menu_icon.icon_arrow_down:before{content:""}.scheduler_icon.arrow_left:before,.dhx_menu_icon.icon_arrow_left:before{content:"";font-size:24px}.scheduler_icon.arrow_right:before,.dhx_menu_icon.icon_arrow_right:before{content:"";font-size:24px}.scheduler_icon.arrow_up:before,.dhx_menu_icon.icon_arrow_up:before{content:""}.scheduler_icon.calendar:before,.dhx_menu_icon.icon_calendar:before{content:""}.scheduler_icon.cancel:before,.dhx_menu_icon.icon_cancel:before{content:""}.scheduler_icon.check:before,.dhx_menu_icon.icon_check:before{content:""}.scheduler_icon.chevron_down:before,.dhx_menu_icon.icon_chevron_down:before{content:"";font-size:24px}.scheduler_icon.chevron_left:before,.dhx_menu_icon.icon_chevron_left:before{content:"";font-size:24px}.scheduler_icon.chevron_right:before,.dhx_menu_icon.icon_chevron_right:before{content:"";font-size:24px}.scheduler_icon.chevron_up:before,.dhx_menu_icon.icon_chevron_up:before{content:"";font-size:24px}.scheduler_icon.clock:before,.dhx_menu_icon.icon_clock:before{content:""}.scheduler_icon.close:before,.dhx_menu_icon.icon_close:before{content:""}.scheduler_icon.delete:before,.dhx_menu_icon.icon_delete:before{content:"";font-size:18px}.scheduler_icon.details:before,.dhx_menu_icon.icon_details:before{content:""}.scheduler_icon.dots_h:before,.dhx_menu_icon.icon_dots_h:before{content:""}.scheduler_icon.dots_v:before,.dhx_menu_icon.icon_dots_v:before{content:""}.scheduler_icon.drag_horizontal:before,.dhx_menu_icon.icon_drag_horizontal:before{content:""}.scheduler_icon.drag_vertical:before,.dhx_menu_icon.icon_drag_vertical:before{content:""}.scheduler_icon.drag:before,.dhx_menu_icon.icon_drag:before{content:""}.scheduler_icon.edit:before,.dhx_menu_icon.icon_edit:before{content:""}.scheduler_icon.form:before,.dhx_menu_icon.icon_form:before{content:""}.scheduler_icon.iclose:before,.dhx_menu_icon.icon_iclose:before{content:""}.scheduler_icon.loading:before,.dhx_menu_icon.icon_loading:before{content:""}.scheduler_icon.menu:before,.dhx_menu_icon.icon_menu:before{content:""}.scheduler_icon.menu_down:before,.dhx_menu_icon.icon_menu_down:before{content:""}.scheduler_icon.menu_right:before,.dhx_menu_icon.icon_menu_right:before{content:""}.scheduler_icon.ok:before,.dhx_menu_icon.icon_ok:before{content:""}.scheduler_icon.plus:before,.dhx_menu_icon.icon_plus:before{content:""}.scheduler_icon.save:before,.dhx_menu_icon.icon_save:before{content:""}.scheduler_icon.sort_asc:before,.dhx_menu_icon.icon_sort_asc:before{content:""}.scheduler_icon.sort_desc:before,.dhx_menu_icon.icon_sort_desc:before{content:""}.button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer}.button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.button-outline{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.button-danger{--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error-text);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active)}.button-danger-outline{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-lighter);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-base-colors-icons)}.button-danger-link{padding:6px 0;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.button-link{padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.button-icon{min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.button-icon:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.button-icon:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.button-icon:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_cal_btn,.dhx_cal_btn_danger,.dhx_cal_btn_outline,.dhx_cal_btn_danger_outline,.dhx_cal_btn_danger_link,.dhx_btn_set,.dhx_cal_tab,.dhx_qi_big_icon,.dhx_cal_today_button,.dhx_cal_tab_standalone{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer}.dhx_cal_btn:hover,.dhx_cal_btn_danger:hover,.dhx_cal_btn_outline:hover,.dhx_cal_btn_danger_outline:hover,.dhx_cal_btn_danger_link:hover,.dhx_btn_set:hover,.dhx_cal_tab:hover,.dhx_qi_big_icon:hover,.dhx_cal_today_button:hover,.dhx_cal_tab_standalone:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_btn:active,.dhx_cal_btn_danger:active,.dhx_cal_btn_outline:active,.dhx_cal_btn_danger_outline:active,.dhx_cal_btn_danger_link:active,.dhx_btn_set:active,.dhx_cal_tab:active,.dhx_qi_big_icon:active,.dhx_cal_today_button:active,.dhx_cal_tab_standalone:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_btn:disabled,.dhx_cal_btn_danger:disabled,.dhx_cal_btn_outline:disabled,.dhx_cal_btn_danger_outline:disabled,.dhx_cal_btn_danger_link:disabled,.dhx_btn_set:disabled,.dhx_cal_tab:disabled,.dhx_qi_big_icon:disabled,.dhx_cal_today_button:disabled,.dhx_cal_tab_standalone:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.scheduler_popup_button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer}.scheduler_popup_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.scheduler_popup_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.scheduler_popup_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.scheduler_popup_button:not(.scheduler_ok_button){--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.scheduler_ok_button{--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error-text);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active)}.dhx_cal_btn_outline,.dhx_cal_btn_danger_outline{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.dhx_cal_button_danger,.dhx_cal_button_danger_outline{--dhx-scheduler-btn-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error-text);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-base-colors-error-active)}.dhx_cal_button_link,.dhx_qi_big_icon{padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;user-select:none}.dhx_cal_container{position:relative;overflow:hidden;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size);line-height:110%;display:flex;flex-direction:column;background-color:var(--dhx-scheduler-container-background);color:var(--dhx-scheduler-container-color);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}.dhx_cal_container div[role=button]{cursor:pointer}.dhx_cal_container.dhx_cal_container_rtl{direction:rtl}.dhx_cal_container,.dhx_cal_container *{box-sizing:border-box}.dhx_cal_container div{-webkit-user-select:none;user-select:none}.dhx_cal_data,.dhx_cal_event,.dhx_cal_event_clear,.dhx_cal_event_line{touch-action:pan-y}.dhx_cal_navline{position:relative;display:flex;align-items:center;flex-wrap:wrap;row-gap:8px;justify-content:space-between;font-weight:var(--dhx-scheduler-important-font-weight);padding:12px;min-height:var(--dhx-scheduler-toolbar-height);color:var(--dhx-scheduler-navline-font-color)}.dhx_cal_navline_flex .dhx_cal_navbar_rows_container{display:flex;align-items:center;flex-direction:column;box-sizing:border-box;flex-grow:1;gap:12px;height:100%}.dhx_cal_navline_flex .dhx_cal_date{width:auto;margin-left:auto;margin-right:auto}.dhx_cal_navline_flex .dhx_cal_today_button{order:unset}.dhx_cal_navline_flex .dhx_cal_navbar_row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding:0 1vw;box-sizing:border-box;height:100%;width:100%;flex-grow:1;flex-shrink:1}.dhx_cal_navline_flex .dhx_cal_line_spacer{display:block;width:auto;flex-grow:1}@media only screen and (max-width: 1023px){.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button,.dhx_cal_navline_flex .dhx_cal_tab,.dhx_cal_navline_flex .dhx_cal_tab.active,.dhx_cal_navline_flex .dhx_cal_today_button{height:2.5vw;line-height:2.5vw}}@media only screen and (max-width: 840px){.dhx_cal_navline_flex{--dhx-scheduler-btn-padding: 0 12px}.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button,.dhx_cal_navline_flex .dhx_cal_tab,.dhx_cal_navline_flex .dhx_cal_tab.active,.dhx_cal_navline_flex .dhx_cal_today_button{height:4vw;line-height:4vw}}@media only screen and (max-width: 480px){.dhx_cal_navline_flex{--dhx-scheduler-btn-padding: 0 4px}.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button{width:2rem}}@media only screen and (max-width: 480px){.dhx_cal_navline_flex .dhx_cal_next_button,.dhx_cal_navline_flex .dhx_cal_prev_button,.dhx_cal_navline_flex .dhx_cal_tab,.dhx_cal_navline_flex .dhx_cal_tab.active,.dhx_cal_navline_flex .dhx_cal_today_button{height:6vw;line-height:6vw}}.dhx_cal_tab:not(.active),.dhx_cal_tab_standalone:not(.active),.dhx_cal_today_button:not(.active){--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.dhx_cal_tab_segmented{border-left-style:none;border-radius:0}.dhx_cal_tab_segmented.dhx_cal_tab_first{border-left-style:solid;border-radius:var(--dhx-scheduler-border-radius) 0px 0px var(--dhx-scheduler-border-radius);margin-left:4px}.dhx_cal_tab_segmented.dhx_cal_tab_last{border-radius:0px var(--dhx-scheduler-border-radius) var(--dhx-scheduler-border-radius) 0px;margin-right:4px}.dhx_cal_container_rtl .dhx_cal_tab_segmented.dhx_cal_tab_first{border-left-style:none;border-radius:0px var(--dhx-scheduler-border-radius) var(--dhx-scheduler-border-radius) 0px;margin-right:4px;margin-left:unset}.dhx_cal_container_rtl .dhx_cal_tab_segmented.dhx_cal_tab_last{border-radius:var(--dhx-scheduler-border-radius) 0px 0px var(--dhx-scheduler-border-radius);border-left-style:solid;margin-right:unset;margin-left:4px}.dhx_cal_container_rtl .dhx_cal_date{margin-right:unset;margin-left:auto}.dhx_cal_container_rtl .dhx_cal_header{border-left:var(--dhx-scheduler-default-border);border-right:none}.dhx_cal_tab_standalone{border-radius:var(--dhx-scheduler-border-radius);margin:0 4px}.dhx_cal_header{height:21px;border-top:var(--dhx-scheduler-header-border);border-right:var(--dhx-scheduler-header-border);position:relative;overflow:hidden}.dhx_scale_bar{position:absolute}.dhx_cal_date{text-align:center;position:relative;margin-right:auto;font-size:var(--dhx-scheduler-heading-font-size);line-height:150%;font-weight:var(--dhx-scheduler-heading-font-weight);flex-shrink:0}.dhx_cal_data{position:relative;flex:1;overflow-y:auto;overflow-x:hidden;border-top:var(--dhx-scheduler-default-border)}.dhx_scale_holder{position:absolute}.dhx_cal_today_button{margin-right:5px;order:-1}.dhx_cal_prev_button,.dhx_cal_next_button{order:0;width:20px;height:20px;background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent;font-size:24px}.dhx_cal_prev_button:hover,.dhx_cal_next_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_prev_button:active,.dhx_cal_next_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_prev_button:disabled,.dhx_cal_next_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_cal_prev_button:hover,.dhx_cal_next_button:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.dhx_cal_prev_button:active,.dhx_cal_next_button:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.dhx_cal_prev_button:disabled,.dhx_cal_next_button:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_cal_prev_button:before,.dhx_cal_next_button:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_prev_button:before{content:"";font-size:24px}.dhx_cal_next_button:before{content:"";font-size:24px}.dhx_cal_container_rtl .dhx_cal_prev_button:before{content:"";font-size:24px}.dhx_cal_container_rtl .dhx_cal_next_button:before{content:"";font-size:24px}.scheduler_container_resize_watcher{background:transparent;width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;pointer-events:none;border:0;box-sizing:border-box;opacity:0}.dhx_title_datepicker_container{z-index:2;position:absolute}.dhx_expand_icon{position:absolute;top:0;right:2px;cursor:pointer;z-index:4}.dhx_marked_timespan{position:absolute;width:100%;margin-left:0;display:flex;justify-content:center;align-items:center}.dhx_time_block{position:absolute;width:100%;background:var(--dhx-scheduler-blocked-time-background);z-index:1;opacity:.6}.dhx_time_block_reset{opacity:1}.dhx_scheduler_month .dhx_marked_timespan,.dhx_mini_calendar .dhx_marked_timespan{display:none}.dhx_timeline_table_wrapper .dhx_marked_timespan{z-index:1}.dhx_timeline_table_wrapper .dhx_time_block{z-index:2}.dhx_timeline_table_wrapper .dhx_cal_event_line{z-index:1}.dhx_timeline_table_wrapper .dhx_timeline_scrollable_data{overflow-x:auto}.dhx_now_time{width:100%;height:2px;background:var(--dhx-scheduler-today-marker-color);opacity:.5;box-shadow:0 1px 0 1px var(--dhx-scheduler-today-marker-color)}.dhx_matrix_now_time{background:var(--dhx-scheduler-today-marker-color);opacity:.5}.dhx_minical_icon{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent;cursor:pointer;font-size:24px}.dhx_minical_icon:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_minical_icon:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_minical_icon:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_minical_icon:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.dhx_minical_icon:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.dhx_minical_icon:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_minical_icon:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_minical_icon:before{content:""}.dhx_scale_ignore{display:none!important}.dhx_drag_placeholder{font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size)}.dhx_hidden{display:none!important}.common_input{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.common_input:focus,.common_input:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.common_input:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.one_line_input{height:var(--dhx-scheduler-control-height)}.dhx_cal_cover,.dhx_cal_cover *{box-sizing:border-box}.dhx_cal_cover{width:100%;height:100%;position:fixed;z-index:14;top:0;left:0;background-color:#0006;display:flex;justify-content:center;align-items:center;overflow:auto}.dhx_cal_light{margin-top:auto;margin-bottom:auto;width:max-content;max-width:var(--dhx-scheduler-lightbox-width);height:auto;-webkit-tap-highlight-color:transparent;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);position:absolute;z-index:15;font-family:var(--dhx-scheduler-lightbox_font-family);font-size:var(--dhx-scheduler-lightbox-font-size);font-weight:var(--dhx-scheduler-lightbox-font-weight);line-height:142%;border:var(--dhx-scheduler-lightbox-border);border-radius:var(--dhx-scheduler-popup-border-radius)}.dhx_cal_light.dhx_cal_light_wide{--dhx-scheduler-lightbox-width: var(--dhx-scheduler-lightbox-wide-max-width)}.dhx_cal_light textarea,.dhx_cal_light input,.dhx_cal_light select{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.dhx_cal_light textarea:focus,.dhx_cal_light input:focus,.dhx_cal_light select:focus,.dhx_cal_light textarea:focus-visible,.dhx_cal_light input:focus-visible,.dhx_cal_light select:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_cal_light textarea:disabled,.dhx_cal_light input:disabled,.dhx_cal_light select:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_light input,.dhx_cal_light select{height:var(--dhx-scheduler-control-height)}.dhx_cal_light input[type=select],.dhx_cal_light input[type=checkbox]{height:var(--dhx-scheduler-checkbox-height)}.dhx_cal_light .dhx_time{display:none}.dhx_cal_ltitle{font-size:var(--dhx-scheduler-lightbox-title-font-size);font-weight:var(--dhx-scheduler-heading-font-weight);line-height:142%;background:var(--dhx-scheduler-lightbox-title-background);color:var(--dhx-scheduler-lightbox-title-color);border-bottom:var(--dhx-scheduler-default-border);padding:calc(var(--dhx-scheduler-base-padding) * 3) calc(var(--dhx-scheduler-base-padding) * 3);overflow:hidden;white-space:nowrap;display:flex;flex-direction:row;justify-content:space-between;gap:calc(var(--dhx-scheduler-base-padding) * 2);border-top-right-radius:var(--dhx-scheduler-popup-border-radius);border-top-left-radius:var(--dhx-scheduler-popup-border-radius)}.dhx_cal_ltitle .dhx_mark{display:none}.dhx_cal_ltitle .dhx_cal_ltitle_descr{overflow:hidden;text-overflow:ellipsis}.dhx_cal_ltitle .dhx_cal_ltitle_controls{cursor:pointer}.dhx_cal_larea{border:none;padding:0 12px 4px;height:auto;gap:calc(var(--dhx-scheduler-base-padding) * 2)}.dhx_btn_inner.dhx_delete_btn{display:block!important}.dhx_btn_inner.dhx_delete_btn:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_btn_inner.dhx_delete_btn:before{content:"";font-size:18px}.dhx_cal_light_rtl{direction:rtl}.dhx_cal_light_wide.dhx_cal_light_rtl .dhx_custom_button{right:auto;left:calc(var(--dhx-scheduler-base-padding) * 2)}.dhx_lightbox_time_select{min-width:80px}.dhx_lightbox_day_select{min-width:60px}.dhx_lightbox_month_select{min-width:110px}.dhx_lightbox_year_select{min-width:77px}.dhx_cal_light_wide .dhx_cal_larea{display:flex;flex-direction:column;padding-top:12px;gap:12px}.dhx_cal_light_wide .dhx_wrap_section{display:flex;flex:0;position:relative}.dhx_cal_light_wide .dhx_cal_lsection{width:120px;justify-content:start;align-items:start;flex-shrink:0;margin-top:0;margin-bottom:0;padding:4px 8px}.dhx_cal_light_wide .dhx_custom_button{position:absolute;left:auto;right:calc(var(--dhx-scheduler-base-padding) * 2)}.dhx_cal_light_wide .dhx_cal_ltext{flex:1}.dhx_cal_light_wide .dhx_section_time{justify-content:start}.dhx_cal_light_wide .dhx_fullday{margin-left:unset}.dhx_cal_lcontrols{display:flex;flex-direction:row-reverse;gap:calc(var(--dhx-scheduler-base-padding)*2);padding:12px}.dhx_cal_lcontrols .dhx_btn_set{display:flex;flex-direction:row;gap:var(--dhx-scheduler-base-padding)}.dhx_cal_lcontrols .dhx_btn_set.dhx_delete_btn_set{padding:6px 0;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-error-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-error-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_cal_lcontrols .dhx_btn_set:not(.dhx_save_btn_set,.dhx_delete_btn_set){--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled)}.dhx_cal_lcontrols .dhx_btn_set .dhx_btn_inner{display:none}.dhx_cal_lcontrols .dhx_cal_lcontrols_push_right{margin-left:auto}.dhx_cal_ltext textarea{width:100%;height:100%;resize:none;font-family:var(--dhx-scheduler-lightbox_font-family);font-size:var(--dhx-scheduler-lightbox-font-size);font-weight:var(--dhx-scheduler-lightbox-font-weight);line-height:142%}.dhx_section_time_spacer,.dhx_lightbox_minical_spacer{visibility:hidden;flex-basis:100%;height:0}.dhx_section_time{--dhx-scheduler-lightbox-time-font-size: var(--dhx-scheduler-important-font-size);--dhx-scheduler-lightbox-time-font-weight: var(--dhx-scheduler-important-font-weight);font-size:var(--dhx-scheduler-lightbox-time-font-size);font-weight:var(--dhx-scheduler-lightbox-time-font-weight);line-height:142%;display:flex;flex-wrap:wrap;align-items:center;gap:calc(var(--dhx-scheduler-base-padding) * 2);row-gap:var(--dhx-scheduler-base-padding)}.dhx_section_time .dhx_section_time_icon{width:calc(var(--dhx-scheduler-base-module) * 2);height:calc(var(--dhx-scheduler-base-module) * 2);border-radius:2px;background:var(--dhx-scheduler-base-colors-primary)}.dhx_fullday{margin-left:auto}.dhx_cal_light_rtl .dhx_fullday{margin-left:unset;margin-right:auto}.dhx_cal_lsection label{font-weight:var(--dhx-scheduler-heading-font-weight);display:flex;align-items:center;gap:4px}.dhx_cal_lsection{display:flex;margin-top:12px;margin-bottom:4px}.dhx_cal_lsection .dhx_custom_button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color);--dhx-scheduler-btn-background: var(--dhx-scheduler-btn-outline-background);--dhx-scheduler-btn-color: var(--dhx-scheduler-btn-outline-color);--dhx-scheduler-btn-border-color: var(--dhx-scheduler-btn-outline-border-color);--dhx-scheduler-btn-background-hover: var(--dhx-scheduler-btn-outline-background-hover);--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-btn-outline-color-hover);--dhx-scheduler-btn-border-hover: var(--dhx-scheduler-btn-outline-border-hover);--dhx-scheduler-btn-background-active: var(--dhx-scheduler-btn-outline-background-active);--dhx-scheduler-btn-color-active: var(--dhx-scheduler-btn-outline-color-active);--dhx-scheduler-btn-border-active: var(--dhx-scheduler-btn-outline-border-active);--dhx-scheduler-btn-background-disabled: var(--dhx-scheduler-btn-outline-background-disabled);--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-btn-outline-color-disabled);--dhx-scheduler-btn-border-color-disabled: var(--dhx-scheduler-btn-outline-border-color-disabled);order:1;margin-left:auto;margin-right:unset}.dhx_cal_lsection .dhx_custom_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_lsection .dhx_custom_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_lsection .dhx_custom_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_cal_light_rtl .dhx_custom_button{margin-left:unset;margin-right:auto}.dhx_cal_checkbox{display:flex;gap:var(--dhx-scheduler-base-padding)}.dhx_cal_wide_checkbox{padding:4px 0}.dhx_cal_radio input{margin:var(--dhx-scheduler-base-padding)}.dhx_cal_radio_item{display:flex;gap:var(--dhx-scheduler-base-padding);align-items:center}.dhx_cal_radio{display:flex;gap:4px}.dhx_cal_radio_vertical{flex-direction:column;overflow:auto;--dhx-scheduler-control-height: 20px}.dhx_multi_select_control{display:flex;gap:4px}.dhx_multi_select_control_vertical{flex-direction:column}.dhx_multi_select_control label{display:flex;align-items:center;gap:4px}.dhx_cal_template{position:relative;padding-top:4px;padding-bottom:4px}.dhx_form_repeat{overflow:hidden;flex-grow:1}.dhx_form_repeat form{display:flex;flex-direction:column;gap:12px;padding:12px}.dhx_form_repeat input,.dhx_form_repeat select{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin:0 4px}.dhx_form_repeat input:focus,.dhx_form_repeat select:focus,.dhx_form_repeat input:focus-visible,.dhx_form_repeat select:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_form_repeat input:disabled,.dhx_form_repeat select:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_form_repeat label{display:inline-flex;align-items:center;vertical-align:top;gap:4px}.dhx_form_repeat #dhx_repeat_year,.dhx_form_repeat #dhx_repeat_month,.dhx_form_repeat #dhx_repeat_week,.dhx_form_repeat #dhx_repeat_day,.dhx_form_repeat .dhx_repeat_right{display:flex;flex-direction:column;gap:4px}.dhx_form_repeat #dhx_repeat_month>div,.dhx_form_repeat #dhx_repeat_week>div{display:flex;gap:8px}.dhx_repeat_left{display:flex;flex-wrap:wrap;gap:12px}.dhx_repeat_divider{background:var(--dhx-scheduler-base-colors-border);height:1px}.dhx_repeat_text{width:28px;border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.dhx_repeat_text:focus,.dhx_repeat_text:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_repeat_text:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_repeat_date,.dhx_form_repeat select{border-radius:2px;background-color:var(--dhx-scheduler-lightbox-background);color:var(--dhx-scheduler-lightbox-color);border:var(--dhx-scheduler-lightbox-control-border);font-size:var(--dhx-scheduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.dhx_repeat_date:focus,.dhx_form_repeat select:focus,.dhx_repeat_date:focus-visible,.dhx_form_repeat select:focus-visible{border-color:var(--dhx-scheduler-base-colors-primary);outline:none}.dhx_repeat_date:disabled,.dhx_form_repeat select:disabled{background-color:var(--dhx-scheduler-base-colors-disabled);color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_light .dhx_readonly{color:var(--dhx-scheduler-base-colors-readonly)}.dhx_lightbox_minical{display:flex;gap:8px;align-items:center}.dhx_lightbox_minical .dhx_lightbox_minical_spacer{display:flex;align-items:center;justify-content:center}.dhx_lightbox_minical .dhx_minical_input{max-width:165px}.dhx_lightbox_minical .dhx_lightbox_time_select{width:95px}.dhx_form_rrule,.dhx_form_rrule .dhx_form_repeat_custom,.dhx_form_rrule .dhx_form_repeat_ends,.dhx_form_rrule .dhx_form_repeat_ends_extra{display:flex;flex-direction:column;gap:8px}.dhx_form_rrule .dhx_form_repeat_ends_options{display:flex;gap:8px}.dhx_form_rrule label{display:inline-flex;align-items:center;vertical-align:top;gap:4px}.dhx_form_rrule input[type=number]{width:80px}.dhx_form_rrule .dhx_form_repeat_custom_week{display:flex;flex-wrap:wrap;gap:8px}.dhx_scale_text_styles{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%}.dhx_scale_bar{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%;display:flex;box-sizing:border-box;height:100%;justify-content:center;align-items:baseline;padding:var(--dhx-scheduler-base-padding);border-left:var(--dhx-scheduler-header-border);overflow:hidden}.dhx_scale_holder{border-right:var(--dhx-scheduler-default-border);background:var(--dhx-scheduler-timescale-background);box-sizing:border-box}.dhx_scale_holder_now{--dhx-scheduler-timescale-background: var(--dhx-scheduler-timescale-today-background);position:absolute}.dhx_cal_container_rtl .dhx_scale_bar{border-left:none;border-right:var(--dhx-scheduler-header-border)}.dhx_cal_container_rtl .dhx_scale_holder{border-right:none;border-left:var(--dhx-scheduler-default-border)}.dhx_scale_hour{font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);color:var(--dhx-scheduler-scale-color);line-height:133%;font-size:var(--dhx-scheduler-hours-font-size);font-weight:var(--dhx-scheduler-hours-font-weight);border-bottom:var(--dhx-scheduler-default-border);display:flex;flex-direction:column;align-items:center;justify-content:start;padding:var(--dhx-scheduler-base-padding);box-sizing:border-box}.dhx_scale_time_slot{box-sizing:border-box;border-bottom:var(--dhx-scheduler-default-border)}.dhx_scale_time_slot.dhx_scale_time_slot_hour_start{border-bottom:var(--dhx-scheduler-halfhour-border)}.dhx_drag_marker{width:100%;opacity:.5;background-color:var(--dhx-scheduler-base-colors-border);position:absolute;box-sizing:border-box;border-top:var(--dhx-scheduler-default-border);border-bottom:var(--dhx-scheduler-default-border)}.dhx_multi_day{position:relative;border-top:var(--dhx-scheduler-default-border)}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:50%;font-size:32px;border-bottom:var(--dhx-scheduler-default-border);border-right:var(--dhx-scheduler-default-border);background-repeat:no-repeat;display:flex;justify-content:center;align-items:center}.dhx_multi_day_icon:before,.dhx_multi_day_icon_small:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_multi_day_icon:before,.dhx_multi_day_icon_small:before{content:""}.dhx_multi_day_icon_small{font-size:16px}.dhx_cal_container_rtl .dhx_multi_day_icon,.dhx_cal_container_rtl .dhx_multi_day_icon_small{border-right:none;border-left:var(--dhx-scheduler-default-border)}.dhx_scheduler_event_base{background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);display:flex;padding:2px var(--dhx-scheduler-base-module);border:var(--dhx-scheduler-event-border);position:absolute;box-sizing:border-box;font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);font-weight:var(--dhx-scheduler-event-text-font-weight);--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-color)}.dhx_title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dhx_cal_event{border-radius:var(--dhx-scheduler-border-radius);flex-direction:column;background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);display:flex;padding:2px var(--dhx-scheduler-base-module);border:var(--dhx-scheduler-event-border);position:absolute;box-sizing:border-box;font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);font-weight:var(--dhx-scheduler-event-text-font-weight);--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-color)}.dhx_cal_event .dhx_title{font-size:var(--dhx-scheduler-event-title-font-size);line-height:var(--dhx-scheduler-event-title-line-height);max-height:21px}.dhx_cal_event .dhx_body{font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);flex:1;gap:4px;overflow:hidden;text-overflow:ellipsis}.dhx_cal_event .dhx_event_move.dhx_header{display:none}.dhx_cal_event .dhx_event_resize{cursor:ns-resize}.dhx_cal_event .dhx_resize_denied{display:none!important}.dhx_cal_event .dhx_footer{position:absolute;bottom:2px;opacity:0}.dhx_cal_event .dhx_menu_icon{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-text)}.dhx_cal_event .dhx_menu_icon.icon_delete{margin-left:-2px}.dhx_cal_event.dhx_cal_select_menu{padding:8px 2px;box-shadow:var(--dhx-scheduler-box-shadow-s);--dhx-scheduler-event-background: var(--dhx-scheduler-event-menu-background);--dhx-scheduler-event-color: var(--dhx-scheduler-event-menu-color)}.dhx_cal_event.dhx_cal_select_menu .dhx_body{display:flex;flex-direction:column;gap:4px;align-items:center}.dhx_cal_event textarea.dhx_cal_editor{width:100%;height:100%;padding:0;margin:0;overflow:auto;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size)}.dhx_cal_event_cascade{--dhx-scheduler-event-border: 1px solid rgba(0, 0, 0, .05)}.dhx_cal_editor{z-index:10}.dhx_cal_event .dhx_footer,.dhx_cal_event .dhx_select_menu_footer{height:calc(var(--dhx-scheduler-base-module) * 2);border-width:0;position:relative;margin-left:auto;margin-right:auto}.dhx_cal_event .dhx_footer:before,.dhx_cal_event .dhx_select_menu_footer:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_event .dhx_footer:before,.dhx_cal_event .dhx_select_menu_footer:before{content:""}.dhx_cal_event.dhx_cal_event_drag .dhx_event_resize.dhx_footer,.dhx_cal_event.dhx_cal_event_selected .dhx_event_resize.dhx_footer,.dhx_cal_event:hover .dhx_event_resize.dhx_footer{opacity:1;background-color:transparent}.dhx_cal_event_line{background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);display:flex;padding:2px var(--dhx-scheduler-base-module);border:var(--dhx-scheduler-event-border);position:absolute;box-sizing:border-box;font-size:var(--dhx-scheduler-event-text-font-size);line-height:var(--dhx-scheduler-event-text-line-height);font-weight:var(--dhx-scheduler-event-text-font-weight);--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-event-color);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-event-bar-font-size);--dhx-scheduler-event-text-line-height: var(--dhx-scheduler-event-bar-line-height);cursor:pointer;align-items:center;z-index:1;overflow:hidden;padding-left:12px;white-space:nowrap}.dhx_cal_event_line.dhx_cal_event_line_end{border-top-right-radius:var(--dhx-scheduler-border-radius);border-bottom-right-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_event_line.dhx_cal_event_line_start{border-top-left-radius:var(--dhx-scheduler-border-radius);border-bottom-left-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_event_line.dhx_cal_event--small{padding-left:8px}.dhx_cal_event_line.dhx_cal_event--xsmall{padding-left:4px}.dhx_cal_container_rtl .dhx_cal_event_line{border-top-right-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:unset;border-bottom-left-radius:unset}.dhx_cal_container_rtl .dhx_cal_event_line.dhx_cal_event_line_end{border-top-left-radius:var(--dhx-scheduler-border-radius);border-bottom-left-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_container_rtl .dhx_cal_event_line.dhx_cal_event_line_start{border-top-right-radius:var(--dhx-scheduler-border-radius);border-bottom-right-radius:var(--dhx-scheduler-border-radius)}.dhx_cal_event.dhx_cal_event--xsmall,.dhx_cal_event.dhx_cal_event--small{flex-direction:row-reverse;justify-content:space-between;--dhx-scheduler-event-title-font-size: var(--dhx-scheduler-event-bar-font-size);--dhx-scheduler-event-title-line-height: var(--dhx-scheduler-event-bar-line-height);--dhx-scheduler-event-text-font-size: var(--dhx-scheduler-event-bar-font-size);--dhx-scheduler-event-text-line-height: var(--dhx-scheduler-event-bar-line-height);gap:4px;padding-top:2px;padding-bottom:1px}.dhx_cal_event.dhx_cal_event--xsmall .dhx_title,.dhx_cal_event.dhx_cal_event--small .dhx_title{display:flex;justify-content:end}.dhx_cal_event.dhx_cal_event--xsmall .dhx_body,.dhx_cal_event.dhx_cal_event--small .dhx_body{flex-grow:2}.dhx_cal_event.dhx_cal_event--xsmall .dhx_footer,.dhx_cal_event.dhx_cal_event--small .dhx_footer,.dhx_cal_event.dhx_cal_event--xsmall .dhx_select_menu_footer,.dhx_cal_event.dhx_cal_event--small .dhx_select_menu_footer{position:absolute;bottom:0;left:4px;width:100%;transform:translateY(50%)}.dhx_cal_month_table{overflow:hidden}.dhx_cal_month_row{display:flex}.dhx_cal_month_cell{box-sizing:border-box;background:var(--dhx-scheduler-timescale-background);border-right:var(--dhx-scheduler-default-border);border-bottom:var(--dhx-scheduler-default-border);display:flex;flex-direction:column}.dhx_cal_month_cell.dhx_now{--dhx-scheduler-timescale-background: var(--dhx-scheduler-timescale-today-background)}.dhx_month_body_border,.dhx_month_head_border{border-left:var(--dhx-scheduler-default-border)}.dhx_cal_container_rtl .dhx_cal_month_cell{border-left:var(--dhx-scheduler-default-border);border-right:none}.dhx_cal_container_rtl .dhx_month_body_border,.dhx_cal_container_rtl .dhx_month_head_border{border-left:none;border-right:var(--dhx-scheduler-default-border)}.dhx_month_head{box-sizing:border-box;display:flex;flex-shrink:0;color:var(--dhx-scheduler-month-header-color);justify-content:end;align-items:flex-start;align-self:stretch;padding:var(--dhx-scheduler-month-day-header-padding)}.dhx_month_body{flex-grow:1;padding:var(--dhx-scheduler-base-padding) calc(var(--dhx-scheduler-base-padding) * 2);box-sizing:border-box;position:relative}.dhx_before,.dhx_after{--dhx-scheduler-month-header-color: var(--dhx-scheduler-inactive-month-color)}.dhx_month_link{position:absolute;text-align:right;cursor:pointer;padding-right:10px}.dhx_month_link a:hover{text-decoration:underline}.dhx_global_tip{font-family:var(--dhx-scheduler-font-family);line-height:110%;background-color:var(--dhx-scheduler-container-background);color:var(--dhx-scheduler-container-color);text-align:center;font-size:20px;position:fixed;top:60px;right:20px;z-index:14;padding:20px 30px;width:190px;background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);border:var(--dhx-scheduler-popup-border);box-shadow:var(--dhx-scheduler-box-shadow-m)}@media (-moz-touch-enabled){.dhx_cal_container{-webkit-user-select:none;user-select:none;-moz-user-select:none}}.dhx_cal_event_clear{box-sizing:border-box;padding:var(--dhx-scheduler-base-padding) calc(var(--dhx-scheduler-base-padding) * 2);font-size:var(--dhx-scheduler-caption-font-size);font-weight:var(--dhx-scheduler-caption-font-weight);display:flex;justify-content:start;align-items:center;gap:var(--dhx-scheduler-base-padding);cursor:pointer;flex-wrap:nowrap;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dhx_cal_event_clear_date{font-weight:700}.dhx_cal_event_line_content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dhx_cal_event_marker{display:block;flex-shrink:0;border-radius:var(--dhx-scheduler-month-event-marker-size);width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);background:var(--dhx-scheduler-event-background);margin-top:-1px}.dhx_cal_event_clear:before{content:"";display:block;flex-shrink:0;border-radius:var(--dhx-scheduler-month-event-marker-size);width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);background:var(--dhx-scheduler-event-background);margin-top:-1px}.dhx_cal_event_line .dhx_event_resize{cursor:ew-resize;position:absolute;top:0;height:100%;display:none;justify-content:center;align-items:center}.dhx_cal_event_line .dhx_event_resize:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_event_line .dhx_event_resize:before{content:""}.dhx_cal_event_line:hover .dhx_event_resize{display:flex}.dhx_event_resize_end{right:0}.dhx_event_resize_start{left:0}.dhx_cal_container_rtl .dhx_event_resize_start{left:auto;left:unset;right:0}.dhx_cal_container_rtl .dhx_event_resize_end{right:auto;right:unset;left:0}.dhx_cal_quick_info{--dhx-scheduler-quick-info-font-size: var(--dhx-regular-font-size);position:absolute;z-index:8;font-size:var(--dhx-scheduler-quick-info-font-size);background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);border:var(--dhx-scheduler-popup-border);padding:calc(var(--dhx-scheduler-base-padding)*2) calc(var(--dhx-scheduler-base-padding)*3);border-radius:var(--dhx-scheduler-border-radius);width:300px;display:flex;flex-direction:column;box-shadow:var(--dhx-scheduler-box-shadow-s);transition:left .5s ease,right .5s ease}.dhx_cal_qi_tcontrols{display:flex;justify-content:end;height:8px}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn{min-width:32px;height:32px;border-radius:50%;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent;width:unset;min-width:unset;padding:2px;font-size:18px;cursor:pointer;height:20px;position:relative;z-index:1}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn:hover{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-hover)}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn:active{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-base-colors-icons-active)}.dhx_cal_qi_tcontrols .dhx_cal_qi_close_btn:disabled{--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color-disabled)}.dhx_cal_qi_title,.dhx_cal_qi_controls,.dhx_cal_qi_content{padding:0 calc(var(--dhx-scheduler-base-padding) * 3)}.dhx_cal_qi_title{display:flex;flex-direction:column;gap:12px;padding-right:14px}.dhx_cal_qi_tcontent{font-size:var(--dhx-scheduler-heading-font-size);font-weight:var(--dhx-scheduler-heading-font-weight);line-height:150%;position:relative;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;overflow:hidden;flex-grow:0;text-overflow:ellipsis;white-space:nowrap}.dhx_cal_qi_tcontent>span{text-overflow:ellipsis;overflow:hidden}.dhx_cal_qi_tcontent:before{display:var(--dhx-scheduler-quick-info-dot-display, block);content:"";flex-shrink:0;width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);border-radius:2px;background:var(--dhx-scheduler-base-colors-primary)}.dhx_cal_qi_tdate{font-size:var(--dhx-scheduler-important-font-size);font-weight:var(--dhx-scheduler-important-font-weight);line-height:var(--dhx-scheduler-important-line-height)}.dhx_cal_qi_content{padding-top:16px;padding-bottom:8px}.dhx_cal_qi_controls{display:flex;flex-direction:row;justify-content:start;align-items:center;padding-top:8px;gap:12px;color:var(--dhx-scheduler-base-colors-primary)}.dhx_cal_qi_controls>div:first-child{margin-left:-3px}.dhx_menu_icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;--dhx-scheduler-base-colors-icons: var(--dhx-scheduler-btn-color)}.dhx_scheduler_year .dhx_cal_header{display:none}.dhx_scheduler_year .dhx_cal_data{padding:40px}.dhx_year_wrapper{display:flex;gap:40px;padding:12px;justify-content:center;align-items:baseline;flex-wrap:wrap}.dhx_year_box{--dhx-scheduler-month-day-header-padding: 8px 12px}.dhx_year_box .dhx_scale_bar{position:relative;width:var(--dhx-scheduler-datepicker-cell-size)}.dhx_year_box .dhx_month_head{position:relative}.dhx_year_box .dhx_month_head.dhx_year_event:after{content:"";width:4px;height:4px;border-radius:50%;position:absolute;bottom:2px;left:50%;transform:translate(-50%);background:var(--dhx-scheduler-event-marker-color)}.dhx_year_box .dhx_month_body{display:none}.dhx_year_month{text-align:center;padding:12px 0}.dhx_year_week{display:flex}.dhx_year_tooltip{position:absolute;padding:12px;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-event-title-font-size);background:var(--dhx-scheduler-popup-background);border-radius:var(--dhx-scheduler-popup-border-radius);border:var(--dhx-scheduler-popup-border);color:var(--dhx-scheduler-popup-color);box-shadow:var(--dhx-scheduler-box-shadow-m);display:flex;flex-direction:column;width:300px;gap:4px}.dhx_tooltip_line{border-radius:var(--dhx-scheduler-border-radius);background:var(--dhx-scheduler-event-background);color:var(--dhx-scheduler-event-color);padding:4px;display:flex;cursor:pointer}.dhx_tooltip_rtl{direction:rtl}.dhx_timeline_scale_header{position:absolute;overflow:hidden;background-color:var(--dhx-scheduler-container-background);display:flex;justify-content:center;align-items:center;border-right:var(--dhx-scheduler-header-border);border-top:var(--dhx-scheduler-header-border)}.dhx_cal_container_rtl .dhx_timeline_scale_header{border-right:unset;border-left:var(--dhx-scheduler-header-border)}.dhx_timeline_label_wrapper{z-index:1}.dhx_timeline_label_col{position:relative}.dhx_timeline_label_row{position:absolute;left:0}.dhx_matrix_scell{overflow:hidden;text-align:center;border-bottom:var(--dhx-scheduler-default-border);border-right:var(--dhx-scheduler-default-border);color:var(--dhx-scheduler-scale-color)}.dhx_timeline_data_wrapper{position:absolute;z-index:0;left:0;top:0;width:100%}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:var(--dhx-scheduler-default-border);border-right:var(--dhx-scheduler-default-border);font-weight:500}.dhx_cal_container_rtl .dhx_matrix_cell,.dhx_cal_container_rtl .dhx_matrix_scell{border-right:none;border-left:var(--dhx-scheduler-default-border)}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto}.dhx_timeline_data_cell{position:absolute;top:0;height:100%}.dhx_timeline_label_wrapper{position:absolute;overflow:hidden;background:var(--dhx-scheduler-container-background)}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:var(--dhx-scheduler-timeline-folder-background);cursor:pointer}.dhx_matrix_scell .dhx_scell_level0{padding-left:4px}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px}.dhx_matrix_scell .dhx_scell_level2{padding-left:32px}.dhx_matrix_scell .dhx_scell_level3{padding-left:48px}.dhx_matrix_scell .dhx_scell_level4{padding-left:64px}.dhx_matrix_scell.folder{border-right-color:transparent;font-weight:700;text-align:left}.dhx_cal_container_rtl .dhx_matrix_scell.folder{border-right:var(--dhx-scheduler-default-border);border-left-color:transparent}.dhx_matrix_line{overflow:hidden}.dhx_matrix_scell.folder .dhx_scell_expand:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_matrix_scell.folder .dhx_scell_expand:before{content:"";font-size:24px}.dhx_matrix_scell.folder.closed .dhx_scell_expand{transform:rotate(-90deg)}.dhx_matrix_scell.folder,.dhx_timeline_label_row.dhx_row_folder{overflow:visible}.dhx_matrix_scell.folder>div{display:flex;align-items:center;height:inherit}.dhx_matrix_scell.folder .dhx_scell_expand{position:relative;flex-shrink:0}.dhx_matrix_scell.folder .dhx_scell_name{width:auto;color:var(--dhx-scheduler-timeline-folder-color);text-transform:uppercase;font-weight:500;max-height:100%}.dhx_matrix_scell.item .dhx_scell_name{padding-left:16px;text-align:left}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level0{padding-left:0;padding-right:4px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level1{padding-left:0;padding-right:20px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level2{padding-left:0;padding-right:32px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level3{padding-left:0;padding-right:48px}.dhx_cal_container_rtl .dhx_matrix_scell .dhx_scell_level4{padding-left:0;padding-right:63px}.dhx_cal_container_rtl .dhx_matrix_scell.folder .dhx_scell_expand{padding-right:0;padding-left:4px}.dhx_cal_container_rtl .dhx_matrix_scell.item .dhx_scell_name{padding-left:0;padding-right:12px;text-align:right}.dhx_matrix_scell.dhx_matrix_scell_columns,.dhx_timeline_scale_header{display:flex;justify-content:center;align-items:center}.dhx_matrix_scell_columns.dhx_treetimeline .dhx_scell_name{display:flex}.dhx_matrix_scell_columns.dhx_treetimeline .dhx_scell_level{flex-shrink:0}.dhx_matrix_scell_columns.dhx_treetimeline .dhx_timeline_label_column_first{flex-shrink:1;border-left-color:transparent}.dhx_second_scale_bar{border-bottom:var(--dhx-scheduler-header-border)}div.dhx_timeline_label_column,div.dhx_timeline_label_column_header{display:flex;justify-content:center;align-items:center;box-sizing:border-box;flex-grow:0;flex-shrink:0;height:100%;white-space:nowrap}div.dhx_timeline_label_column .dhx_timeline_label_content_wrapper,div.dhx_timeline_label_column_header .dhx_timeline_label_content_wrapper{display:inline-block;text-align:left}.dhx_timeline_label_column{border-left:var(--dhx-scheduler-header-border)}.dhx_timeline_label_column_header{border-left-color:transparent}.dhx_timeline_label_column:first-child{border-left:0}.dhx_cal_container_rtl .dhx_timeline_label_column{border-left:none;border-right:var(--dhx-scheduler-header-border)}.dhx_cal_container_rtl .dhx_timeline_label_column_header{border-right-color:transparent}.dhx_cal_container_rtl .dhx_timeline_label_column:first-child{border-right:0}.dhx_scheduler_map .dhx_cal_header,.dhx_scheduler_agenda .dhx_cal_header{height:auto}.dhx_agenda_line_header{clear:both;overflow:hidden}.dhx_agenda_line,.dhx_map_line{height:var(--dhx-scheduler-list-line-height);line-height:var(--dhx-scheduler-list-line-height);overflow:hidden;display:flex}.dhx_agenda_line .dhx_agenda_event_time,.dhx_map_line .dhx_agenda_event_time,.dhx_agenda_line .dhx_map_event_time,.dhx_map_line .dhx_map_event_time{flex-shrink:0;width:188px;text-align:center;border-right:var(--dhx-scheduler-default-border)}.dhx_agenda_line .dhx_event_icon,.dhx_map_line .dhx_event_icon{height:33px;width:33px;display:flex;align-items:center;justify-content:center}.dhx_agenda_line .dhx_event_icon path,.dhx_map_line .dhx_event_icon path{fill:var(--dhx-scheduler-base-colors-primary)}.dhx_agenda_line>div:first-child,.dhx_map_line>div:first-child{width:var(--dhx-scheduler-agenda-date-column-width);text-align:center}.dhx_agenda_line:nth-child(2n),.dhx_map_line:nth-child(2n){background:var(--dhx-scheduler-base-colors-select)}.dhx_map_area{height:100%}.dhx_map_head{display:flex;height:100%}.dhx_map_head>div{display:flex;justify-content:center;align-items:center;padding:0 var(--dhx-scheduler-base-padding)}.dhx_v_border{position:absolute;height:100%;border-left:var(--dhx-scheduler-default-border);top:0}.dhx_week_agenda_wrapper{width:100%;height:100%;display:flex}.dhx_wa_column{flex:1;display:flex;flex-direction:column;border-right:var(--dhx-scheduler-default-border)}.dhx_wa_day_cont{flex-grow:0;flex-shrink:0;flex-basis:calc(100% / 3);display:flex;flex-direction:column;overflow-y:auto}.dhx_wa_column:last-child .dhx_wa_day_cont:nth-last-child(1),.dhx_wa_column:last-child .dhx_wa_day_cont:nth-last-child(2){flex-shrink:1}.dhx_wa_scale_bar{--dhx-scheduler-week-agenda-scale-height: 35px;--dhx-scheduler-week-agenda-scale-font-size: var(--dhx-scheduler-important-font-size);--dhx-scheduler-week-agenda-scale-font-weight: var(--dhx-scheduler-heading-font-weight);font-size:var(--dhx-scheduler-week-agenda-scale-font-size);font-weight:var(--dhx-scheduler-week-agenda-scale-font-weight);height:var(--dhx-scheduler-week-agenda-scale-height);line-height:var(--dhx-scheduler-week-agenda-scale-height);flex:0;background:var(--dhx-scheduler-base-colors-select);border-top:var(--dhx-scheduler-default-border);border-bottom:var(--dhx-scheduler-default-border);padding:4px;display:flex;align-items:center}.dhx_wa_day_data{flex:1;overflow:auto}.dhx_wa_ev_body{border-bottom:var(--dhx-scheduler-default-border);padding:4px}.dhx_wa_ev_body_rtl{direction:rtl}.dhx_wa_dnd{font-family:var(--dhx-scheduler-font-family);position:absolute;color:#000a;background-color:#faea27;border:1px solid #00000033;min-width:300px}.dhx_wa_ev_body.dhx_cal_event_selected{background-color:var(--dhx-scheduler-base-colors-select)}.dhx_grid_event{height:var(--dhx-scheduler-list-line-height);line-height:var(--dhx-scheduler-list-line-height);background:var(--dhx-scheduler-grid-event-background);color:var(--dhx-scheduler-grid-event-text)}.dhx_grid_event:nth-child(2n){--dhx-scheduler-grid-event-background: var(--dhx-scheduler-base-colors-select)}.dhx_grid_event.dhx_grid_event_selected{--dhx-scheduler-grid-event-background: var(--dhx-scheduler-base-colors-icons)}.dhx_grid_area td,.dhx_grid_line>div{padding-left:8px;padding-right:8px}.dhx_grid_line>div{text-align:center}.dhx_grid_area>table{border-collapse:collapse;width:100%;table-layout:fixed}.dhx_grid_area td{table-layout:fixed;text-align:center;height:var(--dhx-scheduler-list-line-height);line-height:var(--dhx-scheduler-list-line-height)}.dhx_cal_header>.dhx_grid_line{display:flex}.dhx_grid_v_border{position:absolute;border-right:var(--dhx-scheduler-default-border);width:1px;height:100%}.dhx_grid_view_sort{position:absolute;top:5px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:10px solid var(--dhx-scheduler-base-colors-text-light)}.dhx_grid_sort_asc .dhx_grid_view_sort{border-top:none;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:10px solid var(--dhx-scheduler-base-colors-text-light)}.dhx_scheduler_agenda .dhx_cal_header{display:none}.dhx_cal_agenda_day{--dhx-scheduler-agenda-date-width: 110px;--dhx-scheduler-agenda-event-date-width: 120px;display:flex;flex-direction:row;flex-wrap:nowrap;border-bottom:var(--dhx-scheduler-default-border)}.dhx_cal_agenda_day_header{padding:8px 12px;display:flex;flex-direction:column;gap:8px;flex-grow:0;flex-shrink:0;width:var(--dhx-scheduler-agenda-date-width);border-right:var(--dhx-scheduler-default-border)}.dhx_cal_agenda_day_events{padding:8px 12px;flex:1}.dhx_agenda_day_date{font-weight:500}.dhx_cal_agenda_event_line{display:flex;align-items:center;justify-content:start;gap:16px;padding:calc(var(--dhx-scheduler-base-padding)*2)}.dhx_cal_agenda_event_line_selected{background-color:var(--dhx-scheduler-base-colors-select)}.dhx_cal_agenda_event_line_marker{display:block;flex-shrink:0;border-radius:var(--dhx-scheduler-month-event-marker-size);width:var(--dhx-scheduler-month-event-marker-size);height:var(--dhx-scheduler-month-event-marker-size);background:var(--dhx-scheduler-event-background);margin-top:-1px}.dhx_cal_agenda_event_line_time{font-weight:500;min-width:var(--dhx-scheduler-agenda-event-date-width);text-align:center}.dhx_cal_agenda_no_events{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.dhx_cal_datepicker{font-size:var(--dhx-scheduler-datepicker-font-size);font-family:var(--dhx-scheduler-datepicker-family);line-height:142%;font-weight:400;border:var(--dhx-scheduler-popup-border);background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);box-shadow:var(--dhx-scheduler-box-shadow-s);border-radius:var(--dhx-scheduler-popup-border-radius);padding:16px}.dhx_cal_datepicker,.dhx_cal_datepicker *,.dhx_mini_calendar,.dhx_mini_calendar *{box-sizing:border-box}.dhx_cal_datepicker_arrow{border:none;background:none;cursor:pointer}.dhx_cal_datepicker_arrow:focus{outline:none}.dhx_cal_datepicker_data,.dhx_year_grid{display:flex;flex-direction:column;justify-content:space-between;height:100%;padding:var(--dhx-scheduler-datepicker-padding);gap:8px;color:var(--dhx-scheduler-month-header-color)}.dhx_cal_datepicker_done{display:flex;justify-content:center;align-items:center}.dhx_cal_datepicker_header{color:var(--dhx-scheduler-base-colors-primary);display:flex;justify-content:space-between;align-items:center;padding:var(--dhx-scheduler-datepicker-padding)}.dhx_cal_datepicker_title{font-weight:var(--dhx-scheduler-datepicker-header-font-size);font-size:var(--dhx-scheduler-datepicker-header-font-size);background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_cal_datepicker_title:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_datepicker_title:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_datepicker_title:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_cal_datepicker_days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.dhx_cal_datepicker_dayname,.dhx_cal_datepicker_date{display:flex;align-items:center;justify-content:center;position:relative;transition:all .3s;margin-left:auto;margin-right:auto}.dhx_cal_datepicker_dayname{color:var(--dhx-scheduler-base-colors-icons)}.dhx_cal_datepicker_date{border-radius:50%;width:var(--dhx-scheduler-datepicker-cell-size);height:var(--dhx-scheduler-datepicker-cell-size);color:var(--dhx-scheduler-datepicker-cell-color);background:var(--dhx-scheduler-datepicker-cell-background)}.dhx_cal_datepicker_date.dhx_now{--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-timescale-today-background)}.dhx_cal_datepicker_weekend{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-weekend-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-weekend-background)}.dhx_cal_datepicker_date.dhx_before,.dhx_cal_datepicker_date.dhx_after{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-prevnext-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-prevnext-background)}.dhx_cal_datepicker_current{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-today-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-today-background)}.dhx_cal_datepicker_date:not(.dhx_before,.dhx_after):hover,.dhx_cal_datepicker_month:hover,.dhx_cal_datepicker_year:hover{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-datepicker-hover-color);--dhx-scheduler-datepicker-cell-background: var(--dhx-scheduler-datepicker-hover-background)}.dhx_cal_datepicker_months,.dhx_cal_datepicker_years{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.dhx_cal_datepicker_months{column-gap:12px}.dhx_cal_datepicker_years{column-gap:4px}.dhx_cal_datepicker_month,.dhx_cal_datepicker_year{display:flex;align-items:center;justify-content:center;height:var(--dhx-scheduler-datepicker-cell-size);border-radius:10px;padding:4px 8px;transition:background .3s;position:relative;color:var(--dhx-scheduler-datepicker-cell-color);background:var(--dhx-scheduler-datepicker-cell-background)}.dhx_cal_datepicker_done_btn{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.dhx_cal_datepicker_done_btn:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.dhx_cal_datepicker_done_btn:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.dhx_cal_datepicker_done_btn:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_datepicker_date_wrapper{position:relative}.dhx_datepicker_date_wrapper:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_datepicker_date_wrapper:before{content:""}.dhx_datepicker_date_wrapper:before{position:absolute;right:4px;top:8px;font-size:20px}.dhx_cal_datepicker_event.dhx_cal_datepicker_current,.dhx_cal_datepicker_event:hover{--dhx-scheduler-event-marker-color: var(--dhx-scheduler-datepicker-hover-color)}.dhx_cal_datepicker_event:after{content:"";width:4px;height:4px;border-radius:50%;position:absolute;bottom:2px;left:50%;transform:translate(-50%);background:var(--dhx-scheduler-event-marker-color)}.dhx_minical_popup{position:absolute;z-index:15}.dhx_mini_calendar{font-size:var(--dhx-scheduler-datepicker-font-size);font-family:var(--dhx-scheduler-datepicker-family);line-height:142%;font-weight:400;border:var(--dhx-scheduler-popup-border);background:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);box-shadow:var(--dhx-scheduler-box-shadow-m);border-radius:var(--dhx-scheduler-popup-border-radius);--dhx-scheduler-datepicker-font-size: var(--dhx-scheduler-caption-font-size);--dhx-scheduler-header-border: none}.dhx_mini_calendar .dhx_cal_month_row{height:35px!important}.dhx_mini_calendar .dhx_year_week{border-bottom:var(--dhx-scheduler-default-border)}.dhx_mini_calendar .dhx_scale_bar{position:static}.dhx_mini_calendar .dhx_year_month{font-weight:500;font-size:var(--dhx-scheduler-font-size)}.dhx_mini_calendar .dhx_month_body{display:none}.dhx_mini_calendar .dhx_cal_month_cell{display:flex;justify-content:center;align-items:center;border-radius:50%;border:none;background:var(--dhx-scheduler-popup-background)}.dhx_mini_calendar .dhx_month_head{border-radius:50%;color:var(--dhx-scheduler-datepicker-cell-color);background:var(--dhx-scheduler-datepicker-cell-background);width:30px!important;height:30px!important;padding:4px;justify-content:center;align-items:center;cursor:pointer}.dhx_mini_calendar div.dhx_month_head.dhx_year_event{background-color:#0288d133;color:#0288d1;font-weight:500}.dhx_mini_calendar div.dhx_month_head.dhx_calendar_click{background-color:#e5e5e5;color:#000000bf;font-weight:500}.dhx_mini_calendar .dhx_now .dhx_month_head{background-color:#f7f7f7}.dhx_mini_calendar .dhx_after .dhx_month_head,.dhx_mini_calendar .dhx_before .dhx_month_head{--dhx-scheduler-datepicker-cell-color: var(--dhx-scheduler-inactive-month-color)}.dhx_minical_input_wrapper{position:relative}.dhx_minical_input_wrapper:before{font-family:dhx-scheduler-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-scheduler-base-colors-icons)}.dhx_minical_input_wrapper:before{content:""}.dhx_minical_input_wrapper:before{pointer-events:none;position:absolute;right:5px;top:7px;font-size:20px}.scheduler_message_area{position:fixed;right:5px;width:250px;z-index:11}.scheduler-info{min-width:120px;padding:12px;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-regular-font-size);font-weight:var(--dhx-scheduler-regular-font-weight);line-height:var(--dhx-scheduler-regular-line-height);z-index:14;overflow:hidden;margin:5px 5px 10px;transition:all .5s ease;background:var(--dhx-scheduler-info-background);color:var(--dhx-scheduler-info-color);border:var(--dhx-scheduler-info-border);box-shadow:var(--dhx-scheduler-info-shadow)}.scheduler-info.hidden{height:0px;padding:0;border-width:0px;margin:0;overflow:hidden}.scheduler_modal_box{overflow:hidden;position:fixed;min-width:300px;width:var(--dhx-scheduler-modal-width);background:var(--dhx-scheduler-modal-background);box-shadow:var(--dhx-scheduler-box-shadow-l);border:var(--dhx-scheduler-modal-border);z-index:18;border-radius:var(--dhx-scheduler-modal-border-radius);font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-font-size);line-height:150%}.scheduler_popup_text{color:var(--dhx-scheduler-base-colors-text-base)}.scheduler_popup_title{border-top-left-radius:var(--dhx-scheduler-modal-border-radius);border-top-right-radius:var(--dhx-scheduler-modal-border-radius);text-transform:uppercase;font-weight:var(--dhx-scheduler-heading-font-weight);padding:calc(var(--dhx-scheduler-modal-padding)/2) var(--dhx-scheduler-modal-padding);display:flex;justify-content:center;align-items:center}.scheduler_popup_text{padding:var(--dhx-scheduler-modal-padding);display:flex;justify-content:center;align-items:center}.scheduler_popup_controls{display:flex;flex-direction:row-reverse;padding:calc(var(--dhx-scheduler-modal-padding)/2) var(--dhx-scheduler-modal-padding);align-items:center;gap:12px}.scheduler-info,.scheduler_popup_button,.scheduler_button{-webkit-user-select:none;user-select:none;cursor:pointer}.scheduler_popup_text{overflow:hidden}div.dhx_modal_cover{background:#44494E;opacity:.2;position:fixed;z-index:17;left:0;top:0;width:100%;height:100%;border:none}.scheduler_popup_controls{border-radius:var(--dhx-scheduler-border-radius)}.scheduler_message_area .scheduler-error{--dhx-scheduler-info-background: var(--dhx-scheduler-base-colors-error);--dhx-scheduler-info-color: var(--dhx-scheduler-base-colors-white)}.scheduler_message_area .scheduler-warning{--dhx-scheduler-info-background: var(--dhx-scheduler-base-colors-warning)}.scheduler_modal_box.scheduler-error .scheduler_popup_title{background:#d81b1b;border:1px solid #ff3c3c;color:#fff}.scheduler_modal_box.scheduler-error .scheduler_popup_title{background:#FFAB00;border:1px solid #FFAB00}.dhtmlXTooltip.tooltip{box-shadow:var(--dhx-scheduler-box-shadow-m);background-color:var(--dhx-scheduler-popup-background);color:var(--dhx-scheduler-popup-color);border:var(--dhx-scheduler-popup-border);cursor:default;padding:12px;position:fixed;z-index:9;opacity:1;font-family:var(--dhx-scheduler-font-family);font-size:var(--dhx-scheduler-regular-font-size);line-height:var(--dhx-scheduler-regular-line-height);font-weight:var(--dhx-scheduler-regular-font-weight)}.dhtmlXTooltip_rtl{direction:rtl}.dhx_focus_slot{background:var(--dhx-scheduler-base-colors-select);position:absolute;pointer-events:none;opacity:.5}.dhx_cal_container *:focus{outline-style:solid;outline-style:auto;outline-color:var(--dhx-scheduler-base-colors-select)}.dhx_no_select{-webkit-user-select:none;user-select:none}.dhx_drag_placeholder{z-index:10;opacity:.8}.dhx_drag_placeholder .dhx_cal_select_menu{display:none}.dhx_cal_light_readonly .dhx_section_time{display:block}.dhx_cal_light_readonly .dhx_section_time .dhx_section_time_spacer{visibility:visible}.dhx_cal_light_readonly .dhx_cal_lsection+div{padding-top:4px;padding-bottom:4px}.scheduler-info.scheduler-popup_after_delete{cursor:default;border-radius:var(--dhx-scheduler-border-radius);padding:0;width:225px;--dhx-scheduler-info-background: var(--dhx-scheduler-undo-delete-background);--dhx-scheduler-info-color: var(--dhx-scheduler-undo-delete-color)}.dhx_info_message{display:flex;justify-content:space-between;align-items:center;padding:8px 12px}.undo_popup_text{text-align:center}.undo_button{background:var(--dhx-scheduler-btn-background);color:var(--dhx-scheduler-btn-color);border:1px solid var(--dhx-scheduler-btn-border-color);border-radius:var(--dhx-scheduler-border-radius);height:var(--dhx-scheduler-control-height);padding:var(--dhx-scheduler-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-scheduler-font-size);font-family:var(--dhx-scheduler-font-family);font-weight:var(--dhx-scheduler-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-scheduler-btn-text-transform);cursor:pointer;padding:6px 0;--dhx-scheduler-btn-background: transparent;--dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary);--dhx-scheduler-btn-border-color: transparent;--dhx-scheduler-btn-background-hover: transparent;--dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover);--dhx-scheduler-btn-border-hover: transparent;--dhx-scheduler-btn-background-active: transparent;--dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active);--dhx-scheduler-btn-border-active: transparent;--dhx-scheduler-btn-background-disabled: transparent;--dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons);--dhx-scheduler-btn-border-color-disabled: transparent}.undo_button:hover{background:var(--dhx-scheduler-btn-background-hover);color:var(--dhx-scheduler-btn-color-hover);border-color:var(--dhx-scheduler-btn-border-hover)}.undo_button:active{background:var(--dhx-scheduler-btn-background-active);color:var(--dhx-scheduler-btn-color-active);border-color:var(--dhx-scheduler-btn-border-active)}.undo_button:disabled{background:var(--dhx-scheduler-btn-background-disabled);color:var(--dhx-scheduler-btn-color-disabled);border-color:var(--dhx-scheduler-btn-border-disabled)}.dhx_scheduler_month .dhx_marked_timespan.dhx_scheduler_dnd_marker{display:block;margin-top:-4px}.dhx_marked_timespan.dhx_scheduler_dnd_marker{justify-content:flex-start;align-items:flex-start}.dhx_scheduler_dnd_marker{opacity:.5} diff --git a/codebase/dhtmlxscheduler.d.ts b/codebase/dhtmlxscheduler.d.ts index 54ecb52..d99ec60 100644 --- a/codebase/dhtmlxscheduler.d.ts +++ b/codebase/dhtmlxscheduler.d.ts @@ -5,11 +5,13 @@ type SchedulerCallback = (...args: any[]) => any; type SchedulerFilterCallback = { (id: string | number, event: any): boolean } -type SchedulerEventName = "onAfterEventDisplay" | +type SchedulerEventName = "onAfterBatchUpdate" | + "onAfterEventDisplay" | "onAfterFolderToggle" | "onAfterLightbox" | "onAfterQuickInfo" | "onAfterSchedulerResize" | + "onBeforeBatchUpdate" | "onBeforeCollapse" | "onBeforeDrag" | "onBeforeEventChanged" | @@ -253,36 +255,26 @@ export interface SchedulerTemplates { map_date(start: Date, end: Date): string; /** - * specifies the text in the second column of the view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - map_text(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the first column of the view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed + * specifies the content of the info window in the Map View * @param event the event object */ - map_time(start: Date, end: Date, event: any): string; + map_info_content(event: any): void; /** - * specifies the date of the event in the Google Maps popup marker + * specifies the text in the second column of the view * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object */ - marker_date(start: Date, end: Date, event: any): string; + map_text(start: Date, end: Date, event: any): string; /** - * specifies the text of the event in the Google Maps popup marker + * specifies the date in the first column of the view * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object */ - marker_text(start: Date, end: Date, event: any): string; + map_time(start: Date, end: Date, event: any): string; /** * specifies the date in the header of the view @@ -735,7 +727,7 @@ export interface SchedulerConfigOptions { drag_event_body: boolean; /** - * highlights the event's duration on the time scale when you drags an event over the scheduler + * highlights the event's initial position and duration on the time scale when you are dragging an event over the scheduler */ drag_highlight: boolean; @@ -900,7 +892,7 @@ export interface SchedulerConfigOptions { map_error_position: any; /** - * the maximum width of the Google Maps's popup marker in the Map view + * the maximum width of the map's popup marker in the Map view */ map_infowindow_max_width: number; @@ -910,7 +902,7 @@ export interface SchedulerConfigOptions { map_initial_position: any; /** - * sets the initial zoom of Google Maps in the Map view + * sets the initial zoom of the map in the Map view */ map_initial_zoom: number; @@ -924,6 +916,11 @@ export interface SchedulerConfigOptions { */ map_resolve_user_location: boolean; + /** + * provides map-related configuration settings + */ + map_settings: any; + /** * sets the date to start displaying events from */ @@ -934,6 +931,11 @@ export interface SchedulerConfigOptions { */ map_type: any; + /** + * specifies the map provider + */ + map_view_provider: string; + /** * sets the zoom that will be used to show the user's location, if the user agrees to the browser's offer to show it */ @@ -1194,6 +1196,11 @@ export interface SchedulerConfigOptions { */ touch_tooltip: boolean; + /** + * provides the Undo popup when you delete an event + */ + undo_deleted: boolean; + /** * updates the mode when the scheduler fully repaints itself on any action */ @@ -1619,6 +1626,13 @@ export interface SchedulerStatic { */ backbone(events: any): void; + /** + * updates multiple events at once + * @param callback the callback function + * @param noRedraw optional, optional, specifies if Scheduler should repaint the chart after the callback function; true - not to repaint and false (by default) - to repaint + */ + batchUpdate(callback: SchedulerCallback, noRedraw?: boolean): void; + /** * creates a new function that when called has its this keyword set to the provided value * @param method the target function diff --git a/codebase/dhtmlxscheduler.es.d.ts b/codebase/dhtmlxscheduler.es.d.ts index 54ecb52..d99ec60 100644 --- a/codebase/dhtmlxscheduler.es.d.ts +++ b/codebase/dhtmlxscheduler.es.d.ts @@ -5,11 +5,13 @@ type SchedulerCallback = (...args: any[]) => any; type SchedulerFilterCallback = { (id: string | number, event: any): boolean } -type SchedulerEventName = "onAfterEventDisplay" | +type SchedulerEventName = "onAfterBatchUpdate" | + "onAfterEventDisplay" | "onAfterFolderToggle" | "onAfterLightbox" | "onAfterQuickInfo" | "onAfterSchedulerResize" | + "onBeforeBatchUpdate" | "onBeforeCollapse" | "onBeforeDrag" | "onBeforeEventChanged" | @@ -253,36 +255,26 @@ export interface SchedulerTemplates { map_date(start: Date, end: Date): string; /** - * specifies the text in the second column of the view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - map_text(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the first column of the view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed + * specifies the content of the info window in the Map View * @param event the event object */ - map_time(start: Date, end: Date, event: any): string; + map_info_content(event: any): void; /** - * specifies the date of the event in the Google Maps popup marker + * specifies the text in the second column of the view * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object */ - marker_date(start: Date, end: Date, event: any): string; + map_text(start: Date, end: Date, event: any): string; /** - * specifies the text of the event in the Google Maps popup marker + * specifies the date in the first column of the view * @param start the date when an event is scheduled to begin * @param end the date when an event is scheduled to be completed * @param event the event object */ - marker_text(start: Date, end: Date, event: any): string; + map_time(start: Date, end: Date, event: any): string; /** * specifies the date in the header of the view @@ -735,7 +727,7 @@ export interface SchedulerConfigOptions { drag_event_body: boolean; /** - * highlights the event's duration on the time scale when you drags an event over the scheduler + * highlights the event's initial position and duration on the time scale when you are dragging an event over the scheduler */ drag_highlight: boolean; @@ -900,7 +892,7 @@ export interface SchedulerConfigOptions { map_error_position: any; /** - * the maximum width of the Google Maps's popup marker in the Map view + * the maximum width of the map's popup marker in the Map view */ map_infowindow_max_width: number; @@ -910,7 +902,7 @@ export interface SchedulerConfigOptions { map_initial_position: any; /** - * sets the initial zoom of Google Maps in the Map view + * sets the initial zoom of the map in the Map view */ map_initial_zoom: number; @@ -924,6 +916,11 @@ export interface SchedulerConfigOptions { */ map_resolve_user_location: boolean; + /** + * provides map-related configuration settings + */ + map_settings: any; + /** * sets the date to start displaying events from */ @@ -934,6 +931,11 @@ export interface SchedulerConfigOptions { */ map_type: any; + /** + * specifies the map provider + */ + map_view_provider: string; + /** * sets the zoom that will be used to show the user's location, if the user agrees to the browser's offer to show it */ @@ -1194,6 +1196,11 @@ export interface SchedulerConfigOptions { */ touch_tooltip: boolean; + /** + * provides the Undo popup when you delete an event + */ + undo_deleted: boolean; + /** * updates the mode when the scheduler fully repaints itself on any action */ @@ -1619,6 +1626,13 @@ export interface SchedulerStatic { */ backbone(events: any): void; + /** + * updates multiple events at once + * @param callback the callback function + * @param noRedraw optional, optional, specifies if Scheduler should repaint the chart after the callback function; true - not to repaint and false (by default) - to repaint + */ + batchUpdate(callback: SchedulerCallback, noRedraw?: boolean): void; + /** * creates a new function that when called has its this keyword set to the provided value * @param method the target function diff --git a/codebase/dhtmlxscheduler.es.js b/codebase/dhtmlxscheduler.es.js index f4fb1cf..1eca8a2 100644 --- a/codebase/dhtmlxscheduler.es.js +++ b/codebase/dhtmlxscheduler.es.js @@ -1,136 +1,758 @@ -const I = typeof window < "u" ? window : global; -function de(e) { - function h(o) { - var t = document.createElement("div"); - return (o || "").split(" ").forEach(function(n) { - t.classList.add(n); - }), t; +const oe = typeof window < "u" ? window : global; +function Nt(e) { + let i = [], t = !1, r = null, d = null; + function n() { + return e.config.drag_highlight && e.markTimespan; + } + function s(o) { + const l = e.getView(o); + return l ? l.layout : o; + } + function _(o) { + const { event: l, layout: h, viewName: v, sectionId: u, eventNode: f } = o; + (function(m, g) { + switch (g) { + case "month": + m.style.top = "", m.style.left = ""; + break; + case "timeline": + m.style.left = "", m.style.marginLeft = "1px"; + break; + default: + m.style.top = ""; + } + })(f, h); + const c = {}; + let p = { start_date: l.start_date, end_date: l.end_date, css: "dhx_scheduler_dnd_marker", html: f }; + return h != "timeline" && h != "month" || (p = { ...p, end_date: e.date.add(l.start_date, 1, "minute") }), u && (c[v] = u, p.sections = c), p; + } + function a(o) { + const { layout: l } = o; + let h; + switch (l) { + case "month": + h = function(v) { + let u = []; + const { event: f, layout: c, viewName: p, sectionId: m } = v, g = []; + let y = new Date(f.start_date); + for (; y.valueOf() < f.end_date.valueOf(); ) { + let b = { start_date: y }; + g.push(b), y = e.date.week_start(e.date.add(y, 1, "week")); + } + let x = e.$container.querySelectorAll(`[${e.config.event_attribute}='${f.id}']`); + for (let b = 0; b < x.length; b++) { + const k = { event: g[b], layout: c, viewName: p, sectionId: m, eventNode: x[b].cloneNode(!0) }; + u.push(_(k)); + } + return u; + }(o); + break; + case "timeline": + case "units": + h = function(v) { + let u = []; + const { event: f, layout: c, viewName: p, eventNode: m } = v; + let g = function(y) { + const x = e.getView(y); + return x.y_property ? x.y_property : x.map_to ? x.map_to : void 0; + }(p); + if (e.config.multisection && g) { + const y = String(f[g]).split(e.config.section_delimiter).map((b) => String(b)), x = []; + for (let b = 0; b < y.length; b++) { + x[b] = m.cloneNode(!0); + const k = { event: f, layout: c, viewName: p, sectionId: y[b], eventNode: x[b] }; + u.push(_(k)); + } + } + return u; + }(o); + break; + default: + h = function(v) { + const { event: u, layout: f, viewName: c, sectionId: p } = v; + let m = [], g = e.$container.querySelectorAll(`[${e.config.event_attribute}='${u.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`); + if (g) + for (let y = 0; y < g.length; y++) { + let x = g[y].cloneNode(!0); + const b = { event: { start_date: /* @__PURE__ */ new Date(+x.getAttribute("data-bar-start")), end_date: /* @__PURE__ */ new Date(+x.getAttribute("data-bar-end")) }, layout: f, viewName: c, sectionId: p, eventNode: x }; + m.push(_(b)); + } + return m; + }(o); + } + h.forEach((v) => { + i.push(e.markTimespan(v)); + }); + } + e.attachEvent("onBeforeDrag", function(o, l, h) { + return n() && (t = !0, d = e.getEvent(o), r = h.target.closest(`[${e.config.event_attribute}]`), s(e.getState().mode) == "units" && e.config.cascade_event_display && (e.unselect(o), r = h.target.closest(`[${e.config.event_attribute}]`))), !0; + }), e.attachEvent("onEventDrag", function(o, l, h) { + if (t && n()) { + t = !1; + const v = e.getState().mode, u = s(v), f = e.getActionData(h).section; + d && a({ event: d, layout: u, viewName: v, sectionId: f, eventNode: r }); + } + }), e.attachEvent("onDragEnd", function(o, l, h) { + for (let v = 0; v < i.length; v++) + e.unmarkTimespan(i[v]); + i = [], r = null, d = null; + }); +} +function Mt(e) { + e.config.mark_now = !0, e.config.display_marked_timespans = !0, e.config.overwrite_marked_timespans = !0; + var i = "dhx_time_block", t = "default", r = function(n, s, _) { + var a = typeof n == "object" ? n : { days: n }; + return a.type = i, a.css = "", s && (_ && (a.sections = _), a = function(o, l, h) { + return l instanceof Date && h instanceof Date ? (o.start_date = l, o.end_date = h) : (o.days = l, o.zones = h), o; + }(a, n, s)), a; + }; + function d(n, s, _, a, o) { + var l = e, h = [], v = { _props: "map_to", matrix: "y_property" }; + for (var u in v) { + var f = v[u]; + if (l[u]) + for (var c in l[u]) { + var p = l[u][c][f]; + n[p] && (h = l._add_timespan_zones(h, e._get_blocked_zones(s[c], n[p], _, a, o))); + } + } + return h = l._add_timespan_zones(h, e._get_blocked_zones(s, "global", _, a, o)); + } + e.blockTime = function(n, s, _) { + var a = r(n, s, _); + return e.addMarkedTimespan(a); + }, e.unblockTime = function(n, s, _) { + var a = r(n, s = s || "fullday", _); + return e.deleteMarkedTimespan(a); + }, e.checkInMarkedTimespan = function(n, s, _) { + s = s || t; + for (var a = !0, o = new Date(n.start_date.valueOf()), l = e.date.add(o, 1, "day"), h = e._marked_timespans; o < n.end_date; o = e.date.date_part(l), l = e.date.add(o, 1, "day")) { + var v = +e.date.date_part(new Date(o)), u = d(n, h, o.getDay(), v, s); + if (u) + for (var f = 0; f < u.length; f += 2) { + var c = e._get_zone_minutes(o), p = n.end_date > l || n.end_date.getDate() != o.getDate() ? 1440 : e._get_zone_minutes(n.end_date), m = u[f], g = u[f + 1]; + if (m < p && g > c && !(a = typeof _ == "function" && _(n, c, p, m, g))) + break; + } + } + return !a; + }, e.checkLimitViolation = function(n) { + if (!n || !e.config.check_limits) + return !0; + var s = e, _ = s.config, a = []; + if (n.rec_type && n._end_date || n.rrule) { + const u = n._end_date || n.end_date; + return !_.limit_start || !_.limit_end || u.valueOf() >= _.limit_start.valueOf() && n.start_date.valueOf() <= _.limit_end.valueOf(); + } + a = [n]; + for (var o = !0, l = 0; l < a.length; l++) { + var h = !0, v = a[l]; + v._timed = e.isOneDayEvent(v), (h = !_.limit_start || !_.limit_end || v.start_date.valueOf() >= _.limit_start.valueOf() && v.end_date.valueOf() <= _.limit_end.valueOf()) && (h = !e.checkInMarkedTimespan(v, i, function(u, f, c, p, m) { + var g = !0; + return f <= m && f >= p && ((m == 1440 || c <= m) && (g = !1), u._timed && s._drag_id && s._drag_mode == "new-size" ? (u.start_date.setHours(0), u.start_date.setMinutes(m)) : g = !1), (c >= p && c <= m || f < p && c > m) && (u._timed && s._drag_id && s._drag_mode == "new-size" ? (u.end_date.setHours(0), u.end_date.setMinutes(p)) : g = !1), g; + })), h || (h = s.checkEvent("onLimitViolation") ? s.callEvent("onLimitViolation", [v.id, v]) : h), o = o && h; + } + return o || (s._drag_id = null, s._drag_mode = null), o; + }, e._get_blocked_zones = function(n, s, _, a, o) { + var l = []; + if (n && n[s]) + for (var h = n[s], v = this._get_relevant_blocked_zones(_, a, h, o), u = 0; u < v.length; u++) + l = this._add_timespan_zones(l, v[u].zones); + return l; + }, e._get_relevant_blocked_zones = function(n, s, _, a) { + var o; + return e.config.overwrite_marked_timespans ? o = _[s] && _[s][a] ? _[s][a] : _[n] && _[n][a] ? _[n][a] : [] : (o = [], _[s] && _[s][a] && (o = o.concat(_[s][a])), _[n] && _[n][a] && (o = o.concat(_[n][a]))), o; + }, e._mark_now = function(n) { + var s = "dhx_now_time"; + this._els[s] || (this._els[s] = []); + var _ = e._currentDate(), a = this.config; + if (e._remove_mark_now(), !n && a.mark_now && _ < this._max_date && _ > this._min_date && _.getHours() >= a.first_hour && _.getHours() < a.last_hour) { + var o = this.locate_holder_day(_); + this._els[s] = e._append_mark_now(o, _); + } + }, e._append_mark_now = function(n, s) { + var _ = "dhx_now_time", a = e._get_zone_minutes(s), o = { zones: [a, a + 1], css: _, type: _ }; + if (!this._table_view) { + if (this._props && this._props[this._mode]) { + var l, h, v = this._props[this._mode], u = v.size || v.options.length; + v.days > 1 ? (v.size && v.options.length && (n = (v.position + n) / v.options.length * v.size), l = n, h = n + u) : h = (l = 0) + u; + for (var f = [], c = l; c < h; c++) { + var p = c; + o.days = p; + var m = e._render_marked_timespan(o, null, p)[0]; + f.push(m); + } + return f; + } + return o.days = n, e._render_marked_timespan(o, null, n); + } + if (this._mode == "month") + return o.days = +e.date.date_part(s), e._render_marked_timespan(o, null, null); + }, e._remove_mark_now = function() { + for (var n = "dhx_now_time", s = this._els[n], _ = 0; _ < s.length; _++) { + var a = s[_], o = a.parentNode; + o && o.removeChild(a); + } + this._els[n] = []; + }, e._marked_timespans = { global: {} }, e._get_zone_minutes = function(n) { + return 60 * n.getHours() + n.getMinutes(); + }, e._prepare_timespan_options = function(n) { + var s = [], _ = []; + if (n.days == "fullweek" && (n.days = [0, 1, 2, 3, 4, 5, 6]), n.days instanceof Array) { + for (var a = n.days.slice(), o = 0; o < a.length; o++) { + var l = e._lame_clone(n); + l.days = a[o], s.push.apply(s, e._prepare_timespan_options(l)); + } + return s; + } + if (!n || !(n.start_date && n.end_date && n.end_date > n.start_date || n.days !== void 0 && n.zones) && !n.type) + return s; + n.zones == "fullday" && (n.zones = [0, 1440]), n.zones && n.invert_zones && (n.zones = e.invertZones(n.zones)), n.id = e.uid(), n.css = n.css || "", n.type = n.type || t; + var h = n.sections; + if (h) { + for (var v in h) + if (h.hasOwnProperty(v)) { + var u = h[v]; + for (u instanceof Array || (u = [u]), o = 0; o < u.length; o++) + (x = e._lame_copy({}, n)).sections = {}, x.sections[v] = u[o], _.push(x); + } + } else + _.push(n); + for (var f = 0; f < _.length; f++) { + var c = _[f], p = c.start_date, m = c.end_date; + if (p && m) + for (var g = e.date.date_part(new Date(p)), y = e.date.add(g, 1, "day"); g < m; ) { + var x; + delete (x = e._lame_copy({}, c)).start_date, delete x.end_date, x.days = g.valueOf(); + var b = p > g ? e._get_zone_minutes(p) : 0, k = m > y || m.getDate() != g.getDate() ? 1440 : e._get_zone_minutes(m); + x.zones = [b, k], s.push(x), g = y, y = e.date.add(y, 1, "day"); + } + else + c.days instanceof Date && (c.days = e.date.date_part(c.days).valueOf()), c.zones = n.zones.slice(), s.push(c); + } + return s; + }, e._get_dates_by_index = function(n, s, _) { + var a = []; + s = e.date.date_part(new Date(s || e._min_date)), _ = new Date(_ || e._max_date); + for (var o = s.getDay(), l = n - o >= 0 ? n - o : 7 - s.getDay() + n, h = e.date.add(s, l, "day"); h < _; h = e.date.add(h, 1, "week")) + a.push(h); + return a; + }, e._get_css_classes_by_config = function(n) { + var s = []; + return n.type == i && (s.push(i), n.css && s.push(i + "_reset")), s.push("dhx_marked_timespan", n.css), s.join(" "); + }, e._get_block_by_config = function(n) { + var s = document.createElement("div"); + return n.html && (typeof n.html == "string" ? s.innerHTML = n.html : s.appendChild(n.html)), s; + }, e._render_marked_timespan = function(n, s, _) { + var a = [], o = e.config, l = this._min_date, h = this._max_date, v = !1; + if (!o.display_marked_timespans) + return a; + if (!_ && _ !== 0) { + if (n.days < 7) + _ = n.days; + else { + var u = new Date(n.days); + if (v = +u, !(+h > +u && +l <= +u)) + return a; + _ = u.getDay(); + } + var f = l.getDay(); + f > _ ? _ = 7 - (f - _) : _ -= f; + } + var c = n.zones, p = e._get_css_classes_by_config(n); + if (e._table_view && e._mode == "month") { + var m = [], g = []; + if (s) + m.push(s), g.push(_); + else { + g = v ? [v] : e._get_dates_by_index(_); + for (var y = 0; y < g.length; y++) + m.push(this._scales[g[y]]); + } + for (y = 0; y < m.length; y++) { + s = m[y], _ = g[y]; + var x = this.locate_holder_day(_, !1) % this._cols.length; + if (!this._ignores[x]) { + var b = e._get_block_by_config(n); + b.className = p, b.style.top = "0px", b.style.height = "100%"; + for (var k = 0; k < c.length; k += 2) { + var E = c[y]; + if ((N = c[y + 1]) <= E) + return []; + (M = b.cloneNode(!0)).style.left = "0px", M.style.width = "100%", s.appendChild(M), a.push(M); + } + } + } + } else { + var D = _; + if (this._ignores[this.locate_holder_day(_, !1)]) + return a; + if (this._props && this._props[this._mode] && n.sections && n.sections[this._mode]) { + var w = this._props[this._mode]; + D = w.order[n.sections[this._mode]]; + var S = w.order[n.sections[this._mode]]; + w.days > 1 ? D = D * (w.size || w.options.length) + S : (D = S, w.size && D > w.position + w.size && (D = 0)); + } + for (s = s || e.locate_holder(D), y = 0; y < c.length; y += 2) { + var N, M; + if (E = Math.max(c[y], 60 * o.first_hour), (N = Math.min(c[y + 1], 60 * o.last_hour)) <= E) { + if (y + 2 < c.length) + continue; + return []; + } + (M = e._get_block_by_config(n)).className = p; + var T = 24 * this.config.hour_size_px + 1, A = 36e5; + M.style.top = Math.round((60 * E * 1e3 - this.config.first_hour * A) * this.config.hour_size_px / A) % T + "px", M.style.height = Math.max(Math.round(60 * (N - E) * 1e3 * this.config.hour_size_px / A) % T, 1) + "px", s.appendChild(M), a.push(M); + } + } + return a; + }, e._mark_timespans = function() { + var n = this._els.dhx_cal_data[0], s = []; + if (e._table_view && e._mode == "month") + for (var _ in this._scales) { + var a = /* @__PURE__ */ new Date(+_); + s.push.apply(s, e._on_scale_add_marker(this._scales[_], a)); + } + else { + a = new Date(e._min_date); + for (var o = 0, l = n.childNodes.length; o < l; o++) { + var h = n.childNodes[o]; + h.firstChild && e._getClassName(h.firstChild).indexOf("dhx_scale_hour") > -1 || (s.push.apply(s, e._on_scale_add_marker(h, a)), a = e.date.add(a, 1, "day")); + } + } + return s; + }, e.markTimespan = function(n) { + if (!this._els) + throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`."); + var s = !1; + this._els.dhx_cal_data || (e.get_elements(), s = !0); + var _ = e._marked_timespans_ids, a = e._marked_timespans_types, o = e._marked_timespans; + e.deleteMarkedTimespan(), e.addMarkedTimespan(n); + var l = e._mark_timespans(); + return s && (e._els = []), e._marked_timespans_ids = _, e._marked_timespans_types = a, e._marked_timespans = o, l; + }, e.unmarkTimespan = function(n) { + if (n) + for (var s = 0; s < n.length; s++) { + var _ = n[s]; + _.parentNode && _.parentNode.removeChild(_); + } + }, e._addMarkerTimespanConfig = function(n) { + var s = "global", _ = e._marked_timespans, a = n.id, o = e._marked_timespans_ids; + o[a] || (o[a] = []); + var l = n.days, h = n.sections, v = n.type; + if (n.id = a, h) { + for (var u in h) + if (h.hasOwnProperty(u)) { + _[u] || (_[u] = {}); + var f = h[u], c = _[u]; + c[f] || (c[f] = {}), c[f][l] || (c[f][l] = {}), c[f][l][v] || (c[f][l][v] = [], e._marked_timespans_types || (e._marked_timespans_types = {}), e._marked_timespans_types[v] || (e._marked_timespans_types[v] = !0)); + var p = c[f][l][v]; + n._array = p, p.push(n), o[a].push(n); + } + } else + _[s][l] || (_[s][l] = {}), _[s][l][v] || (_[s][l][v] = []), e._marked_timespans_types || (e._marked_timespans_types = {}), e._marked_timespans_types[v] || (e._marked_timespans_types[v] = !0), p = _[s][l][v], n._array = p, p.push(n), o[a].push(n); + }, e._marked_timespans_ids = {}, e.addMarkedTimespan = function(n) { + var s = e._prepare_timespan_options(n); + if (s.length) { + for (var _ = s[0].id, a = 0; a < s.length; a++) + e._addMarkerTimespanConfig(s[a]); + return _; + } + }, e._add_timespan_zones = function(n, s) { + var _ = n.slice(); + if (s = s.slice(), !_.length) + return s; + for (var a = 0; a < _.length; a += 2) + for (var o = _[a], l = _[a + 1], h = a + 2 == _.length, v = 0; v < s.length; v += 2) { + var u = s[v], f = s[v + 1]; + if (f > l && u <= l || u < o && f >= o) + _[a] = Math.min(o, u), _[a + 1] = Math.max(l, f), a -= 2; + else { + if (!h) + continue; + var c = o > u ? 0 : 2; + _.splice(a + c, 0, u, f); + } + s.splice(v--, 2); + break; + } + return _; + }, e._subtract_timespan_zones = function(n, s) { + for (var _ = n.slice(), a = 0; a < _.length; a += 2) + for (var o = _[a], l = _[a + 1], h = 0; h < s.length; h += 2) { + var v = s[h], u = s[h + 1]; + if (u > o && v < l) { + var f = !1; + o >= v && l <= u && _.splice(a, 2), o < v && (_.splice(a, 2, o, v), f = !0), l > u && _.splice(f ? a + 2 : a, f ? 0 : 2, u, l), a -= 2; + break; + } + } + return _; + }, e.invertZones = function(n) { + return e._subtract_timespan_zones([0, 1440], n.slice()); + }, e._delete_marked_timespan_by_id = function(n) { + var s = e._marked_timespans_ids[n]; + if (s) { + for (var _ = 0; _ < s.length; _++) + for (var a = s[_], o = a._array, l = 0; l < o.length; l++) + if (o[l] == a) { + o.splice(l, 1); + break; + } + } + }, e._delete_marked_timespan_by_config = function(n) { + var s, _ = e._marked_timespans, a = n.sections, o = n.days, l = n.type || t; + if (a) { + for (var h in a) + if (a.hasOwnProperty(h) && _[h]) { + var v = a[h]; + _[h][v] && (s = _[h][v]); + } + } else + s = _.global; + if (s) { + if (o !== void 0) + s[o] && s[o][l] && (e._addMarkerTimespanConfig(n), e._delete_marked_timespans_list(s[o][l], n)); + else + for (var u in s) + if (s[u][l]) { + var f = e._lame_clone(n); + n.days = u, e._addMarkerTimespanConfig(f), e._delete_marked_timespans_list(s[u][l], n); + } + } + }, e._delete_marked_timespans_list = function(n, s) { + for (var _ = 0; _ < n.length; _++) { + var a = n[_], o = e._subtract_timespan_zones(a.zones, s.zones); + if (o.length) + a.zones = o; + else { + n.splice(_, 1), _--; + for (var l = e._marked_timespans_ids[a.id], h = 0; h < l.length; h++) + if (l[h] == a) { + l.splice(h, 1); + break; + } + } + } + }, e.deleteMarkedTimespan = function(n) { + if (arguments.length || (e._marked_timespans = { global: {} }, e._marked_timespans_ids = {}, e._marked_timespans_types = {}), typeof n != "object") + e._delete_marked_timespan_by_id(n); + else { + n.start_date && n.end_date || (n.days !== void 0 || n.type || (n.days = "fullweek"), n.zones || (n.zones = "fullday")); + var s = []; + if (n.type) + s.push(n.type); + else + for (var _ in e._marked_timespans_types) + s.push(_); + for (var a = e._prepare_timespan_options(n), o = 0; o < a.length; o++) + for (var l = a[o], h = 0; h < s.length; h++) { + var v = e._lame_clone(l); + v.type = s[h], e._delete_marked_timespan_by_config(v); + } + } + }, e._get_types_to_render = function(n, s) { + var _ = n ? e._lame_copy({}, n) : {}; + for (var a in s || {}) + s.hasOwnProperty(a) && (_[a] = s[a]); + return _; + }, e._get_configs_to_render = function(n) { + var s = []; + for (var _ in n) + n.hasOwnProperty(_) && s.push.apply(s, n[_]); + return s; + }, e._on_scale_add_marker = function(n, s) { + if (!e._table_view || e._mode == "month") { + var _ = s.getDay(), a = s.valueOf(), o = this._mode, l = e._marked_timespans, h = [], v = []; + if (this._props && this._props[o]) { + var u = this._props[o], f = u.options, c = f[e._get_unit_index(u, s)]; + if (u.days > 1) { + var p = Math.round((s - e._min_date) / 864e5), m = u.size || f.length; + s = e.date.add(e._min_date, Math.floor(p / m), "day"), s = e.date.date_part(s); + } else + s = e.date.date_part(new Date(this._date)); + if (_ = s.getDay(), a = s.valueOf(), l[o] && l[o][c.key]) { + var g = l[o][c.key], y = e._get_types_to_render(g[_], g[a]); + h.push.apply(h, e._get_configs_to_render(y)); + } + } + var x = l.global; + if (e.config.overwrite_marked_timespans) { + var b = x[a] || x[_]; + h.push.apply(h, e._get_configs_to_render(b)); + } else + x[a] && h.push.apply(h, e._get_configs_to_render(x[a])), x[_] && h.push.apply(h, e._get_configs_to_render(x[_])); + for (var k = 0; k < h.length; k++) + v.push.apply(v, e._render_marked_timespan(h[k], n, s)); + return v; + } + }, e.attachEvent("onScaleAdd", function() { + e._on_scale_add_marker.apply(e, arguments); + }), e.dblclick_dhx_marked_timespan = function(n, s) { + e.callEvent("onScaleDblClick", [e.getActionData(n).date, s, n]), e.config.dblclick_create && e.addEventNow(e.getActionData(n).date, null, n); + }; +} +function Tt(e) { + var i = {}, t = !1; + function r(a, o) { + o = typeof o == "function" ? o : function() { + }, i[a] || (i[a] = this[a], this[a] = o); + } + function d(a) { + i[a] && (this[a] = i[a], i[a] = null); + } + function n(a) { + for (var o in a) + r.call(this, o, a[o]); + } + function s() { + for (var a in i) + d.call(this, a); + } + function _(a) { + try { + a(); + } catch (o) { + window.console.error(o); + } + } + return e.$stateProvider.registerProvider("batchUpdate", function() { + return { batch_update: t }; + }, !1), function(a, o) { + if (t) + return void _(a); + var l, h = this._dp && this._dp.updateMode != "off"; + h && (l = this._dp.updateMode, this._dp.setUpdateMode("off")); + const v = { setModeDate: { date: null, mode: null }, needRender: !1, needUpdateView: !1, repaintEvents: {} }, u = (c, p) => { + c && (v.setModeDate.date = c), p && (v.setModeDate.mode = p); + }; + var f = { render: (c, p) => { + v.needRender = !0, u(c, p); + }, setCurrentView: (c, p) => { + v.needRender = !0, u(c, p); + }, updateView: (c, p) => { + v.needUpdateView = !0, u(c, p); + }, render_data: () => v.needRender = !0, render_view_data: (c) => { + c && c.length ? c.forEach((p) => v.repaintEvents[p.id] = !0) : v.needRender = !0; + } }; + if (n.call(this, f), t = !0, this.callEvent("onBeforeBatchUpdate", []), _(a), this.callEvent("onAfterBatchUpdate", []), s.call(this), t = !1, !o) + if (v.needRender) + e.render(v.setModeDate.date, v.setModeDate.mode); + else if (v.needUpdateView) + e.updateView(v.setModeDate.date, v.setModeDate.mode); + else + for (const c in v.repaintEvents) + e.updateEvent(c); + h && (this._dp.setUpdateMode(l), this._dp.sendData()); + }; +} +function At(e) { + (function(i) { + i.attachEvent("onEventDeleted", function(t, r) { + let d = i.copy(r); + i.config.undo_deleted && !i.getState().new_event && i.message({ text: `
+ Event deleted + +
`, expire: 1e4, type: "popup_after_delete", callback: function(n) { + n.target.closest(`[data-deleted-event-id="${r.id}"]`) && (i.addEvent(d), i.render()); + } }); + }); + })(e), Nt(e), Mt(e), function(i) { + i.batchUpdate = Tt(i); + }(e); +} +var Ct = Date.now(); +function Me(e) { + return !(!e || typeof e != "object") && !!(e.getFullYear && e.getMonth && e.getDate); +} +const ee = { uid: function() { + return Ct++; +}, mixin: function(e, i, t) { + for (var r in i) + (e[r] === void 0 || t) && (e[r] = i[r]); + return e; +}, copy: function e(i) { + var t, r, d; + if (i && typeof i == "object") + switch (!0) { + case Me(i): + r = new Date(i); + break; + case (d = i, Array.isArray ? Array.isArray(d) : d && d.length !== void 0 && d.pop && d.push): + for (r = new Array(i.length), t = 0; t < i.length; t++) + r[t] = e(i[t]); + break; + case function(n) { + return n && typeof n == "object" && Function.prototype.toString.call(n.constructor) === "function String() { [native code] }"; + }(i): + r = new String(i); + break; + case function(n) { + return n && typeof n == "object" && Function.prototype.toString.call(n.constructor) === "function Number() { [native code] }"; + }(i): + r = new Number(i); + break; + case function(n) { + return n && typeof n == "object" && Function.prototype.toString.call(n.constructor) === "function Boolean() { [native code] }"; + }(i): + r = new Boolean(i); + break; + default: + for (t in r = {}, i) { + const n = typeof i[t]; + n === "string" || n === "number" || n === "boolean" ? r[t] = i[t] : Me(i[t]) ? r[t] = new Date(i[t]) : Object.prototype.hasOwnProperty.apply(i, [t]) && (r[t] = e(i[t])); + } + } + return r || i; +}, defined: function(e) { + return e !== void 0; +}, isDate: Me, delay: function(e, i) { + var t, r = function() { + r.$cancelTimeout(), r.$pending = !0; + var d = Array.prototype.slice.call(arguments); + t = setTimeout(function() { + e.apply(this, d), r.$pending = !1; + }, i); + }; + return r.$pending = !1, r.$cancelTimeout = function() { + clearTimeout(t), r.$pending = !1; + }, r.$execute = function() { + var d = Array.prototype.slice.call(arguments); + e.apply(this, d), r.$cancelTimeout(); + }, r; +} }; +function Ot(e) { + function i(_) { + var a = document.createElement("div"); + return (_ || "").split(" ").forEach(function(o) { + a.classList.add(o); + }), a; } - var a = { rows_container: function() { - return h("dhx_cal_navbar_rows_container"); + var t = { rows_container: function() { + return i("dhx_cal_navbar_rows_container"); }, row: function() { - return h("dhx_cal_navbar_row"); - }, view: function(o) { - var t = h("dhx_cal_tab"); - return t.setAttribute("name", o.view + "_tab"), t.setAttribute("data-tab", o.view), e.config.fix_tab_position && (o.$firstTab ? t.classList.add("dhx_cal_tab_first") : o.$lastTab ? t.classList.add("dhx_cal_tab_last") : o.view !== "week" && t.classList.add("dhx_cal_tab_standalone"), o.$segmentedTab && t.classList.add("dhx_cal_tab_segmented")), t; + return i("dhx_cal_navbar_row"); + }, view: function(_) { + var a = i("dhx_cal_tab"); + return a.setAttribute("name", _.view + "_tab"), a.setAttribute("data-tab", _.view), e.config.fix_tab_position && (_.$firstTab ? a.classList.add("dhx_cal_tab_first") : _.$lastTab ? a.classList.add("dhx_cal_tab_last") : _.view !== "week" && a.classList.add("dhx_cal_tab_standalone"), _.$segmentedTab && a.classList.add("dhx_cal_tab_segmented")), a; }, date: function() { - return h("dhx_cal_date"); - }, button: function(o) { - return h("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab"); - }, builtInButton: function(o) { - return h("dhx_cal_" + o.view + "_button dhx_cal_nav_button"); + return i("dhx_cal_date"); + }, button: function(_) { + return i("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab"); + }, builtInButton: function(_) { + return i("dhx_cal_" + _.view + "_button dhx_cal_nav_button"); }, spacer: function() { - return h("dhx_cal_line_spacer"); - }, minicalendarButton: function(o) { - var t = h("dhx_minical_icon"); - return o.click || t.$_eventAttached || e.event(t, "click", function() { - e.isCalendarVisible() ? e.destroyCalendar() : e.renderCalendar({ position: this, date: e.getState().date, navigation: !0, handler: function(n, s) { - e.setCurrentView(n), e.destroyCalendar(); + return i("dhx_cal_line_spacer"); + }, minicalendarButton: function(_) { + var a = i("dhx_minical_icon"); + return _.click || a.$_eventAttached || e.event(a, "click", function() { + e.isCalendarVisible() ? e.destroyCalendar() : e.renderCalendar({ position: this, date: e.getState().date, navigation: !0, handler: function(o, l) { + e.setCurrentView(o), e.destroyCalendar(); } }); - }), t; - }, html_element: function(o) { - return h("dhx_cal_nav_content"); + }), a; + }, html_element: function(_) { + return i("dhx_cal_nav_content"); } }; - function r(o) { - var t = function(c) { - var u; - if (c.view) - switch (c.view) { + function r(_) { + var a = function(h) { + var v; + if (h.view) + switch (h.view) { case "today": case "next": case "prev": - u = a.builtInButton; + v = t.builtInButton; break; case "date": - u = a.date; + v = t.date; break; case "spacer": - u = a.spacer; + v = t.spacer; break; case "button": - u = a.button; + v = t.button; break; case "minicalendar": - u = a.minicalendarButton; + v = t.minicalendarButton; break; default: - u = a.view; + v = t.view; } else - c.rows ? u = a.rows_container : c.cols && (u = a.row); - return u; - }(o); - if (t) { - var n = t(o); - if (o.css && n.classList.add(o.css), o.width && ((s = o.width) === 1 * s && (s += "px"), n.style.width = s), o.height && ((s = o.height) === 1 * s && (s += "px"), n.style.height = s), o.click && e.event(n, "click", o.click), o.html && (n.innerHTML = o.html), o.align) { - var s = ""; - o.align == "right" ? s = "flex-end" : o.align == "left" && (s = "flex-start"), n.style.justifyContent = s; + h.rows ? v = t.rows_container : h.cols && (v = t.row); + return v; + }(_); + if (a) { + var o = a(_); + if (_.css && o.classList.add(_.css), _.width && ((l = _.width) === 1 * l && (l += "px"), o.style.width = l), _.height && ((l = _.height) === 1 * l && (l += "px"), o.style.height = l), _.click && e.event(o, "click", _.click), _.html && (o.innerHTML = _.html), _.align) { + var l = ""; + _.align == "right" ? l = "flex-end" : _.align == "left" && (l = "flex-start"), o.style.justifyContent = l; } - return n; + return o; } } - function d(o) { - return typeof o == "string" && (o = { view: o }), o.view || o.rows || o.cols || (o.view = "button"), o; + function d(_) { + return typeof _ == "string" && (_ = { view: _ }), _.view || _.rows || _.cols || (_.view = "button"), _; } - function i(o) { - var t, n = document.createDocumentFragment(); - t = Array.isArray(o) ? o : [o]; - for (var s = 0; s < t.length; s++) { - var c, u = d(t[s]); - u.view === "day" && t[s + 1] && ((c = d(t[s + 1])).view !== "week" && c.view !== "month" || (u.$firstTab = !0, u.$segmentedTab = !0)), u.view === "week" && t[s - 1] && ((c = d(t[s + 1])).view !== "week" && c.view !== "month" || (u.$segmentedTab = !0)), u.view === "month" && t[s - 1] && ((c = d(t[s - 1])).view !== "week" && c.view !== "day" || (u.$lastTab = !0, u.$segmentedTab = !0)); - var v = r(u); - n.appendChild(v), (u.cols || u.rows) && v.appendChild(i(u.cols || u.rows)); + function n(_) { + var a, o = document.createDocumentFragment(); + a = Array.isArray(_) ? _ : [_]; + for (var l = 0; l < a.length; l++) { + var h, v = d(a[l]); + v.view === "day" && a[l + 1] && ((h = d(a[l + 1])).view !== "week" && h.view !== "month" || (v.$firstTab = !0, v.$segmentedTab = !0)), v.view === "week" && a[l - 1] && ((h = d(a[l + 1])).view !== "week" && h.view !== "month" || (v.$segmentedTab = !0)), v.view === "month" && a[l - 1] && ((h = d(a[l - 1])).view !== "week" && h.view !== "day" || (v.$lastTab = !0, v.$segmentedTab = !0)); + var u = r(v); + o.appendChild(u), (v.cols || v.rows) && u.appendChild(n(v.cols || v.rows)); } - return n; + return o; } - e._init_nav_bar = function(o) { - var t = this.$container.querySelector(".dhx_cal_navline"); - return t || ((t = document.createElement("div")).className = "dhx_cal_navline dhx_cal_navline_flex", e._update_nav_bar(o, t), t); + e._init_nav_bar = function(_) { + var a = this.$container.querySelector(".dhx_cal_navline"); + return a || ((a = document.createElement("div")).className = "dhx_cal_navline dhx_cal_navline_flex", e._update_nav_bar(_, a), a); }; - var _ = null; - e._update_nav_bar = function(o, t) { - if (o) { - var n = !1, s = o.height || e.xy.nav_height; - _ !== null && _ === s || (n = !0), n && (e.xy.nav_height = s), t.innerHTML = "", t.appendChild(i(o)), e.unset_actions(), e._els = [], e.get_elements(), e.set_actions(), t.style.display = s === 0 ? "none" : "", _ = s; + var s = null; + e._update_nav_bar = function(_, a) { + if (_) { + var o = !1, l = _.height || e.xy.nav_height; + s !== null && s === l || (o = !0), o && (e.xy.nav_height = l), a.innerHTML = "", a.appendChild(n(_)), e.unset_actions(), e._els = [], e.get_elements(), e.set_actions(), a.style.display = l === 0 ? "none" : "", s = l; } }; } -function _e(e) { - function h(i) { - for (var _ = document.body; i && i != _; ) - i = i.parentNode; - return _ == i; - } - function a(i) { - return { w: i.innerWidth || document.documentElement.clientWidth, h: i.innerHeight || document.documentElement.clientHeight }; - } - function r(i, _) { - var o, t = a(_); - i.event(_, "resize", function() { - clearTimeout(o), o = setTimeout(function() { - if (h(i.$container) && !i.$destroyed) { - var n, s, c = a(_); - s = c, ((n = t).w != s.w || n.h != s.h) && (t = c, d(i)); +function Lt(e) { + function i(n) { + for (var s = document.body; n && n != s; ) + n = n.parentNode; + return s == n; + } + function t(n) { + return { w: n.innerWidth || document.documentElement.clientWidth, h: n.innerHeight || document.documentElement.clientHeight }; + } + function r(n, s) { + var _, a = t(s); + n.event(s, "resize", function() { + clearTimeout(_), _ = setTimeout(function() { + if (i(n.$container) && !n.$destroyed) { + var o, l, h = t(s); + l = h, ((o = a).w != l.w || o.h != l.h) && (a = h, d(n)); } }, 150); }); } - function d(i) { - !i.$destroyed && i.$root && h(i.$root) && i.callEvent("onSchedulerResize", []) && (i.updateView(), i.callEvent("onAfterSchedulerResize", [])); + function d(n) { + !n.$destroyed && n.$root && i(n.$root) && n.callEvent("onSchedulerResize", []) && (n.updateView(), n.callEvent("onAfterSchedulerResize", [])); } - (function(i) { - var _ = i.$container; - window.getComputedStyle(_).getPropertyValue("position") == "static" && (_.style.position = "relative"); - var o = document.createElement("iframe"); - o.className = "scheduler_container_resize_watcher", o.tabIndex = -1, i.config.wai_aria_attributes && (o.setAttribute("role", "none"), o.setAttribute("aria-hidden", !0)), window.Sfdc || window.$A || window.Aura ? function(t) { - var n = t.$root.offsetHeight, s = t.$root.offsetWidth; - (function c() { - t.$destroyed || (t.$root && (t.$root.offsetHeight == n && t.$root.offsetWidth == s || d(t), n = t.$root.offsetHeight, s = t.$root.offsetWidth), setTimeout(c, 200)); + (function(n) { + var s = n.$container; + window.getComputedStyle(s).getPropertyValue("position") == "static" && (s.style.position = "relative"); + var _ = document.createElement("iframe"); + _.className = "scheduler_container_resize_watcher", _.tabIndex = -1, n.config.wai_aria_attributes && (_.setAttribute("role", "none"), _.setAttribute("aria-hidden", !0)), window.Sfdc || window.$A || window.Aura ? function(a) { + var o = a.$root.offsetHeight, l = a.$root.offsetWidth; + (function h() { + a.$destroyed || (a.$root && (a.$root.offsetHeight == o && a.$root.offsetWidth == l || d(a), o = a.$root.offsetHeight, l = a.$root.offsetWidth), setTimeout(h, 200)); })(); - }(i) : (_.appendChild(o), o.contentWindow ? r(i, o.contentWindow) : (_.removeChild(o), r(i, window))); + }(n) : (s.appendChild(_), _.contentWindow ? r(n, _.contentWindow) : (s.removeChild(_), r(n, window))); })(e); } -class le { +class Ht { constructor() { this._silent_mode = !1, this.listeners = {}; } @@ -141,181 +763,121 @@ class le { this._silent_mode = !1; } } -const ce = function(e) { - let h = {}, a = 0; +const $t = function(e) { + let i = {}, t = 0; const r = function() { let d = !0; - for (const i in h) { - const _ = h[i].apply(e, arguments); - d = d && _; + for (const n in i) { + const s = i[n].apply(e, arguments); + d = d && s; } return d; }; - return r.addEvent = function(d, i) { + return r.addEvent = function(d, n) { if (typeof d == "function") { - let _; - if (i && i.id ? _ = i.id : (_ = a, a++), i && i.once) { - const o = d; + let s; + if (n && n.id ? s = n.id : (s = t, t++), n && n.once) { + const _ = d; d = function() { - o(), r.removeEvent(_); + _(), r.removeEvent(s); }; } - return h[_] = d, _; + return i[s] = d, s; } return !1; }, r.removeEvent = function(d) { - delete h[d]; + delete i[d]; }, r.clear = function() { - h = {}; + i = {}; }, r; }; -function Q(e) { - const h = new le(); - e.attachEvent = function(a, r, d) { - a = "ev_" + a.toLowerCase(), h.listeners[a] || (h.listeners[a] = ce(this)), d && d.thisObject && (r = r.bind(d.thisObject)); - let i = a + ":" + h.listeners[a].addEvent(r, d); - return d && d.id && (i = d.id), i; - }, e.attachAll = function(a) { - this.attachEvent("listen_all", a); - }, e.callEvent = function(a, r) { - if (h._silent_mode) +function Ue(e) { + const i = new Ht(); + e.attachEvent = function(t, r, d) { + t = "ev_" + t.toLowerCase(), i.listeners[t] || (i.listeners[t] = $t(this)), d && d.thisObject && (r = r.bind(d.thisObject)); + let n = t + ":" + i.listeners[t].addEvent(r, d); + return d && d.id && (n = d.id), n; + }, e.attachAll = function(t) { + this.attachEvent("listen_all", t); + }, e.callEvent = function(t, r) { + if (i._silent_mode) return !0; - const d = "ev_" + a.toLowerCase(), i = h.listeners; - return i.ev_listen_all && i.ev_listen_all.apply(this, [a].concat(r)), !i[d] || i[d].apply(this, r); - }, e.checkEvent = function(a) { - return !!h.listeners["ev_" + a.toLowerCase()]; - }, e.detachEvent = function(a) { - if (a) { - let r = h.listeners; - for (const i in r) - r[i].removeEvent(a); - const d = a.split(":"); - if (r = h.listeners, d.length === 2) { - const i = d[0], _ = d[1]; - r[i] && r[i].removeEvent(_); + const d = "ev_" + t.toLowerCase(), n = i.listeners; + return n.ev_listen_all && n.ev_listen_all.apply(this, [t].concat(r)), !n[d] || n[d].apply(this, r); + }, e.checkEvent = function(t) { + return !!i.listeners["ev_" + t.toLowerCase()]; + }, e.detachEvent = function(t) { + if (t) { + let r = i.listeners; + for (const n in r) + r[n].removeEvent(t); + const d = t.split(":"); + if (r = i.listeners, d.length === 2) { + const n = d[0], s = d[1]; + r[n] && r[n].removeEvent(s); } } }, e.detachAllEvents = function() { - for (const a in h.listeners) - h.listeners[a].clear(); + for (const t in i.listeners) + i.listeners[t].clear(); }; } -const ee = { event: function(e, h, a) { - e.addEventListener ? e.addEventListener(h, a, !1) : e.attachEvent && e.attachEvent("on" + h, a); -}, eventRemove: function(e, h, a) { - e.removeEventListener ? e.removeEventListener(h, a, !1) : e.detachEvent && e.detachEvent("on" + h, a); +const We = { event: function(e, i, t) { + e.addEventListener ? e.addEventListener(i, t, !1) : e.attachEvent && e.attachEvent("on" + i, t); +}, eventRemove: function(e, i, t) { + e.removeEventListener ? e.removeEventListener(i, t, !1) : e.detachEvent && e.detachEvent("on" + i, t); } }; -function he(e) { - var h = function() { - var a = function(r, d) { - r = r || ee.event, d = d || ee.eventRemove; - var i = [], _ = { attach: function(o, t, n, s) { - i.push({ element: o, event: t, callback: n, capture: s }), r(o, t, n, s); - }, detach: function(o, t, n, s) { - d(o, t, n, s); - for (var c = 0; c < i.length; c++) { - var u = i[c]; - u.element === o && u.event === t && u.callback === n && u.capture === s && (i.splice(c, 1), c--); +function zt(e) { + var i = function() { + var t = function(r, d) { + r = r || We.event, d = d || We.eventRemove; + var n = [], s = { attach: function(_, a, o, l) { + n.push({ element: _, event: a, callback: o, capture: l }), r(_, a, o, l); + }, detach: function(_, a, o, l) { + d(_, a, o, l); + for (var h = 0; h < n.length; h++) { + var v = n[h]; + v.element === _ && v.event === a && v.callback === o && v.capture === l && (n.splice(h, 1), h--); } }, detachAll: function() { - for (var o = i.slice(), t = 0; t < o.length; t++) { - var n = o[t]; - _.detach(n.element, n.event, n.callback, n.capture), _.detach(n.element, n.event, n.callback, void 0), _.detach(n.element, n.event, n.callback, !1), _.detach(n.element, n.event, n.callback, !0); + for (var _ = n.slice(), a = 0; a < _.length; a++) { + var o = _[a]; + s.detach(o.element, o.event, o.callback, o.capture), s.detach(o.element, o.event, o.callback, void 0), s.detach(o.element, o.event, o.callback, !1), s.detach(o.element, o.event, o.callback, !0); } - i.splice(0, i.length); + n.splice(0, n.length); }, extend: function() { - return a(this.event, this.eventRemove); + return t(this.event, this.eventRemove); } }; - return _; + return s; }; - return a(); + return t(); }(); - e.event = h.attach, e.eventRemove = h.detach, e._eventRemoveAll = h.detachAll, e._createDomEventScope = h.extend, e._trim = function(a) { + e.event = i.attach, e.eventRemove = i.detach, e._eventRemoveAll = i.detachAll, e._createDomEventScope = i.extend, e._trim = function(t) { return (String.prototype.trim || function() { return this.replace(/^\s+|\s+$/g, ""); - }).apply(a); - }, e._isDate = function(a) { - return !(!a || typeof a != "object") && !!(a.getFullYear && a.getMonth && a.getDate); - }, e._isObject = function(a) { - return a && typeof a == "object"; + }).apply(t); + }, e._isDate = function(t) { + return !(!t || typeof t != "object") && !!(t.getFullYear && t.getMonth && t.getDate); + }, e._isObject = function(t) { + return t && typeof t == "object"; }; } -var ue = Date.now(); -function Y(e) { - return !(!e || typeof e != "object") && !!(e.getFullYear && e.getMonth && e.getDate); -} -const V = { uid: function() { - return ue++; -}, mixin: function(e, h, a) { - for (var r in h) - (e[r] === void 0 || a) && (e[r] = h[r]); - return e; -}, copy: function e(h) { - var a, r, d; - if (h && typeof h == "object") - switch (!0) { - case Y(h): - r = new Date(h); - break; - case (d = h, Array.isArray ? Array.isArray(d) : d && d.length !== void 0 && d.pop && d.push): - for (r = new Array(h.length), a = 0; a < h.length; a++) - r[a] = e(h[a]); - break; - case function(i) { - return i && typeof i == "object" && Function.prototype.toString.call(i.constructor) === "function String() { [native code] }"; - }(h): - r = new String(h); - break; - case function(i) { - return i && typeof i == "object" && Function.prototype.toString.call(i.constructor) === "function Number() { [native code] }"; - }(h): - r = new Number(h); - break; - case function(i) { - return i && typeof i == "object" && Function.prototype.toString.call(i.constructor) === "function Boolean() { [native code] }"; - }(h): - r = new Boolean(h); - break; - default: - for (a in r = {}, h) { - const i = typeof h[a]; - i === "string" || i === "number" || i === "boolean" ? r[a] = h[a] : Y(h[a]) ? r[a] = new Date(h[a]) : Object.prototype.hasOwnProperty.apply(h, [a]) && (r[a] = e(h[a])); - } - } - return r || h; -}, defined: function(e) { - return e !== void 0; -}, isDate: Y, delay: function(e, h) { - var a, r = function() { - r.$cancelTimeout(), r.$pending = !0; - var d = Array.prototype.slice.call(arguments); - a = setTimeout(function() { - e.apply(this, d), r.$pending = !1; - }, h); - }; - return r.$pending = !1, r.$cancelTimeout = function() { - clearTimeout(a), r.$pending = !1; - }, r.$execute = function() { - var d = Array.prototype.slice.call(arguments); - e.apply(this, d), r.$cancelTimeout(); - }, r; -} }; -function ne(e) { +function ut(e) { if (!e) return ""; - var h = e.className || ""; - return h.baseVal && (h = h.baseVal), h.indexOf || (h = ""), h || ""; + var i = e.className || ""; + return i.baseVal && (i = i.baseVal), i.indexOf || (i = ""), i || ""; } -function ie(e, h, a) { - a === void 0 && (a = !0); +function ft(e, i, t) { + t === void 0 && (t = !0); for (var r = e.target || e.srcElement, d = ""; r; ) { - if (d = ne(r)) { - var i = d.indexOf(h); - if (i >= 0) { - if (!a) + if (d = ut(r)) { + var n = d.indexOf(i); + if (n >= 0) { + if (!t) return r; - var _ = i === 0 || !(d.charAt(i - 1) || "").trim(), o = i + h.length >= d.length || !d.charAt(i + h.length).trim(); - if (_ && o) + var s = n === 0 || !(d.charAt(n - 1) || "").trim(), _ = n + i.length >= d.length || !d.charAt(n + i.length).trim(); + if (s && _) return r; } } @@ -323,228 +885,228 @@ function ie(e, h, a) { } return null; } -function fe(e) { - var h = !1, a = !1; +function qt(e) { + var i = !1, t = !1; if (window.getComputedStyle) { var r = window.getComputedStyle(e, null); - h = r.display, a = r.visibility; + i = r.display, t = r.visibility; } else - e.currentStyle && (h = e.currentStyle.display, a = e.currentStyle.visibility); - var d = !1, i = ie({ target: e }, "dhx_form_repeat", !1); - return i && (d = i.style.height == "0px"), d = d || !e.offsetHeight, h != "none" && a != "hidden" && !d; + e.currentStyle && (i = e.currentStyle.display, t = e.currentStyle.visibility); + var d = !1, n = ft({ target: e }, "dhx_form_repeat", !1); + return n && (d = n.style.height == "0px"), d = d || !e.offsetHeight, i != "none" && t != "hidden" && !d; } -function ve(e) { +function jt(e) { return !isNaN(e.getAttribute("tabindex")) && 1 * e.getAttribute("tabindex") >= 0; } -function ge(e) { +function Pt(e) { return !{ a: !0, area: !0 }[e.nodeName.loLowerCase()] || !!e.getAttribute("href"); } -function me(e) { +function It(e) { return !{ input: !0, select: !0, textarea: !0, button: !0, object: !0 }[e.nodeName.toLowerCase()] || !e.hasAttribute("disabled"); } -function re() { +function pt() { return document.head.createShadowRoot || document.head.attachShadow; } -function te(e) { - if (!e || !re()) +function Ke(e) { + if (!e || !pt()) return document.body; for (; e.parentNode && (e = e.parentNode); ) if (e instanceof ShadowRoot) return e.host; return document.body; } -const q = { getAbsoluteLeft: function(e) { +const _e = { getAbsoluteLeft: function(e) { return this.getOffset(e).left; }, getAbsoluteTop: function(e) { return this.getOffset(e).top; }, getOffsetSum: function(e) { - for (var h = 0, a = 0; e; ) - h += parseInt(e.offsetTop), a += parseInt(e.offsetLeft), e = e.offsetParent; - return { top: h, left: a }; + for (var i = 0, t = 0; e; ) + i += parseInt(e.offsetTop), t += parseInt(e.offsetLeft), e = e.offsetParent; + return { top: i, left: t }; }, getOffsetRect: function(e) { - var h = e.getBoundingClientRect(), a = 0, r = 0; + var i = e.getBoundingClientRect(), t = 0, r = 0; if (/Mobi/.test(navigator.userAgent)) { var d = document.createElement("div"); d.style.position = "absolute", d.style.left = "0px", d.style.top = "0px", d.style.width = "1px", d.style.height = "1px", document.body.appendChild(d); - var i = d.getBoundingClientRect(); - a = h.top - i.top, r = h.left - i.left, d.parentNode.removeChild(d); + var n = d.getBoundingClientRect(); + t = i.top - n.top, r = i.left - n.left, d.parentNode.removeChild(d); } else { - var _ = document.body, o = document.documentElement, t = window.pageYOffset || o.scrollTop || _.scrollTop, n = window.pageXOffset || o.scrollLeft || _.scrollLeft, s = o.clientTop || _.clientTop || 0, c = o.clientLeft || _.clientLeft || 0; - a = h.top + t - s, r = h.left + n - c; + var s = document.body, _ = document.documentElement, a = window.pageYOffset || _.scrollTop || s.scrollTop, o = window.pageXOffset || _.scrollLeft || s.scrollLeft, l = _.clientTop || s.clientTop || 0, h = _.clientLeft || s.clientLeft || 0; + t = i.top + a - l, r = i.left + o - h; } - return { top: Math.round(a), left: Math.round(r) }; + return { top: Math.round(t), left: Math.round(r) }; }, getOffset: function(e) { return e.getBoundingClientRect ? this.getOffsetRect(e) : this.getOffsetSum(e); -}, closest: function(e, h) { - return e && h ? K(e, h) : null; -}, insertAfter: function(e, h) { - h.nextSibling ? h.parentNode.insertBefore(e, h.nextSibling) : h.parentNode.appendChild(e); +}, closest: function(e, i) { + return e && i ? Le(e, i) : null; +}, insertAfter: function(e, i) { + i.nextSibling ? i.parentNode.insertBefore(e, i.nextSibling) : i.parentNode.appendChild(e); }, remove: function(e) { e && e.parentNode && e.parentNode.removeChild(e); -}, isChildOf: function(e, h) { - return h.contains(e); +}, isChildOf: function(e, i) { + return i.contains(e); }, getFocusableNodes: function(e) { - for (var h = e.querySelectorAll(["a[href]", "area[href]", "input", "select", "textarea", "button", "iframe", "object", "embed", "[tabindex]", "[contenteditable]"].join(", ")), a = Array.prototype.slice.call(h, 0), r = 0; r < a.length; r++) - a[r].$position = r; - for (a.sort(function(i, _) { - return i.tabIndex === 0 && _.tabIndex !== 0 ? 1 : i.tabIndex !== 0 && _.tabIndex === 0 ? -1 : i.tabIndex === _.tabIndex ? i.$position - _.$position : i.tabIndex < _.tabIndex ? -1 : 1; - }), r = 0; r < a.length; r++) { - var d = a[r]; - (ve(d) || me(d) || ge(d)) && fe(d) || (a.splice(r, 1), r--); - } - return a; -}, getClassName: ne, locateCss: ie, getRootNode: te, hasShadowParent: function(e) { - return !!te(e); -}, isShadowDomSupported: re, getActiveElement: function() { + for (var i = e.querySelectorAll(["a[href]", "area[href]", "input", "select", "textarea", "button", "iframe", "object", "embed", "[tabindex]", "[contenteditable]"].join(", ")), t = Array.prototype.slice.call(i, 0), r = 0; r < t.length; r++) + t[r].$position = r; + for (t.sort(function(n, s) { + return n.tabIndex === 0 && s.tabIndex !== 0 ? 1 : n.tabIndex !== 0 && s.tabIndex === 0 ? -1 : n.tabIndex === s.tabIndex ? n.$position - s.$position : n.tabIndex < s.tabIndex ? -1 : 1; + }), r = 0; r < t.length; r++) { + var d = t[r]; + (jt(d) || It(d) || Pt(d)) && qt(d) || (t.splice(r, 1), r--); + } + return t; +}, getClassName: ut, locateCss: ft, getRootNode: Ke, hasShadowParent: function(e) { + return !!Ke(e); +}, isShadowDomSupported: pt, getActiveElement: function() { var e = document.activeElement; return e.shadowRoot && (e = e.shadowRoot.activeElement), e === document.body && document.getSelection && (e = document.getSelection().focusNode || document.body), e; -}, getRelativeEventPosition: function(e, h) { - var a = document.documentElement, r = function(d) { - var i = 0, _ = 0, o = 0, t = 0; +}, getRelativeEventPosition: function(e, i) { + var t = document.documentElement, r = function(d) { + var n = 0, s = 0, _ = 0, a = 0; if (d.getBoundingClientRect) { - var n = d.getBoundingClientRect(), s = document.body, c = document.documentElement || document.body.parentNode || document.body, u = window.pageYOffset || c.scrollTop || s.scrollTop, v = window.pageXOffset || c.scrollLeft || s.scrollLeft, m = c.clientTop || s.clientTop || 0, l = c.clientLeft || s.clientLeft || 0; - i = n.top + u - m, _ = n.left + v - l, o = document.body.offsetWidth - n.right, t = document.body.offsetHeight - n.bottom; + var o = d.getBoundingClientRect(), l = document.body, h = document.documentElement || document.body.parentNode || document.body, v = window.pageYOffset || h.scrollTop || l.scrollTop, u = window.pageXOffset || h.scrollLeft || l.scrollLeft, f = h.clientTop || l.clientTop || 0, c = h.clientLeft || l.clientLeft || 0; + n = o.top + v - f, s = o.left + u - c, _ = document.body.offsetWidth - o.right, a = document.body.offsetHeight - o.bottom; } else { for (; d; ) - i += parseInt(d.offsetTop, 10), _ += parseInt(d.offsetLeft, 10), d = d.offsetParent; - o = document.body.offsetWidth - d.offsetWidth - _, t = document.body.offsetHeight - d.offsetHeight - i; + n += parseInt(d.offsetTop, 10), s += parseInt(d.offsetLeft, 10), d = d.offsetParent; + _ = document.body.offsetWidth - d.offsetWidth - s, a = document.body.offsetHeight - d.offsetHeight - n; } - return { y: Math.round(i), x: Math.round(_), width: d.offsetWidth, height: d.offsetHeight, right: Math.round(o), bottom: Math.round(t) }; - }(h); - return { x: e.clientX + a.scrollLeft - a.clientLeft - r.x + h.scrollLeft, y: e.clientY + a.scrollTop - a.clientTop - r.y + h.scrollTop }; + return { y: Math.round(n), x: Math.round(s), width: d.offsetWidth, height: d.offsetHeight, right: Math.round(_), bottom: Math.round(a) }; + }(i); + return { x: e.clientX - t.clientLeft - r.x + i.scrollLeft, y: e.clientY - t.clientTop - r.y + i.scrollTop }; }, getTargetNode: function(e) { - var h; - return e.tagName ? h = e : (h = (e = e || window.event).target || e.srcElement).shadowRoot && e.composedPath && (h = e.composedPath()[0]), h; + var i; + return e.tagName ? i = e : (i = (e = e || window.event).target || e.srcElement).shadowRoot && e.composedPath && (i = e.composedPath()[0]), i; }, getNodePosition: function(e) { - var h = 0, a = 0, r = 0, d = 0; + var i = 0, t = 0, r = 0, d = 0; if (e.getBoundingClientRect) { - var i = e.getBoundingClientRect(), _ = document.body, o = document.documentElement || document.body.parentNode || document.body, t = window.pageYOffset || o.scrollTop || _.scrollTop, n = window.pageXOffset || o.scrollLeft || _.scrollLeft, s = o.clientTop || _.clientTop || 0, c = o.clientLeft || _.clientLeft || 0; - h = i.top + t - s, a = i.left + n - c, r = document.body.offsetWidth - i.right, d = document.body.offsetHeight - i.bottom; + var n = e.getBoundingClientRect(), s = document.body, _ = document.documentElement || document.body.parentNode || document.body, a = window.pageYOffset || _.scrollTop || s.scrollTop, o = window.pageXOffset || _.scrollLeft || s.scrollLeft, l = _.clientTop || s.clientTop || 0, h = _.clientLeft || s.clientLeft || 0; + i = n.top + a - l, t = n.left + o - h, r = document.body.offsetWidth - n.right, d = document.body.offsetHeight - n.bottom; } else { for (; e; ) - h += parseInt(e.offsetTop, 10), a += parseInt(e.offsetLeft, 10), e = e.offsetParent; - r = document.body.offsetWidth - e.offsetWidth - a, d = document.body.offsetHeight - e.offsetHeight - h; + i += parseInt(e.offsetTop, 10), t += parseInt(e.offsetLeft, 10), e = e.offsetParent; + r = document.body.offsetWidth - e.offsetWidth - t, d = document.body.offsetHeight - e.offsetHeight - i; } - return { y: Math.round(h), x: Math.round(a), width: e.offsetWidth, height: e.offsetHeight, right: Math.round(r), bottom: Math.round(d) }; + return { y: Math.round(i), x: Math.round(t), width: e.offsetWidth, height: e.offsetHeight, right: Math.round(r), bottom: Math.round(d) }; } }; -var K; +var Le; if (Element.prototype.closest) - K = function(e, h) { - return e.closest(h); + Le = function(e, i) { + return e.closest(i); }; else { - var pe = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; - K = function(e, h) { - var a = e; + var Rt = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + Le = function(e, i) { + var t = e; do { - if (pe.call(a, h)) - return a; - a = a.parentElement || a.parentNode; - } while (a !== null && a.nodeType === 1); + if (Rt.call(t, i)) + return t; + t = t.parentElement || t.parentNode; + } while (t !== null && t.nodeType === 1); return null; }; } -var B = typeof window < "u"; -const ye = { isIE: B && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0), isOpera: B && navigator.userAgent.indexOf("Opera") >= 0, isChrome: B && navigator.userAgent.indexOf("Chrome") >= 0, isKHTML: B && (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0), isFF: B && navigator.userAgent.indexOf("Firefox") >= 0, isIPad: B && navigator.userAgent.search(/iPad/gi) >= 0, isEdge: B && navigator.userAgent.indexOf("Edge") != -1, isNode: !B || typeof navigator > "u" }; -function W(e) { +var se = typeof window < "u"; +const Yt = { isIE: se && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0), isOpera: se && navigator.userAgent.indexOf("Opera") >= 0, isChrome: se && navigator.userAgent.indexOf("Chrome") >= 0, isKHTML: se && (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0), isFF: se && navigator.userAgent.indexOf("Firefox") >= 0, isIPad: se && navigator.userAgent.search(/iPad/gi) >= 0, isEdge: se && navigator.userAgent.indexOf("Edge") != -1, isNode: !se || typeof navigator > "u" }; +function Te(e) { if (typeof e == "string" || typeof e == "number") return e; - var h = ""; - for (var a in e) { + var i = ""; + for (var t in e) { var r = ""; - e.hasOwnProperty(a) && (r = a + "=" + (r = typeof e[a] == "string" ? encodeURIComponent(e[a]) : typeof e[a] == "number" ? e[a] : encodeURIComponent(JSON.stringify(e[a]))), h.length && (r = "&" + r), h += r); + e.hasOwnProperty(t) && (r = t + "=" + (r = typeof e[t] == "string" ? encodeURIComponent(e[t]) : typeof e[t] == "number" ? e[t] : encodeURIComponent(JSON.stringify(e[t]))), i.length && (r = "&" + r), i += r); } - return h; + return i; } -function be(e) { - var h = function(i, _) { - for (var o = "var temp=date.match(/[a-zA-Z]+|[0-9]+/g);", t = i.match(/%[a-zA-Z]/g), n = 0; n < t.length; n++) - switch (t[n]) { +function Ut(e) { + var i = function(n, s) { + for (var _ = "var temp=date.match(/[a-zA-Z]+|[0-9]+/g);", a = n.match(/%[a-zA-Z]/g), o = 0; o < a.length; o++) + switch (a[o]) { case "%j": case "%d": - o += "set[2]=temp[" + n + "]||1;"; + _ += "set[2]=temp[" + o + "]||1;"; break; case "%n": case "%m": - o += "set[1]=(temp[" + n + "]||1)-1;"; + _ += "set[1]=(temp[" + o + "]||1)-1;"; break; case "%y": - o += "set[0]=temp[" + n + "]*1+(temp[" + n + "]>50?1900:2000);"; + _ += "set[0]=temp[" + o + "]*1+(temp[" + o + "]>50?1900:2000);"; break; case "%g": case "%G": case "%h": case "%H": - o += "set[3]=temp[" + n + "]||0;"; + _ += "set[3]=temp[" + o + "]||0;"; break; case "%i": - o += "set[4]=temp[" + n + "]||0;"; + _ += "set[4]=temp[" + o + "]||0;"; break; case "%Y": - o += "set[0]=temp[" + n + "]||0;"; + _ += "set[0]=temp[" + o + "]||0;"; break; case "%a": case "%A": - o += "set[3]=set[3]%12+((temp[" + n + "]||'').toLowerCase()=='am'?0:12);"; + _ += "set[3]=set[3]%12+((temp[" + o + "]||'').toLowerCase()=='am'?0:12);"; break; case "%s": - o += "set[5]=temp[" + n + "]||0;"; + _ += "set[5]=temp[" + o + "]||0;"; break; case "%M": - o += "set[1]=this.locale.date.month_short_hash[temp[" + n + "]]||0;"; + _ += "set[1]=this.locale.date.month_short_hash[temp[" + o + "]]||0;"; break; case "%F": - o += "set[1]=this.locale.date.month_full_hash[temp[" + n + "]]||0;"; - } - var s = "set[0],set[1],set[2],set[3],set[4],set[5]"; - return _ && (s = " Date.UTC(" + s + ")"), new Function("date", "var set=[0,0,1,0,0,0]; " + o + " return new Date(" + s + ");"); - }, a = function(i, _) { - const o = i.match(/%[a-zA-Z]/g); - return function(t) { - for (var n = [0, 0, 1, 0, 0, 0], s = t.match(/[a-zA-Z]+|[0-9]+/g), c = 0; c < o.length; c++) - switch (o[c]) { + _ += "set[1]=this.locale.date.month_full_hash[temp[" + o + "]]||0;"; + } + var l = "set[0],set[1],set[2],set[3],set[4],set[5]"; + return s && (l = " Date.UTC(" + l + ")"), new Function("date", "var set=[0,0,1,0,0,0]; " + _ + " return new Date(" + l + ");"); + }, t = function(n, s) { + const _ = n.match(/%[a-zA-Z]/g); + return function(a) { + for (var o = [0, 0, 1, 0, 0, 0], l = a.match(/[a-zA-Z]+|[0-9]+/g), h = 0; h < _.length; h++) + switch (_[h]) { case "%j": case "%d": - n[2] = s[c] || 1; + o[2] = l[h] || 1; break; case "%n": case "%m": - n[1] = (s[c] || 1) - 1; + o[1] = (l[h] || 1) - 1; break; case "%y": - n[0] = 1 * s[c] + (s[c] > 50 ? 1900 : 2e3); + o[0] = 1 * l[h] + (l[h] > 50 ? 1900 : 2e3); break; case "%g": case "%G": case "%h": case "%H": - n[3] = s[c] || 0; + o[3] = l[h] || 0; break; case "%i": - n[4] = s[c] || 0; + o[4] = l[h] || 0; break; case "%Y": - n[0] = s[c] || 0; + o[0] = l[h] || 0; break; case "%a": case "%A": - n[3] = n[3] % 12 + ((s[c] || "").toLowerCase() == "am" ? 0 : 12); + o[3] = o[3] % 12 + ((l[h] || "").toLowerCase() == "am" ? 0 : 12); break; case "%s": - n[5] = s[c] || 0; + o[5] = l[h] || 0; break; case "%M": - n[1] = e.locale.date.month_short_hash[s[c]] || 0; + o[1] = e.locale.date.month_short_hash[l[h]] || 0; break; case "%F": - n[1] = e.locale.date.month_full_hash[s[c]] || 0; + o[1] = e.locale.date.month_full_hash[l[h]] || 0; } - return _ ? new Date(Date.UTC(n[0], n[1], n[2], n[3], n[4], n[5])) : new Date(n[0], n[1], n[2], n[3], n[4], n[5]); + return s ? new Date(Date.UTC(o[0], o[1], o[2], o[3], o[4], o[5])) : new Date(o[0], o[1], o[2], o[3], o[4], o[5]); }; }; let r; function d() { - var i = !1; + var n = !1; return e.config.csp === "auto" ? (r === void 0 && (r = function() { try { new Function("cspEnabled = false;"), r = !1; @@ -552,116 +1114,116 @@ function be(e) { r = !0; } return r; - }()), i = r) : i = e.config.csp, i; + }()), n = r) : n = e.config.csp, n; } e.date = { init: function() { - for (var i = e.locale.date.month_short, _ = e.locale.date.month_short_hash = {}, o = 0; o < i.length; o++) - _[i[o]] = o; - for (i = e.locale.date.month_full, _ = e.locale.date.month_full_hash = {}, o = 0; o < i.length; o++) - _[i[o]] = o; - }, date_part: function(i) { - var _ = new Date(i); - return i.setHours(0), i.setMinutes(0), i.setSeconds(0), i.setMilliseconds(0), i.getHours() && (i.getDate() < _.getDate() || i.getMonth() < _.getMonth() || i.getFullYear() < _.getFullYear()) && i.setTime(i.getTime() + 36e5 * (24 - i.getHours())), i; - }, time_part: function(i) { - return (i.valueOf() / 1e3 - 60 * i.getTimezoneOffset()) % 86400; - }, week_start: function(i) { - var _ = i.getDay(); - return e.config.start_on_monday && (_ === 0 ? _ = 6 : _--), this.date_part(this.add(i, -1 * _, "day")); - }, month_start: function(i) { - return i.setDate(1), this.date_part(i); - }, year_start: function(i) { - return i.setMonth(0), this.month_start(i); - }, day_start: function(i) { - return this.date_part(i); - }, _add_days: function(i, _) { - var o = new Date(i.valueOf()); - if (o.setDate(o.getDate() + _), _ == Math.round(_) && _ > 0) { - var t = (+o - +i) % 864e5; - if (t && i.getTimezoneOffset() == o.getTimezoneOffset()) { - var n = t / 36e5; - o.setTime(o.getTime() + 60 * (24 - n) * 60 * 1e3); - } - } - return _ >= 0 && !i.getHours() && o.getHours() && (o.getDate() < i.getDate() || o.getMonth() < i.getMonth() || o.getFullYear() < i.getFullYear()) && o.setTime(o.getTime() + 36e5 * (24 - o.getHours())), o; - }, add: function(i, _, o) { - var t = new Date(i.valueOf()); - switch (o) { + for (var n = e.locale.date.month_short, s = e.locale.date.month_short_hash = {}, _ = 0; _ < n.length; _++) + s[n[_]] = _; + for (n = e.locale.date.month_full, s = e.locale.date.month_full_hash = {}, _ = 0; _ < n.length; _++) + s[n[_]] = _; + }, date_part: function(n) { + var s = new Date(n); + return n.setHours(0), n.setMinutes(0), n.setSeconds(0), n.setMilliseconds(0), n.getHours() && (n.getDate() < s.getDate() || n.getMonth() < s.getMonth() || n.getFullYear() < s.getFullYear()) && n.setTime(n.getTime() + 36e5 * (24 - n.getHours())), n; + }, time_part: function(n) { + return (n.valueOf() / 1e3 - 60 * n.getTimezoneOffset()) % 86400; + }, week_start: function(n) { + var s = n.getDay(); + return e.config.start_on_monday && (s === 0 ? s = 6 : s--), this.date_part(this.add(n, -1 * s, "day")); + }, month_start: function(n) { + return n.setDate(1), this.date_part(n); + }, year_start: function(n) { + return n.setMonth(0), this.month_start(n); + }, day_start: function(n) { + return this.date_part(n); + }, _add_days: function(n, s) { + var _ = new Date(n.valueOf()); + if (_.setDate(_.getDate() + s), s == Math.round(s) && s > 0) { + var a = (+_ - +n) % 864e5; + if (a && n.getTimezoneOffset() == _.getTimezoneOffset()) { + var o = a / 36e5; + _.setTime(_.getTime() + 60 * (24 - o) * 60 * 1e3); + } + } + return s >= 0 && !n.getHours() && _.getHours() && (_.getDate() < n.getDate() || _.getMonth() < n.getMonth() || _.getFullYear() < n.getFullYear()) && _.setTime(_.getTime() + 36e5 * (24 - _.getHours())), _; + }, add: function(n, s, _) { + var a = new Date(n.valueOf()); + switch (_) { case "day": - t = e.date._add_days(t, _); + a = e.date._add_days(a, s); break; case "week": - t = e.date._add_days(t, 7 * _); + a = e.date._add_days(a, 7 * s); break; case "month": - t.setMonth(t.getMonth() + _); + a.setMonth(a.getMonth() + s); break; case "year": - t.setYear(t.getFullYear() + _); + a.setYear(a.getFullYear() + s); break; case "hour": - t.setTime(t.getTime() + 60 * _ * 60 * 1e3); + a.setTime(a.getTime() + 60 * s * 60 * 1e3); break; case "minute": - t.setTime(t.getTime() + 60 * _ * 1e3); + a.setTime(a.getTime() + 60 * s * 1e3); break; default: - return e.date["add_" + o](i, _, o); + return e.date["add_" + _](n, s, _); } - return t; - }, to_fixed: function(i) { - return i < 10 ? "0" + i : i; - }, copy: function(i) { - return new Date(i.valueOf()); - }, date_to_str: function(i, _) { - return d() ? function(o, t) { - return function(n) { - return o.replace(/%[a-zA-Z]/g, function(s) { - switch (s) { + return a; + }, to_fixed: function(n) { + return n < 10 ? "0" + n : n; + }, copy: function(n) { + return new Date(n.valueOf()); + }, date_to_str: function(n, s) { + return d() ? function(_, a) { + return function(o) { + return _.replace(/%[a-zA-Z]/g, function(l) { + switch (l) { case "%d": - return t ? e.date.to_fixed(n.getUTCDate()) : e.date.to_fixed(n.getDate()); + return a ? e.date.to_fixed(o.getUTCDate()) : e.date.to_fixed(o.getDate()); case "%m": - return t ? e.date.to_fixed(n.getUTCMonth() + 1) : e.date.to_fixed(n.getMonth() + 1); + return a ? e.date.to_fixed(o.getUTCMonth() + 1) : e.date.to_fixed(o.getMonth() + 1); case "%j": - return t ? n.getUTCDate() : n.getDate(); + return a ? o.getUTCDate() : o.getDate(); case "%n": - return t ? n.getUTCMonth() + 1 : n.getMonth() + 1; + return a ? o.getUTCMonth() + 1 : o.getMonth() + 1; case "%y": - return t ? e.date.to_fixed(n.getUTCFullYear() % 100) : e.date.to_fixed(n.getFullYear() % 100); + return a ? e.date.to_fixed(o.getUTCFullYear() % 100) : e.date.to_fixed(o.getFullYear() % 100); case "%Y": - return t ? n.getUTCFullYear() : n.getFullYear(); + return a ? o.getUTCFullYear() : o.getFullYear(); case "%D": - return t ? e.locale.date.day_short[n.getUTCDay()] : e.locale.date.day_short[n.getDay()]; + return a ? e.locale.date.day_short[o.getUTCDay()] : e.locale.date.day_short[o.getDay()]; case "%l": - return t ? e.locale.date.day_full[n.getUTCDay()] : e.locale.date.day_full[n.getDay()]; + return a ? e.locale.date.day_full[o.getUTCDay()] : e.locale.date.day_full[o.getDay()]; case "%M": - return t ? e.locale.date.month_short[n.getUTCMonth()] : e.locale.date.month_short[n.getMonth()]; + return a ? e.locale.date.month_short[o.getUTCMonth()] : e.locale.date.month_short[o.getMonth()]; case "%F": - return t ? e.locale.date.month_full[n.getUTCMonth()] : e.locale.date.month_full[n.getMonth()]; + return a ? e.locale.date.month_full[o.getUTCMonth()] : e.locale.date.month_full[o.getMonth()]; case "%h": - return t ? e.date.to_fixed((n.getUTCHours() + 11) % 12 + 1) : e.date.to_fixed((n.getHours() + 11) % 12 + 1); + return a ? e.date.to_fixed((o.getUTCHours() + 11) % 12 + 1) : e.date.to_fixed((o.getHours() + 11) % 12 + 1); case "%g": - return t ? (n.getUTCHours() + 11) % 12 + 1 : (n.getHours() + 11) % 12 + 1; + return a ? (o.getUTCHours() + 11) % 12 + 1 : (o.getHours() + 11) % 12 + 1; case "%G": - return t ? n.getUTCHours() : n.getHours(); + return a ? o.getUTCHours() : o.getHours(); case "%H": - return t ? e.date.to_fixed(n.getUTCHours()) : e.date.to_fixed(n.getHours()); + return a ? e.date.to_fixed(o.getUTCHours()) : e.date.to_fixed(o.getHours()); case "%i": - return t ? e.date.to_fixed(n.getUTCMinutes()) : e.date.to_fixed(n.getMinutes()); + return a ? e.date.to_fixed(o.getUTCMinutes()) : e.date.to_fixed(o.getMinutes()); case "%a": - return t ? n.getUTCHours() > 11 ? "pm" : "am" : n.getHours() > 11 ? "pm" : "am"; + return a ? o.getUTCHours() > 11 ? "pm" : "am" : o.getHours() > 11 ? "pm" : "am"; case "%A": - return t ? n.getUTCHours() > 11 ? "PM" : "AM" : n.getHours() > 11 ? "PM" : "AM"; + return a ? o.getUTCHours() > 11 ? "PM" : "AM" : o.getHours() > 11 ? "PM" : "AM"; case "%s": - return t ? e.date.to_fixed(n.getUTCSeconds()) : e.date.to_fixed(n.getSeconds()); + return a ? e.date.to_fixed(o.getUTCSeconds()) : e.date.to_fixed(o.getSeconds()); case "%W": - return t ? e.date.to_fixed(e.date.getUTCISOWeek(n)) : e.date.to_fixed(e.date.getISOWeek(n)); + return a ? e.date.to_fixed(e.date.getUTCISOWeek(o)) : e.date.to_fixed(e.date.getISOWeek(o)); default: - return s; + return l; } }); }; - }(i, _) : (i = i.replace(/%[a-zA-Z]/g, function(o) { - switch (o) { + }(n, s) : (n = n.replace(/%[a-zA-Z]/g, function(_) { + switch (_) { case "%d": return '"+this.date.to_fixed(date.getDate())+"'; case "%m": @@ -701,129 +1263,129 @@ function be(e) { case "%W": return '"+this.date.to_fixed(this.date.getISOWeek(date))+"'; default: - return o; - } - }), _ && (i = i.replace(/date\.get/g, "date.getUTC")), new Function("date", 'return "' + i + '";').bind(e)); - }, str_to_date: function(i, _, o) { - var t = d() ? a : h, n = t(i, _), s = /^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/, c = /^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/, u = /^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/, v = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/, m = t("%Y-%m-%d %H:%i:%s", _), l = t("%m/%d/%Y %H:%i:%s", _), f = t("%d-%m-%Y %H:%i:%s", _); - return function(g) { - if (!o && !e.config.parse_exact_format) { - if (g && g.getISOWeek) - return new Date(g); - if (typeof g == "number") - return new Date(g); - if (p = g, s.test(String(p))) - return m(g); + return _; + } + }), s && (n = n.replace(/date\.get/g, "date.getUTC")), new Function("date", 'return "' + n + '";').bind(e)); + }, str_to_date: function(n, s, _) { + var a = d() ? t : i, o = a(n, s), l = /^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/, h = /^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/, v = /^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/, u = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/, f = a("%Y-%m-%d %H:%i:%s", s), c = a("%m/%d/%Y %H:%i:%s", s), p = a("%d-%m-%Y %H:%i:%s", s); + return function(m) { + if (!_ && !e.config.parse_exact_format) { + if (m && m.getISOWeek) + return new Date(m); + if (typeof m == "number") + return new Date(m); + if (g = m, l.test(String(g))) + return f(m); if (function(y) { - return c.test(String(y)); - }(g)) - return l(g); + return h.test(String(y)); + }(m)) + return c(m); if (function(y) { - return u.test(String(y)); - }(g)) - return f(g); + return v.test(String(y)); + }(m)) + return p(m); if (function(y) { - return v.test(y); - }(g)) - return new Date(g); + return u.test(y); + }(m)) + return new Date(m); } - var p; - return n.call(e, g); + var g; + return o.call(e, m); }; - }, getISOWeek: function(i) { - if (!i) + }, getISOWeek: function(n) { + if (!n) return !1; - var _ = (i = this.date_part(new Date(i))).getDay(); - _ === 0 && (_ = 7); - var o = new Date(i.valueOf()); - o.setDate(i.getDate() + (4 - _)); - var t = o.getFullYear(), n = Math.round((o.getTime() - new Date(t, 0, 1).getTime()) / 864e5); - return 1 + Math.floor(n / 7); - }, getUTCISOWeek: function(i) { - return this.getISOWeek(this.convert_to_utc(i)); - }, convert_to_utc: function(i) { - return new Date(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate(), i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds()); + var s = (n = this.date_part(new Date(n))).getDay(); + s === 0 && (s = 7); + var _ = new Date(n.valueOf()); + _.setDate(n.getDate() + (4 - s)); + var a = _.getFullYear(), o = Math.round((_.getTime() - new Date(a, 0, 1).getTime()) / 864e5); + return 1 + Math.floor(o / 7); + }, getUTCISOWeek: function(n) { + return this.getISOWeek(this.convert_to_utc(n)); + }, convert_to_utc: function(n) { + return new Date(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds()); } }; } -function oe(e) { +function mt(e) { return (function() { - var h = {}; - for (var a in this._events) { - var r = this._events[a]; - r.id.toString().indexOf("#") == -1 && (h[r.id] = r); + var i = {}; + for (var t in this._events) { + var r = this._events[t]; + r.id.toString().indexOf("#") == -1 && (i[r.id] = r); } - return h; + return i; }).bind(e); } -function xe(e) { - e._loaded = {}, e._load = function(a, r) { - if (a = a || this._load_url) { +function Vt(e) { + e._loaded = {}, e._load = function(t, r) { + if (t = t || this._load_url) { var d; - if (a += (a.indexOf("?") == -1 ? "?" : "&") + "timeshift=" + (/* @__PURE__ */ new Date()).getTimezoneOffset(), this.config.prevent_cache && (a += "&uid=" + this.uid()), r = r || this._date, this._load_mode) { - var i = this.templates.load_format; + if (t += (t.indexOf("?") == -1 ? "?" : "&") + "timeshift=" + (/* @__PURE__ */ new Date()).getTimezoneOffset(), this.config.prevent_cache && (t += "&uid=" + this.uid()), r = r || this._date, this._load_mode) { + var n = this.templates.load_format; for (r = this.date[this._load_mode + "_start"](new Date(r.valueOf())); r > this._min_date; ) r = this.date.add(r, -1, this._load_mode); d = r; - for (var _ = !0; d < this._max_date; ) - d = this.date.add(d, 1, this._load_mode), this._loaded[i(r)] && _ ? r = this.date.add(r, 1, this._load_mode) : _ = !1; - var o = d; + for (var s = !0; d < this._max_date; ) + d = this.date.add(d, 1, this._load_mode), this._loaded[n(r)] && s ? r = this.date.add(r, 1, this._load_mode) : s = !1; + var _ = d; do - d = o, o = this.date.add(d, -1, this._load_mode); - while (o > r && this._loaded[i(o)]); + d = _, _ = this.date.add(d, -1, this._load_mode); + while (_ > r && this._loaded[n(_)]); if (d <= r) return !1; - for (e.ajax.get(a + "&from=" + i(r) + "&to=" + i(d), t); r < d; ) - this._loaded[i(r)] = !0, r = this.date.add(r, 1, this._load_mode); + for (e.ajax.get(t + "&from=" + n(r) + "&to=" + n(d), a); r < d; ) + this._loaded[n(r)] = !0, r = this.date.add(r, 1, this._load_mode); } else - e.ajax.get(a, t); + e.ajax.get(t, a); return this.callEvent("onXLS", []), this.callEvent("onLoadStart", []), !0; } - function t(n) { - e.on_load(n), e.callEvent("onLoadEnd", []); + function a(o) { + e.on_load(o), e.callEvent("onLoadEnd", []); } - }, e._parsers = {}, function(a) { - a._parsers.xml = { canParse: function(r, d) { + }, e._parsers = {}, function(t) { + t._parsers.xml = { canParse: function(r, d) { if (d.responseXML && d.responseXML.firstChild) return !0; try { - var i = a.ajax.parse(d.responseText), _ = a.ajax.xmltop("data", i); - if (_ && _.tagName === "data") + var n = t.ajax.parse(d.responseText), s = t.ajax.xmltop("data", n); + if (s && s.tagName === "data") return !0; } catch { } return !1; }, parse: function(r) { var d; - if (r.xmlDoc.responseXML || (r.xmlDoc.responseXML = a.ajax.parse(r.xmlDoc.responseText)), (d = a.ajax.xmltop("data", r.xmlDoc)).tagName != "data") + if (r.xmlDoc.responseXML || (r.xmlDoc.responseXML = t.ajax.parse(r.xmlDoc.responseText)), (d = t.ajax.xmltop("data", r.xmlDoc)).tagName != "data") return null; - var i = d.getAttribute("dhx_security"); - i && (window.dhtmlx && (window.dhtmlx.security_key = i), a.security_key = i); - for (var _ = a.ajax.xpath("//coll_options", r.xmlDoc), o = 0; o < _.length; o++) { - var t = _[o].getAttribute("for"), n = a.serverList[t]; - n || (a.serverList[t] = n = []), n.splice(0, n.length); - for (var s = a.ajax.xpath(".//item", _[o]), c = 0; c < s.length; c++) { - for (var u = s[c].attributes, v = { key: s[c].getAttribute("value"), label: s[c].getAttribute("label") }, m = 0; m < u.length; m++) { - var l = u[m]; - l.nodeName != "value" && l.nodeName != "label" && (v[l.nodeName] = l.nodeValue); + var n = d.getAttribute("dhx_security"); + n && (window.dhtmlx && (window.dhtmlx.security_key = n), t.security_key = n); + for (var s = t.ajax.xpath("//coll_options", r.xmlDoc), _ = 0; _ < s.length; _++) { + var a = s[_].getAttribute("for"), o = t.serverList[a]; + o || (t.serverList[a] = o = []), o.splice(0, o.length); + for (var l = t.ajax.xpath(".//item", s[_]), h = 0; h < l.length; h++) { + for (var v = l[h].attributes, u = { key: l[h].getAttribute("value"), label: l[h].getAttribute("label") }, f = 0; f < v.length; f++) { + var c = v[f]; + c.nodeName != "value" && c.nodeName != "label" && (u[c.nodeName] = c.nodeValue); } - n.push(v); + o.push(u); } } - _.length && a.callEvent("onOptionsLoad", []); - var f = a.ajax.xpath("//userdata", r.xmlDoc); - for (o = 0; o < f.length; o++) { - var g = a._xmlNodeToJSON(f[o]); - a._userdata[g.name] = g.text; + s.length && t.callEvent("onOptionsLoad", []); + var p = t.ajax.xpath("//userdata", r.xmlDoc); + for (_ = 0; _ < p.length; _++) { + var m = t._xmlNodeToJSON(p[_]); + t._userdata[m.name] = m.text; } - var p = []; - for (d = a.ajax.xpath("//event", r.xmlDoc), o = 0; o < d.length; o++) { - var y = p[o] = a._xmlNodeToJSON(d[o]); - a._init_event(y); + var g = []; + for (d = t.ajax.xpath("//event", r.xmlDoc), _ = 0; _ < d.length; _++) { + var y = g[_] = t._xmlNodeToJSON(d[_]); + t._init_event(y); } - return p; + return g; } }; - }(e), function(a) { - a.json = a._parsers.json = { canParse: function(r) { + }(e), function(t) { + t.json = t._parsers.json = { canParse: function(r) { if (r && typeof r == "object") return !0; if (typeof r == "string") @@ -836,529 +1398,529 @@ function xe(e) { return !1; }, parse: function(r) { var d = []; - typeof r == "string" && (r = JSON.parse(r)), Object.prototype.toString.call(r) === "[object Array]" ? d = r : r && (r.events ? d = r.events : r.data && (d = r.data)), d = d || [], r.dhx_security && (window.dhtmlx && (window.dhtmlx.security_key = r.dhx_security), a.security_key = r.dhx_security); - var i = r && r.collections ? r.collections : {}, _ = !1; - for (var o in i) - if (i.hasOwnProperty(o)) { - _ = !0; - var t = i[o], n = a.serverList[o]; - n || (a.serverList[o] = n = []), n.splice(0, n.length); - for (var s = 0; s < t.length; s++) { - var c = t[s], u = { key: c.value, label: c.label }; - for (var v in c) - if (c.hasOwnProperty(v)) { - if (v == "value" || v == "label") + typeof r == "string" && (r = JSON.parse(r)), Object.prototype.toString.call(r) === "[object Array]" ? d = r : r && (r.events ? d = r.events : r.data && (d = r.data)), d = d || [], r.dhx_security && (window.dhtmlx && (window.dhtmlx.security_key = r.dhx_security), t.security_key = r.dhx_security); + var n = r && r.collections ? r.collections : {}, s = !1; + for (var _ in n) + if (n.hasOwnProperty(_)) { + s = !0; + var a = n[_], o = t.serverList[_]; + o || (t.serverList[_] = o = []), o.splice(0, o.length); + for (var l = 0; l < a.length; l++) { + var h = a[l], v = { key: h.value, label: h.label }; + for (var u in h) + if (h.hasOwnProperty(u)) { + if (u == "value" || u == "label") continue; - u[v] = c[v]; + v[u] = h[u]; } - n.push(u); + o.push(v); } } - _ && a.callEvent("onOptionsLoad", []); - for (var m = [], l = 0; l < d.length; l++) { - var f = d[l]; - a._init_event(f), m.push(f); + s && t.callEvent("onOptionsLoad", []); + for (var f = [], c = 0; c < d.length; c++) { + var p = d[c]; + t._init_event(p), f.push(p); } - return m; + return f; } }; - }(e), function(a) { - a.ical = a._parsers.ical = { canParse: function(r) { + }(e), function(t) { + t.ical = t._parsers.ical = { canParse: function(r) { return typeof r == "string" && new RegExp("^BEGIN:VCALENDAR").test(r); }, parse: function(r) { var d = r.match(RegExp(this.c_start + "[^\f]*" + this.c_end, "")); if (d.length) { d[0] = d[0].replace(/[\r\n]+ /g, ""), d[0] = d[0].replace(/[\r\n]+(?=[a-z \t])/g, " "), d[0] = d[0].replace(/;[^:\r\n]*:/g, ":"); - for (var i, _ = [], o = RegExp("(?:" + this.e_start + ")([^\f]*?)(?:" + this.e_end + ")", "g"); (i = o.exec(d)) !== null; ) { - for (var t, n = {}, s = /[^\r\n]+[\r\n]+/g; (t = s.exec(i[1])) !== null; ) - this.parse_param(t.toString(), n); - n.uid && !n.id && (n.id = n.uid), _.push(n); + for (var n, s = [], _ = RegExp("(?:" + this.e_start + ")([^\f]*?)(?:" + this.e_end + ")", "g"); (n = _.exec(d)) !== null; ) { + for (var a, o = {}, l = /[^\r\n]+[\r\n]+/g; (a = l.exec(n[1])) !== null; ) + this.parse_param(a.toString(), o); + o.uid && !o.id && (o.id = o.uid), s.push(o); } - return _; + return s; } }, parse_param: function(r, d) { - var i = r.indexOf(":"); - if (i != -1) { - var _ = r.substr(0, i).toLowerCase(), o = r.substr(i + 1).replace(/\\,/g, ",").replace(/[\r\n]+$/, ""); - _ == "summary" ? _ = "text" : _ == "dtstart" ? (_ = "start_date", o = this.parse_date(o, 0, 0)) : _ == "dtend" && (_ = "end_date", o = this.parse_date(o, 0, 0)), d[_] = o; - } - }, parse_date: function(r, d, i) { - var _ = r.split("T"), o = !1; - _[1] && (d = _[1].substr(0, 2), i = _[1].substr(2, 2), o = _[1][6] == "Z"); - var t = _[0].substr(0, 4), n = parseInt(_[0].substr(4, 2), 10) - 1, s = _[0].substr(6, 2); - return a.config.server_utc || o ? new Date(Date.UTC(t, n, s, d, i)) : new Date(t, n, s, d, i); + var n = r.indexOf(":"); + if (n != -1) { + var s = r.substr(0, n).toLowerCase(), _ = r.substr(n + 1).replace(/\\,/g, ",").replace(/[\r\n]+$/, ""); + s == "summary" ? s = "text" : s == "dtstart" ? (s = "start_date", _ = this.parse_date(_, 0, 0)) : s == "dtend" && (s = "end_date", _ = this.parse_date(_, 0, 0)), d[s] = _; + } + }, parse_date: function(r, d, n) { + var s = r.split("T"), _ = !1; + s[1] && (d = s[1].substr(0, 2), n = s[1].substr(2, 2), _ = s[1][6] == "Z"); + var a = s[0].substr(0, 4), o = parseInt(s[0].substr(4, 2), 10) - 1, l = s[0].substr(6, 2); + return t.config.server_utc || _ ? new Date(Date.UTC(a, o, l, d, n)) : new Date(a, o, l, d, n); }, c_start: "BEGIN:VCALENDAR", e_start: "BEGIN:VEVENT", e_end: "END:VEVENT", c_end: "END:VCALENDAR" }; - }(e), e.on_load = function(a) { + }(e), e.on_load = function(t) { var r; this.callEvent("onBeforeParse", []); - var d = !1, i = !1; - for (var _ in this._parsers) { - var o = this._parsers[_]; - if (o.canParse(a.xmlDoc.responseText, a.xmlDoc)) { + var d = !1, n = !1; + for (var s in this._parsers) { + var _ = this._parsers[s]; + if (_.canParse(t.xmlDoc.responseText, t.xmlDoc)) { try { - var t = a.xmlDoc.responseText; - _ === "xml" && (t = a), (r = o.parse(t)) || (d = !0); + var a = t.xmlDoc.responseText; + s === "xml" && (a = t), (r = _.parse(a)) || (d = !0); } catch { d = !0; } - i = !0; + n = !0; break; } } - if (!i) + if (!n) if (this._process && this[this._process]) try { - r = this[this._process].parse(a.xmlDoc.responseText); + r = this[this._process].parse(t.xmlDoc.responseText); } catch { d = !0; } else d = !0; - (d || a.xmlDoc.status && a.xmlDoc.status >= 400) && (this.callEvent("onLoadError", [a.xmlDoc]), r = []), this._process_loading(r), this.callEvent("onXLE", []), this.callEvent("onParse", []); - }, e._process_loading = function(a) { + (d || t.xmlDoc.status && t.xmlDoc.status >= 400) && (this.callEvent("onLoadError", [t.xmlDoc]), r = []), this._process_loading(r), this.callEvent("onXLE", []), this.callEvent("onParse", []); + }, e._process_loading = function(t) { this._loading = !0, this._not_render = !0; - for (var r = 0; r < a.length; r++) - this.callEvent("onEventLoading", [a[r]]) && this.addEvent(a[r]); + for (var r = 0; r < t.length; r++) + this.callEvent("onEventLoading", [t[r]]) && this.addEvent(t[r]); this._not_render = !1, this._render_wait && this.render_view_data(), this._loading = !1, this._after_call && this._after_call(), this._after_call = null; - }, e._init_event = function(a) { - a.text = a.text || a._tagvalue || "", a.start_date = e._init_date(a.start_date), a.end_date = e._init_date(a.end_date); - }, e._init_date = function(a) { - return a ? typeof a == "string" ? e._helpers.parseDate(a) : new Date(a) : null; + }, e._init_event = function(t) { + t.text = t.text || t._tagvalue || "", t.start_date = e._init_date(t.start_date), t.end_date = e._init_date(t.end_date); + }, e._init_date = function(t) { + return t ? typeof t == "string" ? e._helpers.parseDate(t) : new Date(t) : null; }; - const h = oe(e); + const i = mt(e); e.serialize = function() { - const a = [], r = h(); + const t = [], r = i(); for (var d in r) { - const o = {}; - var i = r[d]; - for (var _ in i) { - if (_.charAt(0) == "$" || _.charAt(0) == "_") + const _ = {}; + var n = r[d]; + for (var s in n) { + if (s.charAt(0) == "$" || s.charAt(0) == "_") continue; - let t; - const n = i[_]; - t = e.utils.isDate(n) ? e.defined(e.templates.xml_format) ? e.templates.xml_format(n) : e.templates.format_date(n) : n, o[_] = t; + let a; + const o = n[s]; + a = e.utils.isDate(o) ? e.defined(e.templates.xml_format) ? e.templates.xml_format(o) : e.templates.format_date(o) : o, _[s] = a; } - a.push(o); + t.push(_); } - return a; - }, e.parse = function(a, r) { - this._process = r, this.on_load({ xmlDoc: { responseText: a } }); - }, e.load = function(a, r) { - typeof r == "string" && (this._process = r, r = arguments[2]), this._load_url = a, this._after_call = r, this._load(a, this._date); - }, e.setLoadMode = function(a) { - a == "all" && (a = ""), this._load_mode = a; - }, e.serverList = function(a, r) { - return r ? (this.serverList[a] = r.slice(0), this.serverList[a]) : (this.serverList[a] = this.serverList[a] || [], this.serverList[a]); - }, e._userdata = {}, e._xmlNodeToJSON = function(a) { - for (var r = {}, d = 0; d < a.attributes.length; d++) - r[a.attributes[d].name] = a.attributes[d].value; - for (d = 0; d < a.childNodes.length; d++) { - var i = a.childNodes[d]; - i.nodeType == 1 && (r[i.tagName] = i.firstChild ? i.firstChild.nodeValue : ""); - } - return r.text || (r.text = a.firstChild ? a.firstChild.nodeValue : ""), r; + return t; + }, e.parse = function(t, r) { + this._process = r, this.on_load({ xmlDoc: { responseText: t } }); + }, e.load = function(t, r) { + typeof r == "string" && (this._process = r, r = arguments[2]), this._load_url = t, this._after_call = r, this._load(t, this._date); + }, e.setLoadMode = function(t) { + t == "all" && (t = ""), this._load_mode = t; + }, e.serverList = function(t, r) { + return r ? (this.serverList[t] = r.slice(0), this.serverList[t]) : (this.serverList[t] = this.serverList[t] || [], this.serverList[t]); + }, e._userdata = {}, e._xmlNodeToJSON = function(t) { + for (var r = {}, d = 0; d < t.attributes.length; d++) + r[t.attributes[d].name] = t.attributes[d].value; + for (d = 0; d < t.childNodes.length; d++) { + var n = t.childNodes[d]; + n.nodeType == 1 && (r[n.tagName] = n.firstChild ? n.firstChild.nodeValue : ""); + } + return r.text || (r.text = t.firstChild ? t.firstChild.nodeValue : ""), r; }, e.attachEvent("onXLS", function() { - var a; - this.config.show_loading === !0 && ((a = this.config.show_loading = document.createElement("div")).className = "dhx_loading", a.style.left = Math.round((this._x - 128) / 2) + "px", a.style.top = Math.round((this._y - 15) / 2) + "px", this._obj.appendChild(a)); + var t; + this.config.show_loading === !0 && ((t = this.config.show_loading = document.createElement("div")).className = "dhx_loading", t.style.left = Math.round((this._x - 128) / 2) + "px", t.style.top = Math.round((this._y - 15) / 2) + "px", this._obj.appendChild(t)); }), e.attachEvent("onXLE", function() { - var a = this.config.show_loading; - a && typeof a == "object" && (a.parentNode && a.parentNode.removeChild(a), this.config.show_loading = !0); + var t = this.config.show_loading; + t && typeof t == "object" && (t.parentNode && t.parentNode.removeChild(t), this.config.show_loading = !0); }); } -function we(e) { +function Bt(e) { e._init_touch_events = function() { if ((this.config.touch && (navigator.userAgent.indexOf("Mobile") != -1 || navigator.userAgent.indexOf("iPad") != -1 || navigator.userAgent.indexOf("Android") != -1 || navigator.userAgent.indexOf("Touch") != -1) && !window.MSStream || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && (this.xy.scroll_width = 0, this._mobile = !0), this.config.touch) { - var h = !0; + var i = !0; try { document.createEvent("TouchEvent"); } catch { - h = !1; + i = !1; } - h ? this._touch_events(["touchmove", "touchstart", "touchend"], function(a) { - return a.touches && a.touches.length > 1 ? null : a.touches[0] ? { target: a.target, pageX: a.touches[0].pageX, pageY: a.touches[0].pageY, clientX: a.touches[0].clientX, clientY: a.touches[0].clientY } : a; + i ? this._touch_events(["touchmove", "touchstart", "touchend"], function(t) { + return t.touches && t.touches.length > 1 ? null : t.touches[0] ? { target: t.target, pageX: t.touches[0].pageX, pageY: t.touches[0].pageY, clientX: t.touches[0].clientX, clientY: t.touches[0].clientY } : t; }, function() { return !1; - }) : window.PointerEvent || window.navigator.pointerEnabled ? this._touch_events(["pointermove", "pointerdown", "pointerup"], function(a) { - return a.pointerType == "mouse" ? null : a; - }, function(a) { - return !a || a.pointerType == "mouse"; - }) : window.navigator.msPointerEnabled && this._touch_events(["MSPointerMove", "MSPointerDown", "MSPointerUp"], function(a) { - return a.pointerType == a.MSPOINTER_TYPE_MOUSE ? null : a; - }, function(a) { - return !a || a.pointerType == a.MSPOINTER_TYPE_MOUSE; + }) : window.PointerEvent || window.navigator.pointerEnabled ? this._touch_events(["pointermove", "pointerdown", "pointerup"], function(t) { + return t.pointerType == "mouse" ? null : t; + }, function(t) { + return !t || t.pointerType == "mouse"; + }) : window.navigator.msPointerEnabled && this._touch_events(["MSPointerMove", "MSPointerDown", "MSPointerUp"], function(t) { + return t.pointerType == t.MSPOINTER_TYPE_MOUSE ? null : t; + }, function(t) { + return !t || t.pointerType == t.MSPOINTER_TYPE_MOUSE; }); } - }, e._touch_events = function(h, a, r) { - var d, i, _, o, t, n, s = 0; - function c(v, m, l) { - e.event(v, m, function(f) { - return !!e._is_lightbox_open() || (r(f) ? void 0 : l(f)); + }, e._touch_events = function(i, t, r) { + var d, n, s, _, a, o, l = 0; + function h(u, f, c) { + e.event(u, f, function(p) { + return !!e._is_lightbox_open() || (r(p) ? void 0 : c(p)); }, { passive: !1 }); } - function u(v) { - r(v) || (e._hide_global_tip(), o && (e._on_mouse_up(a(v)), e._temp_touch_block = !1), e._drag_id = null, e._drag_mode = null, e._drag_pos = null, e._pointerDragId = null, clearTimeout(_), o = n = !1, t = !0); - } - c(document.body, h[0], function(v) { - if (!r(v)) { - var m = a(v); - if (m) { - if (o) - return function(l) { - if (!r(l)) { - var f = e.getState().drag_mode, g = !!e.matrix && e.matrix[e._mode], p = e.render_view_data; - f == "create" && g && (e.render_view_data = function() { - for (var y = e.getState().drag_id, w = e.getEvent(y), b = g.y_property, k = e.getEvents(w.start_date, w.end_date), E = 0; E < k.length; E++) - k[E][b] != w[b] && (k.splice(E, 1), E--); - w._sorder = k.length - 1, w._count = k.length, this.render_data([w], e.getState().mode); - }), e._on_mouse_move(l), f == "create" && g && (e.render_view_data = p), l.preventDefault && l.preventDefault(), l.cancelBubble = !0; + function v(u) { + r(u) || (e._hide_global_tip(), _ && (e._on_mouse_up(t(u)), e._temp_touch_block = !1), e._drag_id = null, e._drag_mode = null, e._drag_pos = null, e._pointerDragId = null, clearTimeout(s), _ = o = !1, a = !0); + } + h(document.body, i[0], function(u) { + if (!r(u)) { + var f = t(u); + if (f) { + if (_) + return function(c) { + if (!r(c)) { + var p = e.getState().drag_mode, m = !!e.matrix && e.matrix[e._mode], g = e.render_view_data; + p == "create" && m && (e.render_view_data = function() { + for (var y = e.getState().drag_id, x = e.getEvent(y), b = m.y_property, k = e.getEvents(x.start_date, x.end_date), E = 0; E < k.length; E++) + k[E][b] != x[b] && (k.splice(E, 1), E--); + x._sorder = k.length - 1, x._count = k.length, this.render_data([x], e.getState().mode); + }), e._on_mouse_move(c), p == "create" && m && (e.render_view_data = g), c.preventDefault && c.preventDefault(), c.cancelBubble = !0; } - }(m), v.preventDefault && v.preventDefault(), v.cancelBubble = !0, e._update_global_tip(), !1; - i = a(v), n && (i ? (d.target != i.target || Math.abs(d.pageX - i.pageX) > 5 || Math.abs(d.pageY - i.pageY) > 5) && (t = !0, clearTimeout(_)) : t = !0); + }(f), u.preventDefault && u.preventDefault(), u.cancelBubble = !0, e._update_global_tip(), !1; + n = t(u), o && (n ? (d.target != n.target || Math.abs(d.pageX - n.pageX) > 5 || Math.abs(d.pageY - n.pageY) > 5) && (a = !0, clearTimeout(s)) : a = !0); } } - }), c(this._els.dhx_cal_data[0], "touchcancel", u), c(this._els.dhx_cal_data[0], "contextmenu", function(v) { - if (!r(v)) - return n ? (v && v.preventDefault && v.preventDefault(), v.cancelBubble = !0, !1) : void 0; - }), c(this._obj, h[1], function(v) { - var m; - if (document && document.body && document.body.classList.add("dhx_cal_touch_active"), !r(v)) - if (e._pointerDragId = v.pointerId, o = t = !1, n = !0, m = i = a(v)) { - var l = /* @__PURE__ */ new Date(); - if (!t && !o && l - s < 250) - return e._click.dhx_cal_data(m), window.setTimeout(function() { - e.$destroyed || e._on_dbl_click(m); - }, 50), v.preventDefault && v.preventDefault(), v.cancelBubble = !0, e._block_next_stop = !0, !1; - if (s = l, !t && !o && e.config.touch_drag) { - var f = e._locate_event(document.activeElement), g = e._locate_event(m.target), p = d ? e._locate_event(d.target) : null; - if (f && g && f == g && f != p) - return v.preventDefault && v.preventDefault(), v.cancelBubble = !0, e._ignore_next_click = !1, e._click.dhx_cal_data(m), d = m, !1; - _ = setTimeout(function() { + }), h(this._els.dhx_cal_data[0], "touchcancel", v), h(this._els.dhx_cal_data[0], "contextmenu", function(u) { + if (!r(u)) + return o ? (u && u.preventDefault && u.preventDefault(), u.cancelBubble = !0, !1) : void 0; + }), h(this._obj, i[1], function(u) { + var f; + if (document && document.body && document.body.classList.add("dhx_cal_touch_active"), !r(u)) + if (e._pointerDragId = u.pointerId, _ = a = !1, o = !0, f = n = t(u)) { + var c = /* @__PURE__ */ new Date(); + if (!a && !_ && c - l < 250) + return e._click.dhx_cal_data(f), window.setTimeout(function() { + e.$destroyed || e._on_dbl_click(f); + }, 50), u.preventDefault && u.preventDefault(), u.cancelBubble = !0, e._block_next_stop = !0, !1; + if (l = c, !a && !_ && e.config.touch_drag) { + var p = e._locate_event(document.activeElement), m = e._locate_event(f.target), g = d ? e._locate_event(d.target) : null; + if (p && m && p == m && p != g) + return u.preventDefault && u.preventDefault(), u.cancelBubble = !0, e._ignore_next_click = !1, e._click.dhx_cal_data(f), d = f, !1; + s = setTimeout(function() { if (!e.$destroyed) { - o = !0; - var y = d.target, w = e._getClassName(y); - y && w.indexOf("dhx_body") != -1 && (y = y.previousSibling), e._on_mouse_down(d, y), e._drag_mode && e._drag_mode != "create" && e.for_rendered(e._drag_id, function(b, k) { + _ = !0; + var y = d.target, x = e._getClassName(y); + y && x.indexOf("dhx_body") != -1 && (y = y.previousSibling), e._on_mouse_down(d, y), e._drag_mode && e._drag_mode != "create" && e.for_rendered(e._drag_id, function(b, k) { b.style.display = "none", e._rendered.splice(k, 1); }), e.config.touch_tip && e._show_global_tip(), e.updateEvent(e._drag_id); } - }, e.config.touch_drag), d = m; + }, e.config.touch_drag), d = f; } } else - t = !0; - }), c(this._els.dhx_cal_data[0], h[2], function(v) { - if (document && document.body && document.body.classList.remove("dhx_cal_touch_active"), !r(v)) - return e.config.touch_swipe_dates && !o && function(m, l, f, g) { - if (!m || !l) + a = !0; + }), h(this._els.dhx_cal_data[0], i[2], function(u) { + if (document && document.body && document.body.classList.remove("dhx_cal_touch_active"), !r(u)) + return e.config.touch_swipe_dates && !_ && function(f, c, p, m) { + if (!f || !c) return !1; - for (var p = m.target; p && p != e._obj; ) - p = p.parentNode; - if (p != e._obj || e.matrix && e.matrix[e.getState().mode] && e.matrix[e.getState().mode].scrollable) + for (var g = f.target; g && g != e._obj; ) + g = g.parentNode; + if (g != e._obj || e.matrix && e.matrix[e.getState().mode] && e.matrix[e.getState().mode].scrollable) return !1; - var y = Math.abs(m.pageY - l.pageY), w = Math.abs(m.pageX - l.pageX); - return y < g && w > f && (!y || w / y > 3) && (m.pageX > l.pageX ? e._click.dhx_cal_next_button() : e._click.dhx_cal_prev_button(), !0); - }(d, i, 200, 100) && (e._block_next_stop = !0), o && (e._ignore_next_click = !0, setTimeout(function() { + var y = Math.abs(f.pageY - c.pageY), x = Math.abs(f.pageX - c.pageX); + return y < m && x > p && (!y || x / y > 3) && (f.pageX > c.pageX ? e._click.dhx_cal_next_button() : e._click.dhx_cal_prev_button(), !0); + }(d, n, 200, 100) && (e._block_next_stop = !0), _ && (e._ignore_next_click = !0, setTimeout(function() { e._ignore_next_click = !1; - }, 100)), u(v), e._block_next_stop ? (e._block_next_stop = !1, v.preventDefault && v.preventDefault(), v.cancelBubble = !0, !1) : void 0; - }), e.event(document.body, h[2], u); + }, 100)), v(u), e._block_next_stop ? (e._block_next_stop = !1, u.preventDefault && u.preventDefault(), u.cancelBubble = !0, !1) : void 0; + }), e.event(document.body, i[2], v); }, e._show_global_tip = function() { e._hide_global_tip(); - var h = e._global_tip = document.createElement("div"); - h.className = "dhx_global_tip", e._update_global_tip(1), document.body.appendChild(h); - }, e._update_global_tip = function(h) { - var a = e._global_tip; - if (a) { + var i = e._global_tip = document.createElement("div"); + i.className = "dhx_global_tip", e._update_global_tip(1), document.body.appendChild(i); + }, e._update_global_tip = function(i) { + var t = e._global_tip; + if (t) { var r = ""; - if (e._drag_id && !h) { + if (e._drag_id && !i) { var d = e.getEvent(e._drag_id); d && (r = "
" + (d._timed ? e.templates.event_header(d.start_date, d.end_date, d) : e.templates.day_date(d.start_date, d.end_date, d)) + "
"); } - e._drag_mode == "create" || e._drag_mode == "new-size" ? a.innerHTML = (e.locale.labels.drag_to_create || "Drag to create") + r : a.innerHTML = (e.locale.labels.drag_to_move || "Drag to move") + r; + e._drag_mode == "create" || e._drag_mode == "new-size" ? t.innerHTML = (e.locale.labels.drag_to_create || "Drag to create") + r : t.innerHTML = (e.locale.labels.drag_to_move || "Drag to move") + r; } }, e._hide_global_tip = function() { - var h = e._global_tip; - h && h.parentNode && (h.parentNode.removeChild(h), e._global_tip = 0); + var i = e._global_tip; + i && i.parentNode && (i.parentNode.removeChild(i), e._global_tip = 0); }; } -function ke(e) { - var h, a; +function Ft(e) { + var i, t; function r() { if (e._is_material_skin()) return !0; - if (a !== void 0) - return a; - var o = document.createElement("div"); - o.style.position = "absolute", o.style.left = "-9999px", o.style.top = "-9999px", o.innerHTML = "
", document.body.appendChild(o); - var t = window.getComputedStyle(o.querySelector(".dhx_body")).getPropertyValue("box-sizing"); - document.body.removeChild(o), (a = t === "border-box") || setTimeout(function() { - a = void 0; + if (t !== void 0) + return t; + var _ = document.createElement("div"); + _.style.position = "absolute", _.style.left = "-9999px", _.style.top = "-9999px", _.innerHTML = "
", document.body.appendChild(_); + var a = window.getComputedStyle(_.querySelector(".dhx_body")).getPropertyValue("box-sizing"); + document.body.removeChild(_), (t = a === "border-box") || setTimeout(function() { + t = void 0; }, 1e3); } function d() { if (!e._is_material_skin() && !e._border_box_events()) { - var o = a; - a = void 0, h = void 0, o !== r() && e.$container && e.getState().mode && e.setCurrentView(); + var _ = t; + t = void 0, i = void 0, _ !== r() && e.$container && e.getState().mode && e.setCurrentView(); } } - function i(o) { - var t = o.getMinutes(); - return t = t < 10 ? "0" + t : t, "" + o.getHours() + " " + t + ""; + function n(_) { + var a = _.getMinutes(); + return a = a < 10 ? "0" + a : a, "" + _.getHours() + " " + a + ""; } e._addThemeClass = function() { document.documentElement.setAttribute("data-scheduler-theme", e.skin); }, e._skin_settings = { fix_tab_position: [1, 0], use_select_menu_space: [1, 0], wide_form: [1, 0], hour_size_px: [44, 42], displayed_event_color: ["#ff4a4a", "ffc5ab"], displayed_event_text_color: ["#ffef80", "7e2727"] }, e._skin_xy = { lightbox_additional_height: [90, 50], nav_height: [59, 22], bar_height: [24, 20] }, e._is_material_skin = function() { return e.skin ? (e.skin + "").indexOf("material") > -1 : function() { - if (h === void 0) { - var o = document.createElement("div"); - o.style.position = "absolute", o.style.left = "-9999px", o.style.top = "-9999px", o.innerHTML = "
", document.body.appendChild(o); - var t = window.getComputedStyle(o.querySelector(".dhx_cal_scale_placeholder")).getPropertyValue("position"); - h = t === "absolute", setTimeout(function() { - h = null, o && o.parentNode && o.parentNode.removeChild(o); + if (i === void 0) { + var _ = document.createElement("div"); + _.style.position = "absolute", _.style.left = "-9999px", _.style.top = "-9999px", _.innerHTML = "
", document.body.appendChild(_); + var a = window.getComputedStyle(_.querySelector(".dhx_cal_scale_placeholder")).getPropertyValue("position"); + i = a === "absolute", setTimeout(function() { + i = null, _ && _.parentNode && _.parentNode.removeChild(_); }, 500); } - return h; + return i; }(); }, e._build_skin_info = function() { (function() { - const v = e.$container; - clearInterval(_), v && (_ = setInterval(() => { - const m = getComputedStyle(v).getPropertyValue("--dhx-scheduler-theme"); - m && m !== e.skin && e.setSkin(m); + const u = e.$container; + clearInterval(s), u && (s = setInterval(() => { + const f = getComputedStyle(u).getPropertyValue("--dhx-scheduler-theme"); + f && f !== e.skin && e.setSkin(f); }, 100)); })(); - const o = getComputedStyle(this.$container), t = o.getPropertyValue("--dhx-scheduler-theme"); - let n, s = !!t, c = {}, u = !1; - if (s) { - n = t; - for (let v in e.xy) - c[v] = o.getPropertyValue(`--dhx-scheduler-xy-${v}`); - c.hour_size_px = o.getPropertyValue("--dhx-scheduler-config-hour_size_px"), c.wide_form = o.getPropertyValue("--dhx-scheduler-config-form_wide"); + const _ = getComputedStyle(this.$container), a = _.getPropertyValue("--dhx-scheduler-theme"); + let o, l = !!a, h = {}, v = !1; + if (l) { + o = a; + for (let u in e.xy) + h[u] = _.getPropertyValue(`--dhx-scheduler-xy-${u}`); + h.hour_size_px = _.getPropertyValue("--dhx-scheduler-config-hour_size_px"), h.wide_form = _.getPropertyValue("--dhx-scheduler-config-form_wide"); } else - n = function() { - for (var v = document.getElementsByTagName("link"), m = 0; m < v.length; m++) { - var l = v[m].href.match("dhtmlxscheduler_([a-z]+).css"); - if (l) - return l[1]; + o = function() { + for (var u = document.getElementsByTagName("link"), f = 0; f < u.length; f++) { + var c = u[f].href.match("dhtmlxscheduler_([a-z]+).css"); + if (c) + return c[1]; } - }(), u = e._is_material_skin(); - if (e._theme_info = { theme: n, cssVarTheme: s, oldMaterialTheme: u, values: c }, e._theme_info.cssVarTheme) { - const v = this._theme_info.values; - for (let m in e.xy) - isNaN(parseInt(v[m])) || (e.xy[m] = parseInt(v[m])); + }(), v = e._is_material_skin(); + if (e._theme_info = { theme: o, cssVarTheme: l, oldMaterialTheme: v, values: h }, e._theme_info.cssVarTheme) { + const u = this._theme_info.values; + for (let f in e.xy) + isNaN(parseInt(u[f])) || (e.xy[f] = parseInt(u[f])); } }, e.event(window, "DOMContentLoaded", d), e.event(window, "load", d), e._border_box_events = function() { return r(); - }, e._configure = function(o, t, n) { - for (var s in t) - o[s] === void 0 && (o[s] = t[s][n]); - }, e.setSkin = function(o) { - this.skin = o, e._addThemeClass(), e.$container && (this._skin_init(), this.render()); + }, e._configure = function(_, a, o) { + for (var l in a) + _[l] === void 0 && (_[l] = a[l][o]); + }, e.setSkin = function(_) { + this.skin = _, e._addThemeClass(), e.$container && (this._skin_init(), this.render()); }; - let _ = null; + let s = null; e.attachEvent("onDestroy", function() { - clearInterval(_); + clearInterval(s); }), e._skin_init = function() { - this._build_skin_info(), this.skin || (this.skin = this._theme_info.theme), e._addThemeClass(), e.skin === "flat" ? e.templates.hour_scale = i : e.templates.hour_scale === i && (e.templates.hour_scale = e.date.date_to_str(e.config.hour_date)), e.attachEvent("onTemplatesReady", function() { - var o = e.date.date_to_str("%d"); + this._build_skin_info(), this.skin || (this.skin = this._theme_info.theme), e._addThemeClass(), e.skin === "flat" ? e.templates.hour_scale = n : e.templates.hour_scale === n && (e.templates.hour_scale = e.date.date_to_str(e.config.hour_date)), e.attachEvent("onTemplatesReady", function() { + var _ = e.date.date_to_str("%d"); e.templates._old_month_day || (e.templates._old_month_day = e.templates.month_day); - var t = e.templates._old_month_day; - e.templates.month_day = function(n) { + var a = e.templates._old_month_day; + e.templates.month_day = function(o) { if (this._mode == "month") { - var s = o(n); - return n.getDate() == 1 && (s = e.locale.date.month_full[n.getMonth()] + " " + s), +n == +e.date.date_part(this._currentDate()) && (s = e.locale.labels.dhx_cal_today_button + " " + s), s; + var l = _(o); + return o.getDate() == 1 && (l = e.locale.date.month_full[o.getMonth()] + " " + l), +o == +e.date.date_part(this._currentDate()) && (l = e.locale.labels.dhx_cal_today_button + " " + l), l; } - return t.call(this, n); - }, e.config.fix_tab_position && (e._els.dhx_cal_navline[0].querySelectorAll("[data-tab]").forEach((n) => { - switch (n.getAttribute("data-tab") || n.getAttribute("name")) { + return a.call(this, o); + }, e.config.fix_tab_position && (e._els.dhx_cal_navline[0].querySelectorAll("[data-tab]").forEach((o) => { + switch (o.getAttribute("data-tab") || o.getAttribute("name")) { case "day": case "day_tab": - n.classList.add("dhx_cal_tab_first"), n.classList.add("dhx_cal_tab_segmented"); + o.classList.add("dhx_cal_tab_first"), o.classList.add("dhx_cal_tab_segmented"); break; case "week": case "week_tab": - n.classList.add("dhx_cal_tab_segmented"); + o.classList.add("dhx_cal_tab_segmented"); break; case "month": case "month_tab": - n.classList.add("dhx_cal_tab_last"), n.classList.add("dhx_cal_tab_segmented"); + o.classList.add("dhx_cal_tab_last"), o.classList.add("dhx_cal_tab_segmented"); break; default: - n.classList.add("dhx_cal_tab_standalone"); + o.classList.add("dhx_cal_tab_standalone"); } - }), function(n) { + }), function(o) { if (e.config.header) return; - const s = Array.from(n.querySelectorAll(".dhx_cal_tab")), c = ["day", "week", "month"].map((v) => s.find((m) => m.getAttribute("data-tab") === v)).filter((v) => v !== void 0); - let u = s.length > 0 ? s[0] : null; - c.reverse().forEach((v) => { - n.insertBefore(v, u), u = v; + const l = Array.from(o.querySelectorAll(".dhx_cal_tab")), h = ["day", "week", "month"].map((u) => l.find((f) => f.getAttribute("data-tab") === u)).filter((u) => u !== void 0); + let v = l.length > 0 ? l[0] : null; + h.reverse().forEach((u) => { + o.insertBefore(u, v), v = u; }); }(e._els.dhx_cal_navline[0])); }, { once: !0 }); }; } -function Ee(e, h) { - this.$scheduler = e, this.$dp = h, this._dataProcessorHandlers = [], this.attach = function() { - var a = this.$dp, r = this.$scheduler; +function Jt(e, i) { + this.$scheduler = e, this.$dp = i, this._dataProcessorHandlers = [], this.attach = function() { + var t = this.$dp, r = this.$scheduler; this._dataProcessorHandlers.push(r.attachEvent("onEventAdded", function(d) { - !this._loading && this._validId(d) && a.setUpdated(d, !0, "inserted"); + !this._loading && this._validId(d) && t.setUpdated(d, !0, "inserted"); })), this._dataProcessorHandlers.push(r.attachEvent("onConfirmedBeforeEventDelete", function(d) { if (this._validId(d)) { - var i = a.getState(d); - return i == "inserted" || this._new_event ? (a.setUpdated(d, !1), !0) : i != "deleted" && (i == "true_deleted" || (a.setUpdated(d, !0, "deleted"), !1)); + var n = t.getState(d); + return n == "inserted" || this._new_event ? (t.setUpdated(d, !1), !0) : n != "deleted" && (n == "true_deleted" || (t.setUpdated(d, !0, "deleted"), !1)); } })), this._dataProcessorHandlers.push(r.attachEvent("onEventChanged", function(d) { - !this._loading && this._validId(d) && a.setUpdated(d, !0, "updated"); + !this._loading && this._validId(d) && t.setUpdated(d, !0, "updated"); })), this._dataProcessorHandlers.push(r.attachEvent("onClearAll", function() { - a._in_progress = {}, a._invalid = {}, a.updatedRows = [], a._waitMode = 0; - })), a.attachEvent("insertCallback", r._update_callback), a.attachEvent("updateCallback", r._update_callback), a.attachEvent("deleteCallback", function(d, i) { - r.getEvent(i) ? (r.setUserData(i, this.action_param, "true_deleted"), r.deleteEvent(i)) : r._add_rec_marker && r._update_callback(d, i); + t._in_progress = {}, t._invalid = {}, t.updatedRows = [], t._waitMode = 0; + })), t.attachEvent("insertCallback", r._update_callback), t.attachEvent("updateCallback", r._update_callback), t.attachEvent("deleteCallback", function(d, n) { + r.getEvent(n) ? (r.setUserData(n, this.action_param, "true_deleted"), r.deleteEvent(n)) : r._add_rec_marker && r._update_callback(d, n); }); }, this.detach = function() { - for (var a in this._dataProcessorHandlers) { - var r = this._dataProcessorHandlers[a]; + for (var t in this._dataProcessorHandlers) { + var r = this._dataProcessorHandlers[t]; this.$scheduler.detachEvent(r); } this._dataProcessorHandlers = []; }; } -function G(e) { - return this.serverProcessor = e, this.action_param = "!nativeeditor_status", this.object = null, this.updatedRows = [], this.autoUpdate = !0, this.updateMode = "cell", this._tMode = "GET", this._headers = null, this._payload = null, this.post_delim = "_", this._waitMode = 0, this._in_progress = {}, this._invalid = {}, this.messages = [], this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }, this.enableUTFencoding(!0), Q(this), this; +function He(e) { + return this.serverProcessor = e, this.action_param = "!nativeeditor_status", this.object = null, this.updatedRows = [], this.autoUpdate = !0, this.updateMode = "cell", this._tMode = "GET", this._headers = null, this._payload = null, this.post_delim = "_", this._waitMode = 0, this._in_progress = {}, this._invalid = {}, this.messages = [], this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }, this.enableUTFencoding(!0), Ue(this), this; } -function De(e) { - var h = "data-dhxbox", a = null; - function r(g, p) { - var y = g.callback; - m.hide(g.box), a = g.box = null, y && y(p); +function Wt(e) { + var i = "data-dhxbox", t = null; + function r(m, g) { + var y = m.callback; + f.hide(m.box), t = m.box = null, y && y(g); } - function d(g) { - if (a) { - var p = g.which || g.keyCode, y = !1; - if (l.keyboard) { - if (p == 13 || p == 32) { - var w = g.target || g.srcElement; - q.getClassName(w).indexOf("scheduler_popup_button") > -1 && w.click ? w.click() : (r(a, !0), y = !0); + function d(m) { + if (t) { + var g = m.which || m.keyCode, y = !1; + if (c.keyboard) { + if (g == 13 || g == 32) { + var x = m.target || m.srcElement; + _e.getClassName(x).indexOf("scheduler_popup_button") > -1 && x.click ? x.click() : (r(t, !0), y = !0); } - p == 27 && (r(a, !1), y = !0); + g == 27 && (r(t, !1), y = !0); } - return y ? (g.preventDefault && g.preventDefault(), !(g.cancelBubble = !0)) : void 0; + return y ? (m.preventDefault && m.preventDefault(), !(m.cancelBubble = !0)) : void 0; } } - function i(g) { - i.cover || (i.cover = document.createElement("div"), e.event(i.cover, "keydown", d), i.cover.className = "dhx_modal_cover", document.body.appendChild(i.cover)), i.cover.style.display = g ? "inline-block" : "none"; + function n(m) { + n.cover || (n.cover = document.createElement("div"), e.event(n.cover, "keydown", d), n.cover.className = "dhx_modal_cover", document.body.appendChild(n.cover)), n.cover.style.display = m ? "inline-block" : "none"; } - function _(g, p, y) { - var w = e._waiAria.messageButtonAttrString(g), b = (p || "").toLowerCase().replace(/ /g, "_"); - return `
${g}
`; + function s(m, g, y) { + var x = e._waiAria.messageButtonAttrString(m), b = (g || "").toLowerCase().replace(/ /g, "_"); + return `
${m}
`; } - function o() { - for (var g = [].slice.apply(arguments, [0]), p = 0; p < g.length; p++) - if (g[p]) - return g[p]; - } - function t(g, p, y) { - var w = g.tagName ? g : function(E, D, x) { - var S = document.createElement("div"), N = V.uid(); - e._waiAria.messageModalAttr(S, N), S.className = " scheduler_modal_box dhtmlx_modal_box scheduler-" + E.type + " dhtmlx-" + E.type, S.setAttribute(h, 1); + function _() { + for (var m = [].slice.apply(arguments, [0]), g = 0; g < m.length; g++) + if (m[g]) + return m[g]; + } + function a(m, g, y) { + var x = m.tagName ? m : function(E, D, w) { + var S = document.createElement("div"), N = ee.uid(); + e._waiAria.messageModalAttr(S, N), S.className = " scheduler_modal_box dhtmlx_modal_box scheduler-" + E.type + " dhtmlx-" + E.type, S.setAttribute(i, 1); var M = ""; - if (E.width && (S.style.width = E.width), E.height && (S.style.height = E.height), E.title && (M += '
' + E.title + "
"), M += '
' + (E.content ? "" : E.text) + '
', D && (M += _(o(E.ok, e.locale.labels.message_ok, "OK"), "ok", !0)), x && (M += _(o(E.cancel, e.locale.labels.message_cancel, "Cancel"), "cancel", !1)), E.buttons) - for (var A = 0; A < E.buttons.length; A++) { - var C = E.buttons[A]; - M += typeof C == "object" ? _(C.label, C.css || "scheduler_" + C.label.toLowerCase() + "_button dhtmlx_" + C.label.toLowerCase() + "_button", C.value || A) : _(C, C, A); + if (E.width && (S.style.width = E.width), E.height && (S.style.height = E.height), E.title && (M += '
' + E.title + "
"), M += '
' + (E.content ? "" : E.text) + '
', D && (M += s(_(E.ok, e.locale.labels.message_ok, "OK"), "ok", !0)), w && (M += s(_(E.cancel, e.locale.labels.message_cancel, "Cancel"), "cancel", !1)), E.buttons) + for (var T = 0; T < E.buttons.length; T++) { + var A = E.buttons[T]; + M += typeof A == "object" ? s(A.label, A.css || "scheduler_" + A.label.toLowerCase() + "_button dhtmlx_" + A.label.toLowerCase() + "_button", A.value || T) : s(A, A, T); } if (M += "
", S.innerHTML = M, E.content) { - var T = E.content; - typeof T == "string" && (T = document.getElementById(T)), T.style.display == "none" && (T.style.display = ""), S.childNodes[E.title ? 1 : 0].appendChild(T); - } - return e.event(S, "click", function(O) { - var L = O.target || O.srcElement; - if (L.className || (L = L.parentNode), q.closest(L, ".scheduler_popup_button")) { - var H = L.getAttribute("data-result"); - r(E, H = H == "true" || H != "false" && H); + var H = E.content; + typeof H == "string" && (H = document.getElementById(H)), H.style.display == "none" && (H.style.display = ""), S.childNodes[E.title ? 1 : 0].appendChild(H); + } + return e.event(S, "click", function($) { + var j = $.target || $.srcElement; + if (j.className || (j = j.parentNode), _e.closest(j, ".scheduler_popup_button")) { + var z = j.getAttribute("data-result"); + r(E, z = z == "true" || z != "false" && z); } - }), E.box = S, (D || x) && (a = E), S; - }(g, p, y); - g.hidden || i(!0), document.body.appendChild(w); - var b = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - w.offsetWidth) / 2)), k = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - w.offsetHeight) / 2)); - return g.position == "top" ? w.style.top = "-3px" : w.style.top = k + "px", w.style.left = b + "px", e.event(w, "keydown", d), m.focus(w), g.hidden && m.hide(w), e.callEvent("onMessagePopup", [w]), w; + }), E.box = S, (D || w) && (t = E), S; + }(m, g, y); + m.hidden || n(!0), document.body.appendChild(x); + var b = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - x.offsetWidth) / 2)), k = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - x.offsetHeight) / 2)); + return m.position == "top" ? x.style.top = "-3px" : x.style.top = k + "px", x.style.left = b + "px", e.event(x, "keydown", d), f.focus(x), m.hidden && f.hide(x), e.callEvent("onMessagePopup", [x]), x; } - function n(g) { - return t(g, !0, !1); + function o(m) { + return a(m, !0, !1); } - function s(g) { - return t(g, !0, !0); + function l(m) { + return a(m, !0, !0); } - function c(g) { - return t(g); + function h(m) { + return a(m); } - function u(g, p, y) { - return typeof g != "object" && (typeof p == "function" && (y = p, p = ""), g = { text: g, type: p, callback: y }), g; + function v(m, g, y) { + return typeof m != "object" && (typeof g == "function" && (y = g, g = ""), m = { text: m, type: g, callback: y }), m; } - function v(g, p, y, w) { - return typeof g != "object" && (g = { text: g, type: p, expire: y, id: w }), g.id = g.id || V.uid(), g.expire = g.expire || l.expire, g; + function u(m, g, y, x, b) { + return typeof m != "object" && (m = { text: m, type: g, expire: y, id: x, callback: b }), m.id = m.id || ee.uid(), m.expire = m.expire || c.expire, m; } e.event(document, "keydown", d, !0); - var m = function() { - var g = u.apply(this, arguments); - return g.type = g.type || "alert", c(g); + var f = function() { + var m = v.apply(this, arguments); + return m.type = m.type || "alert", h(m); }; - m.hide = function(g) { - for (; g && g.getAttribute && !g.getAttribute(h); ) - g = g.parentNode; - g && (g.parentNode.removeChild(g), i(!1), e.callEvent("onAfterMessagePopup", [g])); - }, m.focus = function(g) { + f.hide = function(m) { + for (; m && m.getAttribute && !m.getAttribute(i); ) + m = m.parentNode; + m && (m.parentNode.removeChild(m), n(!1), e.callEvent("onAfterMessagePopup", [m])); + }, f.focus = function(m) { setTimeout(function() { - var p = q.getFocusableNodes(g); - p.length && p[0].focus && p[0].focus(); + var g = _e.getFocusableNodes(m); + g.length && g[0].focus && g[0].focus(); }, 1); }; - var l = function(g, p, y, w) { - switch ((g = v.apply(this, arguments)).type = g.type || "info", g.type.split("-")[0]) { + var c = function(m, g, y, x) { + switch ((m = u.apply(this, arguments)).type = m.type || "info", m.type.split("-")[0]) { case "alert": - return n(g); + return o(m); case "confirm": - return s(g); + return l(m); case "modalbox": - return c(g); + return h(m); default: return function(b) { - l.area || (l.area = document.createElement("div"), l.area.className = "scheduler_message_area dhtmlx_message_area", l.area.style[l.position] = "5px", document.body.appendChild(l.area)), l.hide(b.id); + c.area || (c.area = document.createElement("div"), c.area.className = "scheduler_message_area dhtmlx_message_area", c.area.style[c.position] = "5px", document.body.appendChild(c.area)), c.hide(b.id); var k = document.createElement("div"); - return k.innerHTML = "
" + b.text + "
", k.className = "scheduler-info dhtmlx-info scheduler-" + b.type + " dhtmlx-" + b.type, e.event(k, "click", function() { - l.hide(b.id), b = null; - }), e._waiAria.messageInfoAttr(k), l.position == "bottom" && l.area.firstChild ? l.area.insertBefore(k, l.area.firstChild) : l.area.appendChild(k), b.expire > 0 && (l.timers[b.id] = window.setTimeout(function() { - l && l.hide(b.id); - }, b.expire)), l.pull[b.id] = k, k = null, b.id; - }(g); + return k.innerHTML = "
" + b.text + "
", k.className = "scheduler-info dhtmlx-info scheduler-" + b.type + " dhtmlx-" + b.type, e.event(k, "click", function(E) { + b.callback && b.callback.call(this, E), c.hide(b.id), b = null; + }), e._waiAria.messageInfoAttr(k), c.position == "bottom" && c.area.firstChild ? c.area.insertBefore(k, c.area.firstChild) : c.area.appendChild(k), b.expire > 0 && (c.timers[b.id] = window.setTimeout(function() { + c && c.hide(b.id); + }, b.expire)), c.pull[b.id] = k, k = null, b.id; + }(m); } }; - l.seed = (/* @__PURE__ */ new Date()).valueOf(), l.uid = V.uid, l.expire = 4e3, l.keyboard = !0, l.position = "top", l.pull = {}, l.timers = {}, l.hideAll = function() { - for (var g in l.pull) - l.hide(g); - }, l.hide = function(g) { - var p = l.pull[g]; - p && p.parentNode && (window.setTimeout(function() { - p.parentNode.removeChild(p), p = null; - }, 2e3), p.className += " hidden", l.timers[g] && window.clearTimeout(l.timers[g]), delete l.pull[g]); + c.seed = (/* @__PURE__ */ new Date()).valueOf(), c.uid = ee.uid, c.expire = 4e3, c.keyboard = !0, c.position = "top", c.pull = {}, c.timers = {}, c.hideAll = function() { + for (var m in c.pull) + c.hide(m); + }, c.hide = function(m) { + var g = c.pull[m]; + g && g.parentNode && (window.setTimeout(function() { + g.parentNode.removeChild(g), g = null; + }, 2e3), g.className += " hidden", c.timers[m] && window.clearTimeout(c.timers[m]), delete c.pull[m]); }; - var f = []; - return e.attachEvent("onMessagePopup", function(g) { - f.push(g); - }), e.attachEvent("onAfterMessagePopup", function(g) { - for (var p = 0; p < f.length; p++) - f[p] === g && (f.splice(p, 1), p--); + var p = []; + return e.attachEvent("onMessagePopup", function(m) { + p.push(m); + }), e.attachEvent("onAfterMessagePopup", function(m) { + for (var g = 0; g < p.length; g++) + p[g] === m && (p.splice(g, 1), g--); }), e.attachEvent("onDestroy", function() { - i.cover && i.cover.parentNode && i.cover.parentNode.removeChild(i.cover); - for (var g = 0; g < f.length; g++) - f[g].parentNode && f[g].parentNode.removeChild(f[g]); - f = null, l.area && l.area.parentNode && l.area.parentNode.removeChild(l.area), l = null; + n.cover && n.cover.parentNode && n.cover.parentNode.removeChild(n.cover); + for (var m = 0; m < p.length; m++) + p[m].parentNode && p[m].parentNode.removeChild(p[m]); + p = null, c.area && c.area.parentNode && c.area.parentNode.removeChild(c.area), c = null; }), { alert: function() { - var g = u.apply(this, arguments); - return g.type = g.type || "confirm", n(g); + var m = v.apply(this, arguments); + return m.type = m.type || "confirm", o(m); }, confirm: function() { - var g = u.apply(this, arguments); - return g.type = g.type || "alert", s(g); - }, message: l, modalbox: m }; + var m = v.apply(this, arguments); + return m.type = m.type || "alert", l(m); + }, message: c, modalbox: f }; } -G.prototype = { setTransactionMode: function(e, h) { - typeof e == "object" ? (this._tMode = e.mode || this._tMode, e.headers !== void 0 && (this._headers = e.headers), e.payload !== void 0 && (this._payload = e.payload), this._tSend = !!h) : (this._tMode = e, this._tSend = h), this._tMode == "REST" && (this._tSend = !1, this._endnm = !0), this._tMode === "JSON" || this._tMode === "REST-JSON" ? (this._tSend = !1, this._endnm = !0, this._serializeAsJson = !0, this._headers = this._headers || {}, this._headers["Content-Type"] = "application/json") : this._headers && !this._headers["Content-Type"] && (this._headers["Content-Type"] = "application/x-www-form-urlencoded"), this._tMode === "CUSTOM" && (this._tSend = !1, this._endnm = !0, this._router = e.router); +He.prototype = { setTransactionMode: function(e, i) { + typeof e == "object" ? (this._tMode = e.mode || this._tMode, e.headers !== void 0 && (this._headers = e.headers), e.payload !== void 0 && (this._payload = e.payload), this._tSend = !!i) : (this._tMode = e, this._tSend = i), this._tMode == "REST" && (this._tSend = !1, this._endnm = !0), this._tMode === "JSON" || this._tMode === "REST-JSON" ? (this._tSend = !1, this._endnm = !0, this._serializeAsJson = !0, this._headers = this._headers || {}, this._headers["Content-Type"] = "application/json") : this._headers && !this._headers["Content-Type"] && (this._headers["Content-Type"] = "application/x-www-form-urlencoded"), this._tMode === "CUSTOM" && (this._tSend = !1, this._endnm = !0, this._router = e.router); }, escape: function(e) { return this._utf ? encodeURIComponent(e) : escape(e); }, enableUTFencoding: function(e) { @@ -1371,23 +1933,23 @@ G.prototype = { setTransactionMode: function(e, h) { this._endnm = !!e; }, enablePartialDataSend: function(e) { this._changed = !!e; -}, setUpdateMode: function(e, h) { - this.autoUpdate = e == "cell", this.updateMode = e, this.dnd = h; -}, ignore: function(e, h) { - this._silent_mode = !0, e.call(h || window), this._silent_mode = !1; -}, setUpdated: function(e, h, a) { +}, setUpdateMode: function(e, i) { + this.autoUpdate = e == "cell", this.updateMode = e, this.dnd = i; +}, ignore: function(e, i) { + this._silent_mode = !0, e.call(i || window), this._silent_mode = !1; +}, setUpdated: function(e, i, t) { if (!this._silent_mode) { var r = this.findRow(e); - a = a || "updated"; + t = t || "updated"; var d = this.$scheduler.getUserData(e, this.action_param); - d && a == "updated" && (a = d), h ? (this.set_invalid(e, !1), this.updatedRows[r] = e, this.$scheduler.setUserData(e, this.action_param, a), this._in_progress[e] && (this._in_progress[e] = "wait")) : this.is_invalid(e) || (this.updatedRows.splice(r, 1), this.$scheduler.setUserData(e, this.action_param, "")), this.markRow(e, h, a), h && this.autoUpdate && this.sendData(e); + d && t == "updated" && (t = d), i ? (this.set_invalid(e, !1), this.updatedRows[r] = e, this.$scheduler.setUserData(e, this.action_param, t), this._in_progress[e] && (this._in_progress[e] = "wait")) : this.is_invalid(e) || (this.updatedRows.splice(r, 1), this.$scheduler.setUserData(e, this.action_param, "")), this.markRow(e, i, t), i && this.autoUpdate && this.sendData(e); } -}, markRow: function(e, h, a) { +}, markRow: function(e, i, t) { var r = "", d = this.is_invalid(e); - if (d && (r = this.styles[d], h = !0), this.callEvent("onRowMark", [e, h, a, d]) && (r = this.styles[h ? a : "clear"] + r, this.$scheduler[this._methods[0]](e, r), d && d.details)) { + if (d && (r = this.styles[d], i = !0), this.callEvent("onRowMark", [e, i, t, d]) && (r = this.styles[i ? t : "clear"] + r, this.$scheduler[this._methods[0]](e, r), d && d.details)) { r += this.styles[d + "_cell"]; - for (var i = 0; i < d.details.length; i++) - d.details[i] && this.$scheduler[this._methods[1]](e, i, r); + for (var n = 0; n < d.details.length; n++) + d.details[n] && this.$scheduler[this._methods[1]](e, n, r); } }, getActionByState: function(e) { return e === "inserted" ? "create" : e === "updated" ? "update" : e === "deleted" ? "delete" : "update"; @@ -1395,305 +1957,305 @@ G.prototype = { setTransactionMode: function(e, h) { return this.$scheduler.getUserData(e, this.action_param); }, is_invalid: function(e) { return this._invalid[e]; -}, set_invalid: function(e, h, a) { - a && (h = { value: h, details: a, toString: function() { +}, set_invalid: function(e, i, t) { + t && (i = { value: i, details: t, toString: function() { return this.value.toString(); - } }), this._invalid[e] = h; + } }), this._invalid[e] = i; }, checkBeforeUpdate: function(e) { return !0; }, sendData: function(e) { return this.$scheduler.editStop && this.$scheduler.editStop(), e === void 0 || this._tSend ? this.sendAllData() : !this._in_progress[e] && (this.messages = [], !(!this.checkBeforeUpdate(e) && this.callEvent("onValidationError", [e, this.messages])) && void this._beforeSendData(this._getRowData(e), e)); -}, _beforeSendData: function(e, h) { - if (!this.callEvent("onBeforeUpdate", [h, this.getState(h), e])) +}, _beforeSendData: function(e, i) { + if (!this.callEvent("onBeforeUpdate", [i, this.getState(i), e])) return !1; - this._sendData(e, h); -}, serialize: function(e, h) { + this._sendData(e, i); +}, serialize: function(e, i) { if (this._serializeAsJson) return this._serializeAsJSON(e); if (typeof e == "string") return e; - if (h !== void 0) + if (i !== void 0) return this.serialize_one(e, ""); - var a = [], r = []; + var t = [], r = []; for (var d in e) - e.hasOwnProperty(d) && (a.push(this.serialize_one(e[d], d + this.post_delim)), r.push(d)); - return a.push("ids=" + this.escape(r.join(","))), this.$scheduler.security_key && a.push("dhx_security=" + this.$scheduler.security_key), a.join("&"); -}, serialize_one: function(e, h) { + e.hasOwnProperty(d) && (t.push(this.serialize_one(e[d], d + this.post_delim)), r.push(d)); + return t.push("ids=" + this.escape(r.join(","))), this.$scheduler.security_key && t.push("dhx_security=" + this.$scheduler.security_key), t.join("&"); +}, serialize_one: function(e, i) { if (typeof e == "string") return e; - var a = [], r = ""; + var t = [], r = ""; for (var d in e) if (e.hasOwnProperty(d)) { if ((d == "id" || d == this.action_param) && this._tMode == "REST") continue; - r = typeof e[d] == "string" || typeof e[d] == "number" ? e[d] : JSON.stringify(e[d]), a.push(this.escape((h || "") + d) + "=" + this.escape(r)); + r = typeof e[d] == "string" || typeof e[d] == "number" ? e[d] : JSON.stringify(e[d]), t.push(this.escape((i || "") + d) + "=" + this.escape(r)); } - return a.join("&"); + return t.join("&"); }, _applyPayload: function(e) { - var h = this.$scheduler.ajax; + var i = this.$scheduler.ajax; if (this._payload) - for (var a in this._payload) - e = e + h.urlSeparator(e) + this.escape(a) + "=" + this.escape(this._payload[a]); + for (var t in this._payload) + e = e + i.urlSeparator(e) + this.escape(t) + "=" + this.escape(this._payload[t]); return e; -}, _sendData: function(e, h) { +}, _sendData: function(e, i) { if (e) { - if (!this.callEvent("onBeforeDataSending", h ? [h, this.getState(h), e] : [null, null, e])) + if (!this.callEvent("onBeforeDataSending", i ? [i, this.getState(i), e] : [null, null, e])) return !1; - h && (this._in_progress[h] = (/* @__PURE__ */ new Date()).valueOf()); - var a = this, r = this.$scheduler.ajax; + i && (this._in_progress[i] = (/* @__PURE__ */ new Date()).valueOf()); + var t = this, r = this.$scheduler.ajax; if (this._tMode !== "CUSTOM") { - var d, i = { callback: function(m) { - var l = []; - if (h) - l.push(h); + var d, n = { callback: function(f) { + var c = []; + if (i) + c.push(i); else if (e) - for (var f in e) - l.push(f); - return a.afterUpdate(a, m, l); - }, headers: a._headers }, _ = this.serverProcessor + (this._user ? r.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.$scheduler.getUserData(0, "version")].join("&") : ""), o = this._applyPayload(_); + for (var p in e) + c.push(p); + return t.afterUpdate(t, f, c); + }, headers: t._headers }, s = this.serverProcessor + (this._user ? r.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.$scheduler.getUserData(0, "version")].join("&") : ""), _ = this._applyPayload(s); switch (this._tMode) { case "GET": - d = this._cleanupArgumentsBeforeSend(e), i.url = o + r.urlSeparator(o) + this.serialize(d, h), i.method = "GET"; + d = this._cleanupArgumentsBeforeSend(e), n.url = _ + r.urlSeparator(_) + this.serialize(d, i), n.method = "GET"; break; case "POST": - d = this._cleanupArgumentsBeforeSend(e), i.url = o, i.method = "POST", i.data = this.serialize(d, h); + d = this._cleanupArgumentsBeforeSend(e), n.url = _, n.method = "POST", n.data = this.serialize(d, i); break; case "JSON": d = {}; - var t = this._cleanupItemBeforeSend(e); - for (var n in t) - n !== this.action_param && n !== "id" && n !== "gr_id" && (d[n] = t[n]); - i.url = o, i.method = "POST", i.data = JSON.stringify({ id: h, action: e[this.action_param], data: d }); + var a = this._cleanupItemBeforeSend(e); + for (var o in a) + o !== this.action_param && o !== "id" && o !== "gr_id" && (d[o] = a[o]); + n.url = _, n.method = "POST", n.data = JSON.stringify({ id: i, action: e[this.action_param], data: d }); break; case "REST": case "REST-JSON": - switch (o = _.replace(/(&|\?)editing=true/, ""), d = "", this.getState(h)) { + switch (_ = s.replace(/(&|\?)editing=true/, ""), d = "", this.getState(i)) { case "inserted": - i.method = "POST", i.data = this.serialize(e, h); + n.method = "POST", n.data = this.serialize(e, i); break; case "deleted": - i.method = "DELETE", o = o + (o.slice(-1) === "/" ? "" : "/") + h; + n.method = "DELETE", _ = _ + (_.slice(-1) === "/" ? "" : "/") + i; break; default: - i.method = "PUT", i.data = this.serialize(e, h), o = o + (o.slice(-1) === "/" ? "" : "/") + h; + n.method = "PUT", n.data = this.serialize(e, i), _ = _ + (_.slice(-1) === "/" ? "" : "/") + i; } - i.url = this._applyPayload(o); + n.url = this._applyPayload(_); } - return this._waitMode++, r.query(i); + return this._waitMode++, r.query(n); } { - var s = this.getState(h), c = this.getActionByState(s), u = function(l) { - var f = s; - if (l && l.responseText && l.setRequestHeader) { - l.status !== 200 && (f = "error"); + var l = this.getState(i), h = this.getActionByState(l), v = function(c) { + var p = l; + if (c && c.responseText && c.setRequestHeader) { + c.status !== 200 && (p = "error"); try { - l = JSON.parse(l.responseText); + c = JSON.parse(c.responseText); } catch { } } - f = f || "updated"; - var g = h, p = h; - l && (f = l.action || f, g = l.sid || g, p = l.id || l.tid || p), a.afterUpdateCallback(g, p, f, l); + p = p || "updated"; + var m = i, g = i; + c && (p = c.action || p, m = c.sid || m, g = c.id || c.tid || g), t.afterUpdateCallback(m, g, p, c); }; - const m = "event"; - var v; + const f = "event"; + var u; if (this._router instanceof Function) - v = this._router(m, c, e, h); + u = this._router(f, h, e, i); else - switch (s) { + switch (l) { case "inserted": - v = this._router[m].create(e); + u = this._router[f].create(e); break; case "deleted": - v = this._router[m].delete(h); + u = this._router[f].delete(i); break; default: - v = this._router[m].update(e, h); + u = this._router[f].update(e, i); } - if (v) { - if (!v.then && v.id === void 0 && v.tid === void 0 && v.action === void 0) + if (u) { + if (!u.then && u.id === void 0 && u.tid === void 0 && u.action === void 0) throw new Error("Incorrect router return value. A Promise or a response object is expected"); - v.then ? v.then(u).catch(function(l) { - l && l.action ? u(l) : u({ action: "error", value: l }); - }) : u(v); + u.then ? u.then(v).catch(function(c) { + c && c.action ? v(c) : v({ action: "error", value: c }); + }) : v(u); } else - u(null); + v(null); } } }, sendAllData: function() { if (this.updatedRows.length && this.updateMode !== "off") { this.messages = []; var e = !0; - if (this._forEachUpdatedRow(function(h) { - e = e && this.checkBeforeUpdate(h); + if (this._forEachUpdatedRow(function(i) { + e = e && this.checkBeforeUpdate(i); }), !e && !this.callEvent("onValidationError", ["", this.messages])) return !1; - this._tSend ? this._sendData(this._getAllData()) : this._forEachUpdatedRow(function(h) { - if (!this._in_progress[h]) { - if (this.is_invalid(h)) + this._tSend ? this._sendData(this._getAllData()) : this._forEachUpdatedRow(function(i) { + if (!this._in_progress[i]) { + if (this.is_invalid(i)) return; - this._beforeSendData(this._getRowData(h), h); + this._beforeSendData(this._getRowData(i), i); } }); } }, _getAllData: function(e) { - var h = {}, a = !1; + var i = {}, t = !1; return this._forEachUpdatedRow(function(r) { if (!this._in_progress[r] && !this.is_invalid(r)) { var d = this._getRowData(r); - this.callEvent("onBeforeUpdate", [r, this.getState(r), d]) && (h[r] = d, a = !0, this._in_progress[r] = (/* @__PURE__ */ new Date()).valueOf()); + this.callEvent("onBeforeUpdate", [r, this.getState(r), d]) && (i[r] = d, t = !0, this._in_progress[r] = (/* @__PURE__ */ new Date()).valueOf()); } - }), a ? h : null; + }), t ? i : null; }, findRow: function(e) { - var h = 0; - for (h = 0; h < this.updatedRows.length && e != this.updatedRows[h]; h++) + var i = 0; + for (i = 0; i < this.updatedRows.length && e != this.updatedRows[i]; i++) ; - return h; -}, defineAction: function(e, h) { - this._uActions || (this._uActions = {}), this._uActions[e] = h; -}, afterUpdateCallback: function(e, h, a, r) { + return i; +}, defineAction: function(e, i) { + this._uActions || (this._uActions = {}), this._uActions[e] = i; +}, afterUpdateCallback: function(e, i, t, r) { if (this.$scheduler) { - var d = e, i = a !== "error" && a !== "invalid"; - if (i || this.set_invalid(e, a), this._uActions && this._uActions[a] && !this._uActions[a](r)) + var d = e, n = t !== "error" && t !== "invalid"; + if (n || this.set_invalid(e, t), this._uActions && this._uActions[t] && !this._uActions[t](r)) return delete this._in_progress[d]; this._in_progress[d] !== "wait" && this.setUpdated(e, !1); - var _ = e; - switch (a) { + var s = e; + switch (t) { case "inserted": case "insert": - h != e && (this.setUpdated(e, !1), this.$scheduler[this._methods[2]](e, h), e = h); + i != e && (this.setUpdated(e, !1), this.$scheduler[this._methods[2]](e, i), e = i); break; case "delete": case "deleted": - return this.$scheduler.setUserData(e, this.action_param, "true_deleted"), this.$scheduler[this._methods[3]](e, h), delete this._in_progress[d], this.callEvent("onAfterUpdate", [e, a, h, r]); + return this.$scheduler.setUserData(e, this.action_param, "true_deleted"), this.$scheduler[this._methods[3]](e, i), delete this._in_progress[d], this.callEvent("onAfterUpdate", [e, t, i, r]); } - this._in_progress[d] !== "wait" ? (i && this.$scheduler.setUserData(e, this.action_param, ""), delete this._in_progress[d]) : (delete this._in_progress[d], this.setUpdated(h, !0, this.$scheduler.getUserData(e, this.action_param))), this.callEvent("onAfterUpdate", [_, a, h, r]); + this._in_progress[d] !== "wait" ? (n && this.$scheduler.setUserData(e, this.action_param, ""), delete this._in_progress[d]) : (delete this._in_progress[d], this.setUpdated(i, !0, this.$scheduler.getUserData(e, this.action_param))), this.callEvent("onAfterUpdate", [s, t, i, r]); } -}, _errorResponse: function(e, h) { - return this.$scheduler && this.$scheduler.callEvent && this.$scheduler.callEvent("onSaveError", [h, e.xmlDoc]), this.cleanUpdate(h); +}, _errorResponse: function(e, i) { + return this.$scheduler && this.$scheduler.callEvent && this.$scheduler.callEvent("onSaveError", [i, e.xmlDoc]), this.cleanUpdate(i); }, _setDefaultTransactionMode: function() { this.serverProcessor && (this.setTransactionMode("POST", !0), this.serverProcessor += (this.serverProcessor.indexOf("?") !== -1 ? "&" : "?") + "editing=true", this._serverProcessor = this.serverProcessor); -}, afterUpdate: function(e, h, a) { +}, afterUpdate: function(e, i, t) { var r = this.$scheduler.ajax; - if (h.xmlDoc.status === 200) { + if (i.xmlDoc.status === 200) { var d; try { - d = JSON.parse(h.xmlDoc.responseText); + d = JSON.parse(i.xmlDoc.responseText); } catch { - h.xmlDoc.responseText.length || (d = {}); + i.xmlDoc.responseText.length || (d = {}); } if (d) { - var i = d.action || this.getState(a) || "updated", _ = d.sid || a[0], o = d.tid || a[0]; - return e.afterUpdateCallback(_, o, i, d), void e.finalizeUpdate(); - } - var t = r.xmltop("data", h.xmlDoc); - if (!t) - return this._errorResponse(h, a); - var n = r.xpath("//data/action", t); - if (!n.length) - return this._errorResponse(h, a); - for (var s = 0; s < n.length; s++) { - var c = n[s]; - i = c.getAttribute("type"), _ = c.getAttribute("sid"), o = c.getAttribute("tid"), e.afterUpdateCallback(_, o, i, c); + var n = d.action || this.getState(t) || "updated", s = d.sid || t[0], _ = d.tid || t[0]; + return e.afterUpdateCallback(s, _, n, d), void e.finalizeUpdate(); + } + var a = r.xmltop("data", i.xmlDoc); + if (!a) + return this._errorResponse(i, t); + var o = r.xpath("//data/action", a); + if (!o.length) + return this._errorResponse(i, t); + for (var l = 0; l < o.length; l++) { + var h = o[l]; + n = h.getAttribute("type"), s = h.getAttribute("sid"), _ = h.getAttribute("tid"), e.afterUpdateCallback(s, _, n, h); } e.finalizeUpdate(); } else - this._errorResponse(h, a); + this._errorResponse(i, t); }, cleanUpdate: function(e) { if (e) - for (var h = 0; h < e.length; h++) - delete this._in_progress[e[h]]; + for (var i = 0; i < e.length; i++) + delete this._in_progress[e[i]]; }, finalizeUpdate: function() { this._waitMode && this._waitMode--, this.callEvent("onAfterUpdateFinish", []), this.updatedRows.length || this.callEvent("onFullSync", []); }, init: function(e) { if (!this._initialized) { - this.$scheduler = e, this.$scheduler._dp_init && this.$scheduler._dp_init(this), this._setDefaultTransactionMode(), this._methods = this._methods || ["_set_event_text_style", "", "_dp_change_event_id", "_dp_hook_delete"], function(a, r) { - a._validId = function(d) { + this.$scheduler = e, this.$scheduler._dp_init && this.$scheduler._dp_init(this), this._setDefaultTransactionMode(), this._methods = this._methods || ["_set_event_text_style", "", "_dp_change_event_id", "_dp_hook_delete"], function(t, r) { + t._validId = function(d) { return !this._is_virtual_event || !this._is_virtual_event(d); - }, a.setUserData = function(d, i, _) { + }, t.setUserData = function(d, n, s) { if (d) { - var o = this.getEvent(d); - o && (o[i] = _); + var _ = this.getEvent(d); + _ && (_[n] = s); } else - this._userdata[i] = _; - }, a.getUserData = function(d, i) { + this._userdata[n] = s; + }, t.getUserData = function(d, n) { if (d) { - var _ = this.getEvent(d); - return _ ? _[i] : null; + var s = this.getEvent(d); + return s ? s[n] : null; } - return this._userdata[i]; - }, a._set_event_text_style = function(d, i) { - if (a.getEvent(d)) { - this.for_rendered(d, function(o) { - o.style.cssText += ";" + i; + return this._userdata[n]; + }, t._set_event_text_style = function(d, n) { + if (t.getEvent(d)) { + this.for_rendered(d, function(_) { + _.style.cssText += ";" + n; }); - var _ = this.getEvent(d); - _._text_style = i, this.event_updated(_); + var s = this.getEvent(d); + s._text_style = n, this.event_updated(s); } - }, a._update_callback = function(d, i) { - var _ = a._xmlNodeToJSON(d.firstChild); - _.rec_type == "none" && (_.rec_pattern = "none"), _.text = _.text || _._tagvalue, _.start_date = a._helpers.parseDate(_.start_date), _.end_date = a._helpers.parseDate(_.end_date), a.addEvent(_), a._add_rec_marker && a.setCurrentView(); - }, a._dp_change_event_id = function(d, i) { - a.getEvent(d) && a.changeEventId(d, i); - }, a._dp_hook_delete = function(d, i) { - if (a.getEvent(d)) - return i && d != i && (this.getUserData(d, r.action_param) == "true_deleted" && this.setUserData(d, r.action_param, "updated"), this.changeEventId(d, i)), this.deleteEvent(i, !0); - }, a.setDp = function() { + }, t._update_callback = function(d, n) { + var s = t._xmlNodeToJSON(d.firstChild); + s.rec_type == "none" && (s.rec_pattern = "none"), s.text = s.text || s._tagvalue, s.start_date = t._helpers.parseDate(s.start_date), s.end_date = t._helpers.parseDate(s.end_date), t.addEvent(s), t._add_rec_marker && t.setCurrentView(); + }, t._dp_change_event_id = function(d, n) { + t.getEvent(d) && t.changeEventId(d, n); + }, t._dp_hook_delete = function(d, n) { + if (t.getEvent(d)) + return n && d != n && (this.getUserData(d, r.action_param) == "true_deleted" && this.setUserData(d, r.action_param, "updated"), this.changeEventId(d, n)), this.deleteEvent(n, !0); + }, t.setDp = function() { this._dp = r; - }, a.setDp(); + }, t.setDp(); }(this.$scheduler, this); - var h = new Ee(this.$scheduler, this); - h.attach(), this.attachEvent("onDestroy", function() { - delete this._getRowData, delete this.$scheduler._dp, delete this.$scheduler._dataprocessor, delete this.$scheduler._set_event_text_style, delete this.$scheduler._dp_change_event_id, delete this.$scheduler._dp_hook_delete, delete this.$scheduler, h.detach(); + var i = new Jt(this.$scheduler, this); + i.attach(), this.attachEvent("onDestroy", function() { + delete this._getRowData, delete this.$scheduler._dp, delete this.$scheduler._dataprocessor, delete this.$scheduler._set_event_text_style, delete this.$scheduler._dp_change_event_id, delete this.$scheduler._dp_hook_delete, delete this.$scheduler, i.detach(); }), this.$scheduler.callEvent("onDataProcessorReady", [this]), this._initialized = !0, e._dataprocessor = this; } }, setOnAfterUpdate: function(e) { this.attachEvent("onAfterUpdate", e); }, setOnBeforeUpdateHandler: function(e) { this.attachEvent("onBeforeDataSending", e); -}, setAutoUpdate: function(e, h) { - e = e || 2e3, this._user = h || (/* @__PURE__ */ new Date()).valueOf(), this._need_update = !1, this._update_busy = !1, this.attachEvent("onAfterUpdate", function(d, i, _, o) { - this.afterAutoUpdate(d, i, _, o); +}, setAutoUpdate: function(e, i) { + e = e || 2e3, this._user = i || (/* @__PURE__ */ new Date()).valueOf(), this._need_update = !1, this._update_busy = !1, this.attachEvent("onAfterUpdate", function(d, n, s, _) { + this.afterAutoUpdate(d, n, s, _); }), this.attachEvent("onFullSync", function() { this.fullSync(); }); - var a = this; - let r = I.setInterval(function() { - a.loadUpdate(); + var t = this; + let r = oe.setInterval(function() { + t.loadUpdate(); }, e); this.attachEvent("onDestroy", function() { clearInterval(r); }); -}, afterAutoUpdate: function(e, h, a, r) { - return h != "collision" || (this._need_update = !0, !1); +}, afterAutoUpdate: function(e, i, t, r) { + return i != "collision" || (this._need_update = !0, !1); }, fullSync: function() { return this._need_update && (this._need_update = !1, this.loadUpdate()), !0; -}, getUpdates: function(e, h) { - var a = this.$scheduler.ajax; +}, getUpdates: function(e, i) { + var t = this.$scheduler.ajax; if (this._update_busy) return !1; - this._update_busy = !0, a.get(e, h); + this._update_busy = !0, t.get(e, i); }, _getXmlNodeValue: function(e) { return e.firstChild ? e.firstChild.nodeValue : ""; }, loadUpdate: function() { - var e = this, h = this.$scheduler.ajax, a = this.$scheduler.getUserData(0, "version"), r = this.serverProcessor + h.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + a].join("&"); + var e = this, i = this.$scheduler.ajax, t = this.$scheduler.getUserData(0, "version"), r = this.serverProcessor + i.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + t].join("&"); r = r.replace("editing=true&", ""), this.getUpdates(r, function(d) { - var i = h.xpath("//userdata", d); - e.$scheduler.setUserData(0, "version", e._getXmlNodeValue(i[0])); - var _ = h.xpath("//update", d); - if (_.length) { + var n = i.xpath("//userdata", d); + e.$scheduler.setUserData(0, "version", e._getXmlNodeValue(n[0])); + var s = i.xpath("//update", d); + if (s.length) { e._silent_mode = !0; - for (var o = 0; o < _.length; o++) { - var t = _[o].getAttribute("status"), n = _[o].getAttribute("id"), s = _[o].getAttribute("parent"); - switch (t) { + for (var _ = 0; _ < s.length; _++) { + var a = s[_].getAttribute("status"), o = s[_].getAttribute("id"), l = s[_].getAttribute("parent"); + switch (a) { case "inserted": - this.callEvent("insertCallback", [_[o], n, s]); + this.callEvent("insertCallback", [s[_], o, l]); break; case "updated": - this.callEvent("updateCallback", [_[o], n, s]); + this.callEvent("updateCallback", [s[_], o, l]); break; case "deleted": - this.callEvent("deleteCallback", [_[o], n, s]); + this.callEvent("deleteCallback", [s[_], o, l]); } } e._silent_mode = !1; @@ -1707,400 +2269,416 @@ G.prototype = { setTransactionMode: function(e, h) { }, _serializeAsJSON: function(e) { if (typeof e == "string") return e; - var h = this.$scheduler.utils.copy(e); - return this._tMode === "REST-JSON" && (delete h.id, delete h[this.action_param]), JSON.stringify(h); + var i = this.$scheduler.utils.copy(e); + return this._tMode === "REST-JSON" && (delete i.id, delete i[this.action_param]), JSON.stringify(i); }, _cleanupArgumentsBeforeSend: function(e) { - var h; + var i; if (e[this.action_param] === void 0) - for (var a in h = {}, e) - h[a] = this._cleanupArgumentsBeforeSend(e[a]); + for (var t in i = {}, e) + i[t] = this._cleanupArgumentsBeforeSend(e[t]); else - h = this._cleanupItemBeforeSend(e); - return h; + i = this._cleanupItemBeforeSend(e); + return i; }, _cleanupItemBeforeSend: function(e) { - var h = null; - return e && (e[this.action_param] === "deleted" ? ((h = {}).id = e.id, h[this.action_param] = e[this.action_param]) : h = e), h; + var i = null; + return e && (e[this.action_param] === "deleted" ? ((i = {}).id = e.id, i[this.action_param] = e[this.action_param]) : i = e), i; }, _forEachUpdatedRow: function(e) { - for (var h = this.updatedRows.slice(), a = 0; a < h.length; a++) { - var r = h[a]; + for (var i = this.updatedRows.slice(), t = 0; t < i.length; t++) { + var r = i[t]; this.$scheduler.getUserData(r, this.action_param) && e.call(this, r); } }, _prepareDataItem: function(e) { - var h = {}, a = this.$scheduler, r = a.utils.copy(e); + var i = {}, t = this.$scheduler, r = t.utils.copy(e); for (var d in r) - d.indexOf("_") !== 0 && r[d] && (r[d].getUTCFullYear ? h[d] = a._helpers.formatDate(r[d]) : typeof r[d] == "object" ? h[d] = this._prepareDataItem(r[d]) : r[d] === null ? h[d] = "" : h[d] = r[d]); - return h[this.action_param] = a.getUserData(e.id, this.action_param), h; + d.indexOf("_") !== 0 && r[d] && (r[d].getUTCFullYear ? i[d] = t._helpers.formatDate(r[d]) : typeof r[d] == "object" ? i[d] = this._prepareDataItem(r[d]) : r[d] === null ? i[d] = "" : i[d] = r[d]); + return i[this.action_param] = t.getUserData(e.id, this.action_param), i; }, _getRowData: function(e) { - var h = this.$scheduler.getEvent(e); - return h || (h = { id: e }), this._prepareDataItem(h); + var i = this.$scheduler.getEvent(e); + return i || (i = { id: e }), this._prepareDataItem(i); } }; -const Se = { date: { month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"], day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"] }, labels: { dhx_cal_today_button: "اليوم", day_tab: "يوم", week_tab: "أسبوع", month_tab: "شهر", new_event: "حدث جديد", icon_save: "اخزن", icon_cancel: "الغاء", icon_details: "تفاصيل", icon_edit: "تحرير", icon_delete: "حذف", confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟", confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟", section_description: "الوصف", section_time: "الفترة الزمنية", full_day: "طوال اليوم", confirm_recurring: "هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟", section_recurring: "تكرار الحدث", button_recurring: "تعطيل", button_recurring_open: "تمكين", button_edit_series: "تحرير سلسلة", button_edit_occurrence: "تعديل نسخة", grid_tab: "جدول", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, Ne = { date: { month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"], month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"], day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"], day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сёння", day_tab: "Дзень", week_tab: "Тыдзень", month_tab: "Месяц", new_event: "Новая падзея", icon_save: "Захаваць", icon_cancel: "Адмяніць", icon_details: "Дэталі", icon_edit: "Змяніць", icon_delete: "Выдаліць", confirm_closing: "", confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?", section_description: "Апісанне", section_time: "Перыяд часу", full_day: "Увесь дзень", confirm_recurring: "Вы хочаце змяніць усю серыю паўтаральных падзей?", section_recurring: "Паўтарэнне", button_recurring: "Адключана", button_recurring_open: "Уключана", button_edit_series: "Рэдагаваць серыю", button_edit_occurrence: "Рэдагаваць асобнік", agenda_tab: "Спіс", date: "Дата", description: "Апісанне", year_tab: "Год", week_agenda_tab: "Спіс", grid_tab: "Спic", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Дзень", repeat_radio_week: "Тыдзень", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Кожны", repeat_text_day_count: "дзень", repeat_radio_day_type2: "Кожны працоўны дзень", repeat_week: " Паўтараць кожны", repeat_text_week_count: "тыдзень", repeat_radio_month_type: "Паўтараць", repeat_radio_month_start: "", repeat_text_month_day: " чысла кожнага", repeat_text_month_count: "месяцу", repeat_text_month_count2_before: "кожны ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "дзень", select_year_month: "", repeat_radio_end: "Без даты заканчэння", repeat_text_occurences_count: "паўтораў", repeat_radio_end2: "", repeat_radio_end3: "Да ", month_for_recurring: ["Студзеня", "Лютага", "Сакавіка", "Красавіка", "Мая", "Чэрвеня", "Ліпeня", "Жніўня", "Верасня", "Кастрычніка", "Лістапада", "Снежня"], day_for_recurring: ["Нядзелю", "Панядзелак", "Аўторак", "Сераду", "Чацвер", "Пятніцу", "Суботу"] } }, Me = { date: { month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"] }, labels: { dhx_cal_today_button: "Hui", day_tab: "Dia", week_tab: "Setmana", month_tab: "Mes", new_event: "Nou esdeveniment", icon_save: "Guardar", icon_cancel: "Cancel·lar", icon_details: "Detalls", icon_edit: "Editar", icon_delete: "Esborrar", confirm_closing: "", confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?", section_description: "Descripció", section_time: "Periode de temps", full_day: "Tot el dia", confirm_recurring: "¿Desitja modificar el conjunt d'esdeveniments repetits?", section_recurring: "Repeteixca l'esdeveniment", button_recurring: "Impedit", button_recurring_open: "Permés", button_edit_series: "Edit sèrie", button_edit_occurrence: "Edita Instància", agenda_tab: "Agenda", date: "Data", description: "Descripció", year_tab: "Any", week_agenda_tab: "Agenda", grid_tab: "Taula", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, Ae = { date: { month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], day_short: ["日", "一", "二", "三", "四", "五", "六"] }, labels: { dhx_cal_today_button: "今天", day_tab: "日", week_tab: "周", month_tab: "月", new_event: "新建日程", icon_save: "保存", icon_cancel: "关闭", icon_details: "详细", icon_edit: "编辑", icon_delete: "删除", confirm_closing: "请确认是否撤销修改!", confirm_deleting: "是否删除日程?", section_description: "描述", section_time: "时间范围", full_day: "整天", confirm_recurring: "请确认是否将日程设为重复模式?", section_recurring: "重复周期", button_recurring: "禁用", button_recurring_open: "启用", button_edit_series: "编辑系列", button_edit_occurrence: "编辑实例", agenda_tab: "议程", date: "日期", description: "说明", year_tab: "今年", week_agenda_tab: "议程", grid_tab: "电网", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "按天", repeat_radio_week: "按周", repeat_radio_month: "按月", repeat_radio_year: "按年", repeat_radio_day_type: "每", repeat_text_day_count: "天", repeat_radio_day_type2: "每个工作日", repeat_week: " 重复 每", repeat_text_week_count: "星期的:", repeat_radio_month_type: "重复", repeat_radio_month_start: "在", repeat_text_month_day: "日 每", repeat_text_month_count: "月", repeat_text_month_count2_before: "每", repeat_text_month_count2_after: "月", repeat_year_label: "在", select_year_day2: "的", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "无结束日期", repeat_text_occurences_count: "次结束", repeat_radio_end2: "重复", repeat_radio_end3: "结束于", month_for_recurring: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], day_for_recurring: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] } }, Ce = { date: { month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"], day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"], day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Den", week_tab: "Týden", month_tab: "Měsíc", new_event: "Nová událost", icon_save: "Uložit", icon_cancel: "Zpět", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Smazat", confirm_closing: "", confirm_deleting: "Událost bude trvale smazána, opravdu?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Přejete si upravit celou řadu opakovaných událostí?", section_recurring: "Opakování události", button_recurring: "Vypnuto", button_recurring_open: "Zapnuto", button_edit_series: "Edit series", button_edit_occurrence: "Upravit instance", agenda_tab: "Program", date: "Datum", description: "Poznámka", year_tab: "Rok", full_day: "Full day", week_agenda_tab: "Program", grid_tab: "Mřížka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denně", repeat_radio_week: "Týdně", repeat_radio_month: "Měsíčně", repeat_radio_year: "Ročně", repeat_radio_day_type: "každý", repeat_text_day_count: "Den", repeat_radio_day_type2: "pracovní dny", repeat_week: "Opakuje každých", repeat_text_week_count: "Týdnů na:", repeat_radio_month_type: "u každého", repeat_radio_month_start: "na", repeat_text_month_day: "Den každého", repeat_text_month_count: "Měsíc", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "Měsíc", repeat_year_label: "na", select_year_day2: "v", repeat_text_year_day: "Den v", select_year_month: "", repeat_radio_end: "bez data ukončení", repeat_text_occurences_count: "Události", repeat_radio_end2: "po", repeat_radio_end3: "Konec", month_for_recurring: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], day_for_recurring: ["Neděle ", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"] } }, Te = { date: { month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uge", month_tab: "Måned", new_event: "Ny begivenhed", icon_save: "Gem", icon_cancel: "Fortryd", icon_details: "Detaljer", icon_edit: "Tilret", icon_delete: "Slet", confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?", confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du tilrette hele serien af gentagne begivenheder?", section_recurring: "Gentag begivenhed", button_recurring: "Frakoblet", button_recurring_open: "Tilkoblet", button_edit_series: "Rediger serien", button_edit_occurrence: "Rediger en kopi", agenda_tab: "Dagsorden", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Dagsorden", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ugenlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "På hver arbejdsdag", repeat_week: " Gentager sig hver", repeat_text_week_count: "uge på følgende dage:", repeat_radio_month_type: "Hver den", repeat_radio_month_start: "Den", repeat_text_month_day: " i hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen slutdato", repeat_text_occurences_count: "gentagelse", repeat_radio_end2: "Efter", repeat_radio_end3: "Slut", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }, Oe = { date: { month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"], month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"], day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }, labels: { dhx_cal_today_button: "Heute", day_tab: "Tag", week_tab: "Woche", month_tab: "Monat", new_event: "neuer Eintrag", icon_save: "Speichern", icon_cancel: "Abbrechen", icon_details: "Details", icon_edit: "Ändern", icon_delete: "Löschen", confirm_closing: "", confirm_deleting: "Der Eintrag wird gelöscht", section_description: "Beschreibung", section_time: "Zeitspanne", full_day: "Ganzer Tag", confirm_recurring: "Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?", section_recurring: "Wiederholung", button_recurring: "Aus", button_recurring_open: "An", button_edit_series: "Bearbeiten Sie die Serie", button_edit_occurrence: "Bearbeiten Sie eine Kopie", agenda_tab: "Agenda", date: "Datum", description: "Beschreibung", year_tab: "Jahre", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Täglich", repeat_radio_week: "Wöchentlich", repeat_radio_month: "Monatlich", repeat_radio_year: "Jährlich", repeat_radio_day_type: "jeden", repeat_text_day_count: "Tag", repeat_radio_day_type2: "an jedem Arbeitstag", repeat_week: " Wiederholt sich jede", repeat_text_week_count: "Woche am:", repeat_radio_month_type: "an jedem", repeat_radio_month_start: "am", repeat_text_month_day: "Tag eines jeden", repeat_text_month_count: "Monats", repeat_text_month_count2_before: "jeden", repeat_text_month_count2_after: "Monats", repeat_year_label: "am", select_year_day2: "im", repeat_text_year_day: "Tag im", select_year_month: "", repeat_radio_end: "kein Enddatum", repeat_text_occurences_count: "Ereignissen", repeat_radio_end3: "Schluß", repeat_radio_end2: "nach", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] } }, $e = { date: { month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"], day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"] }, labels: { dhx_cal_today_button: "Σήμερα", day_tab: "Ημέρα", week_tab: "Εβδομάδα", month_tab: "Μήνας", new_event: "Νέο έργο", icon_save: "Αποθήκευση", icon_cancel: "Άκυρο", icon_details: "Λεπτομέρειες", icon_edit: "Επεξεργασία", icon_delete: "Διαγραφή", confirm_closing: "", confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;", section_description: "Περιγραφή", section_time: "Χρονική περίοδος", full_day: "Πλήρης Ημέρα", confirm_recurring: "Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;", section_recurring: "Επαναλαμβανόμενο έργο", button_recurring: "Ανενεργό", button_recurring_open: "Ενεργό", button_edit_series: "Επεξεργαστείτε τη σειρά", button_edit_occurrence: "Επεξεργασία ένα αντίγραφο", agenda_tab: "Ημερήσια Διάταξη", date: "Ημερομηνία", description: "Περιγραφή", year_tab: "Έτος", week_agenda_tab: "Ημερήσια Διάταξη", grid_tab: "Πλέγμα", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Ημερησίως", repeat_radio_week: "Εβδομαδιαίως", repeat_radio_month: "Μηνιαίως", repeat_radio_year: "Ετησίως", repeat_radio_day_type: "Κάθε", repeat_text_day_count: "ημέρα", repeat_radio_day_type2: "Κάθε εργάσιμη", repeat_week: " Επανάληψη κάθε", repeat_text_week_count: "εβδομάδα τις επόμενες ημέρες:", repeat_radio_month_type: "Επανάληψη", repeat_radio_month_start: "Την", repeat_text_month_day: "ημέρα κάθε", repeat_text_month_count: "μήνα", repeat_text_month_count2_before: "κάθε", repeat_text_month_count2_after: "μήνα", repeat_year_label: "Την", select_year_day2: "του", repeat_text_year_day: "ημέρα", select_year_month: "μήνα", repeat_radio_end: "Χωρίς ημερομηνία λήξεως", repeat_text_occurences_count: "επαναλήψεις", repeat_radio_end3: "Λήγει την", repeat_radio_end2: "Μετά από", month_for_recurring: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], day_for_recurring: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"] } }, He = { date: { month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, labels: { dhx_cal_today_button: "Today", day_tab: "Day", week_tab: "Week", month_tab: "Month", new_event: "New event", icon_save: "Save", icon_cancel: "Cancel", icon_details: "Details", icon_edit: "Edit", icon_delete: "Delete", confirm_closing: "", confirm_deleting: "Event will be deleted permanently, are you sure?", section_description: "Description", section_time: "Time period", full_day: "Full day", confirm_recurring: "Do you want to edit the whole set of repeated events?", section_recurring: "Repeat event", button_recurring: "Disabled", button_recurring_open: "Enabled", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Agenda", date: "Date", description: "Description", year_tab: "Year", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daily", repeat_radio_week: "Weekly", repeat_radio_month: "Monthly", repeat_radio_year: "Yearly", repeat_radio_day_type: "Every", repeat_text_day_count: "day", repeat_radio_day_type2: "Every workday", repeat_week: " Repeat every", repeat_text_week_count: "week next days:", repeat_radio_month_type: "Repeat", repeat_radio_month_start: "On", repeat_text_month_day: "day every", repeat_text_month_count: "month", repeat_text_month_count2_before: "every", repeat_text_month_count2_after: "month", repeat_year_label: "On", select_year_day2: "of", repeat_text_year_day: "day", select_year_month: "month", repeat_radio_end: "No end date", repeat_text_occurences_count: "occurrences", repeat_radio_end2: "After", repeat_radio_end3: "End by", month_for_recurring: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], day_for_recurring: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] } }, Le = { date: { month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"] }, labels: { dhx_cal_today_button: "Hoy", day_tab: "Día", week_tab: "Semana", month_tab: "Mes", new_event: "Nuevo evento", icon_save: "Guardar", icon_cancel: "Cancelar", icon_details: "Detalles", icon_edit: "Editar", icon_delete: "Eliminar", confirm_closing: "", confirm_deleting: "El evento se borrará definitivamente, ¿continuar?", section_description: "Descripción", section_time: "Período", full_day: "Todo el día", confirm_recurring: "¿Desea modificar el conjunto de eventos repetidos?", section_recurring: "Repita el evento", button_recurring: "Impedido", button_recurring_open: "Permitido", button_edit_series: "Editar la serie", button_edit_occurrence: "Editar este evento", agenda_tab: "Día", date: "Fecha", description: "Descripción", year_tab: "Año", week_agenda_tab: "Día", grid_tab: "Reja", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diariamente", repeat_radio_week: "Semanalmente", repeat_radio_month: "Mensualmente", repeat_radio_year: "Anualmente", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada jornada de trabajo", repeat_week: " Repetir cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repita", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada ", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "del", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sin fecha de finalización", repeat_text_occurences_count: "ocurrencias", repeat_radio_end3: "Fin", repeat_radio_end2: "Después de", month_for_recurring: ["Enero", "Febrero", "Маrzo", "Аbril", "Mayo", "Junio", "Julio", "Аgosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"], day_for_recurring: ["Domingo", "Lunes", "Martes", "Miércoles", "Jeuves", "Viernes", "Sabado"] } }, ze = { date: { month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"], day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"] }, labels: { dhx_cal_today_button: "Tänään", day_tab: "Päivä", week_tab: "Viikko", month_tab: "Kuukausi", new_event: "Uusi tapahtuma", icon_save: "Tallenna", icon_cancel: "Peru", icon_details: "Tiedot", icon_edit: "Muokkaa", icon_delete: "Poista", confirm_closing: "", confirm_deleting: "Haluatko varmasti poistaa tapahtuman?", section_description: "Kuvaus", section_time: "Aikajakso", full_day: "Koko päivä", confirm_recurring: "Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?", section_recurring: "Toista tapahtuma", button_recurring: "Ei käytössä", button_recurring_open: "Käytössä", button_edit_series: "Muokkaa sarja", button_edit_occurrence: "Muokkaa kopio", agenda_tab: "Esityslista", date: "Päivämäärä", description: "Kuvaus", year_tab: "Vuoden", week_agenda_tab: "Esityslista", grid_tab: "Ritilä", drag_to_create: "Luo uusi vetämällä", drag_to_move: "Siirrä vetämällä", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Päivittäin", repeat_radio_week: "Viikoittain", repeat_radio_month: "Kuukausittain", repeat_radio_year: "Vuosittain", repeat_radio_day_type: "Joka", repeat_text_day_count: "päivä", repeat_radio_day_type2: "Joka arkipäivä", repeat_week: "Toista joka", repeat_text_week_count: "viikko näinä päivinä:", repeat_radio_month_type: "Toista", repeat_radio_month_start: "", repeat_text_month_day: "päivänä joka", repeat_text_month_count: "kuukausi", repeat_text_month_count2_before: "joka", repeat_text_month_count2_after: "kuukausi", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "päivä", select_year_month: "kuukausi", repeat_radio_end: "Ei loppumisaikaa", repeat_text_occurences_count: "Toiston jälkeen", repeat_radio_end3: "Loppuu", repeat_radio_end2: "", month_for_recurring: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], day_for_recurring: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"] } }, je = { date: { month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"], day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels: { dhx_cal_today_button: "Aujourd'hui", day_tab: "Jour", week_tab: "Semaine", month_tab: "Mois", new_event: "Nouvel événement", icon_save: "Enregistrer", icon_cancel: "Annuler", icon_details: "Détails", icon_edit: "Modifier", icon_delete: "Effacer", confirm_closing: "", confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?", section_description: "Description", section_time: "Période", full_day: "Journée complète", confirm_recurring: "Voulez-vous éditer toute une série d'évènements répétés?", section_recurring: "Périodicité", button_recurring: "Désactivé", button_recurring_open: "Activé", button_edit_series: "Modifier la série", button_edit_occurrence: "Modifier une copie", agenda_tab: "Jour", date: "Date", description: "Description", year_tab: "Année", week_agenda_tab: "Jour", grid_tab: "Grille", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidienne", repeat_radio_week: "Hebdomadaire", repeat_radio_month: "Mensuelle", repeat_radio_year: "Annuelle", repeat_radio_day_type: "Chaque", repeat_text_day_count: "jour", repeat_radio_day_type2: "Chaque journée de travail", repeat_week: " Répéter toutes les", repeat_text_week_count: "semaine:", repeat_radio_month_type: "Répéter", repeat_radio_month_start: "Le", repeat_text_month_day: "jour chaque", repeat_text_month_count: "mois", repeat_text_month_count2_before: "chaque", repeat_text_month_count2_after: "mois", repeat_year_label: "Le", select_year_day2: "du", repeat_text_year_day: "jour", select_year_month: "mois", repeat_radio_end: "Pas de date d"achèvement", repeat_text_occurences_count: "occurrences", repeat_radio_end3: "Fin", repeat_radio_end2: "Après", month_for_recurring: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], day_for_recurring: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] } }, Pe = { date: { month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"] }, labels: { dhx_cal_today_button: "היום", day_tab: "יום", week_tab: "שבוע", month_tab: "חודש", new_event: "ארוע חדש", icon_save: "שמור", icon_cancel: "בטל", icon_details: "פרטים", icon_edit: "ערוך", icon_delete: "מחק", confirm_closing: "", confirm_deleting: "ארוע ימחק סופית.להמשיך?", section_description: "תיאור", section_time: "תקופה", confirm_recurring: "האם ברצונך לשנות כל סדרת ארועים מתמשכים?", section_recurring: "להעתיק ארוע", button_recurring: "לא פעיל", button_recurring_open: "פעיל", full_day: "יום שלם", button_edit_series: "ערוך את הסדרה", button_edit_occurrence: "עריכת עותק", agenda_tab: "סדר יום", date: "תאריך", description: "תיאור", year_tab: "לשנה", week_agenda_tab: "סדר יום", grid_tab: "סורג", drag_to_create: "Drag to create", drag_to_move: "גרור כדי להזיז", message_ok: "OK", message_cancel: "בטל", next: "הבא", prev: "הקודם", year: "שנה", month: "חודש", day: "יום", hour: "שעה", minute: "דקה", repeat_radio_day: "יומי", repeat_radio_week: "שבועי", repeat_radio_month: "חודשי", repeat_radio_year: "שנתי", repeat_radio_day_type: "חזור כל", repeat_text_day_count: "ימים", repeat_radio_day_type2: "חזור כל יום עבודה", repeat_week: " חזור כל", repeat_text_week_count: "שבוע לפי ימים:", repeat_radio_month_type: "חזור כל", repeat_radio_month_start: "כל", repeat_text_month_day: "ימים כל", repeat_text_month_count: "חודשים", repeat_text_month_count2_before: "חזור כל", repeat_text_month_count2_after: "חודש", repeat_year_label: "כל", select_year_day2: "בחודש", repeat_text_year_day: "ימים", select_year_month: "חודש", repeat_radio_end: "לעולם לא מסתיים", repeat_text_occurences_count: "אירועים", repeat_radio_end3: "מסתיים ב", repeat_radio_end2: "אחרי", month_for_recurring: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], day_for_recurring: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"] } }, Ve = { date: { month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"], day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"] }, labels: { dhx_cal_today_button: "Ma", day_tab: "Nap", week_tab: "Hét", month_tab: "Hónap", new_event: "Új esemény", icon_save: "Mentés", icon_cancel: "Mégse", icon_details: "Részletek", icon_edit: "Szerkesztés", icon_delete: "Törlés", confirm_closing: "", confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?", section_description: "Leírás", section_time: "Idõszak", full_day: "Egesz napos", confirm_recurring: "Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?", section_recurring: "Esemény ismétlése", button_recurring: "Tiltás", button_recurring_open: "Engedélyezés", button_edit_series: "Edit series", button_edit_occurrence: "Szerkesztés bíróság", agenda_tab: "Napirend", date: "Dátum", description: "Leírás", year_tab: "Év", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, Ie = { date: { month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"], day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, labels: { dhx_cal_today_button: "Hari Ini", day_tab: "Hari", week_tab: "Minggu", month_tab: "Bulan", new_event: "Acara Baru", icon_save: "Simpan", icon_cancel: "Batal", icon_details: "Detail", icon_edit: "Edit", icon_delete: "Hapus", confirm_closing: "", confirm_deleting: "Acara akan dihapus", section_description: "Keterangan", section_time: "Periode", full_day: "Hari penuh", confirm_recurring: "Apakah acara ini akan berulang?", section_recurring: "Acara Rutin", button_recurring: "Tidak Difungsikan", button_recurring_open: "Difungsikan", button_edit_series: "Mengedit seri", button_edit_occurrence: "Mengedit salinan", agenda_tab: "Agenda", date: "Tanggal", description: "Keterangan", year_tab: "Tahun", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, Be = { date: { month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"] }, labels: { dhx_cal_today_button: "Oggi", day_tab: "Giorno", week_tab: "Settimana", month_tab: "Mese", new_event: "Nuovo evento", icon_save: "Salva", icon_cancel: "Chiudi", icon_details: "Dettagli", icon_edit: "Modifica", icon_delete: "Elimina", confirm_closing: "", confirm_deleting: "L'evento sarà eliminato, siete sicuri?", section_description: "Descrizione", section_time: "Periodo di tempo", full_day: "Intera giornata", confirm_recurring: "Vuoi modificare l'intera serie di eventi?", section_recurring: "Ripetere l'evento", button_recurring: "Disattivato", button_recurring_open: "Attivato", button_edit_series: "Modificare la serie", button_edit_occurrence: "Modificare una copia", agenda_tab: "Agenda", date: "Data", description: "Descrizione", year_tab: "Anno", week_agenda_tab: "Agenda", grid_tab: "Griglia", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidiano", repeat_radio_week: "Settimanale", repeat_radio_month: "Mensile", repeat_radio_year: "Annuale", repeat_radio_day_type: "Ogni", repeat_text_day_count: "giorno", repeat_radio_day_type2: "Ogni giornata lavorativa", repeat_week: " Ripetere ogni", repeat_text_week_count: "settimana:", repeat_radio_month_type: "Ripetere", repeat_radio_month_start: "Il", repeat_text_month_day: "giorno ogni", repeat_text_month_count: "mese", repeat_text_month_count2_before: "ogni", repeat_text_month_count2_after: "mese", repeat_year_label: "Il", select_year_day2: "del", repeat_text_year_day: "giorno", select_year_month: "mese", repeat_radio_end: "Senza data finale", repeat_text_occurences_count: "occorenze", repeat_radio_end3: "Fine", repeat_radio_end2: "Dopo", month_for_recurring: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Jiugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], day_for_recurring: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Jovedì", "Venerdì", "Sabato"] } }, Re = { date: { month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], day_short: ["日", "月", "火", "水", "木", "金", "土"] }, labels: { dhx_cal_today_button: "今日", day_tab: "日", week_tab: "週", month_tab: "月", new_event: "新イベント", icon_save: "保存", icon_cancel: "キャンセル", icon_details: "詳細", icon_edit: "編集", icon_delete: "削除", confirm_closing: "", confirm_deleting: "イベント完全に削除されます、宜しいですか?", section_description: "デスクリプション", section_time: "期間", confirm_recurring: "繰り返されているイベントを全て編集しますか?", section_recurring: "イベントを繰り返す", button_recurring: "無効", button_recurring_open: "有効", full_day: "終日", button_edit_series: "シリーズを編集します", button_edit_occurrence: "コピーを編集", agenda_tab: "議題は", date: "日付", description: "説明", year_tab: "今年", week_agenda_tab: "議題は", grid_tab: "グリッド", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -class qe { - constructor(h) { +const Kt = { date: { month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"], day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"] }, labels: { dhx_cal_today_button: "اليوم", day_tab: "يوم", week_tab: "أسبوع", month_tab: "شهر", new_event: "حدث جديد", icon_save: "اخزن", icon_cancel: "الغاء", icon_details: "تفاصيل", icon_edit: "تحرير", icon_delete: "حذف", confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟", confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟", section_description: "الوصف", section_time: "الفترة الزمنية", full_day: "طوال اليوم", confirm_recurring: "هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟", section_recurring: "تكرار الحدث", button_recurring: "تعطيل", button_recurring_open: "تمكين", button_edit_series: "تحرير سلسلة", button_edit_occurrence: "تعديل نسخة", grid_tab: "جدول", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "يومي", repeat_radio_week: "أسبوعي", repeat_radio_month: "شهري", repeat_radio_year: "سنوي", repeat_radio_day_type: "كل", repeat_text_day_count: "يوم", repeat_radio_day_type2: "كل يوم عمل", repeat_week: " تكرار كل", repeat_text_week_count: "أسبوع في الأيام التالية:", repeat_radio_month_type: "تكرار", repeat_radio_month_start: "في", repeat_text_month_day: "يوم كل", repeat_text_month_count: "شهر", repeat_text_month_count2_before: "كل", repeat_text_month_count2_after: "شهر", repeat_year_label: "في", select_year_day2: "من", repeat_text_year_day: "يوم", select_year_month: "شهر", repeat_radio_end: "بدون تاريخ انتهاء", repeat_text_occurences_count: "تكرارات", repeat_radio_end2: "بعد", repeat_radio_end3: "ينتهي في", repeat_never: "أبداً", repeat_daily: "كل يوم", repeat_workdays: "كل يوم عمل", repeat_weekly: "كل أسبوع", repeat_monthly: "كل شهر", repeat_yearly: "كل سنة", repeat_custom: "تخصيص", repeat_freq_day: "يوم", repeat_freq_week: "أسبوع", repeat_freq_month: "شهر", repeat_freq_year: "سنة", repeat_on_date: "في التاريخ", repeat_ends: "ينتهي", month_for_recurring: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_for_recurring: ["الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"] } }, Gt = { date: { month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"], month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"], day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"], day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сёння", day_tab: "Дзень", week_tab: "Тыдзень", month_tab: "Месяц", new_event: "Новая падзея", icon_save: "Захаваць", icon_cancel: "Адмяніць", icon_details: "Дэталі", icon_edit: "Змяніць", icon_delete: "Выдаліць", confirm_closing: "", confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?", section_description: "Апісанне", section_time: "Перыяд часу", full_day: "Увесь дзень", confirm_recurring: "Вы хочаце змяніць усю серыю паўтаральных падзей?", section_recurring: "Паўтарэнне", button_recurring: "Адключана", button_recurring_open: "Уключана", button_edit_series: "Рэдагаваць серыю", button_edit_occurrence: "Рэдагаваць асобнік", agenda_tab: "Спіс", date: "Дата", description: "Апісанне", year_tab: "Год", week_agenda_tab: "Спіс", grid_tab: "Спic", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Дзень", repeat_radio_week: "Тыдзень", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Кожны", repeat_text_day_count: "дзень", repeat_radio_day_type2: "Кожны працоўны дзень", repeat_week: " Паўтараць кожны", repeat_text_week_count: "тыдзень", repeat_radio_month_type: "Паўтараць", repeat_radio_month_start: "", repeat_text_month_day: " чысла кожнага", repeat_text_month_count: "месяцу", repeat_text_month_count2_before: "кожны ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "дзень", select_year_month: "", repeat_radio_end: "Без даты заканчэння", repeat_text_occurences_count: "паўтораў", repeat_radio_end2: "", repeat_radio_end3: "Да ", repeat_never: "Ніколі", repeat_daily: "Кожны дзень", repeat_workdays: "Кожны працоўны дзень", repeat_weekly: "Кожны тыдзень", repeat_monthly: "Кожны месяц", repeat_yearly: "Кожны год", repeat_custom: "Наладжвальны", repeat_freq_day: "Дзень", repeat_freq_week: "Тыдзень", repeat_freq_month: "Месяц", repeat_freq_year: "Год", repeat_on_date: "На дату", repeat_ends: "Заканчваецца", month_for_recurring: ["Студзеня", "Лютага", "Сакавіка", "Красавіка", "Мая", "Чэрвеня", "Ліпeня", "Жніўня", "Верасня", "Кастрычніка", "Лістапада", "Снежня"], day_for_recurring: ["Нядзелю", "Панядзелак", "Аўторак", "Сераду", "Чацвер", "Пятніцу", "Суботу"] } }, Xt = { date: { month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"] }, labels: { dhx_cal_today_button: "Hui", day_tab: "Dia", week_tab: "Setmana", month_tab: "Mes", new_event: "Nou esdeveniment", icon_save: "Guardar", icon_cancel: "Cancel·lar", icon_details: "Detalls", icon_edit: "Editar", icon_delete: "Esborrar", confirm_closing: "", confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?", section_description: "Descripció", section_time: "Periode de temps", full_day: "Tot el dia", confirm_recurring: "¿Desitja modificar el conjunt d'esdeveniments repetits?", section_recurring: "Repeteixca l'esdeveniment", button_recurring: "Impedit", button_recurring_open: "Permés", button_edit_series: "Edit sèrie", button_edit_occurrence: "Edita Instància", agenda_tab: "Agenda", date: "Data", description: "Descripció", year_tab: "Any", week_agenda_tab: "Agenda", grid_tab: "Taula", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diari", repeat_radio_week: "Setmanal", repeat_radio_month: "Mensual", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada dia laborable", repeat_week: " Repetir cada", repeat_text_week_count: "setmana els dies següents:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "de", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sense data de finalització", repeat_text_occurences_count: "ocurrències", repeat_radio_end2: "Després", repeat_radio_end3: "Finalitzar el", repeat_never: "Mai", repeat_daily: "Cada dia", repeat_workdays: "Cada dia laborable", repeat_weekly: "Cada setmana", repeat_monthly: "Cada mes", repeat_yearly: "Cada any", repeat_custom: "Personalitzat", repeat_freq_day: "Dia", repeat_freq_week: "Setmana", repeat_freq_month: "Mes", repeat_freq_year: "Any", repeat_on_date: "En la data", repeat_ends: "Finalitza", month_for_recurring: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], day_for_recurring: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] } }, Zt = { date: { month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], day_short: ["日", "一", "二", "三", "四", "五", "六"] }, labels: { dhx_cal_today_button: "今天", day_tab: "日", week_tab: "周", month_tab: "月", new_event: "新建日程", icon_save: "保存", icon_cancel: "关闭", icon_details: "详细", icon_edit: "编辑", icon_delete: "删除", confirm_closing: "请确认是否撤销修改!", confirm_deleting: "是否删除日程?", section_description: "描述", section_time: "时间范围", full_day: "整天", confirm_recurring: "请确认是否将日程设为重复模式?", section_recurring: "重复周期", button_recurring: "禁用", button_recurring_open: "启用", button_edit_series: "编辑系列", button_edit_occurrence: "编辑实例", agenda_tab: "议程", date: "日期", description: "说明", year_tab: "今年", week_agenda_tab: "议程", grid_tab: "电网", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "按天", repeat_radio_week: "按周", repeat_radio_month: "按月", repeat_radio_year: "按年", repeat_radio_day_type: "每", repeat_text_day_count: "天", repeat_radio_day_type2: "每个工作日", repeat_week: " 重复 每", repeat_text_week_count: "星期的:", repeat_radio_month_type: "重复", repeat_radio_month_start: "在", repeat_text_month_day: "日 每", repeat_text_month_count: "月", repeat_text_month_count2_before: "每", repeat_text_month_count2_after: "月", repeat_year_label: "在", select_year_day2: "的", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "无结束日期", repeat_text_occurences_count: "次结束", repeat_radio_end2: "重复", repeat_radio_end3: "结束于", repeat_never: "从不", repeat_daily: "每天", repeat_workdays: "每个工作日", repeat_weekly: "每周", repeat_monthly: "每月", repeat_yearly: "每年", repeat_custom: "自定义", repeat_freq_day: "天", repeat_freq_week: "周", repeat_freq_month: "月", repeat_freq_year: "年", repeat_on_date: "在日期", repeat_ends: "结束", month_for_recurring: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], day_for_recurring: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] } }, Qt = { date: { month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"], day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"], day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Den", week_tab: "Týden", month_tab: "Měsíc", new_event: "Nová událost", icon_save: "Uložit", icon_cancel: "Zpět", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Smazat", confirm_closing: "", confirm_deleting: "Událost bude trvale smazána, opravdu?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Přejete si upravit celou řadu opakovaných událostí?", section_recurring: "Opakování události", button_recurring: "Vypnuto", button_recurring_open: "Zapnuto", button_edit_series: "Edit series", button_edit_occurrence: "Upravit instance", agenda_tab: "Program", date: "Datum", description: "Poznámka", year_tab: "Rok", full_day: "Full day", week_agenda_tab: "Program", grid_tab: "Mřížka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denně", repeat_radio_week: "Týdně", repeat_radio_month: "Měsíčně", repeat_radio_year: "Ročně", repeat_radio_day_type: "každý", repeat_text_day_count: "Den", repeat_radio_day_type2: "pracovní dny", repeat_week: "Opakuje každých", repeat_text_week_count: "Týdnů na:", repeat_radio_month_type: "u každého", repeat_radio_month_start: "na", repeat_text_month_day: "Den každého", repeat_text_month_count: "Měsíc", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "Měsíc", repeat_year_label: "na", select_year_day2: "v", repeat_text_year_day: "Den v", select_year_month: "", repeat_radio_end: "bez data ukončení", repeat_text_occurences_count: "Události", repeat_radio_end2: "po", repeat_radio_end3: "Konec", repeat_never: "Nikdy", repeat_daily: "Každý den", repeat_workdays: "Každý pracovní den", repeat_weekly: "Každý týden", repeat_monthly: "Každý měsíc", repeat_yearly: "Každý rok", repeat_custom: "Vlastní", repeat_freq_day: "Den", repeat_freq_week: "Týden", repeat_freq_month: "Měsíc", repeat_freq_year: "Rok", repeat_on_date: "Na datum", repeat_ends: "Končí", month_for_recurring: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], day_for_recurring: ["Neděle ", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"] } }, ea = { date: { month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uge", month_tab: "Måned", new_event: "Ny begivenhed", icon_save: "Gem", icon_cancel: "Fortryd", icon_details: "Detaljer", icon_edit: "Tilret", icon_delete: "Slet", confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?", confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du tilrette hele serien af gentagne begivenheder?", section_recurring: "Gentag begivenhed", button_recurring: "Frakoblet", button_recurring_open: "Tilkoblet", button_edit_series: "Rediger serien", button_edit_occurrence: "Rediger en kopi", agenda_tab: "Dagsorden", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Dagsorden", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ugenlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "På hver arbejdsdag", repeat_week: " Gentager sig hver", repeat_text_week_count: "uge på følgende dage:", repeat_radio_month_type: "Hver den", repeat_radio_month_start: "Den", repeat_text_month_day: " i hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen slutdato", repeat_text_occurences_count: "gentagelse", repeat_radio_end2: "Efter", repeat_radio_end3: "Slut", repeat_never: "Aldrig", repeat_daily: "Hver dag", repeat_workdays: "Hver hverdag", repeat_weekly: "Hver uge", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Brugerdefineret", repeat_freq_day: "Dag", repeat_freq_week: "Uge", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }, ta = { date: { month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"], month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"], day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }, labels: { dhx_cal_today_button: "Heute", day_tab: "Tag", week_tab: "Woche", month_tab: "Monat", new_event: "neuer Eintrag", icon_save: "Speichern", icon_cancel: "Abbrechen", icon_details: "Details", icon_edit: "Ändern", icon_delete: "Löschen", confirm_closing: "", confirm_deleting: "Der Eintrag wird gelöscht", section_description: "Beschreibung", section_time: "Zeitspanne", full_day: "Ganzer Tag", confirm_recurring: "Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?", section_recurring: "Wiederholung", button_recurring: "Aus", button_recurring_open: "An", button_edit_series: "Bearbeiten Sie die Serie", button_edit_occurrence: "Bearbeiten Sie eine Kopie", agenda_tab: "Agenda", date: "Datum", description: "Beschreibung", year_tab: "Jahre", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Täglich", repeat_radio_week: "Wöchentlich", repeat_radio_month: "Monatlich", repeat_radio_year: "Jährlich", repeat_radio_day_type: "jeden", repeat_text_day_count: "Tag", repeat_radio_day_type2: "an jedem Arbeitstag", repeat_week: " Wiederholt sich jede", repeat_text_week_count: "Woche am:", repeat_radio_month_type: "an jedem", repeat_radio_month_start: "am", repeat_text_month_day: "Tag eines jeden", repeat_text_month_count: "Monats", repeat_text_month_count2_before: "jeden", repeat_text_month_count2_after: "Monats", repeat_year_label: "am", select_year_day2: "im", repeat_text_year_day: "Tag im", select_year_month: "", repeat_radio_end: "kein Enddatum", repeat_text_occurences_count: "Ereignissen", repeat_radio_end3: "Schluß", repeat_radio_end2: "nach", repeat_never: "Nie", repeat_daily: "Jeden Tag", repeat_workdays: "Jeden Werktag", repeat_weekly: "Jede Woche", repeat_monthly: "Jeden Monat", repeat_yearly: "Jedes Jahr", repeat_custom: "Benutzerdefiniert", repeat_freq_day: "Tag", repeat_freq_week: "Woche", repeat_freq_month: "Monat", repeat_freq_year: "Jahr", repeat_on_date: "Am Datum", repeat_ends: "Endet", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] } }, aa = { date: { month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"], day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"] }, labels: { dhx_cal_today_button: "Σήμερα", day_tab: "Ημέρα", week_tab: "Εβδομάδα", month_tab: "Μήνας", new_event: "Νέο έργο", icon_save: "Αποθήκευση", icon_cancel: "Άκυρο", icon_details: "Λεπτομέρειες", icon_edit: "Επεξεργασία", icon_delete: "Διαγραφή", confirm_closing: "", confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;", section_description: "Περιγραφή", section_time: "Χρονική περίοδος", full_day: "Πλήρης Ημέρα", confirm_recurring: "Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;", section_recurring: "Επαναλαμβανόμενο έργο", button_recurring: "Ανενεργό", button_recurring_open: "Ενεργό", button_edit_series: "Επεξεργαστείτε τη σειρά", button_edit_occurrence: "Επεξεργασία ένα αντίγραφο", agenda_tab: "Ημερήσια Διάταξη", date: "Ημερομηνία", description: "Περιγραφή", year_tab: "Έτος", week_agenda_tab: "Ημερήσια Διάταξη", grid_tab: "Πλέγμα", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Ημερησίως", repeat_radio_week: "Εβδομαδιαίως", repeat_radio_month: "Μηνιαίως", repeat_radio_year: "Ετησίως", repeat_radio_day_type: "Κάθε", repeat_text_day_count: "ημέρα", repeat_radio_day_type2: "Κάθε εργάσιμη", repeat_week: " Επανάληψη κάθε", repeat_text_week_count: "εβδομάδα τις επόμενες ημέρες:", repeat_radio_month_type: "Επανάληψη", repeat_radio_month_start: "Την", repeat_text_month_day: "ημέρα κάθε", repeat_text_month_count: "μήνα", repeat_text_month_count2_before: "κάθε", repeat_text_month_count2_after: "μήνα", repeat_year_label: "Την", select_year_day2: "του", repeat_text_year_day: "ημέρα", select_year_month: "μήνα", repeat_radio_end: "Χωρίς ημερομηνία λήξεως", repeat_text_occurences_count: "επαναλήψεις", repeat_radio_end3: "Λήγει την", repeat_radio_end2: "Μετά από", repeat_never: "Ποτέ", repeat_daily: "Κάθε μέρα", repeat_workdays: "Κάθε εργάσιμη μέρα", repeat_weekly: "Κάθε εβδομάδα", repeat_monthly: "Κάθε μήνα", repeat_yearly: "Κάθε χρόνο", repeat_custom: "Προσαρμοσμένο", repeat_freq_day: "Ημέρα", repeat_freq_week: "Εβδομάδα", repeat_freq_month: "Μήνας", repeat_freq_year: "Χρόνος", repeat_on_date: "Σε ημερομηνία", repeat_ends: "Λήγει", month_for_recurring: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], day_for_recurring: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"] } }, na = { date: { month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, labels: { dhx_cal_today_button: "Today", day_tab: "Day", week_tab: "Week", month_tab: "Month", new_event: "New event", icon_save: "Save", icon_cancel: "Cancel", icon_details: "Details", icon_edit: "Edit", icon_delete: "Delete", confirm_closing: "", confirm_deleting: "Event will be deleted permanently, are you sure?", section_description: "Description", section_time: "Time period", full_day: "Full day", confirm_recurring: "Do you want to edit the whole set of repeated events?", section_recurring: "Repeat event", button_recurring: "Disabled", button_recurring_open: "Enabled", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Agenda", date: "Date", description: "Description", year_tab: "Year", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daily", repeat_radio_week: "Weekly", repeat_radio_month: "Monthly", repeat_radio_year: "Yearly", repeat_radio_day_type: "Every", repeat_text_day_count: "day", repeat_radio_day_type2: "Every workday", repeat_week: " Repeat every", repeat_text_week_count: "week next days:", repeat_radio_month_type: "Repeat", repeat_radio_month_start: "On", repeat_text_month_day: "day every", repeat_text_month_count: "month", repeat_text_month_count2_before: "every", repeat_text_month_count2_after: "month", repeat_year_label: "On", select_year_day2: "of", repeat_text_year_day: "day", select_year_month: "month", repeat_radio_end: "No end date", repeat_text_occurences_count: "occurrences", repeat_radio_end2: "After", repeat_radio_end3: "End by", repeat_never: "Never", repeat_daily: "Every day", repeat_workdays: "Every weekday", repeat_weekly: "Every week", repeat_monthly: "Every month", repeat_yearly: "Every year", repeat_custom: "Custom", repeat_freq_day: "Day", repeat_freq_week: "Week", repeat_freq_month: "Month", repeat_freq_year: "Year", repeat_on_date: "On date", repeat_ends: "Ends", month_for_recurring: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], day_for_recurring: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] } }, ra = { date: { month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"] }, labels: { dhx_cal_today_button: "Hoy", day_tab: "Día", week_tab: "Semana", month_tab: "Mes", new_event: "Nuevo evento", icon_save: "Guardar", icon_cancel: "Cancelar", icon_details: "Detalles", icon_edit: "Editar", icon_delete: "Eliminar", confirm_closing: "", confirm_deleting: "El evento se borrará definitivamente, ¿continuar?", section_description: "Descripción", section_time: "Período", full_day: "Todo el día", confirm_recurring: "¿Desea modificar el conjunto de eventos repetidos?", section_recurring: "Repita el evento", button_recurring: "Impedido", button_recurring_open: "Permitido", button_edit_series: "Editar la serie", button_edit_occurrence: "Editar este evento", agenda_tab: "Día", date: "Fecha", description: "Descripción", year_tab: "Año", week_agenda_tab: "Día", grid_tab: "Reja", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diariamente", repeat_radio_week: "Semanalmente", repeat_radio_month: "Mensualmente", repeat_radio_year: "Anualmente", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada jornada de trabajo", repeat_week: " Repetir cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repita", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada ", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "del", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sin fecha de finalización", repeat_text_occurences_count: "ocurrencias", repeat_radio_end3: "Fin", repeat_radio_end2: "Después de", repeat_never: "Nunca", repeat_daily: "Cada día", repeat_workdays: "Cada día laborable", repeat_weekly: "Cada semana", repeat_monthly: "Cada mes", repeat_yearly: "Cada año", repeat_custom: "Personalizado", repeat_freq_day: "Día", repeat_freq_week: "Semana", repeat_freq_month: "Mes", repeat_freq_year: "Año", repeat_on_date: "En la fecha", repeat_ends: "Termina", month_for_recurring: ["Enero", "Febrero", "Маrzo", "Аbril", "Mayo", "Junio", "Julio", "Аgosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"], day_for_recurring: ["Domingo", "Lunes", "Martes", "Miércoles", "Jeuves", "Viernes", "Sabado"] } }, ia = { date: { month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"], day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"] }, labels: { dhx_cal_today_button: "Tänään", day_tab: "Päivä", week_tab: "Viikko", month_tab: "Kuukausi", new_event: "Uusi tapahtuma", icon_save: "Tallenna", icon_cancel: "Peru", icon_details: "Tiedot", icon_edit: "Muokkaa", icon_delete: "Poista", confirm_closing: "", confirm_deleting: "Haluatko varmasti poistaa tapahtuman?", section_description: "Kuvaus", section_time: "Aikajakso", full_day: "Koko päivä", confirm_recurring: "Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?", section_recurring: "Toista tapahtuma", button_recurring: "Ei käytössä", button_recurring_open: "Käytössä", button_edit_series: "Muokkaa sarja", button_edit_occurrence: "Muokkaa kopio", agenda_tab: "Esityslista", date: "Päivämäärä", description: "Kuvaus", year_tab: "Vuoden", week_agenda_tab: "Esityslista", grid_tab: "Ritilä", drag_to_create: "Luo uusi vetämällä", drag_to_move: "Siirrä vetämällä", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Päivittäin", repeat_radio_week: "Viikoittain", repeat_radio_month: "Kuukausittain", repeat_radio_year: "Vuosittain", repeat_radio_day_type: "Joka", repeat_text_day_count: "päivä", repeat_radio_day_type2: "Joka arkipäivä", repeat_week: "Toista joka", repeat_text_week_count: "viikko näinä päivinä:", repeat_radio_month_type: "Toista", repeat_radio_month_start: "", repeat_text_month_day: "päivänä joka", repeat_text_month_count: "kuukausi", repeat_text_month_count2_before: "joka", repeat_text_month_count2_after: "kuukausi", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "päivä", select_year_month: "kuukausi", repeat_radio_end: "Ei loppumisaikaa", repeat_text_occurences_count: "Toiston jälkeen", repeat_radio_end3: "Loppuu", repeat_radio_end2: "", repeat_never: "Ei koskaan", repeat_daily: "Joka päivä", repeat_workdays: "Joka arkipäivä", repeat_weekly: "Joka viikko", repeat_monthly: "Joka kuukausi", repeat_yearly: "Joka vuosi", repeat_custom: "Mukautettu", repeat_freq_day: "Päivä", repeat_freq_week: "Viikko", repeat_freq_month: "Kuukausi", repeat_freq_year: "Vuosi", repeat_on_date: "Tiettynä päivänä", repeat_ends: "Päättyy", month_for_recurring: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], day_for_recurring: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"] } }, oa = { date: { month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"], day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels: { dhx_cal_today_button: "Aujourd'hui", day_tab: "Jour", week_tab: "Semaine", month_tab: "Mois", new_event: "Nouvel événement", icon_save: "Enregistrer", icon_cancel: "Annuler", icon_details: "Détails", icon_edit: "Modifier", icon_delete: "Effacer", confirm_closing: "", confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?", section_description: "Description", section_time: "Période", full_day: "Journée complète", confirm_recurring: "Voulez-vous éditer toute une série d'évènements répétés?", section_recurring: "Périodicité", button_recurring: "Désactivé", button_recurring_open: "Activé", button_edit_series: "Modifier la série", button_edit_occurrence: "Modifier une copie", agenda_tab: "Jour", date: "Date", description: "Description", year_tab: "Année", week_agenda_tab: "Jour", grid_tab: "Grille", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidienne", repeat_radio_week: "Hebdomadaire", repeat_radio_month: "Mensuelle", repeat_radio_year: "Annuelle", repeat_radio_day_type: "Chaque", repeat_text_day_count: "jour", repeat_radio_day_type2: "Chaque journée de travail", repeat_week: " Répéter toutes les", repeat_text_week_count: "semaine:", repeat_radio_month_type: "Répéter", repeat_radio_month_start: "Le", repeat_text_month_day: "jour chaque", repeat_text_month_count: "mois", repeat_text_month_count2_before: "chaque", repeat_text_month_count2_after: "mois", repeat_year_label: "Le", select_year_day2: "du", repeat_text_year_day: "jour", select_year_month: "mois", repeat_radio_end: "Pas de date d"achèvement", repeat_text_occurences_count: "occurrences", repeat_radio_end3: "Fin", repeat_radio_end2: "Après", repeat_never: "Jamais", repeat_daily: "Chaque jour", repeat_workdays: "Chaque jour ouvrable", repeat_weekly: "Chaque semaine", repeat_monthly: "Chaque mois", repeat_yearly: "Chaque année", repeat_custom: "Personnalisé", repeat_freq_day: "Jour", repeat_freq_week: "Semaine", repeat_freq_month: "Mois", repeat_freq_year: "Année", repeat_on_date: "À la date", repeat_ends: "Se termine", month_for_recurring: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], day_for_recurring: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] } }, sa = { date: { month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"] }, labels: { dhx_cal_today_button: "היום", day_tab: "יום", week_tab: "שבוע", month_tab: "חודש", new_event: "ארוע חדש", icon_save: "שמור", icon_cancel: "בטל", icon_details: "פרטים", icon_edit: "ערוך", icon_delete: "מחק", confirm_closing: "", confirm_deleting: "ארוע ימחק סופית.להמשיך?", section_description: "תיאור", section_time: "תקופה", confirm_recurring: "האם ברצונך לשנות כל סדרת ארועים מתמשכים?", section_recurring: "להעתיק ארוע", button_recurring: "לא פעיל", button_recurring_open: "פעיל", full_day: "יום שלם", button_edit_series: "ערוך את הסדרה", button_edit_occurrence: "עריכת עותק", agenda_tab: "סדר יום", date: "תאריך", description: "תיאור", year_tab: "לשנה", week_agenda_tab: "סדר יום", grid_tab: "סורג", drag_to_create: "Drag to create", drag_to_move: "גרור כדי להזיז", message_ok: "OK", message_cancel: "בטל", next: "הבא", prev: "הקודם", year: "שנה", month: "חודש", day: "יום", hour: "שעה", minute: "דקה", repeat_radio_day: "יומי", repeat_radio_week: "שבועי", repeat_radio_month: "חודשי", repeat_radio_year: "שנתי", repeat_radio_day_type: "חזור כל", repeat_text_day_count: "ימים", repeat_radio_day_type2: "חזור כל יום עבודה", repeat_week: " חזור כל", repeat_text_week_count: "שבוע לפי ימים:", repeat_radio_month_type: "חזור כל", repeat_radio_month_start: "כל", repeat_text_month_day: "ימים כל", repeat_text_month_count: "חודשים", repeat_text_month_count2_before: "חזור כל", repeat_text_month_count2_after: "חודש", repeat_year_label: "כל", select_year_day2: "בחודש", repeat_text_year_day: "ימים", select_year_month: "חודש", repeat_radio_end: "לעולם לא מסתיים", repeat_text_occurences_count: "אירועים", repeat_radio_end3: "מסתיים ב", repeat_radio_end2: "אחרי", repeat_never: "אף פעם", repeat_daily: "כל יום", repeat_workdays: "כל יום עבודה", repeat_weekly: "כל שבוע", repeat_monthly: "כל חודש", repeat_yearly: "כל שנה", repeat_custom: "מותאם אישית", repeat_freq_day: "יום", repeat_freq_week: "שבוע", repeat_freq_month: "חודש", repeat_freq_year: "שנה", repeat_on_date: "בתאריך", repeat_ends: "מסתיים", month_for_recurring: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], day_for_recurring: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"] } }, da = { date: { month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"], day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"] }, labels: { dhx_cal_today_button: "Ma", day_tab: "Nap", week_tab: "Hét", month_tab: "Hónap", new_event: "Új esemény", icon_save: "Mentés", icon_cancel: "Mégse", icon_details: "Részletek", icon_edit: "Szerkesztés", icon_delete: "Törlés", confirm_closing: "", confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?", section_description: "Leírás", section_time: "Idõszak", full_day: "Egesz napos", confirm_recurring: "Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?", section_recurring: "Esemény ismétlése", button_recurring: "Tiltás", button_recurring_open: "Engedélyezés", button_edit_series: "Edit series", button_edit_occurrence: "Szerkesztés bíróság", agenda_tab: "Napirend", date: "Dátum", description: "Leírás", year_tab: "Év", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Napi", repeat_radio_week: "Heti", repeat_radio_month: "Havi", repeat_radio_year: "Éves", repeat_radio_day_type: "Minden", repeat_text_day_count: "nap", repeat_radio_day_type2: "Minden munkanap", repeat_week: " Ismételje meg minden", repeat_text_week_count: "héten a következő napokon:", repeat_radio_month_type: "Ismétlés", repeat_radio_month_start: "Ekkor", repeat_text_month_day: "nap minden", repeat_text_month_count: "hónapban", repeat_text_month_count2_before: "minden", repeat_text_month_count2_after: "hónapban", repeat_year_label: "Ekkor", select_year_day2: "-án/-én", repeat_text_year_day: "nap", select_year_month: "hónap", repeat_radio_end: "Nincs befejezési dátum", repeat_text_occurences_count: "esemény", repeat_radio_end2: "Után", repeat_radio_end3: "Befejező dátum", repeat_never: "Soha", repeat_daily: "Minden nap", repeat_workdays: "Minden munkanap", repeat_weekly: "Minden héten", repeat_monthly: "Minden hónapban", repeat_yearly: "Minden évben", repeat_custom: "Egyedi", repeat_freq_day: "Nap", repeat_freq_week: "Hét", repeat_freq_month: "Hónap", repeat_freq_year: "Év", repeat_on_date: "Dátum szerint", repeat_ends: "Befejeződik", month_for_recurring: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], day_for_recurring: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"] } }, _a = { date: { month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"], day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, labels: { dhx_cal_today_button: "Hari Ini", day_tab: "Hari", week_tab: "Minggu", month_tab: "Bulan", new_event: "Acara Baru", icon_save: "Simpan", icon_cancel: "Batal", icon_details: "Detail", icon_edit: "Edit", icon_delete: "Hapus", confirm_closing: "", confirm_deleting: "Acara akan dihapus", section_description: "Keterangan", section_time: "Periode", full_day: "Hari penuh", confirm_recurring: "Apakah acara ini akan berulang?", section_recurring: "Acara Rutin", button_recurring: "Tidak Difungsikan", button_recurring_open: "Difungsikan", button_edit_series: "Mengedit seri", button_edit_occurrence: "Mengedit salinan", agenda_tab: "Agenda", date: "Tanggal", description: "Keterangan", year_tab: "Tahun", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Harian", repeat_radio_week: "Mingguan", repeat_radio_month: "Bulanan", repeat_radio_year: "Tahunan", repeat_radio_day_type: "Setiap", repeat_text_day_count: "hari", repeat_radio_day_type2: "Setiap hari kerja", repeat_week: " Ulangi setiap", repeat_text_week_count: "minggu pada hari berikut:", repeat_radio_month_type: "Ulangi", repeat_radio_month_start: "Pada", repeat_text_month_day: "hari setiap", repeat_text_month_count: "bulan", repeat_text_month_count2_before: "setiap", repeat_text_month_count2_after: "bulan", repeat_year_label: "Pada", select_year_day2: "dari", repeat_text_year_day: "hari", select_year_month: "bulan", repeat_radio_end: "Tanpa tanggal akhir", repeat_text_occurences_count: "kejadian", repeat_radio_end2: "Setelah", repeat_radio_end3: "Berakhir pada", repeat_never: "Tidak pernah", repeat_daily: "Setiap hari", repeat_workdays: "Setiap hari kerja", repeat_weekly: "Setiap minggu", repeat_monthly: "Setiap bulan", repeat_yearly: "Setiap tahun", repeat_custom: "Kustom", repeat_freq_day: "Hari", repeat_freq_week: "Minggu", repeat_freq_month: "Bulan", repeat_freq_year: "Tahun", repeat_on_date: "Pada tanggal", repeat_ends: "Berakhir", month_for_recurring: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] } }, la = { date: { month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"] }, labels: { dhx_cal_today_button: "Oggi", day_tab: "Giorno", week_tab: "Settimana", month_tab: "Mese", new_event: "Nuovo evento", icon_save: "Salva", icon_cancel: "Chiudi", icon_details: "Dettagli", icon_edit: "Modifica", icon_delete: "Elimina", confirm_closing: "", confirm_deleting: "L'evento sarà eliminato, siete sicuri?", section_description: "Descrizione", section_time: "Periodo di tempo", full_day: "Intera giornata", confirm_recurring: "Vuoi modificare l'intera serie di eventi?", section_recurring: "Ripetere l'evento", button_recurring: "Disattivato", button_recurring_open: "Attivato", button_edit_series: "Modificare la serie", button_edit_occurrence: "Modificare una copia", agenda_tab: "Agenda", date: "Data", description: "Descrizione", year_tab: "Anno", week_agenda_tab: "Agenda", grid_tab: "Griglia", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidiano", repeat_radio_week: "Settimanale", repeat_radio_month: "Mensile", repeat_radio_year: "Annuale", repeat_radio_day_type: "Ogni", repeat_text_day_count: "giorno", repeat_radio_day_type2: "Ogni giornata lavorativa", repeat_week: " Ripetere ogni", repeat_text_week_count: "settimana:", repeat_radio_month_type: "Ripetere", repeat_radio_month_start: "Il", repeat_text_month_day: "giorno ogni", repeat_text_month_count: "mese", repeat_text_month_count2_before: "ogni", repeat_text_month_count2_after: "mese", repeat_year_label: "Il", select_year_day2: "del", repeat_text_year_day: "giorno", select_year_month: "mese", repeat_radio_end: "Senza data finale", repeat_text_occurences_count: "occorenze", repeat_radio_end3: "Fine", repeat_radio_end2: "Dopo", repeat_never: "Mai", repeat_daily: "Ogni giorno", repeat_workdays: "Ogni giorno feriale", repeat_weekly: "Ogni settimana", repeat_monthly: "Ogni mese", repeat_yearly: "Ogni anno", repeat_custom: "Personalizzato", repeat_freq_day: "Giorno", repeat_freq_week: "Settimana", repeat_freq_month: "Mese", repeat_freq_year: "Anno", repeat_on_date: "Alla data", repeat_ends: "Finisce", month_for_recurring: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Jiugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], day_for_recurring: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Jovedì", "Venerdì", "Sabato"] } }, ca = { date: { month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], day_short: ["日", "月", "火", "水", "木", "金", "土"] }, labels: { dhx_cal_today_button: "今日", day_tab: "日", week_tab: "週", month_tab: "月", new_event: "新イベント", icon_save: "保存", icon_cancel: "キャンセル", icon_details: "詳細", icon_edit: "編集", icon_delete: "削除", confirm_closing: "", confirm_deleting: "イベント完全に削除されます、宜しいですか?", section_description: "デスクリプション", section_time: "期間", confirm_recurring: "繰り返されているイベントを全て編集しますか?", section_recurring: "イベントを繰り返す", button_recurring: "無効", button_recurring_open: "有効", full_day: "終日", button_edit_series: "シリーズを編集します", button_edit_occurrence: "コピーを編集", agenda_tab: "議題は", date: "日付", description: "説明", year_tab: "今年", week_agenda_tab: "議題は", grid_tab: "グリッド", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "毎日", repeat_radio_week: "毎週", repeat_radio_month: "毎月", repeat_radio_year: "毎年", repeat_radio_day_type: "毎", repeat_text_day_count: "日", repeat_radio_day_type2: "毎営業日", repeat_week: " 繰り返し毎", repeat_text_week_count: "週 次の日:", repeat_radio_month_type: "繰り返し", repeat_radio_month_start: "オン", repeat_text_month_day: "日毎", repeat_text_month_count: "月", repeat_text_month_count2_before: "毎", repeat_text_month_count2_after: "月", repeat_year_label: "オン", select_year_day2: "の", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "終了日なし", repeat_text_occurences_count: "回数", repeat_radio_end2: "後", repeat_radio_end3: "終了日まで", repeat_never: "決して", repeat_daily: "毎日", repeat_workdays: "毎営業日", repeat_weekly: "毎週", repeat_monthly: "毎月", repeat_yearly: "毎年", repeat_custom: "カスタム", repeat_freq_day: "日", repeat_freq_week: "週", repeat_freq_month: "月", repeat_freq_year: "年", repeat_on_date: "日にち", repeat_ends: "終了", month_for_recurring: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_for_recurring: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"] } }; +class ha { + constructor(i) { this._locales = {}; - for (const a in h) - this._locales[a] = h[a]; + for (const t in i) + this._locales[t] = i[t]; } - addLocale(h, a) { - this._locales[h] = a; + addLocale(i, t) { + this._locales[i] = t; } - getLocale(h) { - return this._locales[h]; + getLocale(i) { + return this._locales[i]; } } -const Fe = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "I dag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny hendelse", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du forandre hele dette settet av repeterende hendelser?", section_recurring: "Repeter hendelsen", button_recurring: "Av", button_recurring_open: "På", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Alle hverdager", repeat_week: " Gjentas hver", repeat_text_week_count: "uke på:", repeat_radio_month_type: "På hver", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "på", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomst", repeat_radio_end3: "Stop den", repeat_radio_end2: "Etter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Sondag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }, Je = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { dhx_cal_today_button: "Vandaag", day_tab: "Dag", week_tab: "Week", month_tab: "Maand", new_event: "Nieuw item", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", full_day: "Hele dag", confirm_recurring: "Wilt u alle terugkerende items bijwerken?", section_recurring: "Item herhalen", button_recurring: "Uit", button_recurring_open: "Aan", button_edit_series: "Bewerk de serie", button_edit_occurrence: "Bewerk een kopie", agenda_tab: "Agenda", date: "Datum", description: "Omschrijving", year_tab: "Jaar", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagelijks", repeat_radio_week: "Wekelijks", repeat_radio_month: "Maandelijks", repeat_radio_year: "Jaarlijks", repeat_radio_day_type: "Elke", repeat_text_day_count: "dag(en)", repeat_radio_day_type2: "Elke werkdag", repeat_week: " Herhaal elke", repeat_text_week_count: "week op de volgende dagen:", repeat_radio_month_type: "Herhaal", repeat_radio_month_start: "Op", repeat_text_month_day: "dag iedere", repeat_text_month_count: "maanden", repeat_text_month_count2_before: "iedere", repeat_text_month_count2_after: "maanden", repeat_year_label: "Op", select_year_day2: "van", repeat_text_year_day: "dag", select_year_month: "maand", repeat_radio_end: "Geen eind datum", repeat_text_occurences_count: "keren", repeat_radio_end3: "Eindigd per", repeat_radio_end2: "Na", month_for_recurring: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], day_for_recurring: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"] } }, Ue = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", full_day: "Full dag", confirm_recurring: "Vil du endre hele settet med repeterende oppføringer?", section_recurring: "Repeterende oppføring", button_recurring: "Ikke aktiv", button_recurring_open: "Aktiv", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, Ye = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { dhx_cal_today_button: "Dziś", day_tab: "Dzień", week_tab: "Tydzień", month_tab: "Miesiąc", new_event: "Nowe zdarzenie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", full_day: "Cały dzień", confirm_recurring: "Czy chcesz edytować cały zbiór powtarzających się zdarzeń?", section_recurring: "Powtórz zdarzenie", button_recurring: "Nieaktywne", button_recurring_open: "Aktywne", button_edit_series: "Edytuj serię", button_edit_occurrence: "Edytuj kopię", agenda_tab: "Agenda", date: "Data", description: "Opis", year_tab: "Rok", week_agenda_tab: "Agenda", grid_tab: "Tabela", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Codziennie", repeat_radio_week: "Co tydzie", repeat_radio_month: "Co miesic", repeat_radio_year: "Co rok", repeat_radio_day_type: "Kadego", repeat_text_day_count: "dnia", repeat_radio_day_type2: "Kadego dnia roboczego", repeat_week: " Powtarzaj kadego", repeat_text_week_count: "tygodnia w dni:", repeat_radio_month_type: "Powtrz", repeat_radio_month_start: "W", repeat_text_month_day: "dnia kadego", repeat_text_month_count: "miesica", repeat_text_month_count2_before: "kadego", repeat_text_month_count2_after: "miesica", repeat_year_label: "W", select_year_day2: "miesica", repeat_text_year_day: "dnia miesica", select_year_month: "", repeat_radio_end: "Bez daty kocowej", repeat_text_occurences_count: "wystpieniu/ach", repeat_radio_end3: "Zakocz w", repeat_radio_end2: "Po", month_for_recurring: ["Stycznia", "Lutego", "Marca", "Kwietnia", "Maja", "Czerwca", "Lipca", "Sierpnia", "Wrzenia", "Padziernka", "Listopada", "Grudnia"], day_for_recurring: ["Niedziela", "Poniedziaek", "Wtorek", "roda", "Czwartek", "Pitek", "Sobota"] } }, We = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { dhx_cal_today_button: "Hoje", day_tab: "Dia", week_tab: "Semana", month_tab: "Mês", new_event: "Novo evento", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Deletar", confirm_closing: "", confirm_deleting: "Tem certeza que deseja excluir?", section_description: "Descrição", section_time: "Período de tempo", full_day: "Dia inteiro", confirm_recurring: "Deseja editar todos esses eventos repetidos?", section_recurring: "Repetir evento", button_recurring: "Desabilitar", button_recurring_open: "Habilitar", button_edit_series: "Editar a série", button_edit_occurrence: "Editar uma cópia", agenda_tab: "Dia", date: "Data", description: "Descrição", year_tab: "Ano", week_agenda_tab: "Dia", grid_tab: "Grade", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diário", repeat_radio_week: "Semanal", repeat_radio_month: "Mensal", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia(s)", repeat_radio_day_type2: "Cada trabalho diário", repeat_week: " Repita cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "Em", repeat_text_month_day: "todo dia", repeat_text_month_count: "mês", repeat_text_month_count2_before: "todo", repeat_text_month_count2_after: "mês", repeat_year_label: "Em", select_year_day2: "of", repeat_text_year_day: "dia", select_year_month: "mês", repeat_radio_end: "Sem data final", repeat_text_occurences_count: "ocorrências", repeat_radio_end3: "Fim", repeat_radio_end2: "Depois", month_for_recurring: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], day_for_recurring: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] } }, Ke = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { dhx_cal_today_button: "Astazi", day_tab: "Zi", week_tab: "Saptamana", month_tab: "Luna", new_event: "Eveniment nou", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", full_day: "Toata ziua", confirm_recurring: "Vrei sa editezi toata seria de evenimente repetate?", section_recurring: "Repetare", button_recurring: "Dezactivata", button_recurring_open: "Activata", button_edit_series: "Editeaza serie", button_edit_occurrence: "Editeaza doar intrare", agenda_tab: "Agenda", date: "Data", description: "Descriere", year_tab: "An", week_agenda_tab: "Agenda", grid_tab: "Lista", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Zilnic", repeat_radio_week: "Saptamanal", repeat_radio_month: "Lunar", repeat_radio_year: "Anual", repeat_radio_day_type: "La fiecare", repeat_text_day_count: "zi(le)", repeat_radio_day_type2: "Fiecare zi lucratoare", repeat_week: " Repeta la fiecare", repeat_text_week_count: "saptamana in urmatoarele zile:", repeat_radio_month_type: "Repeta in", repeat_radio_month_start: "In a", repeat_text_month_day: "zi la fiecare", repeat_text_month_count: "luni", repeat_text_month_count2_before: "la fiecare", repeat_text_month_count2_after: "luni", repeat_year_label: "In", select_year_day2: "a lunii", repeat_text_year_day: "zi a lunii", select_year_month: "", repeat_radio_end: "Fara data de sfarsit", repeat_text_occurences_count: "evenimente", repeat_radio_end3: "La data", repeat_radio_end2: "Dupa", month_for_recurring: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], day_for_recurring: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"] } }, Ge = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сегодня", day_tab: "День", week_tab: "Неделя", month_tab: "Месяц", new_event: "Новое событие", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", full_day: "Весь день", confirm_recurring: "Вы хотите изменить всю серию повторяющихся событий?", section_recurring: "Повторение", button_recurring: "Отключено", button_recurring_open: "Включено", button_edit_series: "Редактировать серию", button_edit_occurrence: "Редактировать экземпляр", agenda_tab: "Список", date: "Дата", description: "Описание", year_tab: "Год", week_agenda_tab: "Список", grid_tab: "Таблица", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Неделя", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Каждый", repeat_text_day_count: "день", repeat_radio_day_type2: "Каждый рабочий день", repeat_week: " Повторять каждую", repeat_text_week_count: "неделю , в:", repeat_radio_month_type: "Повторять", repeat_radio_month_start: "", repeat_text_month_day: " числа каждый ", repeat_text_month_count: "месяц", repeat_text_month_count2_before: "каждый ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без даты окончания", repeat_text_occurences_count: "повторений", repeat_radio_end3: "До ", repeat_radio_end2: "", month_for_recurring: ["Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря"], day_for_recurring: ["Воскресенье", "Понедельник", "Вторник", "Среду", "Четверг", "Пятницу", "Субботу"] } }, Xe = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", full_day: "Ves dan", confirm_recurring: "Želite urediti celoten set ponavljajočih dogodkov?", section_recurring: "Ponovi dogodek", button_recurring: "Onemogočeno", button_recurring_open: "Omogočeno", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Zadeva", date: "Datum", description: "Opis", year_tab: "Leto", week_agenda_tab: "Zadeva", grid_tab: "Miza", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, Ze = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Deň", week_tab: "Týždeň", month_tab: "Mesiac", new_event: "Nová udalosť", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Prajete si upraviť celú radu opakovaných udalostí?", section_recurring: "Opakovanie udalosti", button_recurring: "Vypnuté", button_recurring_open: "Zapnuté", button_edit_series: "Upraviť opakovania", button_edit_occurrence: "Upraviť inštancie", agenda_tab: "Program", date: "Dátum", description: "Poznámka", year_tab: "Rok", full_day: "Celý deň", week_agenda_tab: "Program", grid_tab: "Mriežka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denne", repeat_radio_week: "Týždenne", repeat_radio_month: "Mesaène", repeat_radio_year: "Roène", repeat_radio_day_type: "Každý", repeat_text_day_count: "deò", repeat_radio_day_type2: "Každý prac. deò", repeat_week: "Opakova každý", repeat_text_week_count: "týždeò v dòoch:", repeat_radio_month_type: "Opakova", repeat_radio_month_start: "On", repeat_text_month_day: "deò každý", repeat_text_month_count: "mesiac", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "mesiac", repeat_year_label: "On", select_year_day2: "poèas", repeat_text_year_day: "deò", select_year_month: "mesiac", repeat_radio_end: "Bez dátumu ukonèenia", repeat_text_occurences_count: "udalostiach", repeat_radio_end3: "Ukonèi", repeat_radio_end2: "Po", month_for_recurring: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], day_for_recurring: ["Nede¾a", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] } }, Qe = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Vecka", month_tab: "Månad", new_event: "Ny händelse", icon_save: "Spara", icon_cancel: "Ångra", icon_details: "Detaljer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", full_day: "Hela dagen", confirm_recurring: "Vill du redigera hela serien med repeterande händelser?", section_recurring: "Upprepa händelse", button_recurring: "Inaktiverat", button_recurring_open: "Aktiverat", button_edit_series: "Redigera serien", button_edit_occurrence: "Redigera en kopia", agenda_tab: "Dagordning", date: "Datum", description: "Beskrivning", year_tab: "År", week_agenda_tab: "Dagordning", grid_tab: "Galler", drag_to_create: "Dra för att skapa ny", drag_to_move: "Dra för att flytta", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagligen", repeat_radio_week: "Veckovis", repeat_radio_month: "Månadsvis", repeat_radio_year: "Årligen", repeat_radio_day_type: "Var", repeat_text_day_count: "dag", repeat_radio_day_type2: "Varje arbetsdag", repeat_week: " Upprepa var", repeat_text_week_count: "vecka dessa dagar:", repeat_radio_month_type: "Upprepa", repeat_radio_month_start: "Den", repeat_text_month_day: "dagen var", repeat_text_month_count: "månad", repeat_text_month_count2_before: "var", repeat_text_month_count2_after: "månad", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "månad", repeat_radio_end: "Inget slutdatum", repeat_text_occurences_count: "upprepningar", repeat_radio_end3: "Sluta efter", repeat_radio_end2: "Efter", month_for_recurring: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], day_for_recurring: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] } }, et = { date: { month_full: ["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"], month_short: ["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"] }, labels: { dhx_cal_today_button: "Bugün", day_tab: "Gün", week_tab: "Hafta", month_tab: "Ay", new_event: "Uygun", icon_save: "Kaydet", icon_cancel: "Ýptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Etkinlik silinecek, devam?", section_description: "Açýklama", section_time: "Zaman aralýðý", full_day: "Tam gün", confirm_recurring: "Tüm tekrar eden etkinlikler silinecek, devam?", section_recurring: "Etkinliði tekrarla", button_recurring: "Pasif", button_recurring_open: "Aktif", button_edit_series: "Dizi düzenleme", button_edit_occurrence: "Bir kopyasını düzenleyin", agenda_tab: "Ajanda", date: "Tarih", description: "Açýklama", year_tab: "Yýl", week_agenda_tab: "Ajanda", grid_tab: "Izgara", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }, tt = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { dhx_cal_today_button: "Сьогодні", day_tab: "День", week_tab: "Тиждень", month_tab: "Місяць", new_event: "Нова подія", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", full_day: "Весь день", confirm_recurring: "Хочете редагувати весь перелік повторюваних подій?", section_recurring: "Повторювана подія", button_recurring: "Відключено", button_recurring_open: "Включено", button_edit_series: "Редагувати серію", button_edit_occurrence: "Редагувати примірник", agenda_tab: "Перелік", date: "Дата", description: "Опис", year_tab: "Рік", week_agenda_tab: "Перелік", grid_tab: "Таблиця", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Тиждень", repeat_radio_month: "Місяць", repeat_radio_year: "Рік", repeat_radio_day_type: "Кожний", repeat_text_day_count: "день", repeat_radio_day_type2: "Кожний робочий день", repeat_week: " Повторювати кожен", repeat_text_week_count: "тиждень , по:", repeat_radio_month_type: "Повторювати", repeat_radio_month_start: "", repeat_text_month_day: " числа кожний ", repeat_text_month_count: "місяць", repeat_text_month_count2_before: "кожен ", repeat_text_month_count2_after: "місяць", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без дати закінчення", repeat_text_occurences_count: "повторень", repeat_radio_end3: "До ", repeat_radio_end2: "", month_for_recurring: ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], day_for_recurring: ["Неділям", "Понеділкам", "Вівторкам", "Середам", "Четвергам", "П'ятницям", "Суботам"] } }; -class at { - constructor(h, a, r = {}) { - this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...r }, this.container = null, this.element = null, this.onStateChangeHandlers = [], this.scheduler = h, this._domEvents = h._createDomEventScope(), this.state = this.getState(), Q(this), a && (this.container = a, this.render(this.container)), this.onStateChange((d, i) => { - this.callEvent("onStateChange", [i, d]); +const ua = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "I dag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny hendelse", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du forandre hele dette settet av repeterende hendelser?", section_recurring: "Repeter hendelsen", button_recurring: "Av", button_recurring_open: "På", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Alle hverdager", repeat_week: " Gjentas hver", repeat_text_week_count: "uke på:", repeat_radio_month_type: "På hver", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "på", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomst", repeat_radio_end3: "Stop den", repeat_radio_end2: "Etter", repeat_never: "Aldri", repeat_daily: "Hver dag", repeat_workdays: "Hver ukedag", repeat_weekly: "Hver uke", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Tilpasset", repeat_freq_day: "Dag", repeat_freq_week: "Uke", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Sondag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }, fa = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { dhx_cal_today_button: "Vandaag", day_tab: "Dag", week_tab: "Week", month_tab: "Maand", new_event: "Nieuw item", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", full_day: "Hele dag", confirm_recurring: "Wilt u alle terugkerende items bijwerken?", section_recurring: "Item herhalen", button_recurring: "Uit", button_recurring_open: "Aan", button_edit_series: "Bewerk de serie", button_edit_occurrence: "Bewerk een kopie", agenda_tab: "Agenda", date: "Datum", description: "Omschrijving", year_tab: "Jaar", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagelijks", repeat_radio_week: "Wekelijks", repeat_radio_month: "Maandelijks", repeat_radio_year: "Jaarlijks", repeat_radio_day_type: "Elke", repeat_text_day_count: "dag(en)", repeat_radio_day_type2: "Elke werkdag", repeat_week: " Herhaal elke", repeat_text_week_count: "week op de volgende dagen:", repeat_radio_month_type: "Herhaal", repeat_radio_month_start: "Op", repeat_text_month_day: "dag iedere", repeat_text_month_count: "maanden", repeat_text_month_count2_before: "iedere", repeat_text_month_count2_after: "maanden", repeat_year_label: "Op", select_year_day2: "van", repeat_text_year_day: "dag", select_year_month: "maand", repeat_radio_end: "Geen eind datum", repeat_text_occurences_count: "keren", repeat_radio_end3: "Eindigd per", repeat_radio_end2: "Na", repeat_never: "Nooit", repeat_daily: "Elke dag", repeat_workdays: "Elke werkdag", repeat_weekly: "Elke week", repeat_monthly: "Elke maand", repeat_yearly: "Elk jaar", repeat_custom: "Aangepast", repeat_freq_day: "Dag", repeat_freq_week: "Week", repeat_freq_month: "Maand", repeat_freq_year: "Jaar", repeat_on_date: "Op datum", repeat_ends: "Eindigt", month_for_recurring: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], day_for_recurring: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"] } }, pa = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", full_day: "Full dag", confirm_recurring: "Vil du endre hele settet med repeterende oppføringer?", section_recurring: "Repeterende oppføring", button_recurring: "Ikke aktiv", button_recurring_open: "Aktiv", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Hver arbeidsdag", repeat_week: " Gjenta hver", repeat_text_week_count: "uke neste dager:", repeat_radio_month_type: "Gjenta", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "På", select_year_day2: "av", repeat_text_year_day: "dag", select_year_month: "måned", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomster", repeat_radio_end2: "Etter", repeat_radio_end3: "Slutt innen", repeat_never: "Aldri", repeat_daily: "Hver dag", repeat_workdays: "Hver ukedag", repeat_weekly: "Hver uke", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Tilpasset", repeat_freq_day: "Dag", repeat_freq_week: "Uke", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }, ma = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { dhx_cal_today_button: "Dziś", day_tab: "Dzień", week_tab: "Tydzień", month_tab: "Miesiąc", new_event: "Nowe zdarzenie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", full_day: "Cały dzień", confirm_recurring: "Czy chcesz edytować cały zbiór powtarzających się zdarzeń?", section_recurring: "Powtórz zdarzenie", button_recurring: "Nieaktywne", button_recurring_open: "Aktywne", button_edit_series: "Edytuj serię", button_edit_occurrence: "Edytuj kopię", agenda_tab: "Agenda", date: "Data", description: "Opis", year_tab: "Rok", week_agenda_tab: "Agenda", grid_tab: "Tabela", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Codziennie", repeat_radio_week: "Co tydzie", repeat_radio_month: "Co miesic", repeat_radio_year: "Co rok", repeat_radio_day_type: "Kadego", repeat_text_day_count: "dnia", repeat_radio_day_type2: "Kadego dnia roboczego", repeat_week: " Powtarzaj kadego", repeat_text_week_count: "tygodnia w dni:", repeat_radio_month_type: "Powtrz", repeat_radio_month_start: "W", repeat_text_month_day: "dnia kadego", repeat_text_month_count: "miesica", repeat_text_month_count2_before: "kadego", repeat_text_month_count2_after: "miesica", repeat_year_label: "W", select_year_day2: "miesica", repeat_text_year_day: "dnia miesica", select_year_month: "", repeat_radio_end: "Bez daty kocowej", repeat_text_occurences_count: "wystpieniu/ach", repeat_radio_end3: "Zakocz w", repeat_radio_end2: "Po", repeat_never: "Nigdy", repeat_daily: "Codziennie", repeat_workdays: "Każdy dzień roboczy", repeat_weekly: "Co tydzień", repeat_monthly: "Co miesiąc", repeat_yearly: "Co rok", repeat_custom: "Niestandardowy", repeat_freq_day: "Dzień", repeat_freq_week: "Tydzień", repeat_freq_month: "Miesiąc", repeat_freq_year: "Rok", repeat_on_date: "W dniu", repeat_ends: "Kończy się", month_for_recurring: ["Stycznia", "Lutego", "Marca", "Kwietnia", "Maja", "Czerwca", "Lipca", "Sierpnia", "Wrzenia", "Padziernka", "Listopada", "Grudnia"], day_for_recurring: ["Niedziela", "Poniedziaek", "Wtorek", "roda", "Czwartek", "Pitek", "Sobota"] } }, va = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { dhx_cal_today_button: "Hoje", day_tab: "Dia", week_tab: "Semana", month_tab: "Mês", new_event: "Novo evento", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Deletar", confirm_closing: "", confirm_deleting: "Tem certeza que deseja excluir?", section_description: "Descrição", section_time: "Período de tempo", full_day: "Dia inteiro", confirm_recurring: "Deseja editar todos esses eventos repetidos?", section_recurring: "Repetir evento", button_recurring: "Desabilitar", button_recurring_open: "Habilitar", button_edit_series: "Editar a série", button_edit_occurrence: "Editar uma cópia", agenda_tab: "Dia", date: "Data", description: "Descrição", year_tab: "Ano", week_agenda_tab: "Dia", grid_tab: "Grade", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diário", repeat_radio_week: "Semanal", repeat_radio_month: "Mensal", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia(s)", repeat_radio_day_type2: "Cada trabalho diário", repeat_week: " Repita cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "Em", repeat_text_month_day: "todo dia", repeat_text_month_count: "mês", repeat_text_month_count2_before: "todo", repeat_text_month_count2_after: "mês", repeat_year_label: "Em", select_year_day2: "of", repeat_text_year_day: "dia", select_year_month: "mês", repeat_radio_end: "Sem data final", repeat_text_occurences_count: "ocorrências", repeat_radio_end3: "Fim", repeat_radio_end2: "Depois", repeat_never: "Nunca", repeat_daily: "Todos os dias", repeat_workdays: "Todos os dias úteis", repeat_weekly: "Toda semana", repeat_monthly: "Todo mês", repeat_yearly: "Todo ano", repeat_custom: "Personalizado", repeat_freq_day: "Dia", repeat_freq_week: "Semana", repeat_freq_month: "Mês", repeat_freq_year: "Ano", repeat_on_date: "Na data", repeat_ends: "Termina", month_for_recurring: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], day_for_recurring: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] } }, ga = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { dhx_cal_today_button: "Astazi", day_tab: "Zi", week_tab: "Saptamana", month_tab: "Luna", new_event: "Eveniment nou", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", full_day: "Toata ziua", confirm_recurring: "Vrei sa editezi toata seria de evenimente repetate?", section_recurring: "Repetare", button_recurring: "Dezactivata", button_recurring_open: "Activata", button_edit_series: "Editeaza serie", button_edit_occurrence: "Editeaza doar intrare", agenda_tab: "Agenda", date: "Data", description: "Descriere", year_tab: "An", week_agenda_tab: "Agenda", grid_tab: "Lista", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Zilnic", repeat_radio_week: "Saptamanal", repeat_radio_month: "Lunar", repeat_radio_year: "Anual", repeat_radio_day_type: "La fiecare", repeat_text_day_count: "zi(le)", repeat_radio_day_type2: "Fiecare zi lucratoare", repeat_week: " Repeta la fiecare", repeat_text_week_count: "saptamana in urmatoarele zile:", repeat_radio_month_type: "Repeta in", repeat_radio_month_start: "In a", repeat_text_month_day: "zi la fiecare", repeat_text_month_count: "luni", repeat_text_month_count2_before: "la fiecare", repeat_text_month_count2_after: "luni", repeat_year_label: "In", select_year_day2: "a lunii", repeat_text_year_day: "zi a lunii", select_year_month: "", repeat_radio_end: "Fara data de sfarsit", repeat_text_occurences_count: "evenimente", repeat_radio_end3: "La data", repeat_radio_end2: "Dupa", repeat_never: "Niciodată", repeat_daily: "În fiecare zi", repeat_workdays: "În fiecare zi lucrătoare", repeat_weekly: "În fiecare săptămână", repeat_monthly: "În fiecare lună", repeat_yearly: "În fiecare an", repeat_custom: "Personalizat", repeat_freq_day: "Zi", repeat_freq_week: "Săptămână", repeat_freq_month: "Lună", repeat_freq_year: "An", repeat_on_date: "La data", repeat_ends: "Se termină", month_for_recurring: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], day_for_recurring: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"] } }, ya = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сегодня", day_tab: "День", week_tab: "Неделя", month_tab: "Месяц", new_event: "Новое событие", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", full_day: "Весь день", confirm_recurring: "Вы хотите изменить всю серию повторяющихся событий?", section_recurring: "Повторение", button_recurring: "Отключено", button_recurring_open: "Включено", button_edit_series: "Редактировать серию", button_edit_occurrence: "Редактировать экземпляр", agenda_tab: "Список", date: "Дата", description: "Описание", year_tab: "Год", week_agenda_tab: "Список", grid_tab: "Таблица", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Неделя", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Каждый", repeat_text_day_count: "день", repeat_radio_day_type2: "Каждый рабочий день", repeat_week: " Повторять каждую", repeat_text_week_count: "неделю , в:", repeat_radio_month_type: "Повторять", repeat_radio_month_start: "", repeat_text_month_day: " числа каждый ", repeat_text_month_count: "месяц", repeat_text_month_count2_before: "каждый ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без даты окончания", repeat_text_occurences_count: "повторений", repeat_radio_end3: "До ", repeat_radio_end2: "", repeat_never: "Никогда", repeat_daily: "Каждый день", repeat_workdays: "Каждый будний день", repeat_weekly: "Каждую неделю", repeat_monthly: "Каждый месяц", repeat_yearly: "Каждый год", repeat_custom: "Настроить", repeat_freq_day: "День", repeat_freq_week: "Неделя", repeat_freq_month: "Месяц", repeat_freq_year: "Год", repeat_on_date: "В дату", repeat_ends: "Заканчивается", month_for_recurring: ["Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря"], day_for_recurring: ["Воскресенье", "Понедельник", "Вторник", "Среду", "Четверг", "Пятницу", "Субботу"] } }, ba = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", full_day: "Ves dan", confirm_recurring: "Želite urediti celoten set ponavljajočih dogodkov?", section_recurring: "Ponovi dogodek", button_recurring: "Onemogočeno", button_recurring_open: "Omogočeno", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Zadeva", date: "Datum", description: "Opis", year_tab: "Leto", week_agenda_tab: "Zadeva", grid_tab: "Miza", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dnevno", repeat_radio_week: "Tedensko", repeat_radio_month: "Mesečno", repeat_radio_year: "Letno", repeat_radio_day_type: "Vsak", repeat_text_day_count: "dan", repeat_radio_day_type2: "Vsak delovni dan", repeat_week: " Ponavljaj vsak", repeat_text_week_count: "teden na naslednje dni:", repeat_radio_month_type: "Ponavljaj", repeat_radio_month_start: "Na", repeat_text_month_day: "dan vsak", repeat_text_month_count: "mesec", repeat_text_month_count2_before: "vsak", repeat_text_month_count2_after: "mesec", repeat_year_label: "Na", select_year_day2: "od", repeat_text_year_day: "dan", select_year_month: "mesec", repeat_radio_end: "Brez končnega datuma", repeat_text_occurences_count: "pojavitve", repeat_radio_end2: "Po", repeat_radio_end3: "Končaj do", repeat_never: "Nikoli", repeat_daily: "Vsak dan", repeat_workdays: "Vsak delovni dan", repeat_weekly: "Vsak teden", repeat_monthly: "Vsak mesec", repeat_yearly: "Vsako leto", repeat_custom: "Po meri", repeat_freq_day: "Dan", repeat_freq_week: "Teden", repeat_freq_month: "Mesec", repeat_freq_year: "Leto", repeat_on_date: "Na datum", repeat_ends: "Konča se", month_for_recurring: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], day_for_recurring: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"] } }, xa = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Deň", week_tab: "Týždeň", month_tab: "Mesiac", new_event: "Nová udalosť", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Prajete si upraviť celú radu opakovaných udalostí?", section_recurring: "Opakovanie udalosti", button_recurring: "Vypnuté", button_recurring_open: "Zapnuté", button_edit_series: "Upraviť opakovania", button_edit_occurrence: "Upraviť inštancie", agenda_tab: "Program", date: "Dátum", description: "Poznámka", year_tab: "Rok", full_day: "Celý deň", week_agenda_tab: "Program", grid_tab: "Mriežka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denne", repeat_radio_week: "Týždenne", repeat_radio_month: "Mesaène", repeat_radio_year: "Roène", repeat_radio_day_type: "Každý", repeat_text_day_count: "deò", repeat_radio_day_type2: "Každý prac. deò", repeat_week: "Opakova každý", repeat_text_week_count: "týždeò v dòoch:", repeat_radio_month_type: "Opakova", repeat_radio_month_start: "On", repeat_text_month_day: "deò každý", repeat_text_month_count: "mesiac", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "mesiac", repeat_year_label: "On", select_year_day2: "poèas", repeat_text_year_day: "deò", select_year_month: "mesiac", repeat_radio_end: "Bez dátumu ukonèenia", repeat_text_occurences_count: "udalostiach", repeat_radio_end3: "Ukonèi", repeat_radio_end2: "Po", repeat_never: "Nikdy", repeat_daily: "Každý deň", repeat_workdays: "Každý pracovný deň", repeat_weekly: "Každý týždeň", repeat_monthly: "Každý mesiac", repeat_yearly: "Každý rok", repeat_custom: "Vlastné", repeat_freq_day: "Deň", repeat_freq_week: "Týždeň", repeat_freq_month: "Mesiac", repeat_freq_year: "Rok", repeat_on_date: "Na dátum", repeat_ends: "Koniec", month_for_recurring: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], day_for_recurring: ["Nede¾a", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] } }, ka = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Vecka", month_tab: "Månad", new_event: "Ny händelse", icon_save: "Spara", icon_cancel: "Ångra", icon_details: "Detaljer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", full_day: "Hela dagen", confirm_recurring: "Vill du redigera hela serien med repeterande händelser?", section_recurring: "Upprepa händelse", button_recurring: "Inaktiverat", button_recurring_open: "Aktiverat", button_edit_series: "Redigera serien", button_edit_occurrence: "Redigera en kopia", agenda_tab: "Dagordning", date: "Datum", description: "Beskrivning", year_tab: "År", week_agenda_tab: "Dagordning", grid_tab: "Galler", drag_to_create: "Dra för att skapa ny", drag_to_move: "Dra för att flytta", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagligen", repeat_radio_week: "Veckovis", repeat_radio_month: "Månadsvis", repeat_radio_year: "Årligen", repeat_radio_day_type: "Var", repeat_text_day_count: "dag", repeat_radio_day_type2: "Varje arbetsdag", repeat_week: " Upprepa var", repeat_text_week_count: "vecka dessa dagar:", repeat_radio_month_type: "Upprepa", repeat_radio_month_start: "Den", repeat_text_month_day: "dagen var", repeat_text_month_count: "månad", repeat_text_month_count2_before: "var", repeat_text_month_count2_after: "månad", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "månad", repeat_radio_end: "Inget slutdatum", repeat_text_occurences_count: "upprepningar", repeat_radio_end3: "Sluta efter", repeat_radio_end2: "Efter", repeat_never: "Aldrig", repeat_daily: "Varje dag", repeat_workdays: "Varje vardag", repeat_weekly: "Varje vecka", repeat_monthly: "Varje månad", repeat_yearly: "Varje år", repeat_custom: "Anpassad", repeat_freq_day: "Dag", repeat_freq_week: "Vecka", repeat_freq_month: "Månad", repeat_freq_year: "År", repeat_on_date: "På datum", repeat_ends: "Slutar", month_for_recurring: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], day_for_recurring: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] } }, wa = { date: { month_full: ["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"], month_short: ["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"] }, labels: { dhx_cal_today_button: "Bugün", day_tab: "Gün", week_tab: "Hafta", month_tab: "Ay", new_event: "Uygun", icon_save: "Kaydet", icon_cancel: "Ýptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Etkinlik silinecek, devam?", section_description: "Açýklama", section_time: "Zaman aralýðý", full_day: "Tam gün", confirm_recurring: "Tüm tekrar eden etkinlikler silinecek, devam?", section_recurring: "Etkinliði tekrarla", button_recurring: "Pasif", button_recurring_open: "Aktif", button_edit_series: "Dizi düzenleme", button_edit_occurrence: "Bir kopyasını düzenleyin", agenda_tab: "Ajanda", date: "Tarih", description: "Açýklama", year_tab: "Yýl", week_agenda_tab: "Ajanda", grid_tab: "Izgara", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Günlük", repeat_radio_week: "Haftalık", repeat_radio_month: "Aylık", repeat_radio_year: "Yıllık", repeat_radio_day_type: "Her", repeat_text_day_count: "gün", repeat_radio_day_type2: "Her iş günü", repeat_week: " Tekrar her", repeat_text_week_count: "hafta şu günlerde:", repeat_radio_month_type: "Tekrar et", repeat_radio_month_start: "Tarihinde", repeat_text_month_day: "gün her", repeat_text_month_count: "ay", repeat_text_month_count2_before: "her", repeat_text_month_count2_after: "ay", repeat_year_label: "Tarihinde", select_year_day2: "ayın", repeat_text_year_day: "günü", select_year_month: "ay", repeat_radio_end: "Bitiş tarihi yok", repeat_text_occurences_count: "olay", repeat_radio_end2: "Sonra", repeat_radio_end3: "Tarihinde bitir", repeat_never: "Asla", repeat_daily: "Her gün", repeat_workdays: "Her iş günü", repeat_weekly: "Her hafta", repeat_monthly: "Her ay", repeat_yearly: "Her yıl", repeat_custom: "Özel", repeat_freq_day: "Gün", repeat_freq_week: "Hafta", repeat_freq_month: "Ay", repeat_freq_year: "Yıl", repeat_on_date: "Tarihinde", repeat_ends: "Biter", month_for_recurring: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], day_for_recurring: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"] } }, Ea = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { dhx_cal_today_button: "Сьогодні", day_tab: "День", week_tab: "Тиждень", month_tab: "Місяць", new_event: "Нова подія", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", full_day: "Весь день", confirm_recurring: "Хочете редагувати весь перелік повторюваних подій?", section_recurring: "Повторювана подія", button_recurring: "Відключено", button_recurring_open: "Включено", button_edit_series: "Редагувати серію", button_edit_occurrence: "Редагувати примірник", agenda_tab: "Перелік", date: "Дата", description: "Опис", year_tab: "Рік", week_agenda_tab: "Перелік", grid_tab: "Таблиця", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Тиждень", repeat_radio_month: "Місяць", repeat_radio_year: "Рік", repeat_radio_day_type: "Кожний", repeat_text_day_count: "день", repeat_radio_day_type2: "Кожний робочий день", repeat_week: " Повторювати кожен", repeat_text_week_count: "тиждень , по:", repeat_radio_month_type: "Повторювати", repeat_radio_month_start: "", repeat_text_month_day: " числа кожний ", repeat_text_month_count: "місяць", repeat_text_month_count2_before: "кожен ", repeat_text_month_count2_after: "місяць", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без дати закінчення", repeat_text_occurences_count: "повторень", repeat_radio_end3: "До ", repeat_radio_end2: "", repeat_never: "Ніколи", repeat_daily: "Щодня", repeat_workdays: "Щодня в робочі дні", repeat_weekly: "Щотижня", repeat_monthly: "Щомісяця", repeat_yearly: "Щороку", repeat_custom: "Налаштоване", repeat_freq_day: "День", repeat_freq_week: "Тиждень", repeat_freq_month: "Місяць", repeat_freq_year: "Рік", repeat_on_date: "На дату", repeat_ends: "Закінчується", month_for_recurring: ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], day_for_recurring: ["Неділям", "Понеділкам", "Вівторкам", "Середам", "Четвергам", "П'ятницям", "Суботам"] } }; +class Da { + constructor(i, t, r = {}) { + this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...r }, this.container = null, this.element = null, this.onStateChangeHandlers = [], this.scheduler = i, this._domEvents = i._createDomEventScope(), this.state = this.getState(), Ue(this), t && (this.container = t, this.render(this.container)), this.onStateChange((d, n) => { + this.callEvent("onStateChange", [n, d]); }); } getState() { return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] }; } - setState(h) { - const a = { ...this.state }; - h.mode && (h.currentModeIndex = this.state.modes.indexOf(h.mode)), this.state = { ...this.state, ...h }, this._notifyStateChange(a, this.state), this.container && this.render(this.container); + setState(i) { + const t = { ...this.state }; + i.mode && (i.currentModeIndex = this.state.modes.indexOf(i.mode)), this.state = { ...this.state, ...i }, this._notifyStateChange(t, this.state), this.container && this.render(this.container); } - onStateChange(h) { - return this.onStateChangeHandlers.push(h), () => { - const a = this.onStateChangeHandlers.indexOf(h); - a !== -1 && this.onStateChangeHandlers.splice(a, 1); + onStateChange(i) { + return this.onStateChangeHandlers.push(i), () => { + const t = this.onStateChangeHandlers.indexOf(i); + t !== -1 && this.onStateChangeHandlers.splice(t, 1); }; } - _notifyStateChange(h, a) { - this.onStateChangeHandlers.forEach((r) => r(h, a)); + _notifyStateChange(i, t) { + this.onStateChangeHandlers.forEach((r) => r(i, t)); } - _adjustDate(h) { - const { mode: a, date: r } = this.getState(), d = new Date(r); - a === "days" ? d.setMonth(r.getMonth() + h) : a === "months" ? d.setFullYear(r.getFullYear() + h) : d.setFullYear(r.getFullYear() + 10 * h), this.setState({ date: d }); + _adjustDate(i) { + const { mode: t, date: r } = this.getState(), d = new Date(r); + t === "days" ? d.setMonth(r.getMonth() + i) : t === "months" ? d.setFullYear(r.getFullYear() + i) : d.setFullYear(r.getFullYear() + 10 * i), this.setState({ date: d }); } _toggleMode() { - const h = (this.state.currentModeIndex + 1) % this.state.modes.length; - this.setState({ currentModeIndex: h }); + const i = (this.state.currentModeIndex + 1) % this.state.modes.length; + this.setState({ currentModeIndex: i }); } - _renderCalendarHeader(h) { - const { mode: a, date: r } = this.getState(), d = document.createElement("div"); + _renderCalendarHeader(i) { + const { mode: t, date: r } = this.getState(), d = document.createElement("div"); d.classList.add("dhx_cal_datepicker_header"); - const i = document.createElement("button"); - i.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"), d.appendChild(i); - const _ = document.createElement("div"); - if (_.classList.add("dhx_cal_datepicker_title"), a === "days") - _.innerText = r.toLocaleString("default", { month: "long" }) + " " + r.getFullYear(); - else if (a === "months") - _.innerText = r.getFullYear(); + const n = document.createElement("button"); + n.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"), d.appendChild(n); + const s = document.createElement("div"); + if (s.classList.add("dhx_cal_datepicker_title"), t === "days") + s.innerText = r.toLocaleString("default", { month: "long" }) + " " + r.getFullYear(); + else if (t === "months") + s.innerText = r.getFullYear(); else { - const t = 10 * Math.floor(r.getFullYear() / 10); - _.innerText = `${t} - ${t + 9}`; + const a = 10 * Math.floor(r.getFullYear() / 10); + s.innerText = `${a} - ${a + 9}`; } - this._domEvents.attach(_, "click", this._toggleMode.bind(this)), d.appendChild(_); - const o = document.createElement("button"); - o.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"), d.appendChild(o), h.appendChild(d), this._domEvents.attach(i, "click", this._adjustDate.bind(this, -1)), this._domEvents.attach(o, "click", this._adjustDate.bind(this, 1)); + this._domEvents.attach(s, "click", this._toggleMode.bind(this)), d.appendChild(s); + const _ = document.createElement("button"); + _.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"), d.appendChild(_), i.appendChild(d), this._domEvents.attach(n, "click", this._adjustDate.bind(this, -1)), this._domEvents.attach(_, "click", this._adjustDate.bind(this, 1)); } - render(h) { - this._domEvents.detachAll(), this.container = h || this.container, this.container.innerHTML = "", this.element || (this.element = document.createElement("div"), this.element.classList.add("dhx_cal_datepicker")), this.element.innerHTML = "", this.container.appendChild(this.element), this._renderCalendarHeader(this.element); - const a = document.createElement("div"); - a.classList.add("dhx_cal_datepicker_data"), this.element.appendChild(a); + render(i) { + this._domEvents.detachAll(), this.container = i || this.container, this.container.innerHTML = "", this.element || (this.element = document.createElement("div"), this.element.classList.add("dhx_cal_datepicker")), this.element.innerHTML = "", this.container.appendChild(this.element), this._renderCalendarHeader(this.element); + const t = document.createElement("div"); + t.classList.add("dhx_cal_datepicker_data"), this.element.appendChild(t); const { mode: r } = this.getState(); - r === "days" ? this._renderDayGrid(a) : r === "months" ? this._renderMonthGrid(a) : this._renderYearGrid(a); + r === "days" ? this._renderDayGrid(t) : r === "months" ? this._renderMonthGrid(t) : this._renderYearGrid(t); } - _renderDayGridHeader(h) { - const { date: a } = this.getState(), r = this.scheduler; - let d = r.date.week_start(new Date(a)); - const i = r.date.add(r.date.week_start(new Date(a)), 1, "week"); - h.classList.add("dhx_cal_datepicker_days"); - const _ = r.date.date_to_str("%D"); - for (; d.valueOf() < i.valueOf(); ) { - const o = _(d), t = document.createElement("div"); - t.setAttribute("data-day", d.getDay()), t.classList.add("dhx_cal_datepicker_dayname"), t.innerText = o, h.appendChild(t), d = r.date.add(d, 1, "day"); + _renderDayGridHeader(i) { + const { date: t } = this.getState(), r = this.scheduler; + let d = r.date.week_start(new Date(t)); + const n = r.date.add(r.date.week_start(new Date(t)), 1, "week"); + i.classList.add("dhx_cal_datepicker_days"); + const s = r.date.date_to_str("%D"); + for (; d.valueOf() < n.valueOf(); ) { + const _ = s(d), a = document.createElement("div"); + a.setAttribute("data-day", d.getDay()), a.classList.add("dhx_cal_datepicker_dayname"), a.innerText = _, i.appendChild(a), d = r.date.add(d, 1, "day"); } } - _weeksBetween(h, a) { + _weeksBetween(i, t) { const r = this.scheduler; - let d = 0, i = new Date(h); - for (; i.valueOf() < a.valueOf(); ) - d += 1, i = r.date.week_start(r.date.add(i, 1, "week")); + let d = 0, n = new Date(i); + for (; n.valueOf() < t.valueOf(); ) + d += 1, n = r.date.week_start(r.date.add(n, 1, "week")); return d; } - _renderDayGrid(h) { - const { date: a, currentRange: r, eventDates: d, minWeeks: i } = this.getState(); - let _ = r[0], o = r[1]; - const t = d.reduce((y, w) => (y[this.scheduler.date.day_start(new Date(w)).valueOf()] = !0, y), {}), n = document.createElement("div"); - this._renderDayGridHeader(n), h.appendChild(n); - const s = this.scheduler, c = s.date.week_start(s.date.month_start(new Date(a))), u = s.date.month_start(new Date(a)), v = s.date.add(s.date.month_start(new Date(a)), 1, "month"); - let m = s.date.add(s.date.month_start(new Date(a)), 1, "month"); - const l = s.date.date_part(s._currentDate()); - m.getDay() !== 0 && (m = s.date.add(s.date.week_start(m), 1, "week")); - let f = this._weeksBetween(c, m); - i && f < i && (m = s.date.add(m, i - f, "week")); - let g = c; - const p = document.createElement("div"); - for (p.classList.add("dhx_cal_datepicker_days"), this._domEvents.attach(p, "click", (y) => { - const w = y.target.closest("[data-cell-date]"), b = new Date(w.getAttribute("data-cell-date")); + _renderDayGrid(i) { + const { date: t, currentRange: r, eventDates: d, minWeeks: n } = this.getState(); + let s = r[0], _ = r[1]; + const a = d.reduce((y, x) => (y[this.scheduler.date.day_start(new Date(x)).valueOf()] = !0, y), {}), o = document.createElement("div"); + this._renderDayGridHeader(o), i.appendChild(o); + const l = this.scheduler, h = l.date.week_start(l.date.month_start(new Date(t))), v = l.date.month_start(new Date(t)), u = l.date.add(l.date.month_start(new Date(t)), 1, "month"); + let f = l.date.add(l.date.month_start(new Date(t)), 1, "month"); + const c = l.date.date_part(l._currentDate()); + f.getDay() !== 0 && (f = l.date.add(l.date.week_start(f), 1, "week")); + let p = this._weeksBetween(h, f); + n && p < n && (f = l.date.add(f, n - p, "week")); + let m = h; + const g = document.createElement("div"); + for (g.classList.add("dhx_cal_datepicker_days"), this._domEvents.attach(g, "click", (y) => { + const x = y.target.closest("[data-cell-date]"), b = new Date(x.getAttribute("data-cell-date")); this.callEvent("onDateClick", [b, y]); - }); g.valueOf() < m.valueOf(); ) { + }); m.valueOf() < f.valueOf(); ) { const y = document.createElement("div"); - y.setAttribute("data-cell-date", s.templates.format_date(g)), y.setAttribute("data-day", g.getDay()), y.innerHTML = g.getDate(), g.valueOf() < u.valueOf() ? y.classList.add("dhx_before") : g.valueOf() >= v.valueOf() && y.classList.add("dhx_after"), g.getDay() !== 0 && g.getDay() !== 6 || y.classList.add("dhx_cal_datepicker_weekend"), g.valueOf() == l.valueOf() && y.classList.add("dhx_now"), _ && o && g.valueOf() >= _.valueOf() && g.valueOf() < o.valueOf() && y.classList.add("dhx_cal_datepicker_current"), t[g.valueOf()] && y.classList.add("dhx_cal_datepicker_event"), y.classList.add("dhx_cal_datepicker_date"), p.appendChild(y), g = s.date.add(g, 1, "day"); + y.setAttribute("data-cell-date", l.templates.format_date(m)), y.setAttribute("data-day", m.getDay()), y.innerHTML = m.getDate(), m.valueOf() < v.valueOf() ? y.classList.add("dhx_before") : m.valueOf() >= u.valueOf() && y.classList.add("dhx_after"), m.getDay() !== 0 && m.getDay() !== 6 || y.classList.add("dhx_cal_datepicker_weekend"), m.valueOf() == c.valueOf() && y.classList.add("dhx_now"), s && _ && m.valueOf() >= s.valueOf() && m.valueOf() < _.valueOf() && y.classList.add("dhx_cal_datepicker_current"), a[m.valueOf()] && y.classList.add("dhx_cal_datepicker_event"), y.classList.add("dhx_cal_datepicker_date"), g.appendChild(y), m = l.date.add(m, 1, "day"); } - h.appendChild(p); + i.appendChild(g); } - _renderMonthGrid(h) { - const { date: a } = this.getState(), r = document.createElement("div"); + _renderMonthGrid(i) { + const { date: t } = this.getState(), r = document.createElement("div"); r.classList.add("dhx_cal_datepicker_months"); const d = []; - for (let t = 0; t < 12; t++) - d.push(new Date(a.getFullYear(), t, 1)); - const i = this.scheduler.date.date_to_str("%M"); - d.forEach((t) => { - const n = document.createElement("div"); - n.classList.add("dhx_cal_datepicker_month"), a.getMonth() === t.getMonth() && n.classList.add("dhx_cal_datepicker_current"), n.setAttribute("data-month", t.getMonth()), n.innerHTML = i(t), this._domEvents.attach(n, "click", () => { - const s = new Date(t); - this.setState({ date: s, mode: "days" }); - }), r.appendChild(n); - }), h.appendChild(r); - const _ = document.createElement("div"); - _.classList.add("dhx_cal_datepicker_done"); - const o = document.createElement("button"); - o.innerText = "Done", o.classList.add("dhx_cal_datepicker_done_btn"), this._domEvents.attach(o, "click", () => { + for (let a = 0; a < 12; a++) + d.push(new Date(t.getFullYear(), a, 1)); + const n = this.scheduler.date.date_to_str("%M"); + d.forEach((a) => { + const o = document.createElement("div"); + o.classList.add("dhx_cal_datepicker_month"), t.getMonth() === a.getMonth() && o.classList.add("dhx_cal_datepicker_current"), o.setAttribute("data-month", a.getMonth()), o.innerHTML = n(a), this._domEvents.attach(o, "click", () => { + const l = new Date(a); + this.setState({ date: l, mode: "days" }); + }), r.appendChild(o); + }), i.appendChild(r); + const s = document.createElement("div"); + s.classList.add("dhx_cal_datepicker_done"); + const _ = document.createElement("button"); + _.innerText = "Done", _.classList.add("dhx_cal_datepicker_done_btn"), this._domEvents.attach(_, "click", () => { this.setState({ mode: "days" }); - }), _.appendChild(o), h.appendChild(_); + }), s.appendChild(_), i.appendChild(s); } - _renderYearGrid(h) { - const { date: a } = this.getState(), r = 10 * Math.floor(a.getFullYear() / 10), d = document.createElement("div"); + _renderYearGrid(i) { + const { date: t } = this.getState(), r = 10 * Math.floor(t.getFullYear() / 10), d = document.createElement("div"); d.classList.add("dhx_cal_datepicker_years"); - for (let o = r - 1; o <= r + 10; o++) { - const t = document.createElement("div"); - t.innerText = o, t.classList.add("dhx_cal_datepicker_year"), t.setAttribute("data-year", o), a.getFullYear() === o && t.classList.add("dhx_cal_datepicker_current"), this._domEvents.attach(t, "click", () => { - this.setState({ date: new Date(o, a.getMonth(), 1), mode: "months" }); - }), d.appendChild(t); - } - h.appendChild(d); - const i = document.createElement("div"); - i.classList.add("dhx_cal_datepicker_done"); - const _ = document.createElement("button"); - _.innerText = "Done", _.classList.add("dhx_cal_datepicker_done_btn"), this._domEvents.attach(_, "click", () => { + for (let _ = r - 1; _ <= r + 10; _++) { + const a = document.createElement("div"); + a.innerText = _, a.classList.add("dhx_cal_datepicker_year"), a.setAttribute("data-year", _), t.getFullYear() === _ && a.classList.add("dhx_cal_datepicker_current"), this._domEvents.attach(a, "click", () => { + this.setState({ date: new Date(_, t.getMonth(), 1), mode: "months" }); + }), d.appendChild(a); + } + i.appendChild(d); + const n = document.createElement("div"); + n.classList.add("dhx_cal_datepicker_done"); + const s = document.createElement("button"); + s.innerText = "Done", s.classList.add("dhx_cal_datepicker_done_btn"), this._domEvents.attach(s, "click", () => { this.setState({ mode: "months" }); - }), i.appendChild(_), h.appendChild(i); + }), n.appendChild(s), i.appendChild(n); } destructor() { this.onStateChangeHandlers = [], this.element && (this.element.innerHTML = "", this.element.remove()), this._domEvents.detachAll(), this.callEvent("onDestroy", []), this.detachAllEvents(), this.scheduler = null; } } -function nt(e) { - const h = { version: "7.0.5" }; - (function(t) { - var n = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }, s = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" }; - t._commonErrorMessages = { unknownView: function(c) { - var u = s[c] ? "You're probably missing " + s[c] + "." : ""; - return "`" + c + "` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \nRelated docs: " + (n[c] || n.anythingElse) + ` -` + (u ? u + ` +function Sa(e) { + const i = { version: "7.1.0" }; + i.$stateProvider = function() { + const a = {}; + return { getState: function(o) { + if (a[o]) + return a[o].method(); + { + const l = {}; + for (const h in a) + a[h].internal || ee.mixin(l, a[h].method(), !0); + return l; + } + }, registerProvider: function(o, l, h) { + a[o] = { method: l, internal: h }; + }, unregisterProvider: function(o) { + delete a[o]; + } }; + }(), i.getState = i.$stateProvider.getState, function(a) { + var o = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }, l = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" }; + a._commonErrorMessages = { unknownView: function(h) { + var v = l[h] ? "You're probably missing " + l[h] + "." : ""; + return "`" + h + "` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \nRelated docs: " + (o[h] || o.anythingElse) + ` +` + (v ? v + ` ` : ""); - }, collapsedContainer: function(c) { + }, collapsedContainer: function(h) { return `Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. Make sure that the container has some initial height or use different units. For example:
`; - } }, t.createTimelineView = function() { - throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: " + s.timeline + ` -Related docs: ` + n.timeline); - }, t.createUnitsView = function() { - throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: " + s.unit + ` -Related docs: ` + n.unit); - }, t.createGridView = function() { - throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: " + s.grid + ` -Related docs: ` + n.grid); - }, t.addMarkedTimespan = function() { + } }, a.createTimelineView = function() { + throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: " + l.timeline + ` +Related docs: ` + o.timeline); + }, a.createUnitsView = function() { + throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: " + l.unit + ` +Related docs: ` + o.unit); + }, a.createGridView = function() { + throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: " + l.grid + ` +Related docs: ` + o.grid); + }, a.addMarkedTimespan = function() { throw new Error(`scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js Related docs: https://docs.dhtmlx.com/scheduler/limits.html`); - }, t.renderCalendar = function() { + }, a.renderCalendar = function() { throw new Error(`scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js https://docs.dhtmlx.com/scheduler/minicalendar.html`); - }, t.exportToPNG = function() { + }, a.exportToPNG = function() { throw new Error(["scheduler.exportToPNG is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join(` `)); - }, t.exportToPDF = function() { + }, a.exportToPDF = function() { throw new Error(["scheduler.exportToPDF is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join(` `)); }; - })(h), he(h), function(t) { - Q(t), de(t), t._detachDomEvent = function(l, f, g) { - l.removeEventListener ? l.removeEventListener(f, g, !1) : l.detachEvent && l.detachEvent("on" + f, g); - }, t._init_once = function() { - _e(t), t._init_once = function() { + }(i), zt(i), function(a) { + Ue(a), Ot(a), a._detachDomEvent = function(c, p, m) { + c.removeEventListener ? c.removeEventListener(p, m, !1) : c.detachEvent && c.detachEvent("on" + p, m); + }, a._init_once = function() { + Lt(a), a._init_once = function() { }; }; - const n = { render: function(l) { - return t._init_nav_bar(l); - } }, s = { render: function(l) { - const f = document.createElement("div"); - return f.className = "dhx_cal_header", f; - } }, c = { render: function(l) { - const f = document.createElement("div"); - return f.className = "dhx_cal_data", f; + const o = { render: function(c) { + return a._init_nav_bar(c); + } }, l = { render: function(c) { + const p = document.createElement("div"); + return p.className = "dhx_cal_header", p; + } }, h = { render: function(c) { + const p = document.createElement("div"); + return p.className = "dhx_cal_data", p; } }; - function u(l) { - return !!(l.querySelector(".dhx_cal_header") && l.querySelector(".dhx_cal_data") && l.querySelector(".dhx_cal_navline")); + function v(c) { + return !!(c.querySelector(".dhx_cal_header") && c.querySelector(".dhx_cal_data") && c.querySelector(".dhx_cal_navline")); } - t.init = function(l, f, g) { + a.init = function(c, p, m) { if (!this.$destroyed) { - if (f = f || t._currentDate(), g = g || "week", this._obj && this.unset_actions(), this._obj = typeof l == "string" ? document.getElementById(l) : l, this.$container = this._obj, this.$root = this._obj, !this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === "100%" && window.console.error(t._commonErrorMessages.collapsedContainer(), this.$container), this.config.wai_aria_attributes && this.config.wai_aria_application_role && this.$container.setAttribute("role", "application"), this.config.header || u(this.$container) || (this.config.header = function(p) { + if (p = p || a._currentDate(), m = m || "week", this._obj && this.unset_actions(), this._obj = typeof c == "string" ? document.getElementById(c) : c, this.$container = this._obj, this.$root = this._obj, !this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === "100%" && window.console.error(a._commonErrorMessages.collapsedContainer(), this.$container), this.config.wai_aria_attributes && this.config.wai_aria_application_role && this.$container.setAttribute("role", "application"), this.config.header || v(this.$container) || (this.config.header = function(g) { const y = ["day", "week", "month"]; - if (p.matrix) - for (const w in p.matrix) - y.push(w); - if (p._props) - for (const w in p._props) - y.push(w); - if (p._grid && p._grid.names) - for (const w in p._grid.names) - y.push(w); - return ["map", "agenda", "week_agenda", "year"].forEach(function(w) { - p[w + "_view"] && y.push(w); + if (g.matrix) + for (const x in g.matrix) + y.push(x); + if (g._props) + for (const x in g._props) + y.push(x); + if (g._grid && g._grid.names) + for (const x in g._grid.names) + y.push(x); + return ["map", "agenda", "week_agenda", "year"].forEach(function(x) { + g[x + "_view"] && y.push(x); }), y.concat(["date"]).concat(["prev", "today", "next"]); }(this), window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.", "Using a default header configuration: ", "scheduler.config.header = " + JSON.stringify(this.config.header, null, 2), "Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join(` `))), this.config.header) - this.$container.innerHTML = "", this.$container.classList.add("dhx_cal_container"), this.config.header.height && (this.xy.nav_height = this.config.header.height), this.$container.appendChild(n.render(this.config.header)), this.$container.appendChild(s.render()), this.$container.appendChild(c.render()); - else if (!u(this.$container)) + this.$container.innerHTML = "", this.$container.classList.add("dhx_cal_container"), this.config.header.height && (this.xy.nav_height = this.config.header.height), this.$container.appendChild(o.render(this.config.header)), this.$container.appendChild(l.render()), this.$container.appendChild(h.render()); + else if (!v(this.$container)) throw new Error(["Required DOM elements are missing from the scheduler container.", "Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup", "Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join(` `)); - this.config.rtl && (this.$container.className += " dhx_cal_container_rtl"), this._skin_init && t._skin_init(), t.date.init(), this._scroll = !0, this._els = [], this.get_elements(), this.init_templates(), this.set_actions(), this._init_once(), this._init_touch_events(), this.set_sizes(), t.callEvent("onSchedulerReady", []), t.$initialized = !0, this.setCurrentView(f, g); + this.config.rtl && (this.$container.className += " dhx_cal_container_rtl"), this._skin_init && a._skin_init(), a.date.init(), this._scroll = !0, this._els = [], this.get_elements(), this.init_templates(), this.set_actions(), this._init_once(), this._init_touch_events(), this.set_sizes(), a.callEvent("onSchedulerReady", []), a.$initialized = !0, this.setCurrentView(p, m); } - }, t.xy = { min_event_height: 20, bar_height: 24, scale_width: 50, scroll_width: 18, scale_height: 20, month_scale_height: 20, menu_width: 25, margin_top: 0, margin_left: 0, editor_width: 140, month_head_height: 22, event_header_height: 14 }, t.keys = { edit_save: 13, edit_cancel: 27 }, t.bind = function(l, f) { - return l.bind ? l.bind(f) : function() { - return l.apply(f, arguments); + }, a.xy = { min_event_height: 20, bar_height: 24, scale_width: 50, scroll_width: 18, scale_height: 20, month_scale_height: 20, menu_width: 25, margin_top: 0, margin_left: 0, editor_width: 140, month_head_height: 22, event_header_height: 14 }, a.keys = { edit_save: 13, edit_cancel: 27 }, a.bind = function(c, p) { + return c.bind ? c.bind(p) : function() { + return c.apply(p, arguments); }; - }, t.set_sizes = function() { - var l = this._x = this._obj.clientWidth - this.xy.margin_left, f = this._table_view ? 0 : this.xy.scale_width + this.xy.scroll_width, g = this.$container.querySelector(".dhx_cal_scale_placeholder"); - t._is_material_skin() ? (g || ((g = document.createElement("div")).className = "dhx_cal_scale_placeholder", this.$container.insertBefore(g, this._els.dhx_cal_header[0])), g.style.display = "block", this.set_xy(g, l, this.xy.scale_height + 1, 0, this._els.dhx_cal_header[0].offsetTop)) : g && g.parentNode.removeChild(g), this._lightbox && (t.$container.offsetWidth < 1200 || this._setLbPosition(document.querySelector(".dhx_cal_light"))), this._data_width = l - f, this._els.dhx_cal_navline[0].style.width = l + "px"; - const p = this._els.dhx_cal_header[0]; - this.set_xy(p, this._data_width, this.xy.scale_height), p.style.left = "", p.style.right = "", this._table_view ? this.config.rtl ? p.style.right = "-1px" : p.style.left = "-1px" : this.config.rtl ? p.style.right = `${this.xy.scale_width}px` : p.style.left = `${this.xy.scale_width}px`; - }, t.set_xy = function(l, f, g, p, y) { - function w(k) { + }, a.set_sizes = function() { + var c = this._x = this._obj.clientWidth - this.xy.margin_left, p = this._table_view ? 0 : this.xy.scale_width + this.xy.scroll_width, m = this.$container.querySelector(".dhx_cal_scale_placeholder"); + a._is_material_skin() ? (m || ((m = document.createElement("div")).className = "dhx_cal_scale_placeholder", this.$container.insertBefore(m, this._els.dhx_cal_header[0])), m.style.display = "block", this.set_xy(m, c, this.xy.scale_height + 1, 0, this._els.dhx_cal_header[0].offsetTop)) : m && m.parentNode.removeChild(m), this._lightbox && (a.$container.offsetWidth < 1200 || this._setLbPosition(document.querySelector(".dhx_cal_light"))), this._data_width = c - p, this._els.dhx_cal_navline[0].style.width = c + "px"; + const g = this._els.dhx_cal_header[0]; + this.set_xy(g, this._data_width, this.xy.scale_height), g.style.left = "", g.style.right = "", this._table_view ? this.config.rtl ? g.style.right = "-1px" : g.style.left = "-1px" : this.config.rtl ? g.style.right = `${this.xy.scale_width}px` : g.style.left = `${this.xy.scale_width}px`; + }, a.set_xy = function(c, p, m, g, y) { + function x(k) { let E = k; return isNaN(Number(E)) || (E = Math.max(0, E) + "px"), E; } var b = "left"; - f !== void 0 && (l.style.width = w(f)), g !== void 0 && (l.style.height = w(g)), arguments.length > 3 && (p !== void 0 && (this.config.rtl && (b = "right"), l.style[b] = p + "px"), y !== void 0 && (l.style.top = y + "px")); - }, t.get_elements = function() { - const l = this._obj.getElementsByTagName("DIV"); - for (let f = 0; f < l.length; f++) { - let g = t._getClassName(l[f]); - const p = l[f].getAttribute("data-tab") || l[f].getAttribute("name") || ""; - g && (g = g.split(" ")[0]), this._els[g] || (this._els[g] = []), this._els[g].push(l[f]); - let y = t.locale.labels[p + "_tab"] || t.locale.labels[p || g]; - typeof y != "string" && p && !l[f].innerHTML && (y = p.split("_")[0]), y && (this._waiAria.labelAttr(l[f], y), l[f].innerHTML = y); + p !== void 0 && (c.style.width = x(p)), m !== void 0 && (c.style.height = x(m)), arguments.length > 3 && (g !== void 0 && (this.config.rtl && (b = "right"), c.style[b] = g + "px"), y !== void 0 && (c.style.top = y + "px")); + }, a.get_elements = function() { + const c = this._obj.getElementsByTagName("DIV"); + for (let p = 0; p < c.length; p++) { + let m = a._getClassName(c[p]); + const g = c[p].getAttribute("data-tab") || c[p].getAttribute("name") || ""; + m && (m = m.split(" ")[0]), this._els[m] || (this._els[m] = []), this._els[m].push(c[p]); + let y = a.locale.labels[g + "_tab"] || a.locale.labels[g || m]; + typeof y != "string" && g && !c[p].innerHTML && (y = g.split("_")[0]), y && (this._waiAria.labelAttr(c[p], y), c[p].innerHTML = y); } }; - const v = t._createDomEventScope(); - function m(l, f) { - const g = new Date(l), p = (new Date(f).getTime() - g.getTime()) / 864e5; - return Math.abs(p); - } - t.unset_actions = function() { - v.detachAll(); - }, t.set_actions = function() { - for (const l in this._els) - if (this._click[l]) - for (let f = 0; f < this._els[l].length; f++) { - const g = this._els[l][f], p = this._click[l].bind(g); - v.attach(g, "click", p); + const u = a._createDomEventScope(); + function f(c, p) { + const m = new Date(c), g = (new Date(p).getTime() - m.getTime()) / 864e5; + return Math.abs(g); + } + a.unset_actions = function() { + u.detachAll(); + }, a.set_actions = function() { + for (const c in this._els) + if (this._click[c]) + for (let p = 0; p < this._els[c].length; p++) { + const m = this._els[c][p], g = this._click[c].bind(m); + u.attach(m, "click", g); } - v.attach(this._obj, "selectstart", function(l) { - return l.preventDefault(), !1; - }), v.attach(this._obj, "mousemove", function(l) { - t._temp_touch_block || t._on_mouse_move(l); - }), v.attach(this._obj, "mousedown", function(l) { - t._ignore_next_click || t._on_mouse_down(l); - }), v.attach(this._obj, "mouseup", function(l) { - t._ignore_next_click || t._on_mouse_up(l); - }), v.attach(this._obj, "dblclick", function(l) { - t._on_dbl_click(l); - }), v.attach(this._obj, "contextmenu", function(l) { - return t.checkEvent("onContextMenu") && l.preventDefault(), t.callEvent("onContextMenu", [t._locate_event(l.target), l]); + u.attach(this._obj, "selectstart", function(c) { + return c.preventDefault(), !1; + }), u.attach(this._obj, "mousemove", function(c) { + a._temp_touch_block || a._on_mouse_move(c); + }), u.attach(this._obj, "mousedown", function(c) { + a._ignore_next_click || a._on_mouse_down(c); + }), u.attach(this._obj, "mouseup", function(c) { + a._ignore_next_click || a._on_mouse_up(c); + }), u.attach(this._obj, "dblclick", function(c) { + a._on_dbl_click(c); + }), u.attach(this._obj, "contextmenu", function(c) { + return a.checkEvent("onContextMenu") && c.preventDefault(), a.callEvent("onContextMenu", [a._locate_event(c.target), c]); }); - }, t.select = function(l) { - this._select_id != l && (t._close_not_saved(), this.editStop(!1), this._select_id && this.unselect(), this._select_id = l, this.updateEvent(l), this.callEvent("onEventSelected", [l])); - }, t.unselect = function(l) { - if (l && l != this._select_id) + }, a.select = function(c) { + this._select_id != c && (a._close_not_saved(), this.editStop(!1), this._select_id && this.unselect(), this._select_id = c, this.updateEvent(c), this.callEvent("onEventSelected", [c])); + }, a.unselect = function(c) { + if (c && c != this._select_id) return; - const f = this._select_id; - this._select_id = null, f && this.getEvent(f) && this.updateEvent(f), this.callEvent("onEventUnselected", [f]); - }, t.getState = function() { + const p = this._select_id; + this._select_id = null, p && this.getEvent(p) && this.updateEvent(p), this.callEvent("onEventUnselected", [p]); + }, a.$stateProvider.registerProvider("global", (function() { return { mode: this._mode, date: new Date(this._date), min_date: new Date(this._min_date), max_date: new Date(this._max_date), editor_id: this._edit_id, lightbox_id: this._lightbox_id, new_event: this._new_event, select_id: this._select_id, expanded: this.expanded, drag_id: this._drag_id, drag_mode: this._drag_mode }; - }, t._click = { dhx_cal_data: function(l) { - if (t._ignore_next_click) - return l.preventDefault && l.preventDefault(), l.cancelBubble = !0, t._ignore_next_click = !1, !1; - const f = t._locate_event(l.target); - if (f) { - if (!t.callEvent("onClick", [f, l]) || t.config.readonly) + }).bind(a)), a._click = { dhx_cal_data: function(c) { + if (a._ignore_next_click) + return c.preventDefault && c.preventDefault(), c.cancelBubble = !0, a._ignore_next_click = !1, !1; + const p = a._locate_event(c.target); + if (p) { + if (!a.callEvent("onClick", [p, c]) || a.config.readonly) return; } else - t.callEvent("onEmptyClick", [t.getActionData(l).date, l]); - if (f && t.config.select) { - t.select(f); - const g = l.target.closest(".dhx_menu_icon"), p = t._getClassName(g); - p.indexOf("_icon") != -1 && t._click.buttons[p.split(" ")[1].replace("icon_", "")](f); + a.callEvent("onEmptyClick", [a.getActionData(c).date, c]); + if (p && a.config.select) { + a.select(p); + const m = c.target.closest(".dhx_menu_icon"), g = a._getClassName(m); + g.indexOf("_icon") != -1 && a._click.buttons[g.split(" ")[1].replace("icon_", "")](p); } else - t._close_not_saved(), t.getState().select_id && (/* @__PURE__ */ new Date()).valueOf() - (t._new_event || 0) > 500 && t.unselect(); + a._close_not_saved(), a.getState().select_id && (/* @__PURE__ */ new Date()).valueOf() - (a._new_event || 0) > 500 && a.unselect(); }, dhx_cal_prev_button: function() { - t._click.dhx_cal_next_button(0, -1); - }, dhx_cal_next_button: function(l, f) { - let g = 1; - t.config.rtl && (f = -f, g = -g), t.setCurrentView(t.date.add(t.date[t._mode + "_start"](new Date(t._date)), f || g, t._mode)); + a._click.dhx_cal_next_button(0, -1); + }, dhx_cal_next_button: function(c, p) { + let m = 1; + a.config.rtl && (p = -p, m = -m), a.setCurrentView(a.date.add(a.date[a._mode + "_start"](new Date(a._date)), p || m, a._mode)); }, dhx_cal_today_button: function() { - t.callEvent("onBeforeTodayDisplayed", []) && t.setCurrentView(t._currentDate()); + a.callEvent("onBeforeTodayDisplayed", []) && a.setCurrentView(a._currentDate()); }, dhx_cal_tab: function() { - const l = this.getAttribute("data-tab"), f = this.getAttribute("name"), g = l || f.substring(0, f.search("_tab")); - t.setCurrentView(t._date, g); - }, buttons: { delete: function(l) { - const f = t.locale.labels.confirm_deleting; - t._dhtmlx_confirm({ message: f, title: t.locale.labels.title_confirm_deleting, callback: function() { - t.deleteEvent(l); - }, config: { ok: t.locale.labels.icon_delete } }); - }, edit: function(l) { - t.edit(l); - }, save: function(l) { - t.editStop(!0); - }, details: function(l) { - t.showLightbox(l); - }, form: function(l) { - t.showLightbox(l); - }, cancel: function(l) { - t.editStop(!1); - } } }, t._dhtmlx_confirm = function({ message: l, title: f, callback: g, config: p }) { - if (!l) - return g(); - p = p || {}; - const y = { ...p, text: l }; - f && (y.title = f), g && (y.callback = function(w) { - w && g(); - }), t.confirm(y); - }, t.addEventNow = function(l, f, g) { - let p = {}; - t._isObject(l) && !t._isDate(l) && (p = l, l = null); + const c = this.getAttribute("data-tab"), p = this.getAttribute("name"), m = c || p.substring(0, p.search("_tab")); + a.setCurrentView(a._date, m); + }, buttons: { delete: function(c) { + const p = a.locale.labels.confirm_deleting; + a._dhtmlx_confirm({ message: p, title: a.locale.labels.title_confirm_deleting, callback: function() { + a.deleteEvent(c); + }, config: { ok: a.locale.labels.icon_delete } }); + }, edit: function(c) { + a.edit(c); + }, save: function(c) { + a.editStop(!0); + }, details: function(c) { + a.showLightbox(c); + }, form: function(c) { + a.showLightbox(c); + }, cancel: function(c) { + a.editStop(!1); + } } }, a._dhtmlx_confirm = function({ message: c, title: p, callback: m, config: g }) { + if (!c) + return m(); + g = g || {}; + const y = { ...g, text: c }; + p && (y.title = p), m && (y.callback = function(x) { + x && m(); + }), a.confirm(y); + }, a.addEventNow = function(c, p, m) { + let g = {}; + a._isObject(c) && !a._isDate(c) && (g = c, c = null); const y = 6e4 * (this.config.event_duration || this.config.time_step); - l || (l = p.start_date || Math.round(t._currentDate().valueOf() / y) * y); - let w = new Date(l); - if (!f) { + c || (c = g.start_date || Math.round(a._currentDate().valueOf() / y) * y); + let x = new Date(c); + if (!p) { let E = this.config.first_hour; - E > w.getHours() && (w.setHours(E), l = w.valueOf()), f = l.valueOf() + y; - } - let b = new Date(f); - w.valueOf() == b.valueOf() && b.setTime(b.valueOf() + y), p.start_date = p.start_date || w, p.end_date = p.end_date || b, p.text = p.text || this.locale.labels.new_event, p.id = this._drag_id = p.id || this.uid(), this._drag_mode = "new-size", this._loading = !0; - const k = this.addEvent(p); - return this.callEvent("onEventCreated", [this._drag_id, g]), this._loading = !1, this._drag_event = {}, this._on_mouse_up(g), k; - }, t._on_dbl_click = function(l, f) { - if (f = f || l.target, this.config.readonly) + E > x.getHours() && (x.setHours(E), c = x.valueOf()), p = c.valueOf() + y; + } + let b = new Date(p); + x.valueOf() == b.valueOf() && b.setTime(b.valueOf() + y), g.start_date = g.start_date || x, g.end_date = g.end_date || b, g.text = g.text || this.locale.labels.new_event, g.id = this._drag_id = g.id || this.uid(), this._drag_mode = "new-size", this._loading = !0; + const k = this.addEvent(g); + return this.callEvent("onEventCreated", [this._drag_id, m]), this._loading = !1, this._drag_event = {}, this._on_mouse_up(m), k; + }, a._on_dbl_click = function(c, p) { + if (p = p || c.target, this.config.readonly) return; - const g = t._getClassName(f).split(" ")[0]; - switch (g) { + const m = a._getClassName(p).split(" ")[0]; + switch (m) { case "dhx_scale_holder": case "dhx_scale_holder_now": case "dhx_month_body": case "dhx_wa_day_data": - if (!t.config.dblclick_create) + if (!a.config.dblclick_create) break; - this.addEventNow(this.getActionData(l).date, null, l); + this.addEventNow(this.getActionData(c).date, null, c); break; case "dhx_cal_event": case "dhx_wa_ev_body": @@ -2109,160 +2687,160 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`); case "dhx_grid_event": case "dhx_cal_event_line": case "dhx_cal_event_clear": { - const p = this._locate_event(f); - if (!this.callEvent("onDblClick", [p, l])) + const g = this._locate_event(p); + if (!this.callEvent("onDblClick", [g, c])) return; - this.config.details_on_dblclick || this._table_view || !this.getEvent(p)._timed || !this.config.select ? this.showLightbox(p) : this.edit(p); + this.config.details_on_dblclick || this._table_view || !this.getEvent(g)._timed || !this.config.select ? this.showLightbox(g) : this.edit(g); break; } case "dhx_time_block": case "dhx_cal_container": return; default: { - const p = this["dblclick_" + g]; - if (p) - p.call(this, l); - else if (f.parentNode && f != this) - return t._on_dbl_click(l, f.parentNode); + const g = this["dblclick_" + m]; + if (g) + g.call(this, c); + else if (p.parentNode && p != this) + return a._on_dbl_click(c, p.parentNode); break; } } - }, t._get_column_index = function(l) { - let f = 0; + }, a._get_column_index = function(c) { + let p = 0; if (this._cols) { - let g = 0, p = 0; - for (; g + this._cols[p] < l && p < this._cols.length; ) - g += this._cols[p], p++; - if (f = p + (this._cols[p] ? (l - g) / this._cols[p] : 0), this._ignores && f >= this._cols.length) - for (; f >= 1 && this._ignores[Math.floor(f)]; ) - f--; + let m = 0, g = 0; + for (; m + this._cols[g] < c && g < this._cols.length; ) + m += this._cols[g], g++; + if (p = g + (this._cols[g] ? (c - m) / this._cols[g] : 0), this._ignores && p >= this._cols.length) + for (; p >= 1 && this._ignores[Math.floor(p)]; ) + p--; } - return f; - }, t._week_indexes_from_pos = function(l) { + return p; + }, a._week_indexes_from_pos = function(c) { if (this._cols) { - const f = this._get_column_index(l.x); - return l.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(f) - 1)), l.y = Math.max(0, Math.ceil(60 * l.y / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step), l; + const p = this._get_column_index(c.x); + return c.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(p) - 1)), c.y = Math.max(0, Math.ceil(60 * c.y / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step), c; } - return l; - }, t._mouse_coords = function(l) { - let f; - const g = document.body, p = document.documentElement; - f = this.$env.isIE || !l.pageX && !l.pageY ? { x: l.clientX + (g.scrollLeft || p.scrollLeft || 0) - g.clientLeft, y: l.clientY + (g.scrollTop || p.scrollTop || 0) - g.clientTop } : { x: l.pageX, y: l.pageY }, this.config.rtl && this._colsS ? (f.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - f.x, f.x += this.$domHelpers.getAbsoluteLeft(this._obj), this._mode !== "month" && (f.x -= this.xy.scale_width)) : f.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width); + return c; + }, a._mouse_coords = function(c) { + let p; + const m = document.body, g = document.documentElement; + p = this.$env.isIE || !c.pageX && !c.pageY ? { x: c.clientX + (m.scrollLeft || g.scrollLeft || 0) - m.clientLeft, y: c.clientY + (m.scrollTop || g.scrollTop || 0) - m.clientTop } : { x: c.pageX, y: c.pageY }, this.config.rtl && this._colsS ? (p.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - p.x, p.x += this.$domHelpers.getAbsoluteLeft(this._obj), this._mode !== "month" && (p.x -= this.xy.scale_width)) : p.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width); const y = this.$container.querySelector(".dhx_cal_data"); - f.y -= this.$domHelpers.getAbsoluteTop(y) - this._els.dhx_cal_data[0].scrollTop, f.ev = l; - const w = this["mouse_" + this._mode]; - if (w) - f = w.call(this, f); + p.y -= this.$domHelpers.getAbsoluteTop(y) - this._els.dhx_cal_data[0].scrollTop, p.ev = c; + const x = this["mouse_" + this._mode]; + if (x) + p = x.call(this, p); else if (this._table_view) { - const b = this._get_column_index(f.x); + const b = this._get_column_index(p.x); if (!this._cols || !this._colsS) - return f; + return p; let k = 0; - for (k = 1; k < this._colsS.heights.length && !(this._colsS.heights[k] > f.y); k++) + for (k = 1; k < this._colsS.heights.length && !(this._colsS.heights[k] > p.y); k++) ; - f.y = Math.ceil(24 * (Math.max(0, b) + 7 * Math.max(0, k - 1)) * 60 / this.config.time_step), (t._drag_mode || this._mode == "month") && (f.y = 24 * (Math.max(0, Math.ceil(b) - 1) + 7 * Math.max(0, k - 1)) * 60 / this.config.time_step), this._drag_mode == "move" && t._ignores_detected && t.config.preserve_length && (f._ignores = !0, this._drag_event._event_length || (this._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step: 1, x_unit: "day" }))), f.x = 0; + p.y = Math.ceil(24 * (Math.max(0, b) + 7 * Math.max(0, k - 1)) * 60 / this.config.time_step), (a._drag_mode || this._mode == "month") && (p.y = 24 * (Math.max(0, Math.ceil(b) - 1) + 7 * Math.max(0, k - 1)) * 60 / this.config.time_step), this._drag_mode == "move" && a._ignores_detected && a.config.preserve_length && (p._ignores = !0, this._drag_event._event_length || (this._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step: 1, x_unit: "day" }))), p.x = 0; } else - f = this._week_indexes_from_pos(f); - return f.timestamp = +/* @__PURE__ */ new Date(), f; - }, t._close_not_saved = function() { - if ((/* @__PURE__ */ new Date()).valueOf() - (t._new_event || 0) > 500 && t._edit_id) { - const l = t.locale.labels.confirm_closing; - t._dhtmlx_confirm({ message: l, title: t.locale.labels.title_confirm_closing, callback: function() { - t.editStop(t.config.positive_closing); - } }), l && (this._drag_id = this._drag_pos = this._drag_mode = null); - } - }, t._correct_shift = function(l, f) { - return l - 6e4 * (new Date(t._min_date).getTimezoneOffset() - new Date(l).getTimezoneOffset()) * (f ? -1 : 1); - }, t._is_pos_changed = function(l, f) { - function g(p, y, w) { - return Math.abs(p - y) > w; - } - return !l || !this._drag_pos || !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || f.timestamp - this._drag_pos.timestamp > 100 || g(l.ev.clientX, f.ev.clientX, 5) || g(l.ev.clientY, f.ev.clientY, 5)); - }, t._correct_drag_start_date = function(l) { - let f; - t.matrix && (f = t.matrix[t._mode]), f = f || { x_step: 1, x_unit: "day" }, l = new Date(l); - let g = 1; - return (f._start_correction || f._end_correction) && (g = 60 * (f.last_hour || 0) - (60 * l.getHours() + l.getMinutes()) || 1), 1 * l + (t._get_fictional_event_length(l, g, f) - g); - }, t._correct_drag_end_date = function(l, f) { - let g; - t.matrix && (g = t.matrix[t._mode]), g = g || { x_step: 1, x_unit: "day" }; - const p = 1 * l + t._get_fictional_event_length(l, f, g); - return new Date(1 * p - (t._get_fictional_event_length(p, -1, g, -1) + 1)); - }, t._on_mouse_move = function(l) { + p = this._week_indexes_from_pos(p); + return p.timestamp = +/* @__PURE__ */ new Date(), p; + }, a._close_not_saved = function() { + if ((/* @__PURE__ */ new Date()).valueOf() - (a._new_event || 0) > 500 && a._edit_id) { + const c = a.locale.labels.confirm_closing; + a._dhtmlx_confirm({ message: c, title: a.locale.labels.title_confirm_closing, callback: function() { + a.editStop(a.config.positive_closing); + } }), c && (this._drag_id = this._drag_pos = this._drag_mode = null); + } + }, a._correct_shift = function(c, p) { + return c - 6e4 * (new Date(a._min_date).getTimezoneOffset() - new Date(c).getTimezoneOffset()) * (p ? -1 : 1); + }, a._is_pos_changed = function(c, p) { + function m(g, y, x) { + return Math.abs(g - y) > x; + } + return !c || !this._drag_pos || !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || p.timestamp - this._drag_pos.timestamp > 100 || m(c.ev.clientX, p.ev.clientX, 5) || m(c.ev.clientY, p.ev.clientY, 5)); + }, a._correct_drag_start_date = function(c) { + let p; + a.matrix && (p = a.matrix[a._mode]), p = p || { x_step: 1, x_unit: "day" }, c = new Date(c); + let m = 1; + return (p._start_correction || p._end_correction) && (m = 60 * (p.last_hour || 0) - (60 * c.getHours() + c.getMinutes()) || 1), 1 * c + (a._get_fictional_event_length(c, m, p) - m); + }, a._correct_drag_end_date = function(c, p) { + let m; + a.matrix && (m = a.matrix[a._mode]), m = m || { x_step: 1, x_unit: "day" }; + const g = 1 * c + a._get_fictional_event_length(c, p, m); + return new Date(1 * g - (a._get_fictional_event_length(g, -1, m, -1) + 1)); + }, a._on_mouse_move = function(c) { if (this._drag_mode) { - var f = this._mouse_coords(l); - if (this._is_pos_changed(this._drag_pos, f)) { - var g, p; + var p = this._mouse_coords(c); + if (this._is_pos_changed(this._drag_pos, p)) { + var m, g; if (this._edit_id != this._drag_id && this._close_not_saved(), !this._drag_mode) return; var y = null; - if (this._drag_pos && !this._drag_pos.has_moved && ((y = this._drag_pos).has_moved = !0), this._drag_pos = f, this._drag_pos.has_moved = !0, this._drag_mode == "create") { - if (y && (f = y), this._close_not_saved(), this.unselect(this._select_id), this._loading = !0, g = this._get_date_from_pos(f).valueOf(), !this._drag_start) - return this.callEvent("onBeforeEventCreated", [l, this._drag_id]) ? (this._loading = !1, void (this._drag_start = g)) : void (this._loading = !1); - p = g, this._drag_start; - var w = new Date(this._drag_start), b = new Date(p); - this._mode != "day" && this._mode != "week" || w.getHours() != b.getHours() || w.getMinutes() != b.getMinutes() || (b = new Date(this._drag_start + 1e3)), this._drag_id = this.uid(), this.addEvent(w, b, this.locale.labels.new_event, this._drag_id, f.fields), this.callEvent("onEventCreated", [this._drag_id, l]), this._loading = !1, this._drag_mode = "new-size"; + if (this._drag_pos && !this._drag_pos.has_moved && ((y = this._drag_pos).has_moved = !0), this._drag_pos = p, this._drag_pos.has_moved = !0, this._drag_mode == "create") { + if (y && (p = y), this._close_not_saved(), this.unselect(this._select_id), this._loading = !0, m = this._get_date_from_pos(p).valueOf(), !this._drag_start) + return this.callEvent("onBeforeEventCreated", [c, this._drag_id]) ? (this._loading = !1, void (this._drag_start = m)) : void (this._loading = !1); + g = m, this._drag_start; + var x = new Date(this._drag_start), b = new Date(g); + this._mode != "day" && this._mode != "week" || x.getHours() != b.getHours() || x.getMinutes() != b.getMinutes() || (b = new Date(this._drag_start + 1e3)), this._drag_id = this.uid(), this.addEvent(x, b, this.locale.labels.new_event, this._drag_id, p.fields), this.callEvent("onEventCreated", [this._drag_id, c]), this._loading = !1, this._drag_mode = "new-size"; } var k, E = this.config.time_step, D = this.getEvent(this._drag_id); - if (t.matrix && (k = t.matrix[t._mode]), k = k || { x_step: 1, x_unit: "day" }, this._drag_mode == "move") - g = this._min_date.valueOf() + 6e4 * (f.y * this.config.time_step + 24 * f.x * 60), !f.custom && this._table_view && (g += 1e3 * this.date.time_part(D.start_date)), !this._table_view && this._dragEventBody && this._drag_event._move_event_shift === void 0 && (this._drag_event._move_event_shift = g - D.start_date), this._drag_event._move_event_shift && (g -= this._drag_event._move_event_shift), g = this._correct_shift(g), f._ignores && this.config.preserve_length && this._table_view && k ? (g = t._correct_drag_start_date(g), p = t._correct_drag_end_date(g, this._drag_event._event_length)) : p = D.end_date.valueOf() - (D.start_date.valueOf() - g); + if (a.matrix && (k = a.matrix[a._mode]), k = k || { x_step: 1, x_unit: "day" }, this._drag_mode == "move") + m = this._min_date.valueOf() + 6e4 * (p.y * this.config.time_step + 24 * p.x * 60), !p.custom && this._table_view && (m += 1e3 * this.date.time_part(D.start_date)), !this._table_view && this._dragEventBody && this._drag_event._move_event_shift === void 0 && (this._drag_event._move_event_shift = m - D.start_date), this._drag_event._move_event_shift && (m -= this._drag_event._move_event_shift), m = this._correct_shift(m), p._ignores && this.config.preserve_length && this._table_view && k ? (m = a._correct_drag_start_date(m), g = a._correct_drag_end_date(m, this._drag_event._event_length)) : g = D.end_date.valueOf() - (D.start_date.valueOf() - m); else { - if (g = D.start_date.valueOf(), p = D.end_date.valueOf(), this._table_view) { - var x = this._min_date.valueOf() + f.y * this.config.time_step * 6e4 + (f.custom ? 0 : 864e5); + if (m = D.start_date.valueOf(), g = D.end_date.valueOf(), this._table_view) { + var w = this._min_date.valueOf() + p.y * this.config.time_step * 6e4 + (p.custom ? 0 : 864e5); if (this._mode == "month") - if (x = this._correct_shift(x, !1), this._drag_from_start) { + if (w = this._correct_shift(w, !1), this._drag_from_start) { var S = 864e5; - x <= t.date.date_part(new Date(p + S - 1)).valueOf() && (g = x - S); + w <= a.date.date_part(new Date(g + S - 1)).valueOf() && (m = w - S); } else - p = x; + g = w; else - this.config.preserve_length ? f.resize_from_start ? g = t._correct_drag_start_date(x) : p = t._correct_drag_end_date(x, 0) : f.resize_from_start ? g = x : p = x; + this.config.preserve_length ? p.resize_from_start ? m = a._correct_drag_start_date(w) : g = a._correct_drag_end_date(w, 0) : p.resize_from_start ? m = w : g = w; } else { - var N = this.date.date_part(new Date(D.end_date.valueOf() - 1)).valueOf(), M = new Date(N), A = this.config.first_hour, C = 60 / E * (this.config.last_hour - A); + var N = this.date.date_part(new Date(D.end_date.valueOf() - 1)).valueOf(), M = new Date(N), T = this.config.first_hour, A = 60 / E * (this.config.last_hour - T); this.config.time_step = 1; - var T = this._mouse_coords(l); + var H = this._mouse_coords(c); this.config.time_step = E; - var O = f.y * E * 6e4, L = Math.min(f.y + 1, C) * E * 6e4, H = 6e4 * T.y; - p = Math.abs(O - H) > Math.abs(L - H) ? N + L : N + O, p += 6e4 * (new Date(p).getTimezoneOffset() - M.getTimezoneOffset()), this._els.dhx_cal_data[0].style.cursor = "s-resize", this._mode != "week" && this._mode != "day" || (p = this._correct_shift(p)); + var $ = p.y * E * 6e4, j = Math.min(p.y + 1, A) * E * 6e4, z = 6e4 * H.y; + g = Math.abs($ - z) > Math.abs(j - z) ? N + j : N + $, g += 6e4 * (new Date(g).getTimezoneOffset() - M.getTimezoneOffset()), this._els.dhx_cal_data[0].style.cursor = "s-resize", this._mode != "week" && this._mode != "day" || (g = this._correct_shift(g)); } if (this._drag_mode == "new-size") - if (p <= this._drag_start) { - var P = f.shift || (this._table_view && !f.custom ? 864e5 : 0); - g = p - (f.shift ? 0 : P), p = this._drag_start + (P || 6e4 * E); + if (g <= this._drag_start) { + var W = p.shift || (this._table_view && !p.custom ? 864e5 : 0); + m = g - (p.shift ? 0 : W), g = this._drag_start + (W || 6e4 * E); } else - g = this._drag_start; + m = this._drag_start; else - p <= g && (p = g + 6e4 * E); + g <= m && (g = m + 6e4 * E); } - var z = new Date(p - 1), $ = new Date(g); - if (this._drag_mode == "move" && t.config.limit_drag_out && (+$ < +t._min_date || +p > +t._max_date)) { - if (+D.start_date < +t._min_date || +D.end_date > +t._max_date) - $ = new Date(D.start_date), p = new Date(D.end_date); + var Y = new Date(g - 1), q = new Date(m); + if (this._drag_mode == "move" && a.config.limit_drag_out && (+q < +a._min_date || +g > +a._max_date)) { + if (+D.start_date < +a._min_date || +D.end_date > +a._max_date) + q = new Date(D.start_date), g = new Date(D.end_date); else { - var j = p - $; - +$ < +t._min_date ? ($ = new Date(t._min_date), f._ignores && this.config.preserve_length && this._table_view ? ($ = new Date(t._correct_drag_start_date($)), k._start_correction && ($ = new Date($.valueOf() + k._start_correction)), p = new Date(1 * $ + this._get_fictional_event_length($, this._drag_event._event_length, k))) : p = new Date(+$ + j)) : (p = new Date(t._max_date), f._ignores && this.config.preserve_length && this._table_view ? (k._end_correction && (p = new Date(p.valueOf() - k._end_correction)), p = new Date(1 * p - this._get_fictional_event_length(p, 0, k, !0)), $ = new Date(1 * p - this._get_fictional_event_length(p, this._drag_event._event_length, k, !0)), this._ignores_detected && ($ = t.date.add($, k.x_step, k.x_unit), p = new Date(1 * p - this._get_fictional_event_length(p, 0, k, !0)), p = t.date.add(p, k.x_step, k.x_unit))) : $ = new Date(+p - j)); + var V = g - q; + +q < +a._min_date ? (q = new Date(a._min_date), p._ignores && this.config.preserve_length && this._table_view ? (q = new Date(a._correct_drag_start_date(q)), k._start_correction && (q = new Date(q.valueOf() + k._start_correction)), g = new Date(1 * q + this._get_fictional_event_length(q, this._drag_event._event_length, k))) : g = new Date(+q + V)) : (g = new Date(a._max_date), p._ignores && this.config.preserve_length && this._table_view ? (k._end_correction && (g = new Date(g.valueOf() - k._end_correction)), g = new Date(1 * g - this._get_fictional_event_length(g, 0, k, !0)), q = new Date(1 * g - this._get_fictional_event_length(g, this._drag_event._event_length, k, !0)), this._ignores_detected && (q = a.date.add(q, k.x_step, k.x_unit), g = new Date(1 * g - this._get_fictional_event_length(g, 0, k, !0)), g = a.date.add(g, k.x_step, k.x_unit))) : q = new Date(+g - V)); } - z = new Date(p - 1); + Y = new Date(g - 1); } - if (!this._table_view && this._dragEventBody && !t.config.all_timed && (!t._get_section_view() && f.x != this._get_event_sday({ start_date: new Date(g), end_date: new Date(g) }) || new Date(g).getHours() < this.config.first_hour) && (j = p - $, this._drag_mode == "move" && (S = this._min_date.valueOf() + 24 * f.x * 60 * 6e4, ($ = new Date(S)).setHours(this.config.first_hour), p = new Date($.valueOf() + j), z = new Date(p - 1))), this._table_view || t.config.all_timed || !(!t.getView() && f.x != this._get_event_sday({ start_date: new Date(p), end_date: new Date(p) }) || new Date(p).getHours() >= this.config.last_hour) || (j = p - $, S = this._min_date.valueOf() + 24 * f.x * 60 * 6e4, (p = t.date.date_part(new Date(S))).setHours(this.config.last_hour), z = new Date(p - 1), this._drag_mode == "move" && ($ = new Date(+p - j))), this._table_view || z.getDate() == $.getDate() && z.getHours() < this.config.last_hour || t._allow_dnd) - if (D.start_date = $, D.end_date = new Date(p), this.config.update_render) { - var F = t._els.dhx_cal_data[0].scrollTop; - this.update_view(), t._els.dhx_cal_data[0].scrollTop = F; + if (!this._table_view && this._dragEventBody && !a.config.all_timed && (!a._get_section_view() && p.x != this._get_event_sday({ start_date: new Date(m), end_date: new Date(m) }) || new Date(m).getHours() < this.config.first_hour) && (V = g - q, this._drag_mode == "move" && (S = this._min_date.valueOf() + 24 * p.x * 60 * 6e4, (q = new Date(S)).setHours(this.config.first_hour), g = new Date(q.valueOf() + V), Y = new Date(g - 1))), this._table_view || a.config.all_timed || !(!a.getView() && p.x != this._get_event_sday({ start_date: new Date(g), end_date: new Date(g) }) || new Date(g).getHours() >= this.config.last_hour) || (V = g - q, S = this._min_date.valueOf() + 24 * p.x * 60 * 6e4, (g = a.date.date_part(new Date(S))).setHours(this.config.last_hour), Y = new Date(g - 1), this._drag_mode == "move" && (q = new Date(+g - V))), this._table_view || Y.getDate() == q.getDate() && Y.getHours() < this.config.last_hour || a._allow_dnd) + if (D.start_date = q, D.end_date = new Date(g), this.config.update_render) { + var ve = a._els.dhx_cal_data[0].scrollTop; + this.update_view(), a._els.dhx_cal_data[0].scrollTop = ve; } else this.updateEvent(this._drag_id); - this._table_view && this.for_rendered(this._drag_id, function(J) { - J.className += " dhx_in_move dhx_cal_event_drag"; - }), this.callEvent("onEventDrag", [this._drag_id, this._drag_mode, l]); + this._table_view && this.for_rendered(this._drag_id, function(xe) { + xe.className += " dhx_in_move dhx_cal_event_drag"; + }), this.callEvent("onEventDrag", [this._drag_id, this._drag_mode, c]); } - } else if (t.checkEvent("onMouseMove")) { - var U = this._locate_event(l.target || l.srcElement); - this.callEvent("onMouseMove", [U, l]); - } - }, t._on_mouse_down = function(l, f) { - if (l.button != 2 && !this.config.readonly && !this._drag_mode) { - f = f || l.target || l.srcElement; - var g = t._getClassName(f).split(" ")[0]; - switch (this.config.drag_event_body && g == "dhx_body" && f.parentNode && f.parentNode.className.indexOf("dhx_cal_select_menu") === -1 && (g = "dhx_event_move", this._dragEventBody = !0), g) { + } else if (a.checkEvent("onMouseMove")) { + var Ne = this._locate_event(c.target || c.srcElement); + this.callEvent("onMouseMove", [Ne, c]); + } + }, a._on_mouse_down = function(c, p) { + if (c.button != 2 && !this.config.readonly && !this._drag_mode) { + p = p || c.target || c.srcElement; + var m = a._getClassName(p).split(" ")[0]; + switch (this.config.drag_event_body && m == "dhx_body" && p.parentNode && p.parentNode.className.indexOf("dhx_cal_select_menu") === -1 && (m = "dhx_event_move", this._dragEventBody = !0), m) { case "dhx_cal_event_line": case "dhx_cal_event_clear": this._table_view && (this._drag_mode = "move"); @@ -2272,7 +2850,7 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`); this._drag_mode = "move"; break; case "dhx_event_resize": - this._drag_mode = "resize", t._getClassName(f).indexOf("dhx_event_resize_end") < 0 ? t._drag_from_start = !0 : t._drag_from_start = !1; + this._drag_mode = "resize", a._getClassName(p).indexOf("dhx_event_resize_end") < 0 ? a._drag_from_start = !0 : a._drag_from_start = !1; break; case "dhx_scale_holder": case "dhx_scale_holder_now": @@ -2282,820 +2860,820 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`); this._drag_mode = "create"; break; case "": - if (f.parentNode) - return t._on_mouse_down(l, f.parentNode); + if (p.parentNode) + return a._on_mouse_down(c, p.parentNode); break; default: - if ((!t.checkEvent("onMouseDown") || t.callEvent("onMouseDown", [g, l])) && f.parentNode && f != this && g != "dhx_body") - return t._on_mouse_down(l, f.parentNode); + if ((!a.checkEvent("onMouseDown") || a.callEvent("onMouseDown", [m, c])) && p.parentNode && p != this && m != "dhx_body") + return a._on_mouse_down(c, p.parentNode); this._drag_mode = null, this._drag_id = null; } if (this._drag_mode) { - var p = this._locate_event(f); - if (this.config["drag_" + this._drag_mode] && this.callEvent("onBeforeDrag", [p, this._drag_mode, l])) { - if (this._drag_id = p, (this._edit_id != this._drag_id || this._edit_id && this._drag_mode == "create") && this._close_not_saved(), !this._drag_mode) + var g = this._locate_event(p); + if (this.config["drag_" + this._drag_mode] && this.callEvent("onBeforeDrag", [g, this._drag_mode, c])) { + if (this._drag_id = g, (this._edit_id != this._drag_id || this._edit_id && this._drag_mode == "create") && this._close_not_saved(), !this._drag_mode) return; - this._drag_event = t._lame_clone(this.getEvent(this._drag_id) || {}), this._drag_pos = this._mouse_coords(l); + this._drag_event = a._lame_clone(this.getEvent(this._drag_id) || {}), this._drag_pos = this._mouse_coords(c); } else this._drag_mode = this._drag_id = 0; } this._drag_start = null; } - }, t._get_private_properties = function(l) { - var f = {}; - for (var g in l) - g.indexOf("_") === 0 && (f[g] = !0); - return f; - }, t._clear_temporary_properties = function(l, f) { - var g = this._get_private_properties(l), p = this._get_private_properties(f); - for (var y in p) - g[y] || delete f[y]; - }, t._on_mouse_up = function(l) { - if (!l || l.button != 2 || !this._mobile) { + }, a._get_private_properties = function(c) { + var p = {}; + for (var m in c) + m.indexOf("_") === 0 && (p[m] = !0); + return p; + }, a._clear_temporary_properties = function(c, p) { + var m = this._get_private_properties(c), g = this._get_private_properties(p); + for (var y in g) + m[y] || delete p[y]; + }, a._on_mouse_up = function(c) { + if (!c || c.button != 2 || !this._mobile) { if (this._drag_mode && this._drag_id) { this._els.dhx_cal_data[0].style.cursor = "default"; - var f = this._drag_id, g = this._drag_mode, p = !this._drag_pos || this._drag_pos.has_moved; + var p = this._drag_id, m = this._drag_mode, g = !this._drag_pos || this._drag_pos.has_moved; delete this._drag_event._move_event_shift; var y = this.getEvent(this._drag_id); - if (p && (this._drag_event._dhx_changed || !this._drag_event.start_date || y.start_date.valueOf() != this._drag_event.start_date.valueOf() || y.end_date.valueOf() != this._drag_event.end_date.valueOf())) { - var w = this._drag_mode == "new-size"; - if (this.callEvent("onBeforeEventChanged", [y, l, w, this._drag_event])) - if (this._drag_id = this._drag_mode = null, w && this.config.edit_on_create) { - if (this.unselect(), this._new_event = /* @__PURE__ */ new Date(), this._table_view || this.config.details_on_create || !this.config.select || !this.isOneDayEvent(this.getEvent(f))) - return t.callEvent("onDragEnd", [f, g, l]), this.showLightbox(f); - this._drag_pos = !0, this._select_id = this._edit_id = f; + if (g && (this._drag_event._dhx_changed || !this._drag_event.start_date || y.start_date.valueOf() != this._drag_event.start_date.valueOf() || y.end_date.valueOf() != this._drag_event.end_date.valueOf())) { + var x = this._drag_mode == "new-size"; + if (this.callEvent("onBeforeEventChanged", [y, c, x, this._drag_event])) + if (this._drag_id = this._drag_mode = null, x && this.config.edit_on_create) { + if (this.unselect(), this._new_event = /* @__PURE__ */ new Date(), this._table_view || this.config.details_on_create || !this.config.select || !this.isOneDayEvent(this.getEvent(p))) + return a.callEvent("onDragEnd", [p, m, c]), this.showLightbox(p); + this._drag_pos = !0, this._select_id = this._edit_id = p; } else - this._new_event || this.callEvent(w ? "onEventAdded" : "onEventChanged", [f, this.getEvent(f)]); + this._new_event || this.callEvent(x ? "onEventAdded" : "onEventChanged", [p, this.getEvent(p)]); else - w ? this.deleteEvent(y.id, !0) : (this._drag_event._dhx_changed = !1, this._clear_temporary_properties(y, this._drag_event), t._lame_copy(y, this._drag_event), this.updateEvent(y.id)); + x ? this.deleteEvent(y.id, !0) : (this._drag_event._dhx_changed = !1, this._clear_temporary_properties(y, this._drag_event), a._lame_copy(y, this._drag_event), this.updateEvent(y.id)); } - this._drag_pos && (this._drag_pos.has_moved || this._drag_pos === !0) && (this._drag_id = this._drag_mode = null, this.render_view_data()), t.callEvent("onDragEnd", [f, g, l]); + this._drag_pos && (this._drag_pos.has_moved || this._drag_pos === !0) && (this._drag_id = this._drag_mode = null, this.render_view_data()), a.callEvent("onDragEnd", [p, m, c]); } this._drag_id = null, this._drag_mode = null, this._drag_pos = null, this._drag_event = null, this._drag_from_start = null; } - }, t._trigger_dyn_loading = function() { + }, a._trigger_dyn_loading = function() { return !(!this._load_mode || !this._load() || (this._render_wait = !0, 0)); - }, t.update_view = function() { + }, a.update_view = function() { this._reset_ignores(), this._update_nav_bar(this.config.header, this.$container.querySelector(".dhx_cal_navline")); - var l = this[this._mode + "_view"]; - if (l ? l.call(this, !0) : this._reset_scale(), this._trigger_dyn_loading()) + var c = this[this._mode + "_view"]; + if (c ? c.call(this, !0) : this._reset_scale(), this._trigger_dyn_loading()) return !0; this.render_view_data(); - }, t.isViewExists = function(l) { - return !!(t[l + "_view"] || t.date[l + "_start"] && t.templates[l + "_date"] && t.templates[l + "_scale_date"]); - }, t._set_aria_buttons_attrs = function() { - for (var l = ["dhx_cal_next_button", "dhx_cal_prev_button", "dhx_cal_tab", "dhx_cal_today_button"], f = 0; f < l.length; f++) - for (var g = this._els[l[f]], p = 0; g && p < g.length; p++) { - var y = g[p].getAttribute("data-tab") || g[p].getAttribute("name"), w = this.locale.labels[l[f]]; - y && (w = this.locale.labels[y + "_tab"] || this.locale.labels[y] || w), l[f] == "dhx_cal_next_button" ? w = this.locale.labels.next : l[f] == "dhx_cal_prev_button" && (w = this.locale.labels.prev), this._waiAria.headerButtonsAttributes(g[p], w || ""); + }, a.isViewExists = function(c) { + return !!(a[c + "_view"] || a.date[c + "_start"] && a.templates[c + "_date"] && a.templates[c + "_scale_date"]); + }, a._set_aria_buttons_attrs = function() { + for (var c = ["dhx_cal_next_button", "dhx_cal_prev_button", "dhx_cal_tab", "dhx_cal_today_button"], p = 0; p < c.length; p++) + for (var m = this._els[c[p]], g = 0; m && g < m.length; g++) { + var y = m[g].getAttribute("data-tab") || m[g].getAttribute("name"), x = this.locale.labels[c[p]]; + y && (x = this.locale.labels[y + "_tab"] || this.locale.labels[y] || x), c[p] == "dhx_cal_next_button" ? x = this.locale.labels.next : c[p] == "dhx_cal_prev_button" && (x = this.locale.labels.prev), this._waiAria.headerButtonsAttributes(m[g], x || ""); } - }, t.updateView = function(l, f) { + }, a.updateView = function(c, p) { if (!this.$container) throw new Error(`The scheduler is not initialized. **scheduler.updateView** or **scheduler.setCurrentView** can be called only after **scheduler.init**`); - l = l || this._date, f = f || this._mode; - var g = "dhx_cal_data"; + c = c || this._date, p = p || this._mode; + var m = "dhx_cal_data"; this.locale.labels.icon_form || (this.locale.labels.icon_form = this.locale.labels.icon_edit); - var p = this._obj, y = "dhx_scheduler_" + this._mode, w = "dhx_scheduler_" + f; - this._mode && p.className.indexOf(y) != -1 ? p.className = p.className.replace(y, w) : p.className += " " + w; - var b, k = "dhx_multi_day", E = !(this._mode != f || !this.config.preserve_scroll) && this._els[g][0].scrollTop; - this._els[k] && this._els[k][0] && (b = this._els[k][0].scrollTop), this[this._mode + "_view"] && f && this._mode != f && this[this._mode + "_view"](!1), this._close_not_saved(), this._els[k] && (this._els[k][0].parentNode.removeChild(this._els[k][0]), this._els[k] = null), this._mode = f, this._date = l, this._table_view = this._mode == "month", this._dy_shift = 0, this.update_view(), this._set_aria_buttons_attrs(); + var g = this._obj, y = "dhx_scheduler_" + this._mode, x = "dhx_scheduler_" + p; + this._mode && g.className.indexOf(y) != -1 ? g.className = g.className.replace(y, x) : g.className += " " + x; + var b, k = "dhx_multi_day", E = !(this._mode != p || !this.config.preserve_scroll) && this._els[m][0].scrollTop; + this._els[k] && this._els[k][0] && (b = this._els[k][0].scrollTop), this[this._mode + "_view"] && p && this._mode != p && this[this._mode + "_view"](!1), this._close_not_saved(), this._els[k] && (this._els[k][0].parentNode.removeChild(this._els[k][0]), this._els[k] = null), this._mode = p, this._date = c, this._table_view = this._mode == "month", this._dy_shift = 0, this.update_view(), this._set_aria_buttons_attrs(); var D = this._els.dhx_cal_tab; if (D) - for (var x = 0; x < D.length; x++) { - var S = D[x]; + for (var w = 0; w < D.length; w++) { + var S = D[w]; S.getAttribute("data-tab") == this._mode || S.getAttribute("name") == this._mode + "_tab" ? (S.classList.add("active"), this._waiAria.headerToggleState(S, !0)) : (S.classList.remove("active"), this._waiAria.headerToggleState(S, !1)); } - typeof E == "number" && (this._els[g][0].scrollTop = E), typeof b == "number" && this._els[k] && this._els[k][0] && (this._els[k][0].scrollTop = b); - }, t.setCurrentView = function(l, f) { - this.callEvent("onBeforeViewChange", [this._mode, this._date, f || this._mode, l || this._date]) && (this.updateView(l, f), this.callEvent("onViewChange", [this._mode, this._date])); - }, t.render = function(l, f) { - t.setCurrentView(l, f); - }, t._render_x_header = function(l, f, g, p, y) { + typeof E == "number" && (this._els[m][0].scrollTop = E), typeof b == "number" && this._els[k] && this._els[k][0] && (this._els[k][0].scrollTop = b); + }, a.setCurrentView = function(c, p) { + this.callEvent("onBeforeViewChange", [this._mode, this._date, p || this._mode, c || this._date]) && (this.updateView(c, p), this.callEvent("onViewChange", [this._mode, this._date])); + }, a.render = function(c, p) { + a.setCurrentView(c, p); + }, a._render_x_header = function(c, p, m, g, y) { y = y || 0; - var w = document.createElement("div"); - w.className = "dhx_scale_bar", this.templates[this._mode + "_scalex_class"] && (w.className += " " + this.templates[this._mode + "_scalex_class"](g)); - var b = this._cols[l]; - this._mode == "month" && l === 0 && this.config.left_border && (w.className += " dhx_scale_bar_border", f += 1), this.set_xy(w, b, this.xy.scale_height - 1, f, y); - var k = this.templates[this._mode + "_scale_date"](g, this._mode); - w.innerHTML = k, this._waiAria.dayHeaderAttr(w, k), p.appendChild(w); - }, t._get_columns_num = function(l, f) { - var g = 7; - if (!t._table_view) { - var p = t.date["get_" + t._mode + "_end"]; - p && (f = p(l)), g = Math.round((f.valueOf() - l.valueOf()) / 864e5); + var x = document.createElement("div"); + x.className = "dhx_scale_bar", this.templates[this._mode + "_scalex_class"] && (x.className += " " + this.templates[this._mode + "_scalex_class"](m)); + var b = this._cols[c]; + this._mode == "month" && c === 0 && this.config.left_border && (x.className += " dhx_scale_bar_border", p += 1), this.set_xy(x, b, this.xy.scale_height - 1, p, y); + var k = this.templates[this._mode + "_scale_date"](m, this._mode); + x.innerHTML = k, this._waiAria.dayHeaderAttr(x, k), g.appendChild(x); + }, a._get_columns_num = function(c, p) { + var m = 7; + if (!a._table_view) { + var g = a.date["get_" + a._mode + "_end"]; + g && (p = g(c)), m = Math.round((p.valueOf() - c.valueOf()) / 864e5); } - return g; - }, t._get_timeunit_start = function() { + return m; + }, a._get_timeunit_start = function() { return this.date[this._mode + "_start"](new Date(this._date.valueOf())); - }, t._get_view_end = function() { - var l = this._get_timeunit_start(), f = t.date.add(l, 1, this._mode); - if (!t._table_view) { - var g = t.date["get_" + t._mode + "_end"]; - g && (f = g(l)); + }, a._get_view_end = function() { + var c = this._get_timeunit_start(), p = a.date.add(c, 1, this._mode); + if (!a._table_view) { + var m = a.date["get_" + a._mode + "_end"]; + m && (p = m(c)); } - return f; - }, t._calc_scale_sizes = function(l, f, g) { - var p = this.config.rtl, y = l, w = this._get_columns_num(f, g); - this._process_ignores(f, w, "day", 1); - for (var b = w - this._ignores_detected, k = 0; k < w; k++) - this._ignores[k] ? (this._cols[k] = 0, b++) : this._cols[k] = Math.floor(y / (b - k)), y -= this._cols[k], this._colsS[k] = (this._cols[k - 1] || 0) + (this._colsS[k - 1] || (this._table_view ? 0 : p ? this.xy.scroll_width : this.xy.scale_width)); - this._colsS.col_length = w, this._colsS[w] = this._cols[w - 1] + this._colsS[w - 1] || 0; - }, t._set_scale_col_size = function(l, f, g) { - var p = this.config; - this.set_xy(l, f, p.hour_size_px * (p.last_hour - p.first_hour), g + this.xy.scale_width + 1, 0); - }, t._render_scales = function(l, f) { - var g = new Date(t._min_date), p = new Date(t._max_date), y = this.date.date_part(t._currentDate()), w = parseInt(l.style.width, 10) - 1, b = new Date(this._min_date), k = this._get_columns_num(g, p); - this._calc_scale_sizes(w, g, p); + return p; + }, a._calc_scale_sizes = function(c, p, m) { + var g = this.config.rtl, y = c, x = this._get_columns_num(p, m); + this._process_ignores(p, x, "day", 1); + for (var b = x - this._ignores_detected, k = 0; k < x; k++) + this._ignores[k] ? (this._cols[k] = 0, b++) : this._cols[k] = Math.floor(y / (b - k)), y -= this._cols[k], this._colsS[k] = (this._cols[k - 1] || 0) + (this._colsS[k - 1] || (this._table_view ? 0 : g ? this.xy.scroll_width : this.xy.scale_width)); + this._colsS.col_length = x, this._colsS[x] = this._cols[x - 1] + this._colsS[x - 1] || 0; + }, a._set_scale_col_size = function(c, p, m) { + var g = this.config; + this.set_xy(c, p, g.hour_size_px * (g.last_hour - g.first_hour), m + this.xy.scale_width + 1, 0); + }, a._render_scales = function(c, p) { + var m = new Date(a._min_date), g = new Date(a._max_date), y = this.date.date_part(a._currentDate()), x = parseInt(c.style.width, 10) - 1, b = new Date(this._min_date), k = this._get_columns_num(m, g); + this._calc_scale_sizes(x, m, g); var E = 0; - l.innerHTML = ""; + c.innerHTML = ""; for (var D = 0; D < k; D++) { - if (this._ignores[D] || this._render_x_header(D, E, b, l), !this._table_view) { - var x = document.createElement("div"), S = "dhx_scale_holder"; - b.valueOf() == y.valueOf() && (S += " dhx_scale_holder_now"), x.setAttribute("data-column-index", D), this._ignores_detected && this._ignores[D] && (S += " dhx_scale_ignore"); + if (this._ignores[D] || this._render_x_header(D, E, b, c), !this._table_view) { + var w = document.createElement("div"), S = "dhx_scale_holder"; + b.valueOf() == y.valueOf() && (S += " dhx_scale_holder_now"), w.setAttribute("data-column-index", D), this._ignores_detected && this._ignores[D] && (S += " dhx_scale_ignore"); for (let N = 1 * this.config.first_hour; N < this.config.last_hour; N++) { const M = document.createElement("div"); M.className = "dhx_scale_time_slot dhx_scale_time_slot_hour_start", M.style.height = this.config.hour_size_px / 2 + "px"; - let A = new Date(b.getFullYear(), b.getMonth(), b.getDate(), N, 0); - M.setAttribute("data-slot-date", this.templates.format_date(A)); - let C = this.templates.time_slot_text(A); - C && (M.innerHTML = C); - let T = this.templates.time_slot_class(A); - T && M.classList.add(T), x.appendChild(M); - const O = document.createElement("div"); - O.className = "dhx_scale_time_slot", A = new Date(b.getFullYear(), b.getMonth(), b.getDate(), N, 30), O.setAttribute("data-slot-date", this.templates.format_date(A)), O.style.height = this.config.hour_size_px / 2 + "px", C = this.templates.time_slot_text(A), C && (O.innerHTML = C), T = this.templates.time_slot_class(A), T && O.classList.add(T), x.appendChild(O); + let T = new Date(b.getFullYear(), b.getMonth(), b.getDate(), N, 0); + M.setAttribute("data-slot-date", this.templates.format_date(T)); + let A = this.templates.time_slot_text(T); + A && (M.innerHTML = A); + let H = this.templates.time_slot_class(T); + H && M.classList.add(H), w.appendChild(M); + const $ = document.createElement("div"); + $.className = "dhx_scale_time_slot", T = new Date(b.getFullYear(), b.getMonth(), b.getDate(), N, 30), $.setAttribute("data-slot-date", this.templates.format_date(T)), $.style.height = this.config.hour_size_px / 2 + "px", A = this.templates.time_slot_text(T), A && ($.innerHTML = A), H = this.templates.time_slot_class(T), H && $.classList.add(H), w.appendChild($); } - x.className = S + " " + this.templates.week_date_class(b, y), this._waiAria.dayColumnAttr(x, b), this._set_scale_col_size(x, this._cols[D], E), f.appendChild(x), this.callEvent("onScaleAdd", [x, b]); + w.className = S + " " + this.templates.week_date_class(b, y), this._waiAria.dayColumnAttr(w, b), this._set_scale_col_size(w, this._cols[D], E), p.appendChild(w), this.callEvent("onScaleAdd", [w, b]); } E += this._cols[D], b = this.date.add(b, 1, "day"), b = this.date.day_start(b); } - }, t._getNavDateElement = function() { + }, a._getNavDateElement = function() { return this.$container.querySelector(".dhx_cal_date"); - }, t._reset_scale = function() { + }, a._reset_scale = function() { if (this.templates[this._mode + "_date"]) { - var l = this._els.dhx_cal_header[0], f = this._els.dhx_cal_data[0], g = this.config; - l.innerHTML = "", f.innerHTML = ""; - var p, y, w = (g.readonly || !g.drag_resize ? " dhx_resize_denied" : "") + (g.readonly || !g.drag_move ? " dhx_move_denied" : ""); - f.className = "dhx_cal_data" + w, this._scales = {}, this._cols = [], this._colsS = { height: 0 }, this._dy_shift = 0, this.set_sizes(); - var b = this._get_timeunit_start(), k = t._get_view_end(); - p = y = this._table_view ? t.date.week_start(b) : b, this._min_date = p; + var c = this._els.dhx_cal_header[0], p = this._els.dhx_cal_data[0], m = this.config; + c.innerHTML = "", p.innerHTML = ""; + var g, y, x = (m.readonly || !m.drag_resize ? " dhx_resize_denied" : "") + (m.readonly || !m.drag_move ? " dhx_move_denied" : ""); + p.className = "dhx_cal_data" + x, this._scales = {}, this._cols = [], this._colsS = { height: 0 }, this._dy_shift = 0, this.set_sizes(); + var b = this._get_timeunit_start(), k = a._get_view_end(); + g = y = this._table_view ? a.date.week_start(b) : b, this._min_date = g; var E = this.templates[this._mode + "_date"](b, k, this._mode), D = this._getNavDateElement(); - if (D && (D.innerHTML = E, this._waiAria.navBarDateAttr(D, E)), this._max_date = k, t._render_scales(l, f), this._table_view) - this._reset_month_scale(f, b, y); - else if (this._reset_hours_scale(f, b, y), g.multi_day) { - var x = "dhx_multi_day"; - this._els[x] && (this._els[x][0].parentNode.removeChild(this._els[x][0]), this._els[x] = null); + if (D && (D.innerHTML = E, this._waiAria.navBarDateAttr(D, E)), this._max_date = k, a._render_scales(c, p), this._table_view) + this._reset_month_scale(p, b, y); + else if (this._reset_hours_scale(p, b, y), m.multi_day) { + var w = "dhx_multi_day"; + this._els[w] && (this._els[w][0].parentNode.removeChild(this._els[w][0]), this._els[w] = null); var S = document.createElement("div"); - S.className = x, S.style.visibility = "hidden", S.style.display = "none"; - var N = this._colsS[this._colsS.col_length], M = g.rtl ? this.xy.scale_width : this.xy.scroll_width, A = Math.max(N + M, 0); - this.set_xy(S, A, 0, 0), f.parentNode.insertBefore(S, f); - var C = S.cloneNode(!0); - C.className = x + "_icon", C.style.visibility = "hidden", C.style.display = "none", this.set_xy(C, this.xy.scale_width + 1, 0, 0), S.appendChild(C), this._els[x] = [S, C], t.event(this._els[x][0], "click", this._click.dhx_cal_data); + S.className = w, S.style.visibility = "hidden", S.style.display = "none"; + var N = this._colsS[this._colsS.col_length], M = m.rtl ? this.xy.scale_width : this.xy.scroll_width, T = Math.max(N + M, 0); + this.set_xy(S, T, 0, 0), p.parentNode.insertBefore(S, p); + var A = S.cloneNode(!0); + A.className = w + "_icon", A.style.visibility = "hidden", A.style.display = "none", this.set_xy(A, this.xy.scale_width + 1, 0, 0), S.appendChild(A), this._els[w] = [S, A], a.event(this._els[w][0], "click", this._click.dhx_cal_data); } } - }, t._reset_hours_scale = function(l, f, g) { - var p = document.createElement("div"); - p.className = "dhx_scale_holder"; - for (var y = new Date(1980, 1, 1, this.config.first_hour, 0, 0), w = 1 * this.config.first_hour; w < this.config.last_hour; w++) { + }, a._reset_hours_scale = function(c, p, m) { + var g = document.createElement("div"); + g.className = "dhx_scale_holder"; + for (var y = new Date(1980, 1, 1, this.config.first_hour, 0, 0), x = 1 * this.config.first_hour; x < this.config.last_hour; x++) { var b = document.createElement("div"); b.className = "dhx_scale_hour", b.style.height = this.config.hour_size_px + "px"; var k = this.xy.scale_width; this.config.left_border && (b.className += " dhx_scale_hour_border"), b.style.width = k + "px"; - var E = t.templates.hour_scale(y); - b.innerHTML = E, this._waiAria.hourScaleAttr(b, E), p.appendChild(b), y = this.date.add(y, 1, "hour"); + var E = a.templates.hour_scale(y); + b.innerHTML = E, this._waiAria.hourScaleAttr(b, E), g.appendChild(b), y = this.date.add(y, 1, "hour"); } - l.appendChild(p), this.config.scroll_hour && (l.scrollTop = this.config.hour_size_px * (this.config.scroll_hour - this.config.first_hour)); - }, t._currentDate = function() { - return t.config.now_date ? new Date(t.config.now_date) : /* @__PURE__ */ new Date(); - }, t._reset_ignores = function() { + c.appendChild(g), this.config.scroll_hour && (c.scrollTop = this.config.hour_size_px * (this.config.scroll_hour - this.config.first_hour)); + }, a._currentDate = function() { + return a.config.now_date ? new Date(a.config.now_date) : /* @__PURE__ */ new Date(); + }, a._reset_ignores = function() { this._ignores = {}, this._ignores_detected = 0; - }, t._process_ignores = function(l, f, g, p, y) { + }, a._process_ignores = function(c, p, m, g, y) { this._reset_ignores(); - var w = t["ignore_" + this._mode]; - if (w) - for (var b = new Date(l), k = 0; k < f; k++) - w(b) && (this._ignores_detected += 1, this._ignores[k] = !0, y && f++), b = t.date.add(b, p, g), t.date[g + "_start"] && (b = t.date[g + "_start"](b)); - }, t._render_month_scale = function(l, f, g, p) { - var y = t.date.add(f, 1, "month"), w = new Date(g), b = t._currentDate(); - this.date.date_part(b), this.date.date_part(g), p = p || Math.ceil(Math.round((y.valueOf() - g.valueOf()) / 864e5) / 7); + var x = a["ignore_" + this._mode]; + if (x) + for (var b = new Date(c), k = 0; k < p; k++) + x(b) && (this._ignores_detected += 1, this._ignores[k] = !0, y && p++), b = a.date.add(b, g, m), a.date[m + "_start"] && (b = a.date[m + "_start"](b)); + }, a._render_month_scale = function(c, p, m, g) { + var y = a.date.add(p, 1, "month"), x = new Date(m), b = a._currentDate(); + this.date.date_part(b), this.date.date_part(m), g = g || Math.ceil(Math.round((y.valueOf() - m.valueOf()) / 864e5) / 7); for (var k = [], E = 0; E <= 7; E++) { var D = this._cols[E] || 0; isNaN(Number(D)) || (D += "px"), k[E] = D; } - function x($) { - var j = t._colsS.height; - return t._colsS.heights[$ + 1] !== void 0 && (j = t._colsS.heights[$ + 1] - (t._colsS.heights[$] || 0)), j; + function w(q) { + var V = a._colsS.height; + return a._colsS.heights[q + 1] !== void 0 && (V = a._colsS.heights[q + 1] - (a._colsS.heights[q] || 0)), V; } var S = 0; const N = document.createElement("div"); - for (N.classList.add("dhx_cal_month_table"), E = 0; E < p; E++) { + for (N.classList.add("dhx_cal_month_table"), E = 0; E < g; E++) { var M = document.createElement("div"); - M.classList.add("dhx_cal_month_row"), M.style.height = x(E) + "px", N.appendChild(M); - for (var A = 0; A < 7; A++) { - var C = document.createElement("div"); - M.appendChild(C); - var T = "dhx_cal_month_cell"; - g < f ? T += " dhx_before" : g >= y ? T += " dhx_after" : g.valueOf() == b.valueOf() && (T += " dhx_now"), this._ignores_detected && this._ignores[A] && (T += " dhx_scale_ignore"), C.className = T + " " + this.templates.month_date_class(g, b), C.setAttribute("data-cell-date", t.templates.format_date(g)); - var O = "dhx_month_body", L = "dhx_month_head"; - if (A === 0 && this.config.left_border && (O += " dhx_month_body_border", L += " dhx_month_head_border"), this._ignores_detected && this._ignores[A]) - C.appendChild(document.createElement("div")), C.appendChild(document.createElement("div")); + M.classList.add("dhx_cal_month_row"), M.style.height = w(E) + "px", N.appendChild(M); + for (var T = 0; T < 7; T++) { + var A = document.createElement("div"); + M.appendChild(A); + var H = "dhx_cal_month_cell"; + m < p ? H += " dhx_before" : m >= y ? H += " dhx_after" : m.valueOf() == b.valueOf() && (H += " dhx_now"), this._ignores_detected && this._ignores[T] && (H += " dhx_scale_ignore"), A.className = H + " " + this.templates.month_date_class(m, b), A.setAttribute("data-cell-date", a.templates.format_date(m)); + var $ = "dhx_month_body", j = "dhx_month_head"; + if (T === 0 && this.config.left_border && ($ += " dhx_month_body_border", j += " dhx_month_head_border"), this._ignores_detected && this._ignores[T]) + A.appendChild(document.createElement("div")), A.appendChild(document.createElement("div")); else { - C.style.width = k[A], this._waiAria.monthCellAttr(C, g); - var H = document.createElement("div"); - H.style.height = t.xy.month_head_height + "px", H.className = L, H.innerHTML = this.templates.month_day(g), C.appendChild(H); - var P = document.createElement("div"); - P.className = O, C.appendChild(P); + A.style.width = k[T], this._waiAria.monthCellAttr(A, m); + var z = document.createElement("div"); + z.style.height = a.xy.month_head_height + "px", z.className = j, z.innerHTML = this.templates.month_day(m), A.appendChild(z); + var W = document.createElement("div"); + W.className = $, A.appendChild(W); } - var z = g.getDate(); - (g = this.date.add(g, 1, "day")).getDate() - z > 1 && (g = new Date(g.getFullYear(), g.getMonth(), z + 1, 12, 0)); + var Y = m.getDate(); + (m = this.date.add(m, 1, "day")).getDate() - Y > 1 && (m = new Date(m.getFullYear(), m.getMonth(), Y + 1, 12, 0)); } - t._colsS.heights[E] = S, S += x(E); + a._colsS.heights[E] = S, S += w(E); } - return this._min_date = w, this._max_date = g, l.innerHTML = "", l.appendChild(N), this._scales = {}, l.querySelectorAll("[data-cell-date]").forEach(($) => { - const j = t.templates.parse_date($.getAttribute("data-cell-date")), F = $.querySelector(".dhx_month_body"); - this._scales[+j] = F, this.callEvent("onScaleAdd", [this._scales[+j], j]); + return this._min_date = x, this._max_date = m, c.innerHTML = "", c.appendChild(N), this._scales = {}, c.querySelectorAll("[data-cell-date]").forEach((q) => { + const V = a.templates.parse_date(q.getAttribute("data-cell-date")), ve = q.querySelector(".dhx_month_body"); + this._scales[+V] = ve, this.callEvent("onScaleAdd", [this._scales[+V], V]); }), this._max_date; - }, t._reset_month_scale = function(l, f, g, p) { - var y = t.date.add(f, 1, "month"), w = t._currentDate(); - this.date.date_part(w), this.date.date_part(g), p = p || Math.ceil(Math.round((y.valueOf() - g.valueOf()) / 864e5) / 7); - var b = Math.floor(l.clientHeight / p) - this.xy.month_head_height; - return this._colsS.height = b + this.xy.month_head_height, this._colsS.heights = [], t._render_month_scale(l, f, g, p); - }, t.getView = function(l) { - return l || (l = t.getState().mode), t.matrix && t.matrix[l] ? t.matrix[l] : t._props && t._props[l] ? t._props[l] : null; - }, t.getLabel = function(l, f) { - for (var g = this.config.lightbox.sections, p = 0; p < g.length; p++) - if (g[p].map_to == l) { - for (var y = g[p].options, w = 0; w < y.length; w++) - if (y[w].key == f) - return y[w].label; + }, a._reset_month_scale = function(c, p, m, g) { + var y = a.date.add(p, 1, "month"), x = a._currentDate(); + this.date.date_part(x), this.date.date_part(m), g = g || Math.ceil(Math.round((y.valueOf() - m.valueOf()) / 864e5) / 7); + var b = Math.floor(c.clientHeight / g) - this.xy.month_head_height; + return this._colsS.height = b + this.xy.month_head_height, this._colsS.heights = [], a._render_month_scale(c, p, m, g); + }, a.getView = function(c) { + return c || (c = a.getState().mode), a.matrix && a.matrix[c] ? a.matrix[c] : a._props && a._props[c] ? a._props[c] : null; + }, a.getLabel = function(c, p) { + for (var m = this.config.lightbox.sections, g = 0; g < m.length; g++) + if (m[g].map_to == c) { + for (var y = m[g].options, x = 0; x < y.length; x++) + if (y[x].key == p) + return y[x].label; } return ""; - }, t.updateCollection = function(l, f) { - var g = t.serverList(l); - return !!g && (g.splice(0, g.length), g.push.apply(g, f || []), t.callEvent("onOptionsLoad", []), t.resetLightbox(), t.hideCover(), !0); - }, t._lame_clone = function(l, f) { - var g, p, y; - for (f = f || [], g = 0; g < f.length; g += 2) - if (l === f[g]) - return f[g + 1]; - if (l && typeof l == "object") { - for (y = Object.create(l), p = [Array, Date, Number, String, Boolean], g = 0; g < p.length; g++) - l instanceof p[g] && (y = g ? new p[g](l) : new p[g]()); - for (g in f.push(l, y), l) - Object.prototype.hasOwnProperty.apply(l, [g]) && (y[g] = t._lame_clone(l[g], f)); - } - return y || l; - }, t._lame_copy = function(l, f) { - for (var g in f) - f.hasOwnProperty(g) && (l[g] = f[g]); - return l; - }, t._get_date_from_pos = function(l) { - var f = this._min_date.valueOf() + 6e4 * (l.y * this.config.time_step + 24 * (this._table_view ? 0 : l.x) * 60); - return new Date(this._correct_shift(f)); - }, t.getActionData = function(l) { - var f = this._mouse_coords(l); - return { date: this._get_date_from_pos(f), section: f.section }; - }, t._focus = function(l, f) { - if (l && l.focus) + }, a.updateCollection = function(c, p) { + var m = a.serverList(c); + return !!m && (m.splice(0, m.length), m.push.apply(m, p || []), a.callEvent("onOptionsLoad", []), a.resetLightbox(), a.hideCover(), !0); + }, a._lame_clone = function(c, p) { + var m, g, y; + for (p = p || [], m = 0; m < p.length; m += 2) + if (c === p[m]) + return p[m + 1]; + if (c && typeof c == "object") { + for (y = Object.create(c), g = [Array, Date, Number, String, Boolean], m = 0; m < g.length; m++) + c instanceof g[m] && (y = m ? new g[m](c) : new g[m]()); + for (m in p.push(c, y), c) + Object.prototype.hasOwnProperty.apply(c, [m]) && (y[m] = a._lame_clone(c[m], p)); + } + return y || c; + }, a._lame_copy = function(c, p) { + for (var m in p) + p.hasOwnProperty(m) && (c[m] = p[m]); + return c; + }, a._get_date_from_pos = function(c) { + var p = this._min_date.valueOf() + 6e4 * (c.y * this.config.time_step + 24 * (this._table_view ? 0 : c.x) * 60); + return new Date(this._correct_shift(p)); + }, a.getActionData = function(c) { + var p = this._mouse_coords(c); + return { date: this._get_date_from_pos(p), section: p.section }; + }, a._focus = function(c, p) { + if (c && c.focus) if (this._mobile) window.setTimeout(function() { - l.focus(); + c.focus(); }, 10); else try { - f && l.select && l.offsetWidth && l.select(), l.focus(); + p && c.select && c.offsetWidth && c.select(), c.focus(); } catch { } - }, t._get_real_event_length = function(l, f, g) { - var p, y = f - l, w = this["ignore_" + this._mode], b = 0; - g.render ? (b = this._get_date_index(g, l), p = this._get_date_index(g, f), l.valueOf() < t.getState().min_date.valueOf() && (b = -m(l, t.getState().min_date)), f.valueOf() > t.getState().max_date.valueOf() && (p += m(f, t.getState().max_date))) : p = Math.round(y / 60 / 60 / 1e3 / 24); - for (var k = !0; b < p; ) { - var E = t.date.add(f, -g.x_step, g.x_unit); - if (w && w(f) && (!k || k && w(E))) - y -= f - E; + }, a._get_real_event_length = function(c, p, m) { + var g, y = p - c, x = this["ignore_" + this._mode], b = 0; + m.render ? (b = this._get_date_index(m, c), g = this._get_date_index(m, p), c.valueOf() < a.getState().min_date.valueOf() && (b = -f(c, a.getState().min_date)), p.valueOf() > a.getState().max_date.valueOf() && (g += f(p, a.getState().max_date))) : g = Math.round(y / 60 / 60 / 1e3 / 24); + for (var k = !0; b < g; ) { + var E = a.date.add(p, -m.x_step, m.x_unit); + if (x && x(p) && (!k || k && x(E))) + y -= p - E; else { let D = 0; - const x = new Date(Math.max(E.valueOf(), l.valueOf())), S = f, N = new Date(x.getFullYear(), x.getMonth(), x.getDate(), g.first_hour), M = new Date(x.getFullYear(), x.getMonth(), x.getDate(), g.last_hour || 24), A = new Date(f.getFullYear(), f.getMonth(), f.getDate(), g.first_hour), C = new Date(f.getFullYear(), f.getMonth(), f.getDate(), g.last_hour || 24); - S.valueOf() > C.valueOf() && (D += S - C), S.valueOf() > A.valueOf() ? D += g._start_correction : D += 60 * S.getHours() * 60 * 1e3 + 60 * S.getMinutes() * 1e3, x.valueOf() < M.valueOf() && (D += g._end_correction), x.valueOf() < N.valueOf() && (D += N.valueOf() - x.valueOf()), y -= D, k = !1; + const w = new Date(Math.max(E.valueOf(), c.valueOf())), S = p, N = new Date(w.getFullYear(), w.getMonth(), w.getDate(), m.first_hour), M = new Date(w.getFullYear(), w.getMonth(), w.getDate(), m.last_hour || 24), T = new Date(p.getFullYear(), p.getMonth(), p.getDate(), m.first_hour), A = new Date(p.getFullYear(), p.getMonth(), p.getDate(), m.last_hour || 24); + S.valueOf() > A.valueOf() && (D += S - A), S.valueOf() > T.valueOf() ? D += m._start_correction : D += 60 * S.getHours() * 60 * 1e3 + 60 * S.getMinutes() * 1e3, w.valueOf() < M.valueOf() && (D += m._end_correction), w.valueOf() < N.valueOf() && (D += N.valueOf() - w.valueOf()), y -= D, k = !1; } - f = E, p--; + p = E, g--; } return y; - }, t._get_fictional_event_length = function(l, f, g, p) { - var y = new Date(l), w = p ? -1 : 1; - if (g._start_correction || g._end_correction) { + }, a._get_fictional_event_length = function(c, p, m, g) { + var y = new Date(c), x = g ? -1 : 1; + if (m._start_correction || m._end_correction) { var b; - b = p ? 60 * y.getHours() + y.getMinutes() - 60 * (g.first_hour || 0) : 60 * (g.last_hour || 0) - (60 * y.getHours() + y.getMinutes()); - var k = 60 * (g.last_hour - g.first_hour), E = Math.ceil((f / 6e4 - b) / k); - E < 0 && (E = 0), f += E * (1440 - k) * 60 * 1e3; + b = g ? 60 * y.getHours() + y.getMinutes() - 60 * (m.first_hour || 0) : 60 * (m.last_hour || 0) - (60 * y.getHours() + y.getMinutes()); + var k = 60 * (m.last_hour - m.first_hour), E = Math.ceil((p / 6e4 - b) / k); + E < 0 && (E = 0), p += E * (1440 - k) * 60 * 1e3; } - var D, x = new Date(1 * l + f * w), S = this["ignore_" + this._mode], N = 0; - for (g.render ? (N = this._get_date_index(g, y), D = this._get_date_index(g, x)) : D = Math.round(f / 60 / 60 / 1e3 / 24); N * w <= D * w; ) { - var M = t.date.add(y, g.x_step * w, g.x_unit); - S && S(y) && (f += (M - y) * w, D += w), y = M, N += w; + var D, w = new Date(1 * c + p * x), S = this["ignore_" + this._mode], N = 0; + for (m.render ? (N = this._get_date_index(m, y), D = this._get_date_index(m, w)) : D = Math.round(p / 60 / 60 / 1e3 / 24); N * x <= D * x; ) { + var M = a.date.add(y, m.x_step * x, m.x_unit); + S && S(y) && (p += (M - y) * x, D += x), y = M, N += x; } - return f; - }, t._get_section_view = function() { + return p; + }, a._get_section_view = function() { return this.getView(); - }, t._get_section_property = function() { + }, a._get_section_property = function() { return this.matrix && this.matrix[this._mode] ? this.matrix[this._mode].y_property : this._props && this._props[this._mode] ? this._props[this._mode].map_to : null; - }, t._is_initialized = function() { - var l = this.getState(); - return this._obj && l.date && l.mode; - }, t._is_lightbox_open = function() { - var l = this.getState(); - return l.lightbox_id !== null && l.lightbox_id !== void 0; + }, a._is_initialized = function() { + var c = this.getState(); + return this._obj && c.date && c.mode; + }, a._is_lightbox_open = function() { + var c = this.getState(); + return c.lightbox_id !== null && c.lightbox_id !== void 0; }; - }(h), function(t) { + }(i), function(a) { (function() { - var n = new RegExp(`<(?:.| -)*?>`, "gm"), s = new RegExp(" +", "gm"); - function c(l) { - return (l + "").replace(n, " ").replace(s, " "); - } - var u = new RegExp("'", "gm"); - function v(l) { - return (l + "").replace(u, "'"); - } - for (var m in t._waiAria = { getAttributeString: function(l) { - var f = [" "]; - for (var g in l) - if (typeof l[g] != "function" && typeof l[g] != "object") { - var p = v(c(l[g])); - f.push(g + "='" + p + "'"); + var o = new RegExp(`<(?:.| +)*?>`, "gm"), l = new RegExp(" +", "gm"); + function h(c) { + return (c + "").replace(o, " ").replace(l, " "); + } + var v = new RegExp("'", "gm"); + function u(c) { + return (c + "").replace(v, "'"); + } + for (var f in a._waiAria = { getAttributeString: function(c) { + var p = [" "]; + for (var m in c) + if (typeof c[m] != "function" && typeof c[m] != "object") { + var g = u(h(c[m])); + p.push(m + "='" + g + "'"); } - return f.push(" "), f.join(" "); - }, setAttributes: function(l, f) { - for (var g in f) - l.setAttribute(g, c(f[g])); - return l; - }, labelAttr: function(l, f) { - return this.setAttributes(l, { "aria-label": f }); - }, label: function(l) { - return t._waiAria.getAttributeString({ "aria-label": l }); - }, hourScaleAttr: function(l, f) { - this.labelAttr(l, f); - }, monthCellAttr: function(l, f) { - this.labelAttr(l, t.templates.day_date(f)); - }, navBarDateAttr: function(l, f) { - this.labelAttr(l, f); - }, dayHeaderAttr: function(l, f) { - this.labelAttr(l, f); - }, dayColumnAttr: function(l, f) { - this.dayHeaderAttr(l, t.templates.day_date(f)); - }, headerButtonsAttributes: function(l, f) { - return this.setAttributes(l, { role: "button", "aria-label": f }); - }, headerToggleState: function(l, f) { - return this.setAttributes(l, { "aria-pressed": f ? "true" : "false" }); - }, getHeaderCellAttr: function(l) { - return t._waiAria.getAttributeString({ "aria-label": l }); - }, eventAttr: function(l, f) { - this._eventCommonAttr(l, f); - }, _eventCommonAttr: function(l, f) { - f.setAttribute("aria-label", c(t.templates.event_text(l.start_date, l.end_date, l))), t.config.readonly && f.setAttribute("aria-readonly", !0), l.$dataprocessor_class && f.setAttribute("aria-busy", !0), f.setAttribute("aria-selected", t.getState().select_id == l.id ? "true" : "false"); - }, setEventBarAttr: function(l, f) { - this._eventCommonAttr(l, f); - }, _getAttributes: function(l, f) { - var g = { setAttribute: function(p, y) { - this[p] = y; + return p.push(" "), p.join(" "); + }, setAttributes: function(c, p) { + for (var m in p) + c.setAttribute(m, h(p[m])); + return c; + }, labelAttr: function(c, p) { + return this.setAttributes(c, { "aria-label": p }); + }, label: function(c) { + return a._waiAria.getAttributeString({ "aria-label": c }); + }, hourScaleAttr: function(c, p) { + this.labelAttr(c, p); + }, monthCellAttr: function(c, p) { + this.labelAttr(c, a.templates.day_date(p)); + }, navBarDateAttr: function(c, p) { + this.labelAttr(c, p); + }, dayHeaderAttr: function(c, p) { + this.labelAttr(c, p); + }, dayColumnAttr: function(c, p) { + this.dayHeaderAttr(c, a.templates.day_date(p)); + }, headerButtonsAttributes: function(c, p) { + return this.setAttributes(c, { role: "button", "aria-label": p }); + }, headerToggleState: function(c, p) { + return this.setAttributes(c, { "aria-pressed": p ? "true" : "false" }); + }, getHeaderCellAttr: function(c) { + return a._waiAria.getAttributeString({ "aria-label": c }); + }, eventAttr: function(c, p) { + this._eventCommonAttr(c, p); + }, _eventCommonAttr: function(c, p) { + p.setAttribute("aria-label", h(a.templates.event_text(c.start_date, c.end_date, c))), a.config.readonly && p.setAttribute("aria-readonly", !0), c.$dataprocessor_class && p.setAttribute("aria-busy", !0), p.setAttribute("aria-selected", a.getState().select_id == c.id ? "true" : "false"); + }, setEventBarAttr: function(c, p) { + this._eventCommonAttr(c, p); + }, _getAttributes: function(c, p) { + var m = { setAttribute: function(g, y) { + this[g] = y; } }; - return l.apply(this, [f, g]), g; - }, eventBarAttrString: function(l) { - return this.getAttributeString(this._getAttributes(this.setEventBarAttr, l)); + return c.apply(this, [p, m]), m; + }, eventBarAttrString: function(c) { + return this.getAttributeString(this._getAttributes(this.setEventBarAttr, c)); }, agendaHeadAttrString: function() { return this.getAttributeString({ role: "row" }); - }, agendaHeadDateString: function(l) { - return this.getAttributeString({ role: "columnheader", "aria-label": l }); - }, agendaHeadDescriptionString: function(l) { - return this.agendaHeadDateString(l); + }, agendaHeadDateString: function(c) { + return this.getAttributeString({ role: "columnheader", "aria-label": c }); + }, agendaHeadDescriptionString: function(c) { + return this.agendaHeadDateString(c); }, agendaDataAttrString: function() { return this.getAttributeString({ role: "grid" }); - }, agendaEventAttrString: function(l) { - var f = this._getAttributes(this._eventCommonAttr, l); - return f.role = "row", this.getAttributeString(f); + }, agendaEventAttrString: function(c) { + var p = this._getAttributes(this._eventCommonAttr, c); + return p.role = "row", this.getAttributeString(p); }, agendaDetailsBtnString: function() { - return this.getAttributeString({ role: "button", "aria-label": t.locale.labels.icon_details }); + return this.getAttributeString({ role: "button", "aria-label": a.locale.labels.icon_details }); }, gridAttrString: function() { return this.getAttributeString({ role: "grid" }); - }, gridRowAttrString: function(l) { - return this.agendaEventAttrString(l); - }, gridCellAttrString: function(l, f, g) { - return this.getAttributeString({ role: "gridcell", "aria-label": [f.label === void 0 ? f.id : f.label, ": ", g] }); + }, gridRowAttrString: function(c) { + return this.agendaEventAttrString(c); + }, gridCellAttrString: function(c, p, m) { + return this.getAttributeString({ role: "gridcell", "aria-label": [p.label === void 0 ? p.id : p.label, ": ", m] }); }, mapAttrString: function() { return this.gridAttrString(); - }, mapRowAttrString: function(l) { - return this.gridRowAttrString(l); + }, mapRowAttrString: function(c) { + return this.gridRowAttrString(c); }, mapDetailsBtnString: function() { return this.agendaDetailsBtnString(); - }, minicalHeader: function(l, f) { - this.setAttributes(l, { id: f + "", "aria-live": "assertice", "aria-atomic": "true" }); - }, minicalGrid: function(l, f) { - this.setAttributes(l, { "aria-labelledby": f + "", role: "grid" }); - }, minicalRow: function(l) { - this.setAttributes(l, { role: "row" }); - }, minicalDayCell: function(l, f) { - var g = f.valueOf() < t._max_date.valueOf() && f.valueOf() >= t._min_date.valueOf(); - this.setAttributes(l, { role: "gridcell", "aria-label": t.templates.day_date(f), "aria-selected": g ? "true" : "false" }); - }, minicalHeadCell: function(l) { - this.setAttributes(l, { role: "columnheader" }); - }, weekAgendaDayCell: function(l, f) { - var g = l.querySelector(".dhx_wa_scale_bar"), p = l.querySelector(".dhx_wa_day_data"), y = t.uid() + ""; - this.setAttributes(g, { id: y }), this.setAttributes(p, { "aria-labelledby": y }); - }, weekAgendaEvent: function(l, f) { - this.eventAttr(f, l); - }, lightboxHiddenAttr: function(l) { - l.setAttribute("aria-hidden", "true"); - }, lightboxVisibleAttr: function(l) { - l.setAttribute("aria-hidden", "false"); - }, lightboxSectionButtonAttrString: function(l) { - return this.getAttributeString({ role: "button", "aria-label": l, tabindex: "0" }); - }, yearHeader: function(l, f) { - this.setAttributes(l, { id: f + "" }); - }, yearGrid: function(l, f) { - this.minicalGrid(l, f); - }, yearHeadCell: function(l) { - return this.minicalHeadCell(l); - }, yearRow: function(l) { - return this.minicalRow(l); - }, yearDayCell: function(l) { - this.setAttributes(l, { role: "gridcell" }); - }, lightboxAttr: function(l) { - l.setAttribute("role", "dialog"), l.setAttribute("aria-hidden", "true"), l.firstChild.setAttribute("role", "heading"); - }, lightboxButtonAttrString: function(l) { - return this.getAttributeString({ role: "button", "aria-label": t.locale.labels[l], tabindex: "0" }); - }, eventMenuAttrString: function(l) { - return this.getAttributeString({ role: "button", "aria-label": t.locale.labels[l] }); - }, lightboxHeader: function(l, f) { - l.setAttribute("aria-label", f); - }, lightboxSelectAttrString: function(l) { - var f = ""; - switch (l) { + }, minicalHeader: function(c, p) { + this.setAttributes(c, { id: p + "", "aria-live": "assertice", "aria-atomic": "true" }); + }, minicalGrid: function(c, p) { + this.setAttributes(c, { "aria-labelledby": p + "", role: "grid" }); + }, minicalRow: function(c) { + this.setAttributes(c, { role: "row" }); + }, minicalDayCell: function(c, p) { + var m = p.valueOf() < a._max_date.valueOf() && p.valueOf() >= a._min_date.valueOf(); + this.setAttributes(c, { role: "gridcell", "aria-label": a.templates.day_date(p), "aria-selected": m ? "true" : "false" }); + }, minicalHeadCell: function(c) { + this.setAttributes(c, { role: "columnheader" }); + }, weekAgendaDayCell: function(c, p) { + var m = c.querySelector(".dhx_wa_scale_bar"), g = c.querySelector(".dhx_wa_day_data"), y = a.uid() + ""; + this.setAttributes(m, { id: y }), this.setAttributes(g, { "aria-labelledby": y }); + }, weekAgendaEvent: function(c, p) { + this.eventAttr(p, c); + }, lightboxHiddenAttr: function(c) { + c.setAttribute("aria-hidden", "true"); + }, lightboxVisibleAttr: function(c) { + c.setAttribute("aria-hidden", "false"); + }, lightboxSectionButtonAttrString: function(c) { + return this.getAttributeString({ role: "button", "aria-label": c, tabindex: "0" }); + }, yearHeader: function(c, p) { + this.setAttributes(c, { id: p + "" }); + }, yearGrid: function(c, p) { + this.minicalGrid(c, p); + }, yearHeadCell: function(c) { + return this.minicalHeadCell(c); + }, yearRow: function(c) { + return this.minicalRow(c); + }, yearDayCell: function(c) { + this.setAttributes(c, { role: "gridcell" }); + }, lightboxAttr: function(c) { + c.setAttribute("role", "dialog"), c.setAttribute("aria-hidden", "true"), c.firstChild.setAttribute("role", "heading"); + }, lightboxButtonAttrString: function(c) { + return this.getAttributeString({ role: "button", "aria-label": a.locale.labels[c], tabindex: "0" }); + }, eventMenuAttrString: function(c) { + return this.getAttributeString({ role: "button", "aria-label": a.locale.labels[c] }); + }, lightboxHeader: function(c, p) { + c.setAttribute("aria-label", p); + }, lightboxSelectAttrString: function(c) { + var p = ""; + switch (c) { case "%Y": - f = t.locale.labels.year; + p = a.locale.labels.year; break; case "%m": - f = t.locale.labels.month; + p = a.locale.labels.month; break; case "%d": - f = t.locale.labels.day; + p = a.locale.labels.day; break; case "%H:%i": - f = t.locale.labels.hour + " " + t.locale.labels.minute; + p = a.locale.labels.hour + " " + a.locale.labels.minute; } - return t._waiAria.getAttributeString({ "aria-label": f }); - }, messageButtonAttrString: function(l) { - return "tabindex='0' role='button' aria-label='" + l + "'"; - }, messageInfoAttr: function(l) { - l.setAttribute("role", "alert"); - }, messageModalAttr: function(l, f) { - l.setAttribute("role", "dialog"), f && l.setAttribute("aria-labelledby", f); - }, quickInfoAttr: function(l) { - l.setAttribute("role", "dialog"); + return a._waiAria.getAttributeString({ "aria-label": p }); + }, messageButtonAttrString: function(c) { + return "tabindex='0' role='button' aria-label='" + c + "'"; + }, messageInfoAttr: function(c) { + c.setAttribute("role", "alert"); + }, messageModalAttr: function(c, p) { + c.setAttribute("role", "dialog"), p && c.setAttribute("aria-labelledby", p); + }, quickInfoAttr: function(c) { + c.setAttribute("role", "dialog"); }, quickInfoHeaderAttrString: function() { return " role='heading' "; - }, quickInfoHeader: function(l, f) { - l.setAttribute("aria-label", f); - }, quickInfoButtonAttrString: function(l) { - return t._waiAria.getAttributeString({ role: "button", "aria-label": l, tabindex: "0" }); - }, tooltipAttr: function(l) { - l.setAttribute("role", "tooltip"); - }, tooltipVisibleAttr: function(l) { - l.setAttribute("aria-hidden", "false"); - }, tooltipHiddenAttr: function(l) { - l.setAttribute("aria-hidden", "true"); - } }, t._waiAria) - t._waiAria[m] = function(l) { + }, quickInfoHeader: function(c, p) { + c.setAttribute("aria-label", p); + }, quickInfoButtonAttrString: function(c) { + return a._waiAria.getAttributeString({ role: "button", "aria-label": c, tabindex: "0" }); + }, tooltipAttr: function(c) { + c.setAttribute("role", "tooltip"); + }, tooltipVisibleAttr: function(c) { + c.setAttribute("aria-hidden", "false"); + }, tooltipHiddenAttr: function(c) { + c.setAttribute("aria-hidden", "true"); + } }, a._waiAria) + a._waiAria[f] = function(c) { return function() { - return t.config.wai_aria_attributes ? l.apply(this, arguments) : " "; + return a.config.wai_aria_attributes ? c.apply(this, arguments) : " "; }; - }(t._waiAria[m]); + }(a._waiAria[f]); })(); - }(h), h.utils = V, h.$domHelpers = q, h.utils.dom = q, h.uid = V.uid, h.mixin = V.mixin, h.defined = V.defined, h.assert = function(t) { - return function(n, s) { - n || t.config.show_errors && t.callEvent("onError", [s]) !== !1 && (t.message ? t.message({ type: "error", text: s, expire: -1 }) : console.log(s)); + }(i), i.utils = ee, i.$domHelpers = _e, i.utils.dom = _e, i.uid = ee.uid, i.mixin = ee.mixin, i.defined = ee.defined, i.assert = function(a) { + return function(o, l) { + o || a.config.show_errors && a.callEvent("onError", [l]) !== !1 && (a.message ? a.message({ type: "error", text: l, expire: -1 }) : console.log(l)); }; - }(h), h.copy = V.copy, h._createDatePicker = function(t, n) { - return new at(h, t, n); - }, h._getFocusableNodes = q.getFocusableNodes, h._getClassName = q.getClassName, h._locate_css = q.locateCss; - const a = De(h); - var r, d, i; - h.utils.mixin(h, a), h.env = h.$env = ye, h.Promise = window.Promise, function(t) { - t.destructor = function() { - for (var n in t.callEvent("onDestroy", []), this.clearAll(), this.$container && (this.$container.innerHTML = ""), this._eventRemoveAll && this._eventRemoveAll(), this.resetLightbox && this.resetLightbox(), this._dp && this._dp.destructor && this._dp.destructor(), this.detachAllEvents(), this) - n.indexOf("$") === 0 && delete this[n]; - t.$destroyed = !0; + }(i), i.copy = ee.copy, i._createDatePicker = function(a, o) { + return new Da(i, a, o); + }, i._getFocusableNodes = _e.getFocusableNodes, i._getClassName = _e.getClassName, i._locate_css = _e.locateCss; + const t = Wt(i); + var r, d, n; + i.utils.mixin(i, t), i.env = i.$env = Yt, i.Promise = window.Promise, function(a) { + a.destructor = function() { + for (var o in a.callEvent("onDestroy", []), this.clearAll(), this.$container && (this.$container.innerHTML = ""), this._eventRemoveAll && this._eventRemoveAll(), this.resetLightbox && this.resetLightbox(), this._dp && this._dp.destructor && this._dp.destructor(), this.detachAllEvents(), this) + o.indexOf("$") === 0 && delete this[o]; + a.$destroyed = !0; }; - }(h), function(t) { - function n(s, c) { - var u = { method: s }; - if (c.length === 0) + }(i), function(a) { + function o(l, h) { + var v = { method: l }; + if (h.length === 0) throw new Error("Arguments list of query is wrong."); - if (c.length === 1) - return typeof c[0] == "string" ? (u.url = c[0], u.async = !0) : (u.url = c[0].url, u.async = c[0].async || !0, u.callback = c[0].callback, u.headers = c[0].headers), c[0].data ? typeof c[0].data != "string" ? u.data = W(c[0].data) : u.data = c[0].data : u.data = "", u; - switch (u.url = c[0], s) { + if (h.length === 1) + return typeof h[0] == "string" ? (v.url = h[0], v.async = !0) : (v.url = h[0].url, v.async = h[0].async || !0, v.callback = h[0].callback, v.headers = h[0].headers), h[0].data ? typeof h[0].data != "string" ? v.data = Te(h[0].data) : v.data = h[0].data : v.data = "", v; + switch (v.url = h[0], l) { case "GET": case "DELETE": - u.callback = c[1], u.headers = c[2]; + v.callback = h[1], v.headers = h[2]; break; case "POST": case "PUT": - c[1] ? typeof c[1] != "string" ? u.data = W(c[1]) : u.data = c[1] : u.data = "", u.callback = c[2], u.headers = c[3]; + h[1] ? typeof h[1] != "string" ? v.data = Te(h[1]) : v.data = h[1] : v.data = "", v.callback = h[2], v.headers = h[3]; } - return u; - } - t.Promise = window.Promise, t.ajax = { cache: !0, method: "get", serializeRequestParams: W, parse: function(s) { - return typeof s != "string" ? s : (s = s.replace(/^[\s]+/, ""), typeof DOMParser > "u" || t.$env.isIE ? window.ActiveXObject !== void 0 && ((c = new window.ActiveXObject("Microsoft.XMLDOM")).async = "false", c.loadXML(s)) : c = new DOMParser().parseFromString(s, "text/xml"), c); - var c; - }, xmltop: function(s, c, u) { - if (c.status === void 0 || c.status < 400) { - var v = c.responseXML ? c.responseXML || c : this.parse(c.responseText || c); - if (v && v.documentElement !== null && !v.getElementsByTagName("parsererror").length) - return v.getElementsByTagName(s)[0]; - } - return u !== -1 && t.callEvent("onLoadXMLError", ["Incorrect XML", arguments[1], u]), document.createElement("DIV"); - }, xpath: function(s, c) { - if (c.nodeName || (c = c.responseXML || c), t.$env.isIE) - return c.selectNodes(s) || []; - for (var u, v = [], m = (c.ownerDocument || c).evaluate(s, c, null, XPathResult.ANY_TYPE, null); u = m.iterateNext(); ) - v.push(u); return v; - }, query: function(s) { - return this._call(s.method || "GET", s.url, s.data || "", s.async || !0, s.callback, s.headers); - }, get: function(s, c, u) { - var v = n("GET", arguments); - return this.query(v); - }, getSync: function(s, c) { - var u = n("GET", arguments); - return u.async = !1, this.query(u); - }, put: function(s, c, u, v) { - var m = n("PUT", arguments); - return this.query(m); - }, del: function(s, c, u) { - var v = n("DELETE", arguments); - return this.query(v); - }, post: function(s, c, u, v) { - arguments.length == 1 ? c = "" : arguments.length == 2 && typeof c == "function" && (u = c, c = ""); - var m = n("POST", arguments); - return this.query(m); - }, postSync: function(s, c, u) { - c = c === null ? "" : String(c); - var v = n("POST", arguments); + } + a.Promise = window.Promise, a.ajax = { cache: !0, method: "get", serializeRequestParams: Te, parse: function(l) { + return typeof l != "string" ? l : (l = l.replace(/^[\s]+/, ""), typeof DOMParser > "u" || a.$env.isIE ? window.ActiveXObject !== void 0 && ((h = new window.ActiveXObject("Microsoft.XMLDOM")).async = "false", h.loadXML(l)) : h = new DOMParser().parseFromString(l, "text/xml"), h); + var h; + }, xmltop: function(l, h, v) { + if (h.status === void 0 || h.status < 400) { + var u = h.responseXML ? h.responseXML || h : this.parse(h.responseText || h); + if (u && u.documentElement !== null && !u.getElementsByTagName("parsererror").length) + return u.getElementsByTagName(l)[0]; + } + return v !== -1 && a.callEvent("onLoadXMLError", ["Incorrect XML", arguments[1], v]), document.createElement("DIV"); + }, xpath: function(l, h) { + if (h.nodeName || (h = h.responseXML || h), a.$env.isIE) + return h.selectNodes(l) || []; + for (var v, u = [], f = (h.ownerDocument || h).evaluate(l, h, null, XPathResult.ANY_TYPE, null); v = f.iterateNext(); ) + u.push(v); + return u; + }, query: function(l) { + return this._call(l.method || "GET", l.url, l.data || "", l.async || !0, l.callback, l.headers); + }, get: function(l, h, v) { + var u = o("GET", arguments); + return this.query(u); + }, getSync: function(l, h) { + var v = o("GET", arguments); return v.async = !1, this.query(v); - }, _call: function(s, c, u, v, m, l) { - return new t.Promise((function(f, g) { - var p = typeof XMLHttpRequest === void 0 || t.$env.isIE ? new window.ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(), y = navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null; - if (v && p.addEventListener("readystatechange", function() { - if (p.readyState == 4 || y && p.readyState == 3) { - if ((p.status != 200 || p.responseText === "") && !t.callEvent("onAjaxError", [p])) + }, put: function(l, h, v, u) { + var f = o("PUT", arguments); + return this.query(f); + }, del: function(l, h, v) { + var u = o("DELETE", arguments); + return this.query(u); + }, post: function(l, h, v, u) { + arguments.length == 1 ? h = "" : arguments.length == 2 && typeof h == "function" && (v = h, h = ""); + var f = o("POST", arguments); + return this.query(f); + }, postSync: function(l, h, v) { + h = h === null ? "" : String(h); + var u = o("POST", arguments); + return u.async = !1, this.query(u); + }, _call: function(l, h, v, u, f, c) { + return new a.Promise((function(p, m) { + var g = typeof XMLHttpRequest === void 0 || a.$env.isIE ? new window.ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(), y = navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null; + if (u && g.addEventListener("readystatechange", function() { + if (g.readyState == 4 || y && g.readyState == 3) { + if ((g.status != 200 || g.responseText === "") && !a.callEvent("onAjaxError", [g])) return; setTimeout(function() { - typeof m == "function" && m.apply(window, [{ xmlDoc: p, filePath: c }]), f(p), typeof m == "function" && (m = null, p = null); + typeof f == "function" && f.apply(window, [{ xmlDoc: g, filePath: h }]), p(g), typeof f == "function" && (f = null, g = null); }, 0); } - }), s != "GET" || this.cache || (c += (c.indexOf("?") >= 0 ? "&" : "?") + "dhxr" + (/* @__PURE__ */ new Date()).getTime() + "=1"), p.open(s, c, v), l) - for (var w in l) - p.setRequestHeader(w, l[w]); + }), l != "GET" || this.cache || (h += (h.indexOf("?") >= 0 ? "&" : "?") + "dhxr" + (/* @__PURE__ */ new Date()).getTime() + "=1"), g.open(l, h, u), c) + for (var x in c) + g.setRequestHeader(x, c[x]); else - s.toUpperCase() == "POST" || s == "PUT" || s == "DELETE" ? p.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") : s == "GET" && (u = null); - if (p.setRequestHeader("X-Requested-With", "XMLHttpRequest"), p.send(u), !v) - return { xmlDoc: p, filePath: c }; + l.toUpperCase() == "POST" || l == "PUT" || l == "DELETE" ? g.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") : l == "GET" && (v = null); + if (g.setRequestHeader("X-Requested-With", "XMLHttpRequest"), g.send(v), !u) + return { xmlDoc: g, filePath: h }; }).bind(this)); - }, urlSeparator: function(s) { - return s.indexOf("?") != -1 ? "&" : "?"; - } }, t.$ajax = t.ajax; - }(h), be(h), function(t) { - t.config = { default_date: "%j %M %Y", month_date: "%F %Y", load_date: "%Y-%m-%d", week_date: "%l", day_date: "%D %j", hour_date: "%H:%i", month_day: "%d", date_format: "%Y-%m-%d %H:%i", api_date: "%d-%m-%Y %H:%i", parse_exact_format: !1, preserve_length: !0, time_step: 5, displayed_event_color: "#ff4a4a", displayed_event_text_color: "#ffef80", wide_form: 0, day_column_padding: 8, use_select_menu_space: !0, fix_tab_position: !0, start_on_monday: !0, first_hour: 0, last_hour: 24, readonly: !1, drag_resize: !0, drag_move: !0, drag_create: !0, drag_event_body: !0, dblclick_create: !0, details_on_dblclick: !0, edit_on_create: !0, details_on_create: !0, header: null, hour_size_px: 44, resize_month_events: !1, resize_month_timed: !1, responsive_lightbox: !1, separate_short_events: !0, rtl: !1, cascade_event_display: !1, cascade_event_count: 4, cascade_event_margin: 30, multi_day: !0, multi_day_height_limit: 200, drag_lightbox: !0, preserve_scroll: !0, select: !0, server_utc: !1, touch: !0, touch_tip: !0, touch_drag: 500, touch_swipe_dates: !1, quick_info_detached: !0, positive_closing: !1, drag_highlight: !0, limit_drag_out: !1, icons_edit: ["icon_save", "icon_cancel"], icons_select: ["icon_details", "icon_edit", "icon_delete"], buttons_left: ["dhx_save_btn", "dhx_cancel_btn"], buttons_right: ["dhx_delete_btn"], lightbox: { sections: [{ name: "description", map_to: "text", type: "textarea", focus: !0 }, { name: "time", height: 72, type: "time", map_to: "auto" }] }, highlight_displayed_event: !0, left_border: !1, ajax_error: "alert", delay_render: 0, timeline_swap_resize: !0, wai_aria_attributes: !0, wai_aria_application_role: !0, csp: "auto", event_attribute: "data-event-id", show_errors: !0 }, t.config.buttons_left.$initial = t.config.buttons_left.join(), t.config.buttons_right.$initial = t.config.buttons_right.join(), t._helpers = { parseDate: function(n) { - return (t.templates.xml_date || t.templates.parse_date)(n); - }, formatDate: function(n) { - return (t.templates.xml_format || t.templates.format_date)(n); - } }, t.templates = {}, t.init_templates = function() { - var n = t.date.date_to_str, s = t.config; - (function(c, u) { - for (var v in u) - c[v] || (c[v] = u[v]); - })(t.templates, { day_date: n(s.default_date), month_date: n(s.month_date), week_date: function(c, u) { - return s.rtl ? t.templates.day_date(t.date.add(u, -1, "day")) + " – " + t.templates.day_date(c) : t.templates.day_date(c) + " – " + t.templates.day_date(t.date.add(u, -1, "day")); - }, day_scale_date: n(s.default_date), time_slot_text: function(c) { + }, urlSeparator: function(l) { + return l.indexOf("?") != -1 ? "&" : "?"; + } }, a.$ajax = a.ajax; + }(i), Ut(i), function(a) { + a.config = { default_date: "%j %M %Y", month_date: "%F %Y", load_date: "%Y-%m-%d", week_date: "%l", day_date: "%D %j", hour_date: "%H:%i", month_day: "%d", date_format: "%Y-%m-%d %H:%i", api_date: "%d-%m-%Y %H:%i", parse_exact_format: !1, preserve_length: !0, time_step: 5, displayed_event_color: "#ff4a4a", displayed_event_text_color: "#ffef80", wide_form: 0, day_column_padding: 8, use_select_menu_space: !0, fix_tab_position: !0, start_on_monday: !0, first_hour: 0, last_hour: 24, readonly: !1, drag_resize: !0, drag_move: !0, drag_create: !0, drag_event_body: !0, dblclick_create: !0, details_on_dblclick: !0, edit_on_create: !0, details_on_create: !0, header: null, hour_size_px: 44, resize_month_events: !1, resize_month_timed: !1, responsive_lightbox: !1, separate_short_events: !0, rtl: !1, cascade_event_display: !1, cascade_event_count: 4, cascade_event_margin: 30, multi_day: !0, multi_day_height_limit: 200, drag_lightbox: !0, preserve_scroll: !0, select: !0, undo_deleted: !0, server_utc: !1, touch: !0, touch_tip: !0, touch_drag: 500, touch_swipe_dates: !1, quick_info_detached: !0, positive_closing: !1, drag_highlight: !0, limit_drag_out: !1, icons_edit: ["icon_save", "icon_cancel"], icons_select: ["icon_details", "icon_edit", "icon_delete"], buttons_left: ["dhx_save_btn", "dhx_cancel_btn"], buttons_right: ["dhx_delete_btn"], lightbox: { sections: [{ name: "description", map_to: "text", type: "textarea", focus: !0 }, { name: "time", height: 72, type: "time", map_to: "auto" }] }, highlight_displayed_event: !0, left_border: !1, ajax_error: "alert", delay_render: 0, timeline_swap_resize: !0, wai_aria_attributes: !0, wai_aria_application_role: !0, csp: "auto", event_attribute: "data-event-id", show_errors: !0 }, a.config.buttons_left.$initial = a.config.buttons_left.join(), a.config.buttons_right.$initial = a.config.buttons_right.join(), a._helpers = { parseDate: function(o) { + return (a.templates.xml_date || a.templates.parse_date)(o); + }, formatDate: function(o) { + return (a.templates.xml_format || a.templates.format_date)(o); + } }, a.templates = {}, a.init_templates = function() { + var o = a.date.date_to_str, l = a.config; + (function(h, v) { + for (var u in v) + h[u] || (h[u] = v[u]); + })(a.templates, { day_date: o(l.default_date), month_date: o(l.month_date), week_date: function(h, v) { + return l.rtl ? a.templates.day_date(a.date.add(v, -1, "day")) + " – " + a.templates.day_date(h) : a.templates.day_date(h) + " – " + a.templates.day_date(a.date.add(v, -1, "day")); + }, day_scale_date: o(l.default_date), time_slot_text: function(h) { return ""; - }, time_slot_class: function(c) { + }, time_slot_class: function(h) { return ""; - }, month_scale_date: n(s.week_date), week_scale_date: n(s.day_date), hour_scale: n(s.hour_date), time_picker: n(s.hour_date), event_date: n(s.hour_date), month_day: n(s.month_day), load_format: n(s.load_date), format_date: n(s.date_format, s.server_utc), parse_date: t.date.str_to_date(s.date_format, s.server_utc), api_date: t.date.str_to_date(s.api_date, !1, !1), event_header: function(c, u, v) { - return v._mode === "small" || v._mode === "smallest" ? t.templates.event_date(c) : t.templates.event_date(c) + " - " + t.templates.event_date(u); - }, event_text: function(c, u, v) { - return v.text; - }, event_class: function(c, u, v) { + }, month_scale_date: o(l.week_date), week_scale_date: o(l.day_date), hour_scale: o(l.hour_date), time_picker: o(l.hour_date), event_date: o(l.hour_date), month_day: o(l.month_day), load_format: o(l.load_date), format_date: o(l.date_format, l.server_utc), parse_date: a.date.str_to_date(l.date_format, l.server_utc), api_date: a.date.str_to_date(l.api_date, !1, !1), event_header: function(h, v, u) { + return u._mode === "small" || u._mode === "smallest" ? a.templates.event_date(h) : a.templates.event_date(h) + " - " + a.templates.event_date(v); + }, event_text: function(h, v, u) { + return u.text; + }, event_class: function(h, v, u) { return ""; - }, month_date_class: function(c) { + }, month_date_class: function(h) { return ""; - }, week_date_class: function(c) { + }, week_date_class: function(h) { return ""; - }, event_bar_date: function(c, u, v) { - return t.templates.event_date(c); - }, event_bar_text: function(c, u, v) { - return v.text; - }, month_events_link: function(c, u) { - return "View more(" + u + " events)"; - }, drag_marker_class: function(c, u, v) { + }, event_bar_date: function(h, v, u) { + return a.templates.event_date(h); + }, event_bar_text: function(h, v, u) { + return u.text; + }, month_events_link: function(h, v) { + return "View more(" + v + " events)"; + }, drag_marker_class: function(h, v, u) { return ""; - }, drag_marker_content: function(c, u, v) { + }, drag_marker_content: function(h, v, u) { return ""; - }, tooltip_date_format: t.date.date_to_str("%Y-%m-%d %H:%i"), tooltip_text: function(c, u, v) { - return "Event: " + v.text + "
Start date: " + t.templates.tooltip_date_format(c) + "
End date: " + t.templates.tooltip_date_format(u); - }, calendar_month: n("%F %Y"), calendar_scale_date: n("%D"), calendar_date: n("%d"), calendar_time: n("%d-%m-%Y") }), this.callEvent("onTemplatesReady", []); + }, tooltip_date_format: a.date.date_to_str("%Y-%m-%d %H:%i"), tooltip_text: function(h, v, u) { + return "Event: " + u.text + "
Start date: " + a.templates.tooltip_date_format(h) + "
End date: " + a.templates.tooltip_date_format(v); + }, calendar_month: o("%F %Y"), calendar_scale_date: o("%D"), calendar_date: o("%d"), calendar_time: o("%d-%m-%Y") }), this.callEvent("onTemplatesReady", []); }; - }(h), function(t) { - t._events = {}, t.clearAll = function() { + }(i), function(a) { + a._events = {}, a.clearAll = function() { this._events = {}, this._loaded = {}, this._edit_id = null, this._select_id = null, this._drag_id = null, this._drag_mode = null, this._drag_pos = null, this._new_event = null, this.clear_view(), this.callEvent("onClearAll", []); - }, t.addEvent = function(n, s, c, u, v) { + }, a.addEvent = function(o, l, h, v, u) { if (!arguments.length) return this.addEventNow(); - var m = n; - arguments.length != 1 && ((m = v || {}).start_date = n, m.end_date = s, m.text = c, m.id = u), m.id = m.id || t.uid(), m.text = m.text || "", typeof m.start_date == "string" && (m.start_date = this.templates.api_date(m.start_date)), typeof m.end_date == "string" && (m.end_date = this.templates.api_date(m.end_date)); - var l = 6e4 * (this.config.event_duration || this.config.time_step); - m.start_date.valueOf() == m.end_date.valueOf() && m.end_date.setTime(m.end_date.valueOf() + l), m.start_date.setMilliseconds(0), m.end_date.setMilliseconds(0), m._timed = this.isOneDayEvent(m); - var f = !this._events[m.id]; - return this._events[m.id] = m, this.event_updated(m), this._loading || this.callEvent(f ? "onEventAdded" : "onEventChanged", [m.id, m]), m.id; - }, t.deleteEvent = function(n, s) { - var c = this._events[n]; - (s || this.callEvent("onBeforeEventDelete", [n, c]) && this.callEvent("onConfirmedBeforeEventDelete", [n, c])) && (c && (t.getState().select_id == n && t.unselect(), delete this._events[n], this.event_updated(c), this._drag_id == c.id && (this._drag_id = null, this._drag_mode = null, this._drag_pos = null)), this.callEvent("onEventDeleted", [n, c])); - }, t.getEvent = function(n) { - return this._events[n]; - }, t.setEvent = function(n, s) { - s.id || (s.id = n), this._events[n] = s; - }, t.for_rendered = function(n, s) { - for (var c = this._rendered.length - 1; c >= 0; c--) - this._rendered[c].getAttribute(this.config.event_attribute) == n && s(this._rendered[c], c); - }, t.changeEventId = function(n, s) { - if (n != s) { - var c = this._events[n]; - c && (c.id = s, this._events[s] = c, delete this._events[n]), this.for_rendered(n, function(u) { - u.setAttribute("event_id", s), u.setAttribute(t.config.event_attribute, s); - }), this._select_id == n && (this._select_id = s), this._edit_id == n && (this._edit_id = s), this.callEvent("onEventIdChange", [n, s]); + var f = o; + arguments.length != 1 && ((f = u || {}).start_date = o, f.end_date = l, f.text = h, f.id = v), f.id = f.id || a.uid(), f.text = f.text || "", typeof f.start_date == "string" && (f.start_date = this.templates.api_date(f.start_date)), typeof f.end_date == "string" && (f.end_date = this.templates.api_date(f.end_date)); + var c = 6e4 * (this.config.event_duration || this.config.time_step); + f.start_date.valueOf() == f.end_date.valueOf() && f.end_date.setTime(f.end_date.valueOf() + c), f.start_date.setMilliseconds(0), f.end_date.setMilliseconds(0), f._timed = this.isOneDayEvent(f); + var p = !this._events[f.id]; + return this._events[f.id] = f, this.event_updated(f), this._loading || this.callEvent(p ? "onEventAdded" : "onEventChanged", [f.id, f]), f.id; + }, a.deleteEvent = function(o, l) { + var h = this._events[o]; + (l || this.callEvent("onBeforeEventDelete", [o, h]) && this.callEvent("onConfirmedBeforeEventDelete", [o, h])) && (h && (a.getState().select_id == o && a.unselect(), delete this._events[o], this.event_updated(h), this._drag_id == h.id && (this._drag_id = null, this._drag_mode = null, this._drag_pos = null)), this.callEvent("onEventDeleted", [o, h])); + }, a.getEvent = function(o) { + return this._events[o]; + }, a.setEvent = function(o, l) { + l.id || (l.id = o), this._events[o] = l; + }, a.for_rendered = function(o, l) { + for (var h = this._rendered.length - 1; h >= 0; h--) + this._rendered[h].getAttribute(this.config.event_attribute) == o && l(this._rendered[h], h); + }, a.changeEventId = function(o, l) { + if (o != l) { + var h = this._events[o]; + h && (h.id = l, this._events[l] = h, delete this._events[o]), this.for_rendered(o, function(v) { + v.setAttribute("event_id", l), v.setAttribute(a.config.event_attribute, l); + }), this._select_id == o && (this._select_id = l), this._edit_id == o && (this._edit_id = l), this.callEvent("onEventIdChange", [o, l]); } }, function() { - for (var n = ["text", "Text", "start_date", "StartDate", "end_date", "EndDate"], s = function(v) { - return function(m) { - return t.getEvent(m)[v]; + for (var o = ["text", "Text", "start_date", "StartDate", "end_date", "EndDate"], l = function(u) { + return function(f) { + return a.getEvent(f)[u]; }; - }, c = function(v) { - return function(m, l) { - var f = t.getEvent(m); - f[v] = l, f._changed = !0, f._timed = this.isOneDayEvent(f), t.event_updated(f, !0); + }, h = function(u) { + return function(f, c) { + var p = a.getEvent(f); + p[u] = c, p._changed = !0, p._timed = this.isOneDayEvent(p), a.event_updated(p, !0); }; - }, u = 0; u < n.length; u += 2) - t["getEvent" + n[u + 1]] = s(n[u]), t["setEvent" + n[u + 1]] = c(n[u]); - }(), t.event_updated = function(n, s) { - this.is_visible_events(n) ? this.render_view_data() : this.clear_event(n.id); - }, t.is_visible_events = function(n) { + }, v = 0; v < o.length; v += 2) + a["getEvent" + o[v + 1]] = l(o[v]), a["setEvent" + o[v + 1]] = h(o[v]); + }(), a.event_updated = function(o, l) { + this.is_visible_events(o) ? this.render_view_data() : this.clear_event(o.id); + }, a.is_visible_events = function(o) { if (!this._min_date || !this._max_date) return !1; - if (n.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < n.end_date.valueOf()) { - var s = n.start_date.getHours(), c = n.end_date.getHours() + n.end_date.getMinutes() / 60, u = this.config.last_hour, v = this.config.first_hour; - return !(!this._table_view && (c > u || c <= v) && (s >= u || s < v) && !((n.end_date.valueOf() - n.start_date.valueOf()) / 36e5 > 24 - (this.config.last_hour - this.config.first_hour) || s < u && c > v)); + if (o.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < o.end_date.valueOf()) { + var l = o.start_date.getHours(), h = o.end_date.getHours() + o.end_date.getMinutes() / 60, v = this.config.last_hour, u = this.config.first_hour; + return !(!this._table_view && (h > v || h <= u) && (l >= v || l < u) && !((o.end_date.valueOf() - o.start_date.valueOf()) / 36e5 > 24 - (this.config.last_hour - this.config.first_hour) || l < v && h > u)); } return !1; - }, t.isOneDayEvent = function(n) { - var s = new Date(n.end_date.valueOf() - 1); - return n.start_date.getFullYear() === s.getFullYear() && n.start_date.getMonth() === s.getMonth() && n.start_date.getDate() === s.getDate() && n.end_date.valueOf() - n.start_date.valueOf() < 864e5; - }, t.get_visible_events = function(n) { - var s = []; - for (var c in this._events) - this.is_visible_events(this._events[c]) && (n && !this._events[c]._timed || this.filter_event(c, this._events[c]) && s.push(this._events[c])); - return s; - }, t.filter_event = function(n, s) { - var c = this["filter_" + this._mode]; - return !c || c(n, s); - }, t._is_main_area_event = function(n) { - return !!n._timed; - }, t.render_view_data = function(n, s) { - var c = !1; - if (!n) { - if (c = !0, this._not_render) + }, a.isOneDayEvent = function(o) { + var l = new Date(o.end_date.valueOf() - 1); + return o.start_date.getFullYear() === l.getFullYear() && o.start_date.getMonth() === l.getMonth() && o.start_date.getDate() === l.getDate() && o.end_date.valueOf() - o.start_date.valueOf() < 864e5; + }, a.get_visible_events = function(o) { + var l = []; + for (var h in this._events) + this.is_visible_events(this._events[h]) && (o && !this._events[h]._timed || this.filter_event(h, this._events[h]) && l.push(this._events[h])); + return l; + }, a.filter_event = function(o, l) { + var h = this["filter_" + this._mode]; + return !h || h(o, l); + }, a._is_main_area_event = function(o) { + return !!o._timed; + }, a.render_view_data = function(o, l) { + var h = !1; + if (!o) { + if (h = !0, this._not_render) return void (this._render_wait = !0); - this._render_wait = !1, this.clear_view(), n = this.get_visible_events(!(this._table_view || this.config.multi_day)); + this._render_wait = !1, this.clear_view(), o = this.get_visible_events(!(this._table_view || this.config.multi_day)); } - for (var u = 0, v = n.length; u < v; u++) - this._recalculate_timed(n[u]); + for (var v = 0, u = o.length; v < u; v++) + this._recalculate_timed(o[v]); if (this.config.multi_day && !this._table_view) { - var m = [], l = []; - for (u = 0; u < n.length; u++) - this._is_main_area_event(n[u]) ? m.push(n[u]) : l.push(n[u]); + var f = [], c = []; + for (v = 0; v < o.length; v++) + this._is_main_area_event(o[v]) ? f.push(o[v]) : c.push(o[v]); if (!this._els.dhx_multi_day) { - var f = t._commonErrorMessages.unknownView(this._mode); - throw new Error(f); + var p = a._commonErrorMessages.unknownView(this._mode); + throw new Error(p); } - this._rendered_location = this._els.dhx_multi_day[0], this._table_view = !0, this.render_data(l, s), this._table_view = !1, this._rendered_location = this._els.dhx_cal_data[0], this._table_view = !1, this.render_data(m, s); + this._rendered_location = this._els.dhx_multi_day[0], this._table_view = !0, this.render_data(c, l), this._table_view = !1, this._rendered_location = this._els.dhx_cal_data[0], this._table_view = !1, this.render_data(f, l); } else { - var g = document.createDocumentFragment(), p = this._els.dhx_cal_data[0]; - this._rendered_location = g, this.render_data(n, s), p.appendChild(g), this._rendered_location = p; - } - c && this.callEvent("onDataRender", []); - }, t._view_month_day = function(n) { - var s = t.getActionData(n).date; - t.callEvent("onViewMoreClick", [s]) && t.setCurrentView(s, "day"); - }, t._render_month_link = function(n) { - for (var s = this._rendered_location, c = this._lame_clone(n), u = n._sday; u < n._eday; u++) { - c._sday = u, c._eday = u + 1; - var v = t.date, m = t._min_date; - m = v.add(m, c._sweek, "week"), m = v.add(m, c._sday, "day"); - var l = t.getEvents(m, v.add(m, 1, "day")).length, f = this._get_event_bar_pos(c), g = f.x2 - f.x, p = document.createElement("div"); - t.event(p, "click", function(y) { - t._view_month_day(y); - }), p.className = "dhx_month_link", p.style.top = f.y + "px", p.style.left = f.x + "px", p.style.width = g + "px", p.innerHTML = t.templates.month_events_link(m, l), this._rendered.push(p), s.appendChild(p); - } - }, t._recalculate_timed = function(n) { - var s; - n && (s = typeof n != "object" ? this._events[n] : n) && (s._timed = t.isOneDayEvent(s)); - }, t.attachEvent("onEventChanged", t._recalculate_timed), t.attachEvent("onEventAdded", t._recalculate_timed), t.render_data = function(n, s) { - n = this._pre_render_events(n, s); - for (var c = {}, u = 0; u < n.length; u++) + var m = document.createDocumentFragment(), g = this._els.dhx_cal_data[0]; + this._rendered_location = m, this.render_data(o, l), g.appendChild(m), this._rendered_location = g; + } + h && this.callEvent("onDataRender", []); + }, a._view_month_day = function(o) { + var l = a.getActionData(o).date; + a.callEvent("onViewMoreClick", [l]) && a.setCurrentView(l, "day"); + }, a._render_month_link = function(o) { + for (var l = this._rendered_location, h = this._lame_clone(o), v = o._sday; v < o._eday; v++) { + h._sday = v, h._eday = v + 1; + var u = a.date, f = a._min_date; + f = u.add(f, h._sweek, "week"), f = u.add(f, h._sday, "day"); + var c = a.getEvents(f, u.add(f, 1, "day")).length, p = this._get_event_bar_pos(h), m = p.x2 - p.x, g = document.createElement("div"); + a.event(g, "click", function(y) { + a._view_month_day(y); + }), g.className = "dhx_month_link", g.style.top = p.y + "px", g.style.left = p.x + "px", g.style.width = m + "px", g.innerHTML = a.templates.month_events_link(f, c), this._rendered.push(g), l.appendChild(g); + } + }, a._recalculate_timed = function(o) { + var l; + o && (l = typeof o != "object" ? this._events[o] : o) && (l._timed = a.isOneDayEvent(l)); + }, a.attachEvent("onEventChanged", a._recalculate_timed), a.attachEvent("onEventAdded", a._recalculate_timed), a.render_data = function(o, l) { + o = this._pre_render_events(o, l); + for (var h = {}, v = 0; v < o.length; v++) if (this._table_view) - if (t._mode != "month") - this.render_event_bar(n[u]); + if (a._mode != "month") + this.render_event_bar(o[v]); else { - var v = t.config.max_month_events; - v !== 1 * v || n[u]._sorder < v ? this.render_event_bar(n[u]) : v !== void 0 && n[u]._sorder == v && t._render_month_link(n[u]); + var u = a.config.max_month_events; + u !== 1 * u || o[v]._sorder < u ? this.render_event_bar(o[v]) : u !== void 0 && o[v]._sorder == u && a._render_month_link(o[v]); } else { - var m = n[u], l = t.locate_holder(m._sday); - if (!l) + var f = o[v], c = a.locate_holder(f._sday); + if (!c) continue; - c[m._sday] || (c[m._sday] = { real: l, buffer: document.createDocumentFragment(), width: l.clientWidth }); - var f = c[m._sday]; - this.render_event(m, f.buffer, f.width); + h[f._sday] || (h[f._sday] = { real: c, buffer: document.createDocumentFragment(), width: c.clientWidth }); + var p = h[f._sday]; + this.render_event(f, p.buffer, p.width); } - for (var u in c) - (f = c[u]).real && f.buffer && f.real.appendChild(f.buffer); - }, t._get_first_visible_cell = function(n) { - for (var s = 0; s < n.length; s++) - if ((n[s].className || "").indexOf("dhx_scale_ignore") == -1) - return n[s]; - return n[0]; - }, t._pre_render_events = function(n, s) { - var c = this.xy.bar_height, u = this._colsS.heights, v = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0], m = this._els.dhx_cal_data[0]; - if (n = this._table_view ? this._pre_render_events_table(n, s) : this._pre_render_events_line(n, s), this._table_view) - if (s) - this._colsS.heights = u; + for (var v in h) + (p = h[v]).real && p.buffer && p.real.appendChild(p.buffer); + }, a._get_first_visible_cell = function(o) { + for (var l = 0; l < o.length; l++) + if ((o[l].className || "").indexOf("dhx_scale_ignore") == -1) + return o[l]; + return o[0]; + }, a._pre_render_events = function(o, l) { + var h = this.xy.bar_height, v = this._colsS.heights, u = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0], f = this._els.dhx_cal_data[0]; + if (o = this._table_view ? this._pre_render_events_table(o, l) : this._pre_render_events_line(o, l), this._table_view) + if (l) + this._colsS.heights = v; else { - var l = m.querySelectorAll(".dhx_cal_month_row"); - if (l.length) { - for (var f = 0; f < l.length; f++) { - v[f]++; - var g = l[f].querySelectorAll(".dhx_cal_month_cell"), p = this._colsS.height - this.xy.month_head_height; - if (v[f] * c > p) { - var y = p; - 1 * this.config.max_month_events !== this.config.max_month_events || v[f] <= this.config.max_month_events ? y = v[f] * c : (this.config.max_month_events + 1) * c > p && (y = (this.config.max_month_events + 1) * c), l[f].style.height = y + this.xy.month_head_height + "px"; + var c = f.querySelectorAll(".dhx_cal_month_row"); + if (c.length) { + for (var p = 0; p < c.length; p++) { + u[p]++; + var m = c[p].querySelectorAll(".dhx_cal_month_cell"), g = this._colsS.height - this.xy.month_head_height; + if (u[p] * h > g) { + var y = g; + 1 * this.config.max_month_events !== this.config.max_month_events || u[p] <= this.config.max_month_events ? y = u[p] * h : (this.config.max_month_events + 1) * h > g && (y = (this.config.max_month_events + 1) * h), c[p].style.height = y + this.xy.month_head_height + "px"; } - v[f] = (v[f - 1] || 0) + t._get_first_visible_cell(g).offsetHeight; + u[p] = (u[p - 1] || 0) + a._get_first_visible_cell(m).offsetHeight; } - v.unshift(0); + u.unshift(0); const M = this.$container.querySelector(".dhx_cal_data"); - if (M.offsetHeight < M.scrollHeight && !t._colsS.scroll_fix && t.xy.scroll_width) { - var w = t._colsS, b = w[w.col_length], k = w.heights.slice(); - b -= t.xy.scroll_width || 0, this._calc_scale_sizes(b, this._min_date, this._max_date), t._colsS.heights = k, this.set_xy(this._els.dhx_cal_header[0], b), t._render_scales(this._els.dhx_cal_header[0]), t._render_month_scale(this._els.dhx_cal_data[0], this._get_timeunit_start(), this._min_date), w.scroll_fix = !0; + if (M.offsetHeight < M.scrollHeight && !a._colsS.scroll_fix && a.xy.scroll_width) { + var x = a._colsS, b = x[x.col_length], k = x.heights.slice(); + b -= a.xy.scroll_width || 0, this._calc_scale_sizes(b, this._min_date, this._max_date), a._colsS.heights = k, this.set_xy(this._els.dhx_cal_header[0], b), a._render_scales(this._els.dhx_cal_header[0]), a._render_month_scale(this._els.dhx_cal_data[0], this._get_timeunit_start(), this._min_date), x.scroll_fix = !0; } - } else if (n.length || this._els.dhx_multi_day[0].style.visibility != "visible" || (v[0] = -1), n.length || v[0] == -1) { - var E = (v[0] + 1) * c + 4, D = E, x = E + "px"; - this.config.multi_day_height_limit && (x = (D = Math.min(E, this.config.multi_day_height_limit)) + "px"); + } else if (o.length || this._els.dhx_multi_day[0].style.visibility != "visible" || (u[0] = -1), o.length || u[0] == -1) { + var E = (u[0] + 1) * h + 4, D = E, w = E + "px"; + this.config.multi_day_height_limit && (w = (D = Math.min(E, this.config.multi_day_height_limit)) + "px"); var S = this._els.dhx_multi_day[0]; - S.style.height = x, S.style.visibility = v[0] == -1 ? "hidden" : "visible", S.style.display = v[0] == -1 ? "none" : ""; + S.style.height = w, S.style.visibility = u[0] == -1 ? "hidden" : "visible", S.style.display = u[0] == -1 ? "none" : ""; var N = this._els.dhx_multi_day[1]; - N.style.height = x, N.style.visibility = v[0] == -1 ? "hidden" : "visible", N.style.display = v[0] == -1 ? "none" : "", N.className = v[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small", this._dy_shift = (v[0] + 1) * c, this.config.multi_day_height_limit && (this._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift)), v[0] = 0, D != E && (S.style.overflowY = "auto", N.style.position = "fixed", N.style.top = "", N.style.left = ""); + N.style.height = w, N.style.visibility = u[0] == -1 ? "hidden" : "visible", N.style.display = u[0] == -1 ? "none" : "", N.className = u[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small", this._dy_shift = (u[0] + 1) * h, this.config.multi_day_height_limit && (this._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift)), u[0] = 0, D != E && (S.style.overflowY = "auto", N.style.position = "fixed", N.style.top = "", N.style.left = ""); } } - return n; - }, t._get_event_sday = function(n) { - var s = this.date.day_start(new Date(n.start_date)); - return Math.round((s.valueOf() - this._min_date.valueOf()) / 864e5); - }, t._get_event_mapped_end_date = function(n) { - var s = n.end_date; + return o; + }, a._get_event_sday = function(o) { + var l = this.date.day_start(new Date(o.start_date)); + return Math.round((l.valueOf() - this._min_date.valueOf()) / 864e5); + }, a._get_event_mapped_end_date = function(o) { + var l = o.end_date; if (this.config.separate_short_events) { - var c = (n.end_date - n.start_date) / 6e4; - c < this._min_mapped_duration && (s = this.date.add(s, this._min_mapped_duration - c, "minute")); + var h = (o.end_date - o.start_date) / 6e4; + h < this._min_mapped_duration && (l = this.date.add(l, this._min_mapped_duration - h, "minute")); } - return s; - }, t._pre_render_events_line = function(n, s) { - n.sort(function(N, M) { + return l; + }, a._pre_render_events_line = function(o, l) { + o.sort(function(N, M) { return N.start_date.valueOf() == M.start_date.valueOf() ? N.id > M.id ? 1 : -1 : N.start_date > M.start_date ? 1 : -1; }); - var c = [], u = []; + var h = [], v = []; this._min_mapped_duration = Math.floor(60 * this.xy.min_event_height / this.config.hour_size_px); - for (var v = 0; v < n.length; v++) { - var m = n[v], l = m.start_date, f = m.end_date, g = l.getHours(), p = f.getHours(); - if (m._sday = this._get_event_sday(m), this._ignores[m._sday]) - n.splice(v, 1), v--; + for (var u = 0; u < o.length; u++) { + var f = o[u], c = f.start_date, p = f.end_date, m = c.getHours(), g = p.getHours(); + if (f._sday = this._get_event_sday(f), this._ignores[f._sday]) + o.splice(u, 1), u--; else { - if (c[m._sday] || (c[m._sday] = []), !s) { - m._inner = !1; - for (var y = c[m._sday]; y.length; ) { - var w = y[y.length - 1]; - if (!(this._get_event_mapped_end_date(w).valueOf() <= m.start_date.valueOf())) + if (h[f._sday] || (h[f._sday] = []), !l) { + f._inner = !1; + for (var y = h[f._sday]; y.length; ) { + var x = y[y.length - 1]; + if (!(this._get_event_mapped_end_date(x).valueOf() <= f.start_date.valueOf())) break; y.splice(y.length - 1, 1); } for (var b = y.length, k = !1, E = 0; E < y.length; E++) - if (w = y[E], this._get_event_mapped_end_date(w).valueOf() <= m.start_date.valueOf()) { - k = !0, m._sorder = w._sorder, b = E, m._inner = !0; + if (x = y[E], this._get_event_mapped_end_date(x).valueOf() <= f.start_date.valueOf()) { + k = !0, f._sorder = x._sorder, b = E, f._inner = !0; break; } if (y.length && (y[y.length - 1]._inner = !0), !k) @@ -3103,985 +3681,2586 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`); if (y.length <= y[y.length - 1]._sorder) { if (y[y.length - 1]._sorder) for (E = 0; E < y.length; E++) { - for (var D = !1, x = 0; x < y.length; x++) - if (y[x]._sorder == E) { + for (var D = !1, w = 0; w < y.length; w++) + if (y[w]._sorder == E) { D = !0; break; } if (!D) { - m._sorder = E; + f._sorder = E; break; } } else - m._sorder = 0; - m._inner = !0; + f._sorder = 0; + f._inner = !0; } else { var S = y[0]._sorder; for (E = 1; E < y.length; E++) y[E]._sorder > S && (S = y[E]._sorder); - m._sorder = S + 1, m._inner = !1; + f._sorder = S + 1, f._inner = !1; } else - m._sorder = 0; - y.splice(b, b == y.length ? 0 : 1, m), y.length > (y.max_count || 0) ? (y.max_count = y.length, m._count = y.length) : m._count = m._count ? m._count : 1; + f._sorder = 0; + y.splice(b, b == y.length ? 0 : 1, f), y.length > (y.max_count || 0) ? (y.max_count = y.length, f._count = y.length) : f._count = f._count ? f._count : 1; } - (g < this.config.first_hour || p >= this.config.last_hour) && (u.push(m), n[v] = m = this._copy_event(m), g < this.config.first_hour && (m.start_date.setHours(this.config.first_hour), m.start_date.setMinutes(0)), p >= this.config.last_hour && (m.end_date.setMinutes(0), m.end_date.setHours(this.config.last_hour)), m.start_date > m.end_date || g == this.config.last_hour) && (n.splice(v, 1), v--); + (m < this.config.first_hour || g >= this.config.last_hour) && (v.push(f), o[u] = f = this._copy_event(f), m < this.config.first_hour && (f.start_date.setHours(this.config.first_hour), f.start_date.setMinutes(0)), g >= this.config.last_hour && (f.end_date.setMinutes(0), f.end_date.setHours(this.config.last_hour)), f.start_date > f.end_date || m == this.config.last_hour) && (o.splice(u, 1), u--); } } - if (!s) { - for (v = 0; v < n.length; v++) - n[v]._count = c[n[v]._sday].max_count; - for (v = 0; v < u.length; v++) - u[v]._count = c[u[v]._sday].max_count; + if (!l) { + for (u = 0; u < o.length; u++) + o[u]._count = h[o[u]._sday].max_count; + for (u = 0; u < v.length; u++) + v[u]._count = h[v[u]._sday].max_count; } - return n; - }, t._time_order = function(n) { - n.sort(function(s, c) { - return s.start_date.valueOf() == c.start_date.valueOf() ? s._timed && !c._timed ? 1 : !s._timed && c._timed ? -1 : s.id > c.id ? 1 : -1 : s.start_date > c.start_date ? 1 : -1; + return o; + }, a._time_order = function(o) { + o.sort(function(l, h) { + return l.start_date.valueOf() == h.start_date.valueOf() ? l._timed && !h._timed ? 1 : !l._timed && h._timed ? -1 : l.id > h.id ? 1 : -1 : l.start_date > h.start_date ? 1 : -1; }); - }, t._is_any_multiday_cell_visible = function(n, s, c) { - var u = this._cols.length, v = !1, m = n, l = !0, f = new Date(s); - for (t.date.day_start(new Date(s)).valueOf() != s.valueOf() && (f = t.date.day_start(f), f = t.date.add(f, 1, "day")); m < f; ) { - l = !1; - var g = this.locate_holder_day(m, !1, c) % u; - if (!this._ignores[g]) { - v = !0; + }, a._is_any_multiday_cell_visible = function(o, l, h) { + var v = this._cols.length, u = !1, f = o, c = !0, p = new Date(l); + for (a.date.day_start(new Date(l)).valueOf() != l.valueOf() && (p = a.date.day_start(p), p = a.date.add(p, 1, "day")); f < p; ) { + c = !1; + var m = this.locate_holder_day(f, !1, h) % v; + if (!this._ignores[m]) { + u = !0; break; } - m = t.date.add(m, 1, "day"); - } - return l || v; - }, t._pre_render_events_table = function(n, s) { - this._time_order(n); - for (var c, u = [], v = [[], [], [], [], [], [], []], m = this._colsS.heights, l = this._cols.length, f = {}, g = 0; g < n.length; g++) { - var p = n[g], y = p.id; - f[y] || (f[y] = { first_chunk: !0, last_chunk: !0 }); - var w = f[y], b = c || p.start_date, k = p.end_date; - b < this._min_date && (w.first_chunk = !1, b = this._min_date), k > this._max_date && (w.last_chunk = !1, k = this._max_date); - var E = this.locate_holder_day(b, !1, p); - if (p._sday = E % l, !this._ignores[p._sday] || !p._timed) { - var D = this.locate_holder_day(k, !0, p) || l; - if (p._eday = D % l || l, p._length = D - E, p._sweek = Math.floor((this._correct_shift(b.valueOf(), 1) - this._min_date.valueOf()) / (864e5 * l)), t._is_any_multiday_cell_visible(b, k, p)) { - var x, S = v[p._sweek]; - for (x = 0; x < S.length && !(S[x]._eday <= p._sday); x++) + f = a.date.add(f, 1, "day"); + } + return c || u; + }, a._pre_render_events_table = function(o, l) { + this._time_order(o); + for (var h, v = [], u = [[], [], [], [], [], [], []], f = this._colsS.heights, c = this._cols.length, p = {}, m = 0; m < o.length; m++) { + var g = o[m], y = g.id; + p[y] || (p[y] = { first_chunk: !0, last_chunk: !0 }); + var x = p[y], b = h || g.start_date, k = g.end_date; + b < this._min_date && (x.first_chunk = !1, b = this._min_date), k > this._max_date && (x.last_chunk = !1, k = this._max_date); + var E = this.locate_holder_day(b, !1, g); + if (g._sday = E % c, !this._ignores[g._sday] || !g._timed) { + var D = this.locate_holder_day(k, !0, g) || c; + if (g._eday = D % c || c, g._length = D - E, g._sweek = Math.floor((this._correct_shift(b.valueOf(), 1) - this._min_date.valueOf()) / (864e5 * c)), a._is_any_multiday_cell_visible(b, k, g)) { + var w, S = u[g._sweek]; + for (w = 0; w < S.length && !(S[w]._eday <= g._sday); w++) ; - if (p._sorder && s || (p._sorder = x), p._sday + p._length <= l) - c = null, u.push(p), S[x] = p, m[p._sweek] = S.length - 1, p._first_chunk = w.first_chunk, p._last_chunk = w.last_chunk; + if (g._sorder && l || (g._sorder = w), g._sday + g._length <= c) + h = null, v.push(g), S[w] = g, f[g._sweek] = S.length - 1, g._first_chunk = x.first_chunk, g._last_chunk = x.last_chunk; else { - var N = this._copy_event(p); - N.id = p.id, N._length = l - p._sday, N._eday = l, N._sday = p._sday, N._sweek = p._sweek, N._sorder = p._sorder, N.end_date = this.date.add(b, N._length, "day"), N._first_chunk = w.first_chunk, w.first_chunk && (w.first_chunk = !1), u.push(N), S[x] = N, c = N.end_date, m[p._sweek] = S.length - 1, g--; + var N = this._copy_event(g); + N.id = g.id, N._length = c - g._sday, N._eday = c, N._sday = g._sday, N._sweek = g._sweek, N._sorder = g._sorder, N.end_date = this.date.add(b, N._length, "day"), N._first_chunk = x.first_chunk, x.first_chunk && (x.first_chunk = !1), v.push(N), S[w] = N, h = N.end_date, f[g._sweek] = S.length - 1, m--; } } else - c = null; + h = null; } } - return u; - }, t._copy_dummy = function() { - var n = new Date(this.start_date), s = new Date(this.end_date); - this.start_date = n, this.end_date = s; - }, t._copy_event = function(n) { - return this._copy_dummy.prototype = n, new this._copy_dummy(); - }, t._rendered = [], t.clear_view = function() { - for (var n = 0; n < this._rendered.length; n++) { - var s = this._rendered[n]; - s.parentNode && s.parentNode.removeChild(s); + return v; + }, a._copy_dummy = function() { + var o = new Date(this.start_date), l = new Date(this.end_date); + this.start_date = o, this.end_date = l; + }, a._copy_event = function(o) { + return this._copy_dummy.prototype = o, new this._copy_dummy(); + }, a._rendered = [], a.clear_view = function() { + for (var o = 0; o < this._rendered.length; o++) { + var l = this._rendered[o]; + l.parentNode && l.parentNode.removeChild(l); } this._rendered = []; - }, t.updateEvent = function(n) { - var s = this.getEvent(n); - this.clear_event(n), s && this.is_visible_events(s) && this.filter_event(n, s) && (this._table_view || this.config.multi_day || s._timed) && (this.config.update_render ? this.render_view_data() : this.getState().mode != "month" || this.getState().drag_id || this.isOneDayEvent(s) ? this.render_view_data([s], !0) : this.render_view_data()); - }, t.clear_event = function(n) { - this.for_rendered(n, function(s, c) { - s.parentNode && s.parentNode.removeChild(s), t._rendered.splice(c, 1); + }, a.updateEvent = function(o) { + var l = this.getEvent(o); + this.clear_event(o), l && this.is_visible_events(l) && this.filter_event(o, l) && (this._table_view || this.config.multi_day || l._timed) && (this.config.update_render ? this.render_view_data() : this.getState().mode != "month" || this.getState().drag_id || this.isOneDayEvent(l) ? this.render_view_data([l], !0) : this.render_view_data()); + }, a.clear_event = function(o) { + this.for_rendered(o, function(l, h) { + l.parentNode && l.parentNode.removeChild(l), a._rendered.splice(h, 1); }); - }, t._y_from_date = function(n) { - var s = 60 * n.getHours() + n.getMinutes(); - return Math.round((60 * s * 1e3 - 60 * this.config.first_hour * 60 * 1e3) * this.config.hour_size_px / 36e5) % (24 * this.config.hour_size_px); - }, t._calc_event_y = function(n, s) { - s = s || 0; - var c = 60 * n.start_date.getHours() + n.start_date.getMinutes(), u = 60 * n.end_date.getHours() + n.end_date.getMinutes() || 60 * t.config.last_hour; - return { top: this._y_from_date(n.start_date), height: Math.max(s, (u - c) * this.config.hour_size_px / 60) }; - }, t.render_event = function(n, s, c) { - var u = t.xy.menu_width, v = this.config.use_select_menu_space ? 0 : u; - if (!(n._sday < 0)) { - var m = t.locate_holder(n._sday); - if (m) { - s = s || m; - var l = this._calc_event_y(n, t.xy.min_event_height), f = l.top, g = l.height, p = n._count || 1, y = n._sorder || 0; - c = c || m.clientWidth, this.config.day_column_padding && (c -= this.config.day_column_padding); - var w = Math.floor((c - v) / p), b = y * w + 1; - if (n._inner || (w *= p - y), this.config.cascade_event_display) { + }, a._y_from_date = function(o) { + var l = 60 * o.getHours() + o.getMinutes(); + return Math.round((60 * l * 1e3 - 60 * this.config.first_hour * 60 * 1e3) * this.config.hour_size_px / 36e5) % (24 * this.config.hour_size_px); + }, a._calc_event_y = function(o, l) { + l = l || 0; + var h = 60 * o.start_date.getHours() + o.start_date.getMinutes(), v = 60 * o.end_date.getHours() + o.end_date.getMinutes() || 60 * a.config.last_hour; + return { top: this._y_from_date(o.start_date), height: Math.max(l, (v - h) * this.config.hour_size_px / 60) }; + }, a.render_event = function(o, l, h) { + var v = a.xy.menu_width, u = this.config.use_select_menu_space ? 0 : v; + if (!(o._sday < 0)) { + var f = a.locate_holder(o._sday); + if (f) { + l = l || f; + var c = this._calc_event_y(o, a.xy.min_event_height), p = c.top, m = c.height, g = o._count || 1, y = o._sorder || 0; + h = h || f.clientWidth, this.config.day_column_padding && (h -= this.config.day_column_padding); + var x = Math.floor((h - u) / g), b = y * x + 1; + if (o._inner || (x *= g - y), this.config.cascade_event_display) { var k = this.config.cascade_event_count, E = this.config.cascade_event_margin; b = y % k * E; - var D = n._inner ? (p - y - 1) % k * E / 2 : 0; - w = Math.floor(c - v - b - D); + var D = o._inner ? (g - y - 1) % k * E / 2 : 0; + x = Math.floor(h - u - b - D); } - n._mode = g < 30 ? "smallest" : g < 42 ? "small" : null; - var x = this._render_v_bar(n, v + b, f, w, g, n._text_style, t.templates.event_header(n.start_date, n.end_date, n), t.templates.event_text(n.start_date, n.end_date, n)); - if (n._mode === "smallest" ? x.classList.add("dhx_cal_event--xsmall") : n._mode === "small" && x.classList.add("dhx_cal_event--small"), this._waiAria.eventAttr(n, x), this._rendered.push(x), s.appendChild(x), b = b + parseInt(this.config.rtl ? m.style.right : m.style.left, 10) + v, this._edit_id == n.id) { - x.style.zIndex = 1, w = Math.max(w, t.xy.editor_width), (x = document.createElement("div")).setAttribute("event_id", n.id), x.setAttribute(this.config.event_attribute, n.id), this._waiAria.eventAttr(n, x), x.className = "dhx_cal_event dhx_cal_editor", this.config.rtl && b++, this.set_xy(x, w, g, b, f), n.color && x.style.setProperty("--dhx-scheduler-event-background", n.color); - var S = t.templates.event_class(n.start_date, n.end_date, n); - S && (x.className += " " + S); + o._mode = m < 30 ? "smallest" : m < 42 ? "small" : null; + var w = this._render_v_bar(o, u + b, p, x, m, o._text_style, a.templates.event_header(o.start_date, o.end_date, o), a.templates.event_text(o.start_date, o.end_date, o)); + if (o._mode === "smallest" ? w.classList.add("dhx_cal_event--xsmall") : o._mode === "small" && w.classList.add("dhx_cal_event--small"), this._waiAria.eventAttr(o, w), this._rendered.push(w), l.appendChild(w), b = b + parseInt(this.config.rtl ? f.style.right : f.style.left, 10) + u, this._edit_id == o.id) { + w.style.zIndex = 1, x = Math.max(x, a.xy.editor_width), (w = document.createElement("div")).setAttribute("event_id", o.id), w.setAttribute(this.config.event_attribute, o.id), this._waiAria.eventAttr(o, w), w.className = "dhx_cal_event dhx_cal_editor", this.config.rtl && b++, this.set_xy(w, x, m, b, p), o.color && w.style.setProperty("--dhx-scheduler-event-background", o.color); + var S = a.templates.event_class(o.start_date, o.end_date, o); + S && (w.className += " " + S); var N = document.createElement("div"); - N.style.cssText += "overflow:hidden;height:100%", x.appendChild(N), this._els.dhx_cal_data[0].appendChild(x), this._rendered.push(x), N.innerHTML = "", this._editor = N.querySelector("textarea"), t.event(this._editor, "keydown", function(L) { - if (L.shiftKey) + N.style.cssText += "overflow:hidden;height:100%", w.appendChild(N), this._els.dhx_cal_data[0].appendChild(w), this._rendered.push(w), N.innerHTML = "", this._editor = N.querySelector("textarea"), a.event(this._editor, "keydown", function(j) { + if (j.shiftKey) return !0; - var H = L.keyCode; - H == t.keys.edit_save && t.editStop(!0), H == t.keys.edit_cancel && t.editStop(!1), H != t.keys.edit_save && H != t.keys.edit_cancel || L.preventDefault && L.preventDefault(); - }), t.event(this._editor, "selectstart", function(L) { - return L.cancelBubble = !0, !0; - }), t._focus(this._editor, !0), this._els.dhx_cal_data[0].scrollLeft = 0; + var z = j.keyCode; + z == a.keys.edit_save && a.editStop(!0), z == a.keys.edit_cancel && a.editStop(!1), z != a.keys.edit_save && z != a.keys.edit_cancel || j.preventDefault && j.preventDefault(); + }), a.event(this._editor, "selectstart", function(j) { + return j.cancelBubble = !0, !0; + }), a._focus(this._editor, !0), this._els.dhx_cal_data[0].scrollLeft = 0; } - if (this.xy.menu_width !== 0 && this._select_id == n.id) { - this.config.cascade_event_display && this._drag_mode && (x.style.zIndex = 1); - for (var M, A = this.config["icons_" + (this._edit_id == n.id ? "edit" : "select")], C = "", T = 0; T < A.length; T++) { - const L = A[T]; - M = this._waiAria.eventMenuAttrString(L), C += `
`; + if (this.xy.menu_width !== 0 && this._select_id == o.id) { + this.config.cascade_event_display && this._drag_mode && (w.style.zIndex = 1); + for (var M, T = this.config["icons_" + (this._edit_id == o.id ? "edit" : "select")], A = "", H = 0; H < T.length; H++) { + const j = T[H]; + M = this._waiAria.eventMenuAttrString(j), A += `
`; } - var O = this._render_v_bar(n, b - u - 1, f, u, null, "", "
", C, !0); - n.color && O.style.setProperty("--dhx-scheduler-event-background", n.color), n.textColor && O.style.setProperty("--dhx-scheduler-event-color", n.textColor), this._els.dhx_cal_data[0].appendChild(O), this._rendered.push(O); + var $ = this._render_v_bar(o, b - v - 1, p, v, null, "", "
", A, !0); + o.color && $.style.setProperty("--dhx-scheduler-event-background", o.color), o.textColor && $.style.setProperty("--dhx-scheduler-event-color", o.textColor), this._els.dhx_cal_data[0].appendChild($), this._rendered.push($); } - this.config.drag_highlight && this._drag_id == n.id && this.highlightEventPosition(n); + this.config.drag_highlight && this._drag_id == o.id && this.highlightEventPosition(o); } } - }, t._render_v_bar = function(n, s, c, u, v, m, l, f, g) { - var p = document.createElement("div"), y = n.id, w = g ? "dhx_cal_event dhx_cal_select_menu" : "dhx_cal_event", b = t.getState(); - b.drag_id == n.id && (w += " dhx_cal_event_drag"), b.select_id == n.id && (w += " dhx_cal_event_selected"); - var k = t.templates.event_class(n.start_date, n.end_date, n); - k && (w = w + " " + k), this.config.cascade_event_display && (w += " dhx_cal_event_cascade"); - var E = u - 1, D = '
'; - p.innerHTML = D; - var x = p.cloneNode(!0).firstChild; - if (!g && t.renderEvent(x, n, u, v, l, f)) - return n.color && x.style.setProperty("--dhx-scheduler-event-background", n.color), n.textColor && x.style.setProperty("--dhx-scheduler-event-color", n.textColor), x; - x = p.firstChild, n.color && x.style.setProperty("--dhx-scheduler-event-background", n.color), n.textColor && x.style.setProperty("--dhx-scheduler-event-color", n.textColor); + }, a._render_v_bar = function(o, l, h, v, u, f, c, p, m) { + var g = document.createElement("div"), y = o.id, x = m ? "dhx_cal_event dhx_cal_select_menu" : "dhx_cal_event", b = a.getState(); + b.drag_id == o.id && (x += " dhx_cal_event_drag"), b.select_id == o.id && (x += " dhx_cal_event_selected"); + var k = a.templates.event_class(o.start_date, o.end_date, o); + k && (x = x + " " + k), this.config.cascade_event_display && (x += " dhx_cal_event_cascade"); + var E = v - 1, D = `
+
`; + g.innerHTML = D; + var w = g.cloneNode(!0).firstChild; + if (!m && a.renderEvent(w, o, v, u, c, p)) + return o.color && w.style.setProperty("--dhx-scheduler-event-background", o.color), o.textColor && w.style.setProperty("--dhx-scheduler-event-color", o.textColor), w; + w = g.firstChild, o.color && w.style.setProperty("--dhx-scheduler-event-background", o.color), o.textColor && w.style.setProperty("--dhx-scheduler-event-color", o.textColor); var S = '
 
'; - S += '
' + l + "
", S += '
' + f + "
"; + S += '
' + c + "
", S += '
' + p + "
"; var N = "dhx_event_resize dhx_footer"; - return (g || n._drag_resize === !1) && (N = "dhx_resize_denied " + N), S += '
', x.innerHTML = S, x; - }, t.renderEvent = function() { + return (m || o._drag_resize === !1) && (N = "dhx_resize_denied " + N), S += '
', w.innerHTML = S, w; + }, a.renderEvent = function() { return !1; - }, t.locate_holder = function(n) { - return this._mode == "day" ? this._els.dhx_cal_data[0].firstChild : this._els.dhx_cal_data[0].childNodes[n]; - }, t.locate_holder_day = function(n, s) { - var c = Math.floor((this._correct_shift(n, 1) - this._min_date) / 864e5); - return s && this.date.time_part(n) && c++, c; - }, t._get_dnd_order = function(n, s, c) { + }, a.locate_holder = function(o) { + return this._mode == "day" ? this._els.dhx_cal_data[0].firstChild : this._els.dhx_cal_data[0].childNodes[o]; + }, a.locate_holder_day = function(o, l) { + var h = Math.floor((this._correct_shift(o, 1) - this._min_date) / 864e5); + return l && this.date.time_part(o) && h++, h; + }, a._get_dnd_order = function(o, l, h) { if (!this._drag_event) - return n; - this._drag_event._orig_sorder ? n = this._drag_event._orig_sorder : this._drag_event._orig_sorder = n; - for (var u = s * n; u + s > c; ) - n--, u -= s; - return Math.max(n, 0); - }, t._get_event_bar_pos = function(n) { - var s = this.config.rtl, c = this._colsS, u = c[n._sday], v = c[n._eday]; - s && (u = c[c.col_length] - c[n._eday] + c[0], v = c[c.col_length] - c[n._sday] + c[0]), v == u && (v = c[n._eday + 1]); - var m = this.xy.bar_height, l = n._sorder; - if (n.id == this._drag_id) { - var f = c.heights[n._sweek + 1] - c.heights[n._sweek] - this.xy.month_head_height; - l = t._get_dnd_order(l, m, f); - } - var g = l * m; - return { x: u, x2: v, y: c.heights[n._sweek] + (c.height ? this.xy.month_scale_height + 2 : 2) + g }; - }, t.render_event_bar = function(n) { - var s = this._rendered_location, c = this._get_event_bar_pos(n), u = c.y, v = c.x, m = c.x2, l = ""; - if (m) { - var f = t.config.resize_month_events && this._mode == "month" && (!n._timed || t.config.resize_month_timed), g = document.createElement("div"), p = n.hasOwnProperty("_first_chunk") && n._first_chunk, y = n.hasOwnProperty("_last_chunk") && n._last_chunk, w = f && (n._timed || p), b = f && (n._timed || y), k = !0, E = "dhx_cal_event_clear"; - n._timed && !f || (k = !1, E = "dhx_cal_event_line"), p && (E += " dhx_cal_event_line_start"), y && (E += " dhx_cal_event_line_end"), w && (l += "
"), b && (l += "
"); - var D = t.templates.event_class(n.start_date, n.end_date, n); + return o; + this._drag_event._orig_sorder ? o = this._drag_event._orig_sorder : this._drag_event._orig_sorder = o; + for (var v = l * o; v + l > h; ) + o--, v -= l; + return Math.max(o, 0); + }, a._get_event_bar_pos = function(o) { + var l = this.config.rtl, h = this._colsS, v = h[o._sday], u = h[o._eday]; + l && (v = h[h.col_length] - h[o._eday] + h[0], u = h[h.col_length] - h[o._sday] + h[0]), u == v && (u = h[o._eday + 1]); + var f = this.xy.bar_height, c = o._sorder; + if (o.id == this._drag_id) { + var p = h.heights[o._sweek + 1] - h.heights[o._sweek] - this.xy.month_head_height; + c = a._get_dnd_order(c, f, p); + } + var m = c * f; + return { x: v, x2: u, y: h.heights[o._sweek] + (h.height ? this.xy.month_scale_height + 2 : 2) + m }; + }, a.render_event_bar = function(o) { + var l = this._rendered_location, h = this._get_event_bar_pos(o), v = h.y, u = h.x, f = h.x2, c = ""; + if (f) { + var p = a.config.resize_month_events && this._mode == "month" && (!o._timed || a.config.resize_month_timed), m = document.createElement("div"), g = o.hasOwnProperty("_first_chunk") && o._first_chunk, y = o.hasOwnProperty("_last_chunk") && o._last_chunk, x = p && (o._timed || g), b = p && (o._timed || y), k = !0, E = "dhx_cal_event_clear"; + o._timed && !p || (k = !1, E = "dhx_cal_event_line"), g && (E += " dhx_cal_event_line_start"), y && (E += " dhx_cal_event_line_end"), x && (c += "
"), b && (c += "
"); + var D = a.templates.event_class(o.start_date, o.end_date, o); D && (E += " " + D); - var x = n.color ? "--dhx-scheduler-event-background:" + n.color + ";" : "", S = n.textColor ? "--dhx-scheduler-event-color:" + n.textColor + ";" : "", N = ["position:absolute", "top:" + u + "px", "left:" + v + "px", "width:" + (m - v - (k ? 1 : 0)) + "px", "height:" + (this.xy.bar_height - 2) + "px", S, x, n._text_style || ""].join(";"), M = "
"; - f && (M += l), t.getState().mode == "month" && (n = t.getEvent(n.id)), n._timed && (M += `${t.templates.event_bar_date(n.start_date, n.end_date, n)}`), M += "
", M += t.templates.event_bar_text(n.start_date, n.end_date, n) + "
", M += "
", M += "
", g.innerHTML = M, this._rendered.push(g.firstChild), s.appendChild(g.firstChild); + var w = o.color ? "--dhx-scheduler-event-background:" + o.color + ";" : "", S = o.textColor ? "--dhx-scheduler-event-color:" + o.textColor + ";" : "", N = ["position:absolute", "top:" + v + "px", "left:" + u + "px", "width:" + (f - u - (k ? 1 : 0)) + "px", "height:" + (this.xy.bar_height - 2) + "px", S, w, o._text_style || ""].join(";"), M = "
"; + p && (M += c), a.getState().mode == "month" && (o = a.getEvent(o.id)), o._timed && (M += `${a.templates.event_bar_date(o.start_date, o.end_date, o)}`), M += "
", M += a.templates.event_bar_text(o.start_date, o.end_date, o) + "
", M += "
", M += "
", m.innerHTML = M, this._rendered.push(m.firstChild), l.appendChild(m.firstChild); } - }, t._locate_event = function(n) { - for (var s = null; n && !s && n.getAttribute; ) - s = n.getAttribute(this.config.event_attribute), n = n.parentNode; - return s; - }, t.edit = function(n) { - this._edit_id != n && (this.editStop(!1, n), this._edit_id = n, this.updateEvent(n)); - }, t.editStop = function(n, s) { - if (!s || this._edit_id != s) { - var c = this.getEvent(this._edit_id); - c && (n && (c.text = this._editor.value), this._edit_id = null, this._editor = null, this.updateEvent(c.id), this._edit_stop_event(c, n)); - } - }, t._edit_stop_event = function(n, s) { - this._new_event ? (s ? this.callEvent("onEventAdded", [n.id, n]) : n && this.deleteEvent(n.id, !0), this._new_event = null) : s && this.callEvent("onEventChanged", [n.id, n]); - }, t.getEvents = function(n, s) { - var c = []; - for (var u in this._events) { - var v = this._events[u]; - v && (!n && !s || v.start_date < s && v.end_date > n) && c.push(v); + }, a._locate_event = function(o) { + for (var l = null; o && !l && o.getAttribute; ) + l = o.getAttribute(this.config.event_attribute), o = o.parentNode; + return l; + }, a.edit = function(o) { + this._edit_id != o && (this.editStop(!1, o), this._edit_id = o, this.updateEvent(o)); + }, a.editStop = function(o, l) { + if (!l || this._edit_id != l) { + var h = this.getEvent(this._edit_id); + h && (o && (h.text = this._editor.value), this._edit_id = null, this._editor = null, this.updateEvent(h.id), this._edit_stop_event(h, o)); + } + }, a._edit_stop_event = function(o, l) { + this._new_event ? (l ? this.callEvent("onEventAdded", [o.id, o]) : o && this.deleteEvent(o.id, !0), this._new_event = null) : l && this.callEvent("onEventChanged", [o.id, o]); + }, a.getEvents = function(o, l) { + var h = []; + for (var v in this._events) { + var u = this._events[v]; + u && (!o && !l || u.start_date < l && u.end_date > o) && h.push(u); } - return c; - }, t.getRenderedEvent = function(n) { - if (n) { - for (var s = t._rendered, c = 0; c < s.length; c++) { - var u = s[c]; - if (u.getAttribute(t.config.event_attribute) == n) - return u; + return h; + }, a.getRenderedEvent = function(o) { + if (o) { + for (var l = a._rendered, h = 0; h < l.length; h++) { + var v = l[h]; + if (v.getAttribute(a.config.event_attribute) == o) + return v; } return null; } - }, t.showEvent = function(n, s) { - n && typeof n == "object" && (s = n.mode, y = n.section, n = n.section); - var c = typeof n == "number" || typeof n == "string" ? t.getEvent(n) : n; - if (s = s || t._mode, c && (!this.checkEvent("onBeforeEventDisplay") || this.callEvent("onBeforeEventDisplay", [c, s]))) { - var u = t.config.scroll_hour; - t.config.scroll_hour = c.start_date.getHours(); - var v = t.config.preserve_scroll; - t.config.preserve_scroll = !1; - var m = c.color, l = c.textColor; - if (t.config.highlight_displayed_event && (c.color = t.config.displayed_event_color, c.textColor = t.config.displayed_event_text_color), t.setCurrentView(new Date(c.start_date), s), t.config.scroll_hour = u, t.config.preserve_scroll = v, t.matrix && t.matrix[s]) { - var f = t.getView(), g = f.y_property, p = t.getEvent(c.id); - if (p) { + }, a.showEvent = function(o, l) { + o && typeof o == "object" && (l = o.mode, y = o.section, o = o.section); + var h = typeof o == "number" || typeof o == "string" ? a.getEvent(o) : o; + if (l = l || a._mode, h && (!this.checkEvent("onBeforeEventDisplay") || this.callEvent("onBeforeEventDisplay", [h, l]))) { + var v = a.config.scroll_hour; + a.config.scroll_hour = h.start_date.getHours(); + var u = a.config.preserve_scroll; + a.config.preserve_scroll = !1; + var f = h.color, c = h.textColor; + if (a.config.highlight_displayed_event && (h.color = a.config.displayed_event_color, h.textColor = a.config.displayed_event_text_color), a.setCurrentView(new Date(h.start_date), l), a.config.scroll_hour = v, a.config.preserve_scroll = u, a.matrix && a.matrix[l]) { + var p = a.getView(), m = p.y_property, g = a.getEvent(h.id); + if (g) { if (!y) { - var y = p[g]; - Array.isArray(y) ? y = y[0] : typeof y == "string" && t.config.section_delimiter && y.indexOf(t.config.section_delimiter) > -1 && (y = y.split(t.config.section_delimiter)[0]); + var y = g[m]; + Array.isArray(y) ? y = y[0] : typeof y == "string" && a.config.section_delimiter && y.indexOf(a.config.section_delimiter) > -1 && (y = y.split(a.config.section_delimiter)[0]); } - var w = f.getSectionTop(y), b = f.posFromDate(p.start_date), k = t.$container.querySelector(".dhx_timeline_data_wrapper"); - if (b -= (k.offsetWidth - f.dx) / 2, w = w - k.offsetHeight / 2 + f.dy / 2, f._smartRenderingEnabled()) - var E = f.attachEvent("onScroll", function() { - D(), f.detachEvent(E); + var x = p.getSectionTop(y), b = p.posFromDate(g.start_date), k = a.$container.querySelector(".dhx_timeline_data_wrapper"); + if (b -= (k.offsetWidth - p.dx) / 2, x = x - k.offsetHeight / 2 + p.dy / 2, p._smartRenderingEnabled()) + var E = p.attachEvent("onScroll", function() { + D(), p.detachEvent(E); }); - f.scrollTo({ left: b, top: w }), f._smartRenderingEnabled() || D(); + p.scrollTo({ left: b, top: x }), p._smartRenderingEnabled() || D(); } } else D(); - t.callEvent("onAfterEventDisplay", [c, s]); + a.callEvent("onAfterEventDisplay", [h, l]); } function D() { - c.color = m, c.textColor = l; + h.color = f, h.textColor = c; } }; - }(h), function(t) { - t._append_drag_marker = function(n) { - if (!n.parentNode) { - var s = t._els.dhx_cal_data[0].lastChild, c = t._getClassName(s); - c.indexOf("dhx_scale_holder") < 0 && s.previousSibling && (s = s.previousSibling), c = t._getClassName(s), s && c.indexOf("dhx_scale_holder") === 0 && s.appendChild(n); - } - }, t._update_marker_position = function(n, s) { - var c = t._calc_event_y(s, 0); - n.style.top = c.top + "px", n.style.height = c.height + "px"; - }, t.highlightEventPosition = function(n) { - var s = document.createElement("div"); - s.setAttribute("event_id", n.id), s.setAttribute(this.config.event_attribute, n.id), this._rendered.push(s), this._update_marker_position(s, n); - var c = this.templates.drag_marker_class(n.start_date, n.end_date, n), u = this.templates.drag_marker_content(n.start_date, n.end_date, n); - s.className = "dhx_drag_marker", c && (s.className += " " + c), u && (s.innerHTML = u), this._append_drag_marker(s); + }(i), function(a) { + a._append_drag_marker = function(o) { + if (!o.parentNode) { + var l = a._els.dhx_cal_data[0].lastChild, h = a._getClassName(l); + h.indexOf("dhx_scale_holder") < 0 && l.previousSibling && (l = l.previousSibling), h = a._getClassName(l), l && h.indexOf("dhx_scale_holder") === 0 && l.appendChild(o); + } + }, a._update_marker_position = function(o, l) { + var h = a._calc_event_y(l, 0); + o.style.top = h.top + "px", o.style.height = h.height + "px"; + }, a.highlightEventPosition = function(o) { + var l = document.createElement("div"); + l.setAttribute("event_id", o.id), l.setAttribute(this.config.event_attribute, o.id), this._rendered.push(l), this._update_marker_position(l, o); + var h = this.templates.drag_marker_class(o.start_date, o.end_date, o), v = this.templates.drag_marker_content(o.start_date, o.end_date, o); + l.className = "dhx_drag_marker", h && (l.className += " " + h), v && (l.innerHTML = v), this._append_drag_marker(l); }; - }(h), xe(h), function(t) { - function n() { - const s = t.config.csp === !0, c = !!window.Sfdc || !!window.$A || window.Aura || "$shadowResolver$" in document.body; - return s || c ? t.$root : document.body; + }(i), Vt(i), function(a) { + function o() { + const l = a.config.csp === !0, h = !!window.Sfdc || !!window.$A || window.Aura || "$shadowResolver$" in document.body; + return l || h ? a.$root : document.body; } - t._lightbox_controls = {}, t.formSection = function(s) { - for (var c = this.config.lightbox.sections, u = 0; u < c.length && c[u].name != s; u++) + a._lightbox_controls = {}, a.formSection = function(l) { + for (var h = this.config.lightbox.sections, v = 0; v < h.length && h[v].name != l; v++) ; - if (u === c.length) + if (v === h.length) return null; - var v = c[u]; - t._lightbox || t.getLightbox(); - var m = t._lightbox.querySelector(`#${v.id}`), l = m.nextSibling, f = { section: v, header: m, node: l, getValue: function(p) { - return t.form_blocks[v.type].get_value(l, p || {}, v); - }, setValue: function(p, y) { - return t.form_blocks[v.type].set_value(l, p, y || {}, v); - } }, g = t._lightbox_controls["get_" + v.type + "_control"]; - return g ? g(f) : f; - }, t._lightbox_controls.get_template_control = function(s) { - return s.control = s.node, s; - }, t._lightbox_controls.get_select_control = function(s) { - return s.control = s.node.getElementsByTagName("select")[0], s; - }, t._lightbox_controls.get_textarea_control = function(s) { - return s.control = s.node.getElementsByTagName("textarea")[0], s; - }, t._lightbox_controls.get_time_control = function(s) { - return s.control = s.node.getElementsByTagName("select"), s; - }, t._lightbox_controls.defaults = { template: { height: 30 }, textarea: { height: 200 }, select: { height: 23 }, time: { height: 20 } }, t.form_blocks = { template: { render: function(s) { + var u = h[v]; + a._lightbox || a.getLightbox(); + var f = a._lightbox.querySelector(`#${u.id}`), c = f.nextSibling, p = { section: u, header: f, node: c, getValue: function(g) { + return a.form_blocks[u.type].get_value(c, g || {}, u); + }, setValue: function(g, y) { + return a.form_blocks[u.type].set_value(c, g, y || {}, u); + } }, m = a._lightbox_controls["get_" + u.type + "_control"]; + return m ? m(p) : p; + }, a._lightbox_controls.get_template_control = function(l) { + return l.control = l.node, l; + }, a._lightbox_controls.get_select_control = function(l) { + return l.control = l.node.getElementsByTagName("select")[0], l; + }, a._lightbox_controls.get_textarea_control = function(l) { + return l.control = l.node.getElementsByTagName("textarea")[0], l; + }, a._lightbox_controls.get_time_control = function(l) { + return l.control = l.node.getElementsByTagName("select"), l; + }, a._lightbox_controls.defaults = { template: { height: 30 }, textarea: { height: 200 }, select: { height: 23 }, time: { height: 20 } }, a.form_blocks = { template: { render: function(l) { return "
"; - }, set_value: function(s, c, u, v) { - s.innerHTML = c || ""; - }, get_value: function(s, c, u) { - return s.innerHTML || ""; - }, focus: function(s) { - } }, textarea: { render: function(s) { - return `
`; - }, set_value: function(s, c, u) { - t.form_blocks.textarea._get_input(s).value = c || ""; - }, get_value: function(s, c) { - return t.form_blocks.textarea._get_input(s).value; - }, focus: function(s) { - var c = t.form_blocks.textarea._get_input(s); - t._focus(c, !0); - }, _get_input: function(s) { - return s.getElementsByTagName("textarea")[0]; - } }, select: { render: function(s) { - for (var c = "
"; - }, set_value: function(s, c, u, v) { - var m = s.firstChild; - !m._dhx_onchange && v.onchange && (t.event(m, "change", v.onchange), m._dhx_onchange = !0), c === void 0 && (c = (m.options[0] || {}).value), m.value = c || ""; - }, get_value: function(s, c) { - return s.firstChild.value; - }, focus: function(s) { - var c = s.firstChild; - t._focus(c, !0); - } }, time: { render: function(s) { - s.time_format || (s.time_format = ["%H:%i", "%d", "%m", "%Y"]), s._time_format_order = {}; - var c = s.time_format, u = t.config, v = t.date.date_part(t._currentDate()), m = 1440, l = 0; - t.config.limit_time_select && (m = 60 * u.last_hour + 1, l = 60 * u.first_hour, v.setHours(u.first_hour)); - for (var f = "", g = 0; g < c.length; g++) { - var p = c[g]; - g > 0 && (f += " "); - var y = "", w = ""; - switch (p) { + }, set_value: function(l, h, v, u) { + l.innerHTML = h || ""; + }, get_value: function(l, h, v) { + return l.innerHTML || ""; + }, focus: function(l) { + } }, textarea: { render: function(l) { + return `
`; + }, set_value: function(l, h, v) { + a.form_blocks.textarea._get_input(l).value = h || ""; + }, get_value: function(l, h) { + return a.form_blocks.textarea._get_input(l).value; + }, focus: function(l) { + var h = a.form_blocks.textarea._get_input(l); + a._focus(h, !0); + }, _get_input: function(l) { + return l.getElementsByTagName("textarea")[0]; + } }, select: { render: function(l) { + for (var h = "
"; + }, set_value: function(l, h, v, u) { + var f = l.firstChild; + !f._dhx_onchange && u.onchange && (a.event(f, "change", u.onchange), f._dhx_onchange = !0), h === void 0 && (h = (f.options[0] || {}).value), f.value = h || ""; + }, get_value: function(l, h) { + return l.firstChild.value; + }, focus: function(l) { + var h = l.firstChild; + a._focus(h, !0); + } }, time: { render: function(l) { + l.time_format || (l.time_format = ["%H:%i", "%d", "%m", "%Y"]), l._time_format_order = {}; + var h = l.time_format, v = a.config, u = a.date.date_part(a._currentDate()), f = 1440, c = 0; + a.config.limit_time_select && (f = 60 * v.last_hour + 1, c = 60 * v.first_hour, u.setHours(v.first_hour)); + for (var p = "", m = 0; m < h.length; m++) { + var g = h[m]; + m > 0 && (p += " "); + var y = "", x = ""; + switch (g) { case "%Y": var b, k, E; - y = "dhx_lightbox_year_select", s._time_format_order[3] = g, s.year_range && (isNaN(s.year_range) ? s.year_range.push && (k = s.year_range[0], E = s.year_range[1]) : b = s.year_range), b = b || 10; + y = "dhx_lightbox_year_select", l._time_format_order[3] = m, l.year_range && (isNaN(l.year_range) ? l.year_range.push && (k = l.year_range[0], E = l.year_range[1]) : b = l.year_range), b = b || 10; var D = D || Math.floor(b / 2); - k = k || v.getFullYear() - D, E = E || k + b; - for (var x = k; x < E; x++) - w += ""; + k = k || u.getFullYear() - D, E = E || k + b; + for (var w = k; w < E; w++) + x += ""; break; case "%m": - for (y = "dhx_lightbox_month_select", s._time_format_order[2] = g, x = 0; x < 12; x++) - w += ""; + for (y = "dhx_lightbox_month_select", l._time_format_order[2] = m, w = 0; w < 12; w++) + x += ""; break; case "%d": - for (y = "dhx_lightbox_day_select", s._time_format_order[1] = g, x = 1; x < 32; x++) - w += ""; + for (y = "dhx_lightbox_day_select", l._time_format_order[1] = m, w = 1; w < 32; w++) + x += ""; break; case "%H:%i": - y = "dhx_lightbox_time_select", s._time_format_order[0] = g, x = l; - var S = v.getDate(); - for (s._time_values = []; x < m; ) - w += "", s._time_values.push(x), v.setTime(v.valueOf() + 60 * this.config.time_step * 1e3), x = 24 * (v.getDate() != S ? 1 : 0) * 60 + 60 * v.getHours() + v.getMinutes(); + y = "dhx_lightbox_time_select", l._time_format_order[0] = m, w = c; + var S = u.getDate(); + for (l._time_values = []; w < f; ) + x += "", l._time_values.push(w), u.setTime(u.valueOf() + 60 * this.config.time_step * 1e3), w = 24 * (u.getDate() != S ? 1 : 0) * 60 + 60 * u.getHours() + u.getMinutes(); } - if (w) { - var N = t._waiAria.lightboxSelectAttrString(p); - f += " "; + if (x) { + var N = a._waiAria.lightboxSelectAttrString(g); + p += " "; } } - return "
" + f + "  –  " + f + "
"; - }, set_value: function(s, c, u, v) { - var m, l, f = t.config, g = s.getElementsByTagName("select"), p = v._time_format_order; - if (f.full_day) { - if (!s._full_day) { - var y = ""; - t.config.wide_form || (y = s.previousSibling.innerHTML + y), s.previousSibling.innerHTML = y, s._full_day = !0; + return "
" + p + "  –  " + p + "
"; + }, set_value: function(l, h, v, u) { + var f, c, p = a.config, m = l.getElementsByTagName("select"), g = u._time_format_order; + if (p.full_day) { + if (!l._full_day) { + var y = ""; + a.config.wide_form || (y = l.previousSibling.innerHTML + y), l.previousSibling.innerHTML = y, l._full_day = !0; } - var w = s.previousSibling.getElementsByTagName("input")[0]; - w.checked = t.date.time_part(u.start_date) === 0 && t.date.time_part(u.end_date) === 0, g[p[0]].disabled = w.checked, g[p[0] + g.length / 2].disabled = w.checked, w.$_eventAttached || (w.$_eventAttached = !0, t.event(w, "click", function() { - if (w.checked) { + var x = l.previousSibling.getElementsByTagName("input")[0]; + x.checked = a.date.time_part(v.start_date) === 0 && a.date.time_part(v.end_date) === 0, m[g[0]].disabled = x.checked, m[g[0] + m.length / 2].disabled = x.checked, x.$_eventAttached || (x.$_eventAttached = !0, a.event(x, "click", function() { + if (x.checked) { var D = {}; - t.form_blocks.time.get_value(s, D, v), m = t.date.date_part(D.start_date), (+(l = t.date.date_part(D.end_date)) == +m || +l >= +m && (u.end_date.getHours() !== 0 || u.end_date.getMinutes() !== 0)) && (l = t.date.add(l, 1, "day")); + a.form_blocks.time.get_value(l, D, u), f = a.date.date_part(D.start_date), (+(c = a.date.date_part(D.end_date)) == +f || +c >= +f && (v.end_date.getHours() !== 0 || v.end_date.getMinutes() !== 0)) && (c = a.date.add(c, 1, "day")); } else - m = null, l = null; - g[p[0]].disabled = w.checked, g[p[0] + g.length / 2].disabled = w.checked, E(g, 0, m || u.start_date), E(g, 4, l || u.end_date); + f = null, c = null; + m[g[0]].disabled = x.checked, m[g[0] + m.length / 2].disabled = x.checked, E(m, 0, f || v.start_date), E(m, 4, c || v.end_date); })); } - if (f.auto_end_date && f.event_duration) + if (p.auto_end_date && p.event_duration) for (var b = function() { - f.auto_end_date && f.event_duration && (m = new Date(g[p[3]].value, g[p[2]].value, g[p[1]].value, 0, g[p[0]].value), l = new Date(m.getTime() + 60 * t.config.event_duration * 1e3), E(g, 4, l)); + p.auto_end_date && p.event_duration && (f = new Date(m[g[3]].value, m[g[2]].value, m[g[1]].value, 0, m[g[0]].value), c = new Date(f.getTime() + 60 * a.config.event_duration * 1e3), E(m, 4, c)); }, k = 0; k < 4; k++) - g[k].$_eventAttached || (g[k].$_eventAttached = !0, t.event(g[k], "change", b)); - function E(D, x, S) { - for (var N = v._time_values, M = 60 * S.getHours() + S.getMinutes(), A = M, C = !1, T = 0; T < N.length; T++) { - var O = N[T]; - if (O === M) { - C = !0; + m[k].$_eventAttached || (m[k].$_eventAttached = !0, a.event(m[k], "change", b)); + function E(D, w, S) { + for (var N = u._time_values, M = 60 * S.getHours() + S.getMinutes(), T = M, A = !1, H = 0; H < N.length; H++) { + var $ = N[H]; + if ($ === M) { + A = !0; break; } - O < M && (A = O); + $ < M && (T = $); } - D[x + p[0]].value = C ? M : A, C || A || (D[x + p[0]].selectedIndex = -1), D[x + p[1]].value = S.getDate(), D[x + p[2]].value = S.getMonth(), D[x + p[3]].value = S.getFullYear(); - } - E(g, 0, u.start_date), E(g, 4, u.end_date); - }, get_value: function(s, c, u) { - var v = s.getElementsByTagName("select"), m = u._time_format_order; - if (c.start_date = new Date(v[m[3]].value, v[m[2]].value, v[m[1]].value, 0, v[m[0]].value), c.end_date = new Date(v[m[3] + 4].value, v[m[2] + 4].value, v[m[1] + 4].value, 0, v[m[0] + 4].value), !v[m[3]].value || !v[m[3] + 4].value) { - var l = t.getEvent(t._lightbox_id); - l && (c.start_date = l.start_date, c.end_date = l.end_date); - } - return c.end_date <= c.start_date && (c.end_date = t.date.add(c.start_date, t.config.time_step, "minute")), { start_date: new Date(c.start_date), end_date: new Date(c.end_date) }; - }, focus: function(s) { - t._focus(s.getElementsByTagName("select")[0]); - } } }, t._setLbPosition = function(s) { - s && (s.style.top = Math.max(n().offsetHeight / 2 - s.offsetHeight / 2, 0) + "px", s.style.left = Math.max(n().offsetWidth / 2 - s.offsetWidth / 2, 0) + "px"); - }, t.showCover = function(s) { - s && (s.style.display = "block", this._setLbPosition(s)), t.config.responsive_lightbox && (document.documentElement.classList.add("dhx_cal_overflow_container"), n().classList.add("dhx_cal_overflow_container")), this.show_cover(), this._cover.style.display = ""; - }, t.showLightbox = function(s) { - if (s) - if (this.callEvent("onBeforeLightbox", [s])) { - this.showCover(c); - var c = this.getLightbox(); - this._setLbPosition(c), this._fill_lightbox(s, c), this._waiAria.lightboxVisibleAttr(c), this.callEvent("onLightbox", [s]); + D[w + g[0]].value = A ? M : T, A || T || (D[w + g[0]].selectedIndex = -1), D[w + g[1]].value = S.getDate(), D[w + g[2]].value = S.getMonth(), D[w + g[3]].value = S.getFullYear(); + } + E(m, 0, v.start_date), E(m, 4, v.end_date); + }, get_value: function(l, h, v) { + var u = l.getElementsByTagName("select"), f = v._time_format_order; + if (h.start_date = new Date(u[f[3]].value, u[f[2]].value, u[f[1]].value, 0, u[f[0]].value), h.end_date = new Date(u[f[3] + 4].value, u[f[2] + 4].value, u[f[1] + 4].value, 0, u[f[0] + 4].value), !u[f[3]].value || !u[f[3] + 4].value) { + var c = a.getEvent(a._lightbox_id); + c && (h.start_date = c.start_date, h.end_date = c.end_date); + } + return h.end_date <= h.start_date && (h.end_date = a.date.add(h.start_date, a.config.time_step, "minute")), { start_date: new Date(h.start_date), end_date: new Date(h.end_date) }; + }, focus: function(l) { + a._focus(l.getElementsByTagName("select")[0]); + } } }, a._setLbPosition = function(l) { + l && (l.style.top = Math.max(o().offsetHeight / 2 - l.offsetHeight / 2, 0) + "px", l.style.left = Math.max(o().offsetWidth / 2 - l.offsetWidth / 2, 0) + "px"); + }, a.showCover = function(l) { + l && (l.style.display = "block", this._setLbPosition(l)), a.config.responsive_lightbox && (document.documentElement.classList.add("dhx_cal_overflow_container"), o().classList.add("dhx_cal_overflow_container")), this.show_cover(), this._cover.style.display = ""; + }, a.showLightbox = function(l) { + if (l) + if (this.callEvent("onBeforeLightbox", [l])) { + this.showCover(h); + var h = this.getLightbox(); + this._setLbPosition(h), this._fill_lightbox(l, h), this._waiAria.lightboxVisibleAttr(h), this.callEvent("onLightbox", [l]); } else this._new_event && (this._new_event = null); - }, t._fill_lightbox = function(s, c) { - var u = this.getEvent(s), v = c.getElementsByTagName("span"), m = []; - if (t.templates.lightbox_header) { - m.push(""); - var l = t.templates.lightbox_header(u.start_date, u.end_date, u); - m.push(l), v[1].innerHTML = "", v[2].innerHTML = l; + }, a._fill_lightbox = function(l, h) { + var v = this.getEvent(l), u = h.getElementsByTagName("span"), f = []; + if (a.templates.lightbox_header) { + f.push(""); + var c = a.templates.lightbox_header(v.start_date, v.end_date, v); + f.push(c), u[1].innerHTML = "", u[2].innerHTML = c; } else { - var f = this.templates.event_header(u.start_date, u.end_date, u), g = (this.templates.event_bar_text(u.start_date, u.end_date, u) || "").substr(0, 70); - m.push(f), m.push(g), v[1].innerHTML = f, v[2].innerHTML = g; - } - this._waiAria.lightboxHeader(c, m.join(" ")); - for (var p = this.config.lightbox.sections, y = 0; y < p.length; y++) { - var w = p[y], b = t._get_lightbox_section_node(w), k = this.form_blocks[w.type], E = u[w.map_to] !== void 0 ? u[w.map_to] : w.default_value; - k.set_value.call(this, b, E, u, w), p[y].focus && k.focus.call(this, b); - } - t._lightbox_id = s; - }, t._get_lightbox_section_node = function(s) { - return t._lightbox.querySelector(`#${s.id}`).nextSibling; - }, t._lightbox_out = function(s) { - for (var c = this.config.lightbox.sections, u = 0; u < c.length; u++) { - var v = t._lightbox.querySelector(`#${c[u].id}`); - v = v && v.nextSibling; - var m = this.form_blocks[c[u].type].get_value.call(this, v, s, c[u]); - c[u].map_to != "auto" && (s[c[u].map_to] = m); + var p = this.templates.event_header(v.start_date, v.end_date, v), m = (this.templates.event_bar_text(v.start_date, v.end_date, v) || "").substr(0, 70); + f.push(p), f.push(m), u[1].innerHTML = p, u[2].innerHTML = m; + } + this._waiAria.lightboxHeader(h, f.join(" ")); + for (var g = this.config.lightbox.sections, y = 0; y < g.length; y++) { + var x = g[y], b = a._get_lightbox_section_node(x), k = this.form_blocks[x.type], E = v[x.map_to] !== void 0 ? v[x.map_to] : x.default_value; + k.set_value.call(this, b, E, v, x), g[y].focus && k.focus.call(this, b); + } + a._lightbox_id = l; + }, a._get_lightbox_section_node = function(l) { + return a._lightbox.querySelector(`#${l.id}`).nextSibling; + }, a._lightbox_out = function(l) { + for (var h = this.config.lightbox.sections, v = 0; v < h.length; v++) { + var u = a._lightbox.querySelector(`#${h[v].id}`); + u = u && u.nextSibling; + var f = this.form_blocks[h[v].type].get_value.call(this, u, l, h[v]); + h[v].map_to != "auto" && (l[h[v].map_to] = f); } - return s; - }, t._empty_lightbox = function(s) { - var c = t._lightbox_id, u = this.getEvent(c); - this._lame_copy(u, s), this.setEvent(u.id, u), this._edit_stop_event(u, !0), this.render_view_data(); - }, t.hide_lightbox = function(s) { - t.endLightbox(!1, this.getLightbox()); - }, t.hideCover = function(s) { - s && (s.style.display = "none"), this.hide_cover(), t.config.responsive_lightbox && (document.documentElement.classList.remove("dhx_cal_overflow_container"), n().classList.remove("dhx_cal_overflow_container")); - }, t.hide_cover = function() { + return l; + }, a._empty_lightbox = function(l) { + var h = a._lightbox_id, v = this.getEvent(h); + this._lame_copy(v, l), this.setEvent(v.id, v), this._edit_stop_event(v, !0), this.render_view_data(); + }, a.hide_lightbox = function(l) { + a.endLightbox(!1, this.getLightbox()); + }, a.hideCover = function(l) { + l && (l.style.display = "none"), this.hide_cover(), a.config.responsive_lightbox && (document.documentElement.classList.remove("dhx_cal_overflow_container"), o().classList.remove("dhx_cal_overflow_container")); + }, a.hide_cover = function() { this._cover && this._cover.parentNode.removeChild(this._cover), this._cover = null; - }, t.show_cover = function() { - this._cover || (this._cover = document.createElement("div"), this._cover.className = "dhx_cal_cover", this._cover.style.display = "none", t.event(this._cover, "mousemove", t._move_while_dnd), t.event(this._cover, "mouseup", t._finish_dnd), n().appendChild(this._cover)); - }, t.save_lightbox = function() { - var s = this._lightbox_out({}, this._lame_copy(this.getEvent(this._lightbox_id))); - this.checkEvent("onEventSave") && !this.callEvent("onEventSave", [this._lightbox_id, s, this._new_event]) || (this._empty_lightbox(s), this.hide_lightbox()); - }, t.startLightbox = function(s, c) { - this._lightbox_id = s, this._custom_lightbox = !0, this._temp_lightbox = this._lightbox, this._lightbox = c, this.showCover(c); - }, t.endLightbox = function(s, c) { - c = c || t.getLightbox(); - var u = t.getEvent(this._lightbox_id); - u && this._edit_stop_event(u, s), s && t.render_view_data(), this.hideCover(c), this._custom_lightbox && (this._lightbox = this._temp_lightbox, this._custom_lightbox = !1), this._temp_lightbox = this._lightbox_id = null, this._waiAria.lightboxHiddenAttr(c), this.resetLightbox(), this.callEvent("onAfterLightbox", []); - }, t.resetLightbox = function() { - t._lightbox && !t._custom_lightbox && t._lightbox.parentNode.removeChild(t._lightbox), t._lightbox = null; - }, t.cancel_lightbox = function() { + }, a.show_cover = function() { + this._cover || (this._cover = document.createElement("div"), this._cover.className = "dhx_cal_cover", this._cover.style.display = "none", a.event(this._cover, "mousemove", a._move_while_dnd), a.event(this._cover, "mouseup", a._finish_dnd), o().appendChild(this._cover)); + }, a.save_lightbox = function() { + var l = this._lightbox_out({}, this._lame_copy(this.getEvent(this._lightbox_id))); + this.checkEvent("onEventSave") && !this.callEvent("onEventSave", [this._lightbox_id, l, this._new_event]) || (this._empty_lightbox(l), this.hide_lightbox()); + }, a.startLightbox = function(l, h) { + this._lightbox_id = l, this._custom_lightbox = !0, this._temp_lightbox = this._lightbox, this._lightbox = h, this.showCover(h); + }, a.endLightbox = function(l, h) { + h = h || a.getLightbox(); + var v = a.getEvent(this._lightbox_id); + v && this._edit_stop_event(v, l), l && a.render_view_data(), this.hideCover(h), this._custom_lightbox && (this._lightbox = this._temp_lightbox, this._custom_lightbox = !1), this._temp_lightbox = this._lightbox_id = null, this._waiAria.lightboxHiddenAttr(h), this.resetLightbox(), this.callEvent("onAfterLightbox", []); + }, a.resetLightbox = function() { + a._lightbox && !a._custom_lightbox && a._lightbox.parentNode.removeChild(a._lightbox), a._lightbox = null; + }, a.cancel_lightbox = function() { this._lightbox_id && this.callEvent("onEventCancel", [this._lightbox_id, !!this._new_event]), this.hide_lightbox(); - }, t.hideLightbox = t.cancel_lightbox, t._init_lightbox_events = function() { + }, a.hideLightbox = a.cancel_lightbox, a._init_lightbox_events = function() { if (this.getLightbox().$_eventAttached) return; - const s = this.getLightbox(); - s.$_eventAttached = !0, t.event(s, "click", function(c) { - c.target.closest(".dhx_cal_ltitle_close_btn") && t.cancel_lightbox(); - const u = t.$domHelpers.closest(c.target, ".dhx_btn_set"); - if (!u) { - const l = t.$domHelpers.closest(c.target, ".dhx_custom_button[data-section-index]"); - if (l) { - const f = Number(l.getAttribute("data-section-index")); - t.form_blocks[t.config.lightbox.sections[f].type].button_click(t.$domHelpers.closest(l, ".dhx_cal_lsection"), l, c); + const l = this.getLightbox(); + l.$_eventAttached = !0, a.event(l, "click", function(h) { + h.target.closest(".dhx_cal_ltitle_close_btn") && a.cancel_lightbox(); + const v = a.$domHelpers.closest(h.target, ".dhx_btn_set"); + if (!v) { + const c = a.$domHelpers.closest(h.target, ".dhx_custom_button[data-section-index]"); + if (c) { + const p = Number(c.getAttribute("data-section-index")); + a.form_blocks[a.config.lightbox.sections[p].type].button_click(a.$domHelpers.closest(c, ".dhx_cal_lsection"), c, h); } return; } - const v = u ? u.getAttribute("data-action") : null; - switch (v) { + const u = v ? v.getAttribute("data-action") : null; + switch (u) { case "dhx_save_btn": case "save": - if (t.config.readonly_active) + if (a.config.readonly_active) return; - t.save_lightbox(); + a.save_lightbox(); break; case "dhx_delete_btn": case "delete": - if (t.config.readonly_active) + if (a.config.readonly_active) return; - var m = t.locale.labels.confirm_deleting; - t._dhtmlx_confirm({ message: m, title: t.locale.labels.title_confirm_deleting, callback: function() { - t.deleteEvent(t._lightbox_id), t._new_event = null, t.hide_lightbox(); - }, config: { ok: t.locale.labels.icon_delete } }); + var f = a.locale.labels.confirm_deleting; + a._dhtmlx_confirm({ message: f, title: a.locale.labels.title_confirm_deleting, callback: function() { + a.deleteEvent(a._lightbox_id), a._new_event = null, a.hide_lightbox(); + }, config: { ok: a.locale.labels.icon_delete } }); break; case "dhx_cancel_btn": case "cancel": - t.cancel_lightbox(); + a.cancel_lightbox(); break; default: - t.callEvent("onLightboxButton", [v, u, c]); + a.callEvent("onLightboxButton", [u, v, h]); } - }), t.event(s, "keydown", function(c) { - var u = c || window.event, v = c.target || c.srcElement, m = v.querySelector("[dhx_button]"); - switch (m || (m = v.parentNode.querySelector(".dhx_custom_button, .dhx_readonly")), (c || u).keyCode) { + }), a.event(l, "keydown", function(h) { + var v = h || window.event, u = h.target || h.srcElement, f = u.querySelector("[dhx_button]"); + switch (f || (f = u.parentNode.querySelector(".dhx_custom_button, .dhx_readonly")), (h || v).keyCode) { case 32: - if ((c || u).shiftKey) + if ((h || v).shiftKey) return; - m && m.click && m.click(); + f && f.click && f.click(); break; - case t.keys.edit_save: - if ((c || u).shiftKey) + case a.keys.edit_save: + if ((h || v).shiftKey) return; - if (m && m.click) - m.click(); + if (f && f.click) + f.click(); else { - if (t.config.readonly_active) + if (a.config.readonly_active) return; - t.save_lightbox(); + a.save_lightbox(); } break; - case t.keys.edit_cancel: - t.cancel_lightbox(); + case a.keys.edit_cancel: + a.cancel_lightbox(); } }); - }, t.setLightboxSize = function() { - }, t._init_dnd_events = function() { - t.event(n(), "mousemove", t._move_while_dnd), t.event(n(), "mouseup", t._finish_dnd), t._init_dnd_events = function() { + }, a.setLightboxSize = function() { + }, a._init_dnd_events = function() { + a.event(o(), "mousemove", a._move_while_dnd), a.event(o(), "mouseup", a._finish_dnd), a._init_dnd_events = function() { }; - }, t._move_while_dnd = function(s) { - if (t._dnd_start_lb) { - document.dhx_unselectable || (n().classList.add("dhx_unselectable"), document.dhx_unselectable = !0); - var c = t.getLightbox(), u = [s.pageX, s.pageY]; - c.style.top = t._lb_start[1] + u[1] - t._dnd_start_lb[1] + "px", c.style.left = t._lb_start[0] + u[0] - t._dnd_start_lb[0] + "px"; - } - }, t._ready_to_dnd = function(s) { - var c = t.getLightbox(); - t._lb_start = [c.offsetLeft, c.offsetTop], t._dnd_start_lb = [s.pageX, s.pageY]; - }, t._finish_dnd = function() { - t._lb_start && (t._lb_start = t._dnd_start_lb = !1, n().classList.remove("dhx_unselectable"), document.dhx_unselectable = !1); - }, t.getLightbox = function() { + }, a._move_while_dnd = function(l) { + if (a._dnd_start_lb) { + document.dhx_unselectable || (o().classList.add("dhx_unselectable"), document.dhx_unselectable = !0); + var h = a.getLightbox(), v = [l.pageX, l.pageY]; + h.style.top = a._lb_start[1] + v[1] - a._dnd_start_lb[1] + "px", h.style.left = a._lb_start[0] + v[0] - a._dnd_start_lb[0] + "px"; + } + }, a._ready_to_dnd = function(l) { + var h = a.getLightbox(); + a._lb_start = [h.offsetLeft, h.offsetTop], a._dnd_start_lb = [l.pageX, l.pageY]; + }, a._finish_dnd = function() { + a._lb_start && (a._lb_start = a._dnd_start_lb = !1, o().classList.remove("dhx_unselectable"), document.dhx_unselectable = !1); + }, a.getLightbox = function() { if (!this._lightbox) { - var s = document.createElement("div"); - s.className = "dhx_cal_light", t.config.wide_form && (s.className += " dhx_cal_light_wide"), t.form_blocks.recurring && (s.className += " dhx_cal_light_rec"), t.config.rtl && (s.className += " dhx_cal_light_rtl"), t.config.responsive_lightbox && (s.className += " dhx_cal_light_responsive"), s.style.visibility = "hidden"; - var c = this._lightbox_template, u = this.config.buttons_left; - c += "
"; - for (var v = 0; v < u.length; v++) - c += "
" + t.locale.labels[u[v]] + "
"; - u = this.config.buttons_right; - var m = t.config.rtl; - for (v = 0; v < u.length; v++) - c += "
", c += "
" + t.locale.labels[u[v]] + "
"; - c += "
", c += "
", s.innerHTML = c, t.config.drag_lightbox && (t.event(s.firstChild, "mousedown", t._ready_to_dnd), t.event(s.firstChild, "selectstart", function(b) { + var l = document.createElement("div"); + l.className = "dhx_cal_light", a.config.wide_form && (l.className += " dhx_cal_light_wide"), a.form_blocks.recurring && (l.className += " dhx_cal_light_rec"), a.config.rtl && (l.className += " dhx_cal_light_rtl"), a.config.responsive_lightbox && (l.className += " dhx_cal_light_responsive"), l.style.visibility = "hidden"; + var h = this._lightbox_template, v = this.config.buttons_left; + h += "
"; + for (var u = 0; u < v.length; u++) + h += "
" + a.locale.labels[v[u]] + "
"; + v = this.config.buttons_right; + var f = a.config.rtl; + for (u = 0; u < v.length; u++) + h += "
", h += "
" + a.locale.labels[v[u]] + "
"; + h += "
", h += "
", l.innerHTML = h, a.config.drag_lightbox && (a.event(l.firstChild, "mousedown", a._ready_to_dnd), a.event(l.firstChild, "selectstart", function(b) { return b.preventDefault(), !1; - }), s.firstChild.style.cursor = "move", t._init_dnd_events()), this._waiAria.lightboxAttr(s), this.show_cover(), this._cover.insertBefore(s, this._cover.firstChild), this._lightbox = s; - var l = this.config.lightbox.sections; - for (c = "", v = 0; v < l.length; v++) { - var f = this.form_blocks[l[v].type]; - if (f) { - l[v].id = "area_" + this.uid(); - var g = ""; - l[v].button && (g = "
" + this.locale.labels["button_" + l[v].button] + "
"), this.config.wide_form && (c += "
"); - var p = this.locale.labels["section_" + l[v].name]; - typeof p != "string" && (p = l[v].name), c += "
" + g + "
" + f.render.call(this, l[v]), c += "
"; + }), l.firstChild.style.cursor = "move", a._init_dnd_events()), this._waiAria.lightboxAttr(l), this.show_cover(), this._cover.insertBefore(l, this._cover.firstChild), this._lightbox = l; + var c = this.config.lightbox.sections; + for (h = "", u = 0; u < c.length; u++) { + var p = this.form_blocks[c[u].type]; + if (p) { + c[u].id = "area_" + this.uid(); + var m = ""; + c[u].button && (m = "
" + this.locale.labels["button_" + c[u].button] + "
"), this.config.wide_form && (h += "
"); + var g = this.locale.labels["section_" + c[u].name]; + typeof g != "string" && (g = c[u].name), h += "
" + m + "
" + p.render.call(this, c[u]), h += "
"; } } - var y = s.getElementsByTagName("div"); - for (v = 0; v < y.length; v++) { - var w = y[v]; - if (t._getClassName(w) == "dhx_cal_larea") { - w.innerHTML = c; + var y = l.getElementsByTagName("div"); + for (u = 0; u < y.length; u++) { + var x = y[u]; + if (a._getClassName(x) == "dhx_cal_larea") { + x.innerHTML = h; break; } } - t._bindLightboxLabels(l), this.setLightboxSize(), this._init_lightbox_events(this), s.style.visibility = "visible"; + a._bindLightboxLabels(c), this.setLightboxSize(), this._init_lightbox_events(this), l.style.visibility = "visible"; } return this._lightbox; - }, t._bindLightboxLabels = function(s) { - for (var c = 0; c < s.length; c++) { - var u = s[c]; - if (u.id && t._lightbox.querySelector(`#${u.id}`)) { - for (var v = t._lightbox.querySelector(`#${u.id}`).querySelector("label"), m = t._get_lightbox_section_node(u); m && !m.querySelector; ) - m = m.nextSibling; - var l = !0; - if (m) { - var f = m.querySelector("input, select, textarea"); - f && (u.inputId = f.id || "input_" + t.uid(), f.id || (f.id = u.inputId), v.setAttribute("for", u.inputId), l = !1); + }, a._bindLightboxLabels = function(l) { + for (var h = 0; h < l.length; h++) { + var v = l[h]; + if (v.id && a._lightbox.querySelector(`#${v.id}`)) { + for (var u = a._lightbox.querySelector(`#${v.id}`).querySelector("label"), f = a._get_lightbox_section_node(v); f && !f.querySelector; ) + f = f.nextSibling; + var c = !0; + if (f) { + var p = f.querySelector("input, select, textarea"); + p && (v.inputId = p.id || "input_" + a.uid(), p.id || (p.id = v.inputId), u.setAttribute("for", v.inputId), c = !1); } - l && t.form_blocks[u.type].focus && t.event(v, "click", function(g) { + c && a.form_blocks[v.type].focus && a.event(u, "click", function(m) { return function() { - var p = t.form_blocks[g.type], y = t._get_lightbox_section_node(g); - p && p.focus && p.focus.call(t, y); + var g = a.form_blocks[m.type], y = a._get_lightbox_section_node(m); + g && g.focus && g.focus.call(a, y); }; - }(u)); + }(v)); } } - }, t.attachEvent("onEventIdChange", function(s, c) { - this._lightbox_id == s && (this._lightbox_id = c); - }), t._lightbox_template = `
  + }, a.attachEvent("onEventIdChange", function(l, h) { + this._lightbox_id == l && (this._lightbox_id = h); + }), a._lightbox_template = `
 
`; - }(h), we(h), function(t) { - t.getRootView = function() { + }(i), Bt(i), function(a) { + a.getRootView = function() { return { view: { render: function() { return { tag: "div", type: 1, attrs: { style: "width:100%;height:100%;" }, hooks: { didInsert: function() { - t.setCurrentView(); + a.setCurrentView(); } }, body: [{ el: this.el, type: 1 }] }; }, init: function() { - var n = document.createElement("DIV"); - n.id = "scheduler_" + t.uid(), n.style.width = "100%", n.style.height = "100%", n.classList.add("dhx_cal_container"), n.cmp = "grid", n.innerHTML = '
', t.init(n), this.el = n; + var o = document.createElement("DIV"); + o.id = "scheduler_" + a.uid(), o.style.width = "100%", o.style.height = "100%", o.classList.add("dhx_cal_container"), o.cmp = "grid", o.innerHTML = '
', a.init(o), this.el = o; } }, type: 4 }; }; - }(h), ke(h), window.jQuery && (r = window.jQuery, d = 0, i = [], r.fn.dhx_scheduler = function(t) { - if (typeof t != "string") { - var n = []; + }(i), Ft(i), window.jQuery && (r = window.jQuery, d = 0, n = [], r.fn.dhx_scheduler = function(a) { + if (typeof a != "string") { + var o = []; return this.each(function() { if (this && this.getAttribute) if (this.getAttribute("dhxscheduler")) - n.push(window[this.getAttribute("dhxscheduler")]); + o.push(window[this.getAttribute("dhxscheduler")]); else { - var s = "scheduler"; - d && (s = "scheduler" + (d + 1), window[s] = Scheduler.getSchedulerInstance()); - var c = window[s]; - for (var u in this.setAttribute("dhxscheduler", s), t) - u != "data" && (c.config[u] = t[u]); - this.getElementsByTagName("div").length || (this.innerHTML = '
', this.className += " dhx_cal_container"), c.init(this, c.config.date, c.config.mode), t.data && c.parse(t.data), n.push(c), d++; + var l = "scheduler"; + d && (l = "scheduler" + (d + 1), window[l] = Scheduler.getSchedulerInstance()); + var h = window[l]; + for (var v in this.setAttribute("dhxscheduler", l), a) + v != "data" && (h.config[v] = a[v]); + this.getElementsByTagName("div").length || (this.innerHTML = '
', this.className += " dhx_cal_container"), h.init(this, h.config.date, h.config.mode), a.data && h.parse(a.data), o.push(h), d++; } - }), n.length === 1 ? n[0] : n; + }), o.length === 1 ? o[0] : o; } - if (i[t]) - return i[t].apply(this, []); - r.error("Method " + t + " does not exist on jQuery.dhx_scheduler"); - }), function(t) { + if (n[a]) + return n[a].apply(this, []); + r.error("Method " + a + " does not exist on jQuery.dhx_scheduler"); + }), function(a) { (function() { - var n = t.setCurrentView, s = t.updateView, c = null, u = null, v = function(f, g) { - var p = this; - I.clearTimeout(u), I.clearTimeout(c); - var y = p._date, w = p._mode; - l(this, f, g), u = setTimeout(function() { - t.$destroyed || (p.callEvent("onBeforeViewChange", [w, y, g || p._mode, f || p._date]) ? (s.call(p, f, g), p.callEvent("onViewChange", [p._mode, p._date]), I.clearTimeout(c), u = 0) : l(p, y, w)); - }, t.config.delay_render); - }, m = function(f, g) { - var p = this, y = arguments; - l(this, f, g), I.clearTimeout(c), c = setTimeout(function() { - t.$destroyed || u || s.apply(p, y); - }, t.config.delay_render); + var o = a.setCurrentView, l = a.updateView, h = null, v = null, u = function(p, m) { + var g = this; + oe.clearTimeout(v), oe.clearTimeout(h); + var y = g._date, x = g._mode; + c(this, p, m), v = setTimeout(function() { + a.$destroyed || (g.callEvent("onBeforeViewChange", [x, y, m || g._mode, p || g._date]) ? (l.call(g, p, m), g.callEvent("onViewChange", [g._mode, g._date]), oe.clearTimeout(h), v = 0) : c(g, y, x)); + }, a.config.delay_render); + }, f = function(p, m) { + var g = this, y = arguments; + c(this, p, m), oe.clearTimeout(h), h = setTimeout(function() { + a.$destroyed || v || l.apply(g, y); + }, a.config.delay_render); }; - function l(f, g, p) { - g && (f._date = g), p && (f._mode = p); + function c(p, m, g) { + m && (p._date = m), g && (p._mode = g); } - t.attachEvent("onSchedulerReady", function() { - t.config.delay_render ? (t.setCurrentView = v, t.updateView = m) : (t.setCurrentView = n, t.updateView = s); + a.attachEvent("onSchedulerReady", function() { + a.config.delay_render ? (a.setCurrentView = u, a.updateView = f) : (a.setCurrentView = o, a.updateView = l); }); })(); - }(h), function(t) { - t.createDataProcessor = function(n) { - var s, c; - n instanceof Function ? s = n : n.hasOwnProperty("router") ? s = n.router : n.hasOwnProperty("event") && (s = n), c = s ? "CUSTOM" : n.mode || "REST-JSON"; - var u = new G(n.url); - return u.init(t), u.setTransactionMode({ mode: c, router: s }, n.batchUpdate), u; - }, t.DataProcessor = G; - }(h), function(t) { - t.attachEvent("onSchedulerReady", function() { - typeof dhtmlxError < "u" && window.dhtmlxError.catchError("LoadXML", function(n, s, c) { - var u = c[0].responseText; - switch (t.config.ajax_error) { + }(i), function(a) { + a.createDataProcessor = function(o) { + var l, h; + o instanceof Function ? l = o : o.hasOwnProperty("router") ? l = o.router : o.hasOwnProperty("event") && (l = o), h = l ? "CUSTOM" : o.mode || "REST-JSON"; + var v = new He(o.url); + return v.init(a), v.setTransactionMode({ mode: h, router: l }, o.batchUpdate), v; + }, a.DataProcessor = He; + }(i), function(a) { + a.attachEvent("onSchedulerReady", function() { + typeof dhtmlxError < "u" && window.dhtmlxError.catchError("LoadXML", function(o, l, h) { + var v = h[0].responseText; + switch (a.config.ajax_error) { case "alert": - I.alert(u); + oe.alert(v); break; case "console": - I.console.log(u); + oe.console.log(v); } }); }); - }(h); - const _ = new qe({ en: He, ar: Se, be: Ne, ca: Me, cn: Ae, cs: Ce, da: Te, de: Oe, el: $e, es: Le, fi: ze, fr: je, he: Pe, hu: Ve, id: Ie, it: Be, jp: Re, nb: Fe, nl: Je, no: Ue, pl: Ye, pt: We, ro: Ke, ru: Ge, si: Xe, sk: Ze, sv: Qe, tr: et, ua: tt }); - h.i18n = { addLocale: _.addLocale, setLocale: function(t) { - if (typeof t == "string") { - var n = _.getLocale(t); - n || (n = _.getLocale("en")), h.locale = n; - } else if (t) - if (h.locale) - for (var s in t) - t[s] && typeof t[s] == "object" ? (h.locale[s] || (h.locale[s] = {}), h.mixin(h.locale[s], t[s], !0)) : h.locale[s] = t[s]; + }(i); + const s = new ha({ en: na, ar: Kt, be: Gt, ca: Xt, cn: Zt, cs: Qt, da: ea, de: ta, el: aa, es: ra, fi: ia, fr: oa, he: sa, hu: da, id: _a, it: la, jp: ca, nb: ua, nl: fa, no: pa, pl: ma, pt: va, ro: ga, ru: ya, si: ba, sk: xa, sv: ka, tr: wa, ua: Ea }); + i.i18n = { addLocale: s.addLocale, setLocale: function(a) { + if (typeof a == "string") { + var o = s.getLocale(a); + o || (o = s.getLocale("en")), i.locale = o; + } else if (a) + if (i.locale) + for (var l in a) + a[l] && typeof a[l] == "object" ? (i.locale[l] || (i.locale[l] = {}), i.mixin(i.locale[l], a[l], !0)) : i.locale[l] = a[l]; else - h.locale = t; - var c = h.locale.labels; - c.dhx_save_btn = c.icon_save, c.dhx_cancel_btn = c.icon_cancel, c.dhx_delete_btn = c.icon_delete, h.$container && h.get_elements(); - }, getLocale: _.getLocale }, h.i18n.setLocale("en"), h.ext = {}; - const o = {}; - return h.plugins = function(t) { - (function(s, c, u) { - const v = []; - for (const m in s) - if (s[m]) { - const l = m.toLowerCase(); - c[l] && c[l].forEach(function(f) { - const g = f.toLowerCase(); - s[g] || v.push(g); - }), v.push(l); + i.locale = a; + var h = i.locale.labels; + h.dhx_save_btn = h.icon_save, h.dhx_cancel_btn = h.icon_cancel, h.dhx_delete_btn = h.icon_delete, i.$container && i.get_elements(); + }, getLocale: s.getLocale }, i.i18n.setLocale("en"), At(i), i.ext = {}; + const _ = {}; + return i.plugins = function(a) { + (function(l, h, v) { + const u = []; + for (const f in l) + if (l[f]) { + const c = f.toLowerCase(); + h[c] && h[c].forEach(function(p) { + const m = p.toLowerCase(); + l[m] || u.push(m); + }), u.push(c); } - return v.sort(function(m, l) { - const f = u[m] || 0, g = u[l] || 0; - return f > g ? 1 : f < g ? -1 : 0; - }), v; - })(t, { treetimeline: ["timeline"], daytimeline: ["timeline"], outerdrag: ["legacy"] }, { legacy: 1, limit: 1, timeline: 2, daytimeline: 3, treetimeline: 3, outerdrag: 6 }).forEach(function(s) { - if (!o[s]) { - const c = e.getExtension(s); - if (!c) - throw new Error("unknown plugin " + s); - c(h), o[s] = !0; + return u.sort(function(f, c) { + const p = v[f] || 0, m = v[c] || 0; + return p > m ? 1 : p < m ? -1 : 0; + }), u; + })(a, { treetimeline: ["timeline"], daytimeline: ["timeline"], outerdrag: ["legacy"] }, { legacy: 1, limit: 1, timeline: 2, daytimeline: 3, treetimeline: 3, outerdrag: 6 }).forEach(function(l) { + if (!_[l]) { + const h = e.getExtension(l); + if (!h) + throw new Error("unknown plugin " + l); + h(i), _[l] = !0; } }); - }, h; + }, i; } -class it { - constructor(h) { +class Na { + constructor(i) { this._extensions = {}; - for (const a in h) - this._extensions[a] = h[a]; + for (const t in i) + this._extensions[t] = i[t]; } - addExtension(h, a) { - this._extensions[h] = a; + addExtension(i, t) { + this._extensions[i] = t; } - getExtension(h) { - return this._extensions[h]; + getExtension(i) { + return this._extensions[i]; } } -typeof dhtmlx < "u" && dhtmlx.attaches && (dhtmlx.attaches.attachScheduler = function(e, h, a, r) { - a = a || '
'; +typeof dhtmlx < "u" && dhtmlx.attaches && (dhtmlx.attaches.attachScheduler = function(e, i, t, r) { + t = t || '
'; var d = document.createElement("DIV"); - return d.id = "dhxSchedObj_" + this._genStr(12), d.innerHTML = '
' + a + '
', document.body.appendChild(d.firstChild), this.attachObject(d.id, !1, !0), this.vs[this.av].sched = r, this.vs[this.av].schedId = d.id, r.setSizes = r.updateView, r.destructor = function() { - }, r.init(d.id, e, h), this.vs[this._viewRestore()].sched; + return d.id = "dhxSchedObj_" + this._genStr(12), d.innerHTML = '
' + t + '
', document.body.appendChild(d.firstChild), this.attachObject(d.id, !1, !0), this.vs[this.av].sched = r, this.vs[this.av].schedId = d.id, r.setSizes = r.updateView, r.destructor = function() { + }, r.init(d.id, e, i), this.vs[this._viewRestore()].sched; }); -const R = (e, h) => { - h(!1, `The ${e} extension is not included in this version of dhtmlxScheduler.
+const de = (e, i) => { + i(!1, `The ${e} extension is not included in this version of dhtmlxScheduler.
You may need a Professional version of the component.
Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`); }; -function rt(e) { +function Ma(e) { (function() { - var h = []; - function a() { - return !!h.length; + var i = []; + function t() { + return !!i.length; } - function r(o) { + function r(_) { setTimeout(function() { if (e.$destroyed) return !0; - a() || function(t, n) { - for (; t && t != n; ) - t = t.parentNode; - return t == n; + t() || function(a, o) { + for (; a && a != o; ) + a = a.parentNode; + return a == o; }(document.activeElement, e.$container) || e.focus(); }, 1); } - function d(o) { - var t = (o = o || window.event).currentTarget; - t == h[h.length - 1] && e.$keyboardNavigation.trapFocus(t, o); + function d(_) { + var a = (_ = _ || window.event).currentTarget; + a == i[i.length - 1] && e.$keyboardNavigation.trapFocus(a, _); } if (e.attachEvent("onLightbox", function() { - var o; - o = e.getLightbox(), e.eventRemove(o, "keydown", d), e.event(o, "keydown", d), h.push(o); + var _; + _ = e.getLightbox(), e.eventRemove(_, "keydown", d), e.event(_, "keydown", d), i.push(_); }), e.attachEvent("onAfterLightbox", function() { - var o = h.pop(); - o && e.eventRemove(o, "keydown", d), r(); + var _ = i.pop(); + _ && e.eventRemove(_, "keydown", d), r(); }), e.attachEvent("onAfterQuickInfo", function() { r(); }), !e._keyNavMessagePopup) { e._keyNavMessagePopup = !0; - var i = null, _ = null; - const o = []; - e.attachEvent("onMessagePopup", function(t) { - for (i = document.activeElement, _ = i; _ && e._getClassName(_).indexOf("dhx_cal_data") < 0; ) - _ = _.parentNode; - _ && (_ = _.parentNode), e.eventRemove(t, "keydown", d), e.event(t, "keydown", d), o.push(t); + var n = null, s = null; + const _ = []; + e.attachEvent("onMessagePopup", function(a) { + for (n = document.activeElement, s = n; s && e._getClassName(s).indexOf("dhx_cal_data") < 0; ) + s = s.parentNode; + s && (s = s.parentNode), e.eventRemove(a, "keydown", d), e.event(a, "keydown", d), _.push(a); }), e.attachEvent("onAfterMessagePopup", function() { - var t = o.pop(); - t && e.eventRemove(t, "keydown", d), setTimeout(function() { + var a = _.pop(); + a && e.eventRemove(a, "keydown", d), setTimeout(function() { if (e.$destroyed) return !0; - for (var n = document.activeElement; n && e._getClassName(n).indexOf("dhx_cal_light") < 0; ) - n = n.parentNode; - n || (i && i.parentNode ? i.focus() : _ && _.parentNode && _.focus(), i = null, _ = null); + for (var o = document.activeElement; o && e._getClassName(o).indexOf("dhx_cal_light") < 0; ) + o = o.parentNode; + o || (n && n.parentNode ? n.focus() : s && s.parentNode && s.focus(), n = null, s = null); }, 1); }); } - e.$keyboardNavigation.isModal = a; + e.$keyboardNavigation.isModal = t; })(); } -function ot(e) { +function Ta(e) { e._temp_key_scope = function() { e.config.key_nav = !0, e.$keyboardNavigation._pasteDate = null, e.$keyboardNavigation._pasteSection = null; - var h = null, a = {}; - function r(_) { - _ = _ || window.event, a.x = _.clientX, a.y = _.clientY; + var i = null, t = {}; + function r(s) { + s = s || window.event, t.x = s.clientX, t.y = s.clientY; } function d() { - for (var _, o, t = document.elementFromPoint(a.x, a.y); t && t != e._obj; ) - t = t.parentNode; - return _ = t == e._obj, o = e.$keyboardNavigation.dispatcher.isEnabled(), _ || o; + for (var s, _, a = document.elementFromPoint(t.x, t.y); a && a != e._obj; ) + a = a.parentNode; + return s = a == e._obj, _ = e.$keyboardNavigation.dispatcher.isEnabled(), s || _; + } + function n(s) { + return e._lame_copy({}, s); + } + document.body ? e.event(document.body, "mousemove", r) : e.event(window, "load", function() { + e.event(document.body, "mousemove", r); + }), e.attachEvent("onMouseMove", function(s, _) { + var a = e.getState(); + if (a.mode && a.min_date) { + var o = e.getActionData(_); + e.$keyboardNavigation._pasteDate = o.date, e.$keyboardNavigation._pasteSection = o.section; + } + }), e._make_pasted_event = function(s) { + var _ = e.$keyboardNavigation._pasteDate, a = e.$keyboardNavigation._pasteSection, o = s.end_date - s.start_date, l = n(s); + if (function(v) { + delete v.rec_type, delete v.rec_pattern, delete v.event_pid, delete v.event_length; + }(l), l.start_date = new Date(_), l.end_date = new Date(l.start_date.valueOf() + o), a) { + var h = e._get_section_property(); + e.config.multisection ? l[h] = s[h] : l[h] = a; + } + return l; + }, e._do_paste = function(s, _, a) { + e.callEvent("onBeforeEventPasted", [s, _, a]) !== !1 && (e.addEvent(_), e.callEvent("onEventPasted", [s, _, a])); + }, e._is_key_nav_active = function() { + return !(!this._is_initialized() || this._is_lightbox_open() || !this.config.key_nav); + }, e.event(document, "keydown", function(s) { + (s.ctrlKey || s.metaKey) && s.keyCode == 86 && e._buffer_event && !e.$keyboardNavigation.dispatcher.isEnabled() && (e.$keyboardNavigation.dispatcher.isActive = d()); + }), e._key_nav_copy_paste = function(s) { + if (!e._is_key_nav_active()) + return !0; + if (s.keyCode == 37 || s.keyCode == 39) { + s.cancelBubble = !0; + var _ = e.date.add(e._date, s.keyCode == 37 ? -1 : 1, e._mode); + return e.setCurrentView(_), !0; + } + var a, o = (a = e.$keyboardNavigation.dispatcher.getActiveNode()) && a.eventId ? a.eventId : e._select_id; + if ((s.ctrlKey || s.metaKey) && s.keyCode == 67) + return o && (e._buffer_event = n(e.getEvent(o)), i = !0, e.callEvent("onEventCopied", [e.getEvent(o)])), !0; + if ((s.ctrlKey || s.metaKey) && s.keyCode == 88 && o) { + i = !1; + var l = e._buffer_event = n(e.getEvent(o)); + e.updateEvent(l.id), e.callEvent("onEventCut", [l]); + } + if ((s.ctrlKey || s.metaKey) && s.keyCode == 86 && d()) { + if (l = (l = e._buffer_event ? e.getEvent(e._buffer_event.id) : e._buffer_event) || e._buffer_event) { + var h = e._make_pasted_event(l); + i ? (h.id = e.uid(), e._do_paste(i, h, l)) : e.callEvent("onBeforeEventChanged", [h, s, !1, l]) && (e._do_paste(i, h, l), i = !0); + } + return !0; + } + }; + }, e._temp_key_scope(); +} +function Aa(e) { + e.$keyboardNavigation.attachSchedulerHandlers = function() { + var i, t = e.$keyboardNavigation.dispatcher, r = function(a) { + if (e.config.key_nav) + return t.keyDownHandler(a); + }, d = function() { + t.keepScrollPosition(function() { + t.focusGlobalNode(); + }); + }; + e.attachEvent("onDataRender", function() { + e.config.key_nav && t.isEnabled() && !e.getState().editor_id && (clearTimeout(i), i = setTimeout(function() { + if (e.$destroyed) + return !0; + t.isEnabled() || t.enable(), n(); + })); + }); + var n = function() { + if (t.isEnabled()) { + var a = t.getActiveNode(); + a && (a.isValid() || (a = a.fallback()), !a || a instanceof e.$keyboardNavigation.MinicalButton || a instanceof e.$keyboardNavigation.MinicalCell || t.keepScrollPosition(function() { + a.focus(!0); + })); + } + }; + function s(a) { + if (!e.config.key_nav) + return !0; + const o = e.getView(); + let l = !1; + if (e.getState().mode === "month") + l = e.$keyboardNavigation.isChildOf(a.target || a.srcElement, e.$container.querySelector(".dhx_cal_month_table")); + else if (o && o.layout === "timeline") + l = e.$keyboardNavigation.isChildOf(a.target || a.srcElement, e.$container.querySelector(".dhx_timeline_data_col")); + else { + const u = e.$container.querySelectorAll(".dhx_scale_holder"); + l = Array.from(u).some((f) => f === a.target.parentNode); + } + var h, v = e.getActionData(a); + e._locate_event(a.target || a.srcElement) ? h = new e.$keyboardNavigation.Event(e._locate_event(a.target || a.srcElement)) : l && (h = new e.$keyboardNavigation.TimeSlot(), v.date && l && (h = h.nextSlot(new e.$keyboardNavigation.TimeSlot(v.date, null, v.section)))), h && (t.isEnabled() ? v.date && l && t.delay(function() { + t.setActiveNode(h); + }) : t.activeNode = h); + } + e.attachEvent("onSchedulerReady", function() { + var a = e.$container; + e.eventRemove(document, "keydown", r), e.eventRemove(a, "mousedown", s), e.eventRemove(a, "focus", d), e.config.key_nav ? (e.event(document, "keydown", r), e.event(a, "mousedown", s), e.event(a, "focus", d), a.setAttribute("tabindex", "0")) : a.removeAttribute("tabindex"); + }); + var _ = e.updateEvent; + e.updateEvent = function(a) { + var o = _.apply(this, arguments); + if (e.config.key_nav && t.isEnabled() && e.getState().select_id == a) { + var l = new e.$keyboardNavigation.Event(a); + e.getState().lightbox_id || function(h) { + if (e.config.key_nav && t.isEnabled()) { + var v = h, u = new e.$keyboardNavigation.Event(v.eventId); + if (!u.isValid()) { + var f = u.start || v.start, c = u.end || v.end, p = u.section || v.section; + (u = new e.$keyboardNavigation.TimeSlot(f, c, p)).isValid() || (u = new e.$keyboardNavigation.TimeSlot()); + } + t.setActiveNode(u); + var m = t.getActiveNode(); + m && m.getNode && document.activeElement != m.getNode() && t.focusNode(t.getActiveNode()); + } + }(l); + } + return o; + }, e.attachEvent("onEventDeleted", function(a) { + return e.config.key_nav && t.isEnabled() && t.getActiveNode().eventId == a && t.setActiveNode(new e.$keyboardNavigation.TimeSlot()), !0; + }), e.attachEvent("onClearAll", function() { + if (!e.config.key_nav) + return !0; + t.isEnabled() && t.getActiveNode() instanceof e.$keyboardNavigation.Event && t.setActiveNode(new e.$keyboardNavigation.TimeSlot()); + }); + }; +} +class Ca { + constructor(i) { + this.map = null, this._markers = [], this.scheduler = i; + } + onEventClick(i) { + if (this._markers && this._markers.length > 0) { + for (let t = 0; t < this._markers.length; t++) + if (i.id == this._markers[t].event.id) { + let r = this.settings.zoom_after_resolve || this.settings.initial_zoom; + i.lat && i.lng ? (this.map.setCenter({ lat: i.lat, lng: i.lng }), this.map.setZoom(r)) : (this.map.setCenter({ lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }), this.map.setZoom(r)), google.maps.event.trigger(this._markers[t].marker, "click"); + } + } + } + initialize(i, t) { + this.settings = t; + let r = this.scheduler, d = { center: { lat: t.initial_position.lat, lng: t.initial_position.lng }, zoom: t.initial_zoom, mapId: i.id, scrollwheel: !0, mapTypeId: t.type }; + if (this.map === null) + this.map = new google.maps.Map(i, d); + else { + let n = this.map; + i.appendChild(this.map.__gm.messageOverlay), i.appendChild(this.map.__gm.outerContainer), setTimeout(function() { + n.setOptions({ container: i.id }); + }, 500); + } + google.maps.event.addListener(this.map, "dblclick", function(n) { + const s = new google.maps.Geocoder(); + if (!r.config.readonly && r.config.dblclick_create) { + let _ = n.latLng; + s.geocode({ latLng: _ }, function(a, o) { + o == google.maps.GeocoderStatus.OK ? (_ = a[0].geometry.location, r.addEventNow({ lat: _.lat(), lng: _.lng(), event_location: a[0].formatted_address, start_date: r.getState().date, end_date: r.date.add(r.getState().date, r.config.time_step, "minute") })) : console.error("Geocode was not successful for the following reason: " + o); + }); + } + }); + } + destroy(i) { + for (google.maps.event.clearInstanceListeners(window), google.maps.event.clearInstanceListeners(document), google.maps.event.clearInstanceListeners(i); i.firstChild; ) + i.firstChild.remove(); + i.innerHTML = ""; + } + async addEventMarker(i) { + let t = { title: i.text, position: {}, map: {} }; + i.lat && i.lng ? t.position = { lat: i.lat, lng: i.lng } : t.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }; + const { AdvancedMarkerElement: r } = await google.maps.importLibrary("marker"); + let d; + this.scheduler.ext.mapView.createMarker ? (t.map = this.map, d = this.scheduler.ext.mapView.createMarker(t)) : (d = new r(t), d.map = this.map), d.setMap(this.map), i["!nativeeditor_status"] == "true_deleted" && d.setMap(null), google.maps.event.addListener(d, "click", () => { + this.infoWindow && this.infoWindow.close(), this.infoWindow = new google.maps.InfoWindow({ maxWidth: this.settings.info_window_max_width }), this.infoWindow.setContent(this.scheduler.templates.map_info_content(i)), this.infoWindow.open({ anchor: d, map: this.map }); + }); + let n = { event: i, ...t, marker: d }; + this._markers.push(n); + } + removeEventMarker(i) { + for (let t = 0; t < this._markers.length; t++) + i == this._markers[t].event.id && (this._markers[t].marker.setVisible(!1), this._markers[t].marker.setMap(null), this._markers[t].marker.setPosition(null), this._markers[t].marker = null, this._markers.splice(t, 1), t--); + } + updateEventMarker(i) { + for (let t = 0; t < this._markers.length; t++) + if (this._markers[t].event.id == i.id) { + this._markers[t].event = i, this._markers[t].position.lat = i.lat, this._markers[t].position.lng = i.lng, this._markers[t].text = i.text; + let r = new google.maps.LatLng(i.lat, i.lng); + this._markers[t].marker.setPosition(r); + } + } + clearEventMarkers() { + if (this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) + this._markers[i].marker.setMap(null); + this._markers = []; + } + } + setView(i, t, r) { + this.map.setCenter({ lat: i, lng: t }), this.map.setZoom(r); + } + async resolveAddress(i) { + const t = new google.maps.Geocoder(); + return await new Promise((r) => { + t.geocode({ address: i }, function(d, n) { + n == google.maps.GeocoderStatus.OK ? r({ lat: d[0].geometry.location.lat(), lng: d[0].geometry.location.lng() }) : (console.error("Geocode was not successful for the following reason: " + n), r({})); + }); + }); + } +} +class Oa { + constructor(i) { + this.map = null, this._markers = [], this.scheduler = i; + } + onEventClick(i) { + if (this._markers && this._markers.length > 0) + for (let t = 0; t < this._markers.length; t++) + i.id == this._markers[t].event.id && (this._markers[t].marker.openPopup(), this._markers[t].marker.closeTooltip(), i.lat && i.lng ? this.setView(i.lat, i.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom) : this.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom)); + } + initialize(i, t) { + let r = this.scheduler, d = document.createElement("div"); + d.className = "mapWrapper", d.id = "mapWrapper", d.style.width = i.style.width, d.style.height = i.style.height, i.appendChild(d); + let n = L.map(d, { center: L.latLng(t.initial_position.lat, t.initial_position.lng), zoom: t.initial_zoom, keyboard: !1 }); + L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(n), n.on("dblclick", async function(s) { + let _ = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${s.latlng.lat}&lon=${s.latlng.lng}&format=json`, { method: "GET", headers: { "Accept-Language": "en" } }).then((a) => a.json()); + if (_.address) { + let a = _.address.country; + r.addEventNow({ lat: s.latlng.lat, lng: s.latlng.lng, event_location: a, start_date: r.getState().date, end_date: r.date.add(r.getState().date, r.config.time_step, "minute") }); + } else + console.error("unable recieve a position of the event", _.error); + }), this.map = n, this.settings = t; + } + destroy(i) { + for (this.map.remove(); i.firstChild; ) + i.firstChild.remove(); + i.innerHTML = ""; + } + addEventMarker(i) { + const t = L.icon({ iconUrl: "https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png", iconSize: [25, 41], shadowSize: [30, 65], iconAnchor: [12, 41], shadowAnchor: [7, 65] }); + let r = { minWidth: 180, maxWidth: this.settings.info_window_max_width }; + const d = L.popup(r).setContent(this.scheduler.templates.map_info_content(i)), n = L.tooltip().setContent(i.text); + let s = [i.lat, i.lng]; + i.lat && i.lng || (s = [this.settings.error_position.lat, this.settings.error_position.lng]); + const _ = { event: i, marker: L.marker(s, { icon: t }).bindPopup(d).bindTooltip(n).addTo(this.map) }; + this._markers.push(_); + } + removeEventMarker(i) { + for (let t = 0; t < this._markers.length; t++) + i == this._markers[t].event.id && (this.map.removeLayer(this._markers[t].marker), this._markers.splice(t, 1), t--); + } + updateEventMarker(i) { + for (let t = 0; t < this._markers.length; t++) + this._markers[t].event.id == i.id && (this._markers[t].event = i, i.lat && i.lng ? this._markers[t].marker.setLatLng([i.lat, i.lng]) : this._markers[t].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng])); + } + clearEventMarkers() { + if (this._markers) { + for (let i = 0; i < this._markers.length; i++) + this.map.removeLayer(this._markers[i].marker); + this._markers = []; + } + } + setView(i, t, r) { + this.map.setView([i, t], r); + } + async resolveAddress(i) { + let t = {}, r = await fetch(`https://nominatim.openstreetmap.org/search?q=${i}&format=json`, { method: "GET", headers: { "Accept-Language": "en" } }).then((d) => d.json()); + return r && r.length ? (t.lat = +r[0].lat, t.lng = +r[0].lon) : console.error(`Unable recieve a position of the event's location: ${i}`), t; + } +} +class La { + constructor(i) { + this.map = null, this._markers = [], this.scheduler = i; + } + onEventClick(i) { + if (this._markers && this._markers.length > 0) + for (let t = 0; t < this._markers.length; t++) { + const r = this._markers[t].marker.getPopup(); + r.isOpen() && r.remove(), i.id == this._markers[t].event.id && (this._markers[t].marker.togglePopup(), i.lat && i.lng ? this.setView(i.lat, i.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom) : this.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom)); + } + } + initialize(i, t) { + let r = this.scheduler; + mapboxgl.accessToken = t.accessToken; + const d = new mapboxgl.Map({ container: i, center: [t.initial_position.lng, t.initial_position.lat], zoom: t.initial_zoom + 1 }); + d.on("dblclick", async function(n) { + let s = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${n.lngLat.lng},${n.lngLat.lat}.json?access_token=${t.accessToken}`).then((_) => _.json()); + if (s.features) { + let _ = s.features[0].place_name; + r.addEventNow({ lat: n.lngLat.lat, lng: n.lngLat.lng, event_location: _, start_date: r.getState().date, end_date: r.date.add(r.getState().date, r.config.time_step, "minute") }); + } else + console.error("unable recieve a position of the event"); + }), this.map = d, this.settings = t; + } + destroy(i) { + for (this.map.remove(); i.firstChild; ) + i.firstChild.remove(); + i.innerHTML = ""; + } + addEventMarker(i) { + let t = [i.lng, i.lat]; + i.lat && i.lng || (t = [this.settings.error_position.lng, this.settings.error_position.lat]); + const r = new mapboxgl.Popup({ offset: 25, focusAfterOpen: !1 }).setMaxWidth(`${this.settings.info_window_max_width}px`).setHTML(this.scheduler.templates.map_info_content(i)), d = { event: i, marker: new mapboxgl.Marker().setLngLat(t).setPopup(r).addTo(this.map) }; + this._markers.push(d); + } + removeEventMarker(i) { + for (let t = 0; t < this._markers.length; t++) + i == this._markers[t].event.id && (this._markers[t].marker.remove(), this._markers.splice(t, 1), t--); + } + updateEventMarker(i) { + for (let t = 0; t < this._markers.length; t++) + this._markers[t].event.id == i.id && (this._markers[t].event = i, i.lat && i.lng ? this._markers[t].marker.setLngLat([i.lng, i.lat]) : this._markers[t].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat])); + } + clearEventMarkers() { + for (let i = 0; i < this._markers.length; i++) + this._markers[i].marker.remove(); + this._markers = []; + } + setView(i, t, r) { + this.map.setCenter([t, i]), this.map.setZoom(r); + } + async resolveAddress(i) { + let t = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${i}.json?access_token=${this.settings.accessToken}`).then((d) => d.json()), r = {}; + return t && t.features.length ? (r.lng = t.features[0].center[0], r.lat = t.features[0].center[1]) : console.error(`Unable recieve a position of the event's location: ${i}`), r; + } +} +var $e = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"], K = function() { + function e(i, t) { + if (t === 0) + throw new Error("Can't create weekday with n == 0"); + this.weekday = i, this.n = t; + } + return e.fromStr = function(i) { + return new e($e.indexOf(i)); + }, e.prototype.nth = function(i) { + return this.n === i ? this : new e(this.weekday, i); + }, e.prototype.equals = function(i) { + return this.weekday === i.weekday && this.n === i.n; + }, e.prototype.toString = function() { + var i = $e[this.weekday]; + return this.n && (i = (this.n > 0 ? "+" : "") + String(this.n) + i), i; + }, e.prototype.getJsWeekday = function() { + return this.weekday === 6 ? 0 : this.weekday + 1; + }, e; +}(), U = function(e) { + return e != null; +}, te = function(e) { + return typeof e == "number"; +}, Ge = function(e) { + return typeof e == "string" && $e.includes(e); +}, G = Array.isArray, ne = function(e, i) { + i === void 0 && (i = e), arguments.length === 1 && (i = e, e = 0); + for (var t = [], r = e; r < i; r++) + t.push(r); + return t; +}, P = function(e, i) { + var t = 0, r = []; + if (G(e)) + for (; t < i; t++) + r[t] = [].concat(e); + else + for (; t < i; t++) + r[t] = e; + return r; +}; +function ue(e, i, t) { + t === void 0 && (t = " "); + var r = String(e); + return i >>= 0, r.length > i ? String(r) : ((i -= r.length) > t.length && (t += P(t, i / t.length)), t.slice(0, i) + String(r)); +} +var Ha = function(e, i, t) { + var r = e.split(i); + return t ? r.slice(0, t).concat([r.slice(t).join(i)]) : r; +}, Z = function(e, i) { + var t = e % i; + return t * i < 0 ? t + i : t; +}, Ae = function(e, i) { + return { div: Math.floor(e / i), mod: Z(e, i) }; +}, ae = function(e) { + return !U(e) || e.length === 0; +}, B = function(e) { + return !ae(e); +}, R = function(e, i) { + return B(e) && e.indexOf(i) !== -1; +}, he = function(e, i, t, r, d, n) { + return r === void 0 && (r = 0), d === void 0 && (d = 0), n === void 0 && (n = 0), new Date(Date.UTC(e, i - 1, t, r, d, n)); +}, $a = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], vt = 864e5, gt = 9999, yt = he(1970, 1, 1), za = [6, 0, 1, 2, 3, 4, 5], ge = function(e) { + return e % 4 == 0 && e % 100 != 0 || e % 400 == 0; +}, bt = function(e) { + return e instanceof Date; +}, ye = function(e) { + return bt(e) && !isNaN(e.getTime()); +}, ze = function(e) { + return i = yt, t = e.getTime() - i.getTime(), Math.round(t / vt); + var i, t; +}, xt = function(e) { + return new Date(yt.getTime() + e * vt); +}, qa = function(e) { + var i = e.getUTCMonth(); + return i === 1 && ge(e.getUTCFullYear()) ? 29 : $a[i]; +}, me = function(e) { + return za[e.getUTCDay()]; +}, Xe = function(e, i) { + var t = he(e, i + 1, 1); + return [me(t), qa(t)]; +}, kt = function(e, i) { + return i = i || e, new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds())); +}, qe = function(e) { + return new Date(e.getTime()); +}, Ze = function(e) { + for (var i = [], t = 0; t < e.length; t++) + i.push(qe(e[t])); + return i; +}, be = function(e) { + e.sort(function(i, t) { + return i.getTime() - t.getTime(); + }); +}, Ve = function(e, i) { + i === void 0 && (i = !0); + var t = new Date(e); + return [ue(t.getUTCFullYear().toString(), 4, "0"), ue(t.getUTCMonth() + 1, 2, "0"), ue(t.getUTCDate(), 2, "0"), "T", ue(t.getUTCHours(), 2, "0"), ue(t.getUTCMinutes(), 2, "0"), ue(t.getUTCSeconds(), 2, "0"), i ? "Z" : ""].join(""); +}, Be = function(e) { + var i = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e); + if (!i) + throw new Error("Invalid UNTIL value: ".concat(e)); + return new Date(Date.UTC(parseInt(i[1], 10), parseInt(i[2], 10) - 1, parseInt(i[3], 10), parseInt(i[5], 10) || 0, parseInt(i[6], 10) || 0, parseInt(i[7], 10) || 0)); +}, Qe = function(e, i) { + return e.toLocaleString("sv-SE", { timeZone: i }).replace(" ", "T") + "Z"; +}, pe = function() { + function e(i, t) { + this.minDate = null, this.maxDate = null, this._result = [], this.total = 0, this.method = i, this.args = t, i === "between" ? (this.maxDate = t.inc ? t.before : new Date(t.before.getTime() - 1), this.minDate = t.inc ? t.after : new Date(t.after.getTime() + 1)) : i === "before" ? this.maxDate = t.inc ? t.dt : new Date(t.dt.getTime() - 1) : i === "after" && (this.minDate = t.inc ? t.dt : new Date(t.dt.getTime() + 1)); + } + return e.prototype.accept = function(i) { + ++this.total; + var t = this.minDate && i < this.minDate, r = this.maxDate && i > this.maxDate; + if (this.method === "between") { + if (t) + return !0; + if (r) + return !1; + } else if (this.method === "before") { + if (r) + return !1; + } else if (this.method === "after") + return !!t || (this.add(i), !1); + return this.add(i); + }, e.prototype.add = function(i) { + return this._result.push(i), !0; + }, e.prototype.getValue = function() { + var i = this._result; + switch (this.method) { + case "all": + case "between": + return i; + default: + return i.length ? i[i.length - 1] : null; + } + }, e.prototype.clone = function() { + return new e(this.method, this.args); + }, e; +}(), je = function(e, i) { + return je = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) { + t.__proto__ = r; + } || function(t, r) { + for (var d in r) + Object.prototype.hasOwnProperty.call(r, d) && (t[d] = r[d]); + }, je(e, i); +}; +function Fe(e, i) { + if (typeof i != "function" && i !== null) + throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); + function t() { + this.constructor = e; + } + je(e, i), e.prototype = i === null ? Object.create(i) : (t.prototype = i.prototype, new t()); +} +var X = function() { + return X = Object.assign || function(e) { + for (var i, t = 1, r = arguments.length; t < r; t++) + for (var d in i = arguments[t]) + Object.prototype.hasOwnProperty.call(i, d) && (e[d] = i[d]); + return e; + }, X.apply(this, arguments); +}; +function O(e, i, t) { + if (t || arguments.length === 2) + for (var r, d = 0, n = i.length; d < n; d++) + !r && d in i || (r || (r = Array.prototype.slice.call(i, 0, d)), r[d] = i[d]); + return e.concat(r || Array.prototype.slice.call(i)); +} +var I, et = function(e) { + function i(t, r, d) { + var n = e.call(this, t, r) || this; + return n.iterator = d, n; + } + return Fe(i, e), i.prototype.add = function(t) { + return !!this.iterator(t, this._result.length) && (this._result.push(t), !0); + }, i; +}(pe), ke = { dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], tokens: { SKIP: /^[ \r\n\t]+|^\.$/, number: /^[1-9][0-9]*/, numberAsText: /^(one|two|three)/i, every: /^every/i, "day(s)": /^days?/i, "weekday(s)": /^weekdays?/i, "week(s)": /^weeks?/i, "hour(s)": /^hours?/i, "minute(s)": /^minutes?/i, "month(s)": /^months?/i, "year(s)": /^years?/i, on: /^(on|in)/i, at: /^(at)/i, the: /^the/i, first: /^first/i, second: /^second/i, third: /^third/i, nth: /^([1-9][0-9]*)(\.|th|nd|rd|st)/i, last: /^last/i, for: /^for/i, "time(s)": /^times?/i, until: /^(un)?til/i, monday: /^mo(n(day)?)?/i, tuesday: /^tu(e(s(day)?)?)?/i, wednesday: /^we(d(n(esday)?)?)?/i, thursday: /^th(u(r(sday)?)?)?/i, friday: /^fr(i(day)?)?/i, saturday: /^sa(t(urday)?)?/i, sunday: /^su(n(day)?)?/i, january: /^jan(uary)?/i, february: /^feb(ruary)?/i, march: /^mar(ch)?/i, april: /^apr(il)?/i, may: /^may/i, june: /^june?/i, july: /^july?/i, august: /^aug(ust)?/i, september: /^sep(t(ember)?)?/i, october: /^oct(ober)?/i, november: /^nov(ember)?/i, december: /^dec(ember)?/i, comma: /^(,\s*|(and|or)\s*)+/i } }, tt = function(e, i) { + return e.indexOf(i) !== -1; +}, ja = function(e) { + return e.toString(); +}, Pa = function(e, i, t) { + return "".concat(i, " ").concat(t, ", ").concat(e); +}, ie = function() { + function e(i, t, r, d) { + if (t === void 0 && (t = ja), r === void 0 && (r = ke), d === void 0 && (d = Pa), this.text = [], this.language = r || ke, this.gettext = t, this.dateFormatter = d, this.rrule = i, this.options = i.options, this.origOptions = i.origOptions, this.origOptions.bymonthday) { + var n = [].concat(this.options.bymonthday), s = [].concat(this.options.bynmonthday); + n.sort(function(l, h) { + return l - h; + }), s.sort(function(l, h) { + return h - l; + }), this.bymonthday = n.concat(s), this.bymonthday.length || (this.bymonthday = null); + } + if (U(this.origOptions.byweekday)) { + var _ = G(this.origOptions.byweekday) ? this.origOptions.byweekday : [this.origOptions.byweekday], a = String(_); + this.byweekday = { allWeeks: _.filter(function(l) { + return !l.n; + }), someWeeks: _.filter(function(l) { + return !!l.n; + }), isWeekdays: a.indexOf("MO") !== -1 && a.indexOf("TU") !== -1 && a.indexOf("WE") !== -1 && a.indexOf("TH") !== -1 && a.indexOf("FR") !== -1 && a.indexOf("SA") === -1 && a.indexOf("SU") === -1, isEveryDay: a.indexOf("MO") !== -1 && a.indexOf("TU") !== -1 && a.indexOf("WE") !== -1 && a.indexOf("TH") !== -1 && a.indexOf("FR") !== -1 && a.indexOf("SA") !== -1 && a.indexOf("SU") !== -1 }; + var o = function(l, h) { + return l.weekday - h.weekday; + }; + this.byweekday.allWeeks.sort(o), this.byweekday.someWeeks.sort(o), this.byweekday.allWeeks.length || (this.byweekday.allWeeks = null), this.byweekday.someWeeks.length || (this.byweekday.someWeeks = null); + } else + this.byweekday = null; + } + return e.isFullyConvertible = function(i) { + if (!(i.options.freq in e.IMPLEMENTED) || i.origOptions.until && i.origOptions.count) + return !1; + for (var t in i.origOptions) { + if (tt(["dtstart", "tzid", "wkst", "freq"], t)) + return !0; + if (!tt(e.IMPLEMENTED[i.options.freq], t)) + return !1; + } + return !0; + }, e.prototype.isFullyConvertible = function() { + return e.isFullyConvertible(this.rrule); + }, e.prototype.toString = function() { + var i = this.gettext; + if (!(this.options.freq in e.IMPLEMENTED)) + return i("RRule error: Unable to fully convert this rrule to text"); + if (this.text = [i("every")], this[C.FREQUENCIES[this.options.freq]](), this.options.until) { + this.add(i("until")); + var t = this.options.until; + this.add(this.dateFormatter(t.getUTCFullYear(), this.language.monthNames[t.getUTCMonth()], t.getUTCDate())); + } else + this.options.count && this.add(i("for")).add(this.options.count.toString()).add(this.plural(this.options.count) ? i("times") : i("time")); + return this.isFullyConvertible() || this.add(i("(~ approximate)")), this.text.join(""); + }, e.prototype.HOURLY = function() { + var i = this.gettext; + this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? i("hours") : i("hour")); + }, e.prototype.MINUTELY = function() { + var i = this.gettext; + this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? i("minutes") : i("minute")); + }, e.prototype.DAILY = function() { + var i = this.gettext; + this.options.interval !== 1 && this.add(this.options.interval.toString()), this.byweekday && this.byweekday.isWeekdays ? this.add(this.plural(this.options.interval) ? i("weekdays") : i("weekday")) : this.add(this.plural(this.options.interval) ? i("days") : i("day")), this.origOptions.bymonth && (this.add(i("in")), this._bymonth()), this.bymonthday ? this._bymonthday() : this.byweekday ? this._byweekday() : this.origOptions.byhour && this._byhour(); + }, e.prototype.WEEKLY = function() { + var i = this.gettext; + this.options.interval !== 1 && this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? i("weeks") : i("week")), this.byweekday && this.byweekday.isWeekdays ? this.options.interval === 1 ? this.add(this.plural(this.options.interval) ? i("weekdays") : i("weekday")) : this.add(i("on")).add(i("weekdays")) : this.byweekday && this.byweekday.isEveryDay ? this.add(this.plural(this.options.interval) ? i("days") : i("day")) : (this.options.interval === 1 && this.add(i("week")), this.origOptions.bymonth && (this.add(i("in")), this._bymonth()), this.bymonthday ? this._bymonthday() : this.byweekday && this._byweekday(), this.origOptions.byhour && this._byhour()); + }, e.prototype.MONTHLY = function() { + var i = this.gettext; + this.origOptions.bymonth ? (this.options.interval !== 1 && (this.add(this.options.interval.toString()).add(i("months")), this.plural(this.options.interval) && this.add(i("in"))), this._bymonth()) : (this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? i("months") : i("month"))), this.bymonthday ? this._bymonthday() : this.byweekday && this.byweekday.isWeekdays ? this.add(i("on")).add(i("weekdays")) : this.byweekday && this._byweekday(); + }, e.prototype.YEARLY = function() { + var i = this.gettext; + this.origOptions.bymonth ? (this.options.interval !== 1 && (this.add(this.options.interval.toString()), this.add(i("years"))), this._bymonth()) : (this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? i("years") : i("year"))), this.bymonthday ? this._bymonthday() : this.byweekday && this._byweekday(), this.options.byyearday && this.add(i("on the")).add(this.list(this.options.byyearday, this.nth, i("and"))).add(i("day")), this.options.byweekno && this.add(i("in")).add(this.plural(this.options.byweekno.length) ? i("weeks") : i("week")).add(this.list(this.options.byweekno, void 0, i("and"))); + }, e.prototype._bymonthday = function() { + var i = this.gettext; + this.byweekday && this.byweekday.allWeeks ? this.add(i("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext, i("or"))).add(i("the")).add(this.list(this.bymonthday, this.nth, i("or"))) : this.add(i("on the")).add(this.list(this.bymonthday, this.nth, i("and"))); + }, e.prototype._byweekday = function() { + var i = this.gettext; + this.byweekday.allWeeks && !this.byweekday.isWeekdays && this.add(i("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext)), this.byweekday.someWeeks && (this.byweekday.allWeeks && this.add(i("and")), this.add(i("on the")).add(this.list(this.byweekday.someWeeks, this.weekdaytext, i("and")))); + }, e.prototype._byhour = function() { + var i = this.gettext; + this.add(i("at")).add(this.list(this.origOptions.byhour, void 0, i("and"))); + }, e.prototype._bymonth = function() { + this.add(this.list(this.options.bymonth, this.monthtext, this.gettext("and"))); + }, e.prototype.nth = function(i) { + var t; + i = parseInt(i.toString(), 10); + var r = this.gettext; + if (i === -1) + return r("last"); + var d = Math.abs(i); + switch (d) { + case 1: + case 21: + case 31: + t = d + r("st"); + break; + case 2: + case 22: + t = d + r("nd"); + break; + case 3: + case 23: + t = d + r("rd"); + break; + default: + t = d + r("th"); + } + return i < 0 ? t + " " + r("last") : t; + }, e.prototype.monthtext = function(i) { + return this.language.monthNames[i - 1]; + }, e.prototype.weekdaytext = function(i) { + var t = te(i) ? (i + 1) % 7 : i.getJsWeekday(); + return (i.n ? this.nth(i.n) + " " : "") + this.language.dayNames[t]; + }, e.prototype.plural = function(i) { + return i % 100 != 1; + }, e.prototype.add = function(i) { + return this.text.push(" "), this.text.push(i), this; + }, e.prototype.list = function(i, t, r, d) { + var n = this; + d === void 0 && (d = ","), G(i) || (i = [i]), t = t || function(_) { + return _.toString(); + }; + var s = function(_) { + return t && t.call(n, _); + }; + return r ? function(_, a, o) { + for (var l = "", h = 0; h < _.length; h++) + h !== 0 && (h === _.length - 1 ? l += " " + o + " " : l += a + " "), l += _[h]; + return l; + }(i.map(s), d, r) : i.map(s).join(d + " "); + }, e; +}(), Ia = function() { + function e(i) { + this.done = !0, this.rules = i; + } + return e.prototype.start = function(i) { + return this.text = i, this.done = !1, this.nextSymbol(); + }, e.prototype.isDone = function() { + return this.done && this.symbol === null; + }, e.prototype.nextSymbol = function() { + var i, t; + this.symbol = null, this.value = null; + do { + if (this.done) + return !1; + for (var r in i = null, this.rules) { + var d = this.rules[r].exec(this.text); + d && (i === null || d[0].length > i[0].length) && (i = d, t = r); + } + if (i != null && (this.text = this.text.substr(i[0].length), this.text === "" && (this.done = !0)), i == null) + return this.done = !0, this.symbol = null, void (this.value = null); + } while (t === "SKIP"); + return this.symbol = t, this.value = i, !0; + }, e.prototype.accept = function(i) { + if (this.symbol === i) { + if (this.value) { + var t = this.value; + return this.nextSymbol(), t; + } + return this.nextSymbol(), !0; + } + return !1; + }, e.prototype.acceptNumber = function() { + return this.accept("number"); + }, e.prototype.expect = function(i) { + if (this.accept(i)) + return !0; + throw new Error("expected " + i + " but found " + this.symbol); + }, e; +}(); +function wt(e, i) { + i === void 0 && (i = ke); + var t = {}, r = new Ia(i.tokens); + return r.start(e) ? (function() { + r.expect("every"); + var l = r.acceptNumber(); + if (l && (t.interval = parseInt(l[0], 10)), r.isDone()) + throw new Error("Unexpected end"); + switch (r.symbol) { + case "day(s)": + t.freq = C.DAILY, r.nextSymbol() && (n(), o()); + break; + case "weekday(s)": + t.freq = C.WEEKLY, t.byweekday = [C.MO, C.TU, C.WE, C.TH, C.FR], r.nextSymbol(), n(), o(); + break; + case "week(s)": + t.freq = C.WEEKLY, r.nextSymbol() && (d(), n(), o()); + break; + case "hour(s)": + t.freq = C.HOURLY, r.nextSymbol() && (d(), o()); + break; + case "minute(s)": + t.freq = C.MINUTELY, r.nextSymbol() && (d(), o()); + break; + case "month(s)": + t.freq = C.MONTHLY, r.nextSymbol() && (d(), o()); + break; + case "year(s)": + t.freq = C.YEARLY, r.nextSymbol() && (d(), o()); + break; + case "monday": + case "tuesday": + case "wednesday": + case "thursday": + case "friday": + case "saturday": + case "sunday": + t.freq = C.WEEKLY; + var h = r.symbol.substr(0, 2).toUpperCase(); + if (t.byweekday = [C[h]], !r.nextSymbol()) + return; + for (; r.accept("comma"); ) { + if (r.isDone()) + throw new Error("Unexpected end"); + var v = _(); + if (!v) + throw new Error("Unexpected symbol " + r.symbol + ", expected weekday"); + t.byweekday.push(C[v]), r.nextSymbol(); + } + n(), function() { + r.accept("on"), r.accept("the"); + var f = a(); + if (f) + for (t.bymonthday = [f], r.nextSymbol(); r.accept("comma"); ) { + if (!(f = a())) + throw new Error("Unexpected symbol " + r.symbol + "; expected monthday"); + t.bymonthday.push(f), r.nextSymbol(); + } + }(), o(); + break; + case "january": + case "february": + case "march": + case "april": + case "may": + case "june": + case "july": + case "august": + case "september": + case "october": + case "november": + case "december": + if (t.freq = C.YEARLY, t.bymonth = [s()], !r.nextSymbol()) + return; + for (; r.accept("comma"); ) { + if (r.isDone()) + throw new Error("Unexpected end"); + var u = s(); + if (!u) + throw new Error("Unexpected symbol " + r.symbol + ", expected month"); + t.bymonth.push(u), r.nextSymbol(); + } + d(), o(); + break; + default: + throw new Error("Unknown symbol"); + } + }(), t) : null; + function d() { + var l = r.accept("on"), h = r.accept("the"); + if (l || h) + do { + var v = a(), u = _(), f = s(); + if (v) + u ? (r.nextSymbol(), t.byweekday || (t.byweekday = []), t.byweekday.push(C[u].nth(v))) : (t.bymonthday || (t.bymonthday = []), t.bymonthday.push(v), r.accept("day(s)")); + else if (u) + r.nextSymbol(), t.byweekday || (t.byweekday = []), t.byweekday.push(C[u]); + else if (r.symbol === "weekday(s)") + r.nextSymbol(), t.byweekday || (t.byweekday = [C.MO, C.TU, C.WE, C.TH, C.FR]); + else if (r.symbol === "week(s)") { + r.nextSymbol(); + var c = r.acceptNumber(); + if (!c) + throw new Error("Unexpected symbol " + r.symbol + ", expected week number"); + for (t.byweekno = [parseInt(c[0], 10)]; r.accept("comma"); ) { + if (!(c = r.acceptNumber())) + throw new Error("Unexpected symbol " + r.symbol + "; expected monthday"); + t.byweekno.push(parseInt(c[0], 10)); + } + } else { + if (!f) + return; + r.nextSymbol(), t.bymonth || (t.bymonth = []), t.bymonth.push(f); + } + } while (r.accept("comma") || r.accept("the") || r.accept("on")); + } + function n() { + if (r.accept("at")) + do { + var l = r.acceptNumber(); + if (!l) + throw new Error("Unexpected symbol " + r.symbol + ", expected hour"); + for (t.byhour = [parseInt(l[0], 10)]; r.accept("comma"); ) { + if (!(l = r.acceptNumber())) + throw new Error("Unexpected symbol " + r.symbol + "; expected hour"); + t.byhour.push(parseInt(l[0], 10)); + } + } while (r.accept("comma") || r.accept("at")); + } + function s() { + switch (r.symbol) { + case "january": + return 1; + case "february": + return 2; + case "march": + return 3; + case "april": + return 4; + case "may": + return 5; + case "june": + return 6; + case "july": + return 7; + case "august": + return 8; + case "september": + return 9; + case "october": + return 10; + case "november": + return 11; + case "december": + return 12; + default: + return !1; + } + } + function _() { + switch (r.symbol) { + case "monday": + case "tuesday": + case "wednesday": + case "thursday": + case "friday": + case "saturday": + case "sunday": + return r.symbol.substr(0, 2).toUpperCase(); + default: + return !1; + } + } + function a() { + switch (r.symbol) { + case "last": + return r.nextSymbol(), -1; + case "first": + return r.nextSymbol(), 1; + case "second": + return r.nextSymbol(), r.accept("last") ? -2 : 2; + case "third": + return r.nextSymbol(), r.accept("last") ? -3 : 3; + case "nth": + var l = parseInt(r.value[1], 10); + if (l < -366 || l > 366) + throw new Error("Nth out of range: " + l); + return r.nextSymbol(), r.accept("last") ? -l : l; + default: + return !1; + } + } + function o() { + if (r.symbol === "until") { + var l = Date.parse(r.text); + if (!l) + throw new Error("Cannot parse until date:" + r.text); + t.until = new Date(l); + } else + r.accept("for") && (t.count = parseInt(r.value[0], 10), r.expect("number")); + } +} +function Ce(e) { + return e < I.HOURLY; +} +(function(e) { + e[e.YEARLY = 0] = "YEARLY", e[e.MONTHLY = 1] = "MONTHLY", e[e.WEEKLY = 2] = "WEEKLY", e[e.DAILY = 3] = "DAILY", e[e.HOURLY = 4] = "HOURLY", e[e.MINUTELY = 5] = "MINUTELY", e[e.SECONDLY = 6] = "SECONDLY"; +})(I || (I = {})); +var Ra = function(e, i) { + return i === void 0 && (i = ke), new C(wt(e, i) || void 0); +}, fe = ["count", "until", "interval", "byweekday", "bymonthday", "bymonth"]; +ie.IMPLEMENTED = [], ie.IMPLEMENTED[I.HOURLY] = fe, ie.IMPLEMENTED[I.MINUTELY] = fe, ie.IMPLEMENTED[I.DAILY] = ["byhour"].concat(fe), ie.IMPLEMENTED[I.WEEKLY] = fe, ie.IMPLEMENTED[I.MONTHLY] = fe, ie.IMPLEMENTED[I.YEARLY] = ["byweekno", "byyearday"].concat(fe); +var Ya = ie.isFullyConvertible, we = function() { + function e(i, t, r, d) { + this.hour = i, this.minute = t, this.second = r, this.millisecond = d || 0; + } + return e.prototype.getHours = function() { + return this.hour; + }, e.prototype.getMinutes = function() { + return this.minute; + }, e.prototype.getSeconds = function() { + return this.second; + }, e.prototype.getMilliseconds = function() { + return this.millisecond; + }, e.prototype.getTime = function() { + return 1e3 * (60 * this.hour * 60 + 60 * this.minute + this.second) + this.millisecond; + }, e; +}(), Ua = function(e) { + function i(t, r, d, n, s, _, a) { + var o = e.call(this, n, s, _, a) || this; + return o.year = t, o.month = r, o.day = d, o; + } + return Fe(i, e), i.fromDate = function(t) { + return new this(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate(), t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds(), t.valueOf() % 1e3); + }, i.prototype.getWeekday = function() { + return me(new Date(this.getTime())); + }, i.prototype.getTime = function() { + return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime(); + }, i.prototype.getDay = function() { + return this.day; + }, i.prototype.getMonth = function() { + return this.month; + }, i.prototype.getYear = function() { + return this.year; + }, i.prototype.addYears = function(t) { + this.year += t; + }, i.prototype.addMonths = function(t) { + if (this.month += t, this.month > 12) { + var r = Math.floor(this.month / 12), d = Z(this.month, 12); + this.month = d, this.year += r, this.month === 0 && (this.month = 12, --this.year); + } + }, i.prototype.addWeekly = function(t, r) { + r > this.getWeekday() ? this.day += -(this.getWeekday() + 1 + (6 - r)) + 7 * t : this.day += -(this.getWeekday() - r) + 7 * t, this.fixDay(); + }, i.prototype.addDaily = function(t) { + this.day += t, this.fixDay(); + }, i.prototype.addHours = function(t, r, d) { + for (r && (this.hour += Math.floor((23 - this.hour) / t) * t); ; ) { + this.hour += t; + var n = Ae(this.hour, 24), s = n.div, _ = n.mod; + if (s && (this.hour = _, this.addDaily(s)), ae(d) || R(d, this.hour)) + break; + } + }, i.prototype.addMinutes = function(t, r, d, n) { + for (r && (this.minute += Math.floor((1439 - (60 * this.hour + this.minute)) / t) * t); ; ) { + this.minute += t; + var s = Ae(this.minute, 60), _ = s.div, a = s.mod; + if (_ && (this.minute = a, this.addHours(_, !1, d)), (ae(d) || R(d, this.hour)) && (ae(n) || R(n, this.minute))) + break; + } + }, i.prototype.addSeconds = function(t, r, d, n, s) { + for (r && (this.second += Math.floor((86399 - (3600 * this.hour + 60 * this.minute + this.second)) / t) * t); ; ) { + this.second += t; + var _ = Ae(this.second, 60), a = _.div, o = _.mod; + if (a && (this.second = o, this.addMinutes(a, !1, d, n)), (ae(d) || R(d, this.hour)) && (ae(n) || R(n, this.minute)) && (ae(s) || R(s, this.second))) + break; + } + }, i.prototype.fixDay = function() { + if (!(this.day <= 28)) { + var t = Xe(this.year, this.month - 1)[1]; + if (!(this.day <= t)) + for (; this.day > t; ) { + if (this.day -= t, ++this.month, this.month === 13 && (this.month = 1, ++this.year, this.year > gt)) + return; + t = Xe(this.year, this.month - 1)[1]; + } + } + }, i.prototype.add = function(t, r) { + var d = t.freq, n = t.interval, s = t.wkst, _ = t.byhour, a = t.byminute, o = t.bysecond; + switch (d) { + case I.YEARLY: + return this.addYears(n); + case I.MONTHLY: + return this.addMonths(n); + case I.WEEKLY: + return this.addWeekly(n, s); + case I.DAILY: + return this.addDaily(n); + case I.HOURLY: + return this.addHours(n, r, _); + case I.MINUTELY: + return this.addMinutes(n, r, _, a); + case I.SECONDLY: + return this.addSeconds(n, r, _, a, o); + } + }, i; +}(we); +function Et(e) { + for (var i = [], t = 0, r = Object.keys(e); t < r.length; t++) { + var d = r[t]; + R(un, d) || i.push(d), bt(e[d]) && !ye(e[d]) && i.push(d); + } + if (i.length) + throw new Error("Invalid options: " + i.join(", ")); + return X({}, e); +} +function Va(e) { + var i = X(X({}, Je), Et(e)); + if (U(i.byeaster) && (i.freq = C.YEARLY), !U(i.freq) || !C.FREQUENCIES[i.freq]) + throw new Error("Invalid frequency: ".concat(i.freq, " ").concat(e.freq)); + if (i.dtstart || (i.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0))), U(i.wkst) ? te(i.wkst) || (i.wkst = i.wkst.weekday) : i.wkst = C.MO.weekday, U(i.bysetpos)) { + te(i.bysetpos) && (i.bysetpos = [i.bysetpos]); + for (var t = 0; t < i.bysetpos.length; t++) + if ((n = i.bysetpos[t]) === 0 || !(n >= -366 && n <= 366)) + throw new Error("bysetpos must be between 1 and 366, or between -366 and -1"); + } + if (!(i.byweekno || B(i.byweekno) || B(i.byyearday) || i.bymonthday || B(i.bymonthday) || U(i.byweekday) || U(i.byeaster))) + switch (i.freq) { + case C.YEARLY: + i.bymonth || (i.bymonth = i.dtstart.getUTCMonth() + 1), i.bymonthday = i.dtstart.getUTCDate(); + break; + case C.MONTHLY: + i.bymonthday = i.dtstart.getUTCDate(); + break; + case C.WEEKLY: + i.byweekday = [me(i.dtstart)]; + } + if (U(i.bymonth) && !G(i.bymonth) && (i.bymonth = [i.bymonth]), U(i.byyearday) && !G(i.byyearday) && te(i.byyearday) && (i.byyearday = [i.byyearday]), U(i.bymonthday)) + if (G(i.bymonthday)) { + var r = [], d = []; + for (t = 0; t < i.bymonthday.length; t++) { + var n; + (n = i.bymonthday[t]) > 0 ? r.push(n) : n < 0 && d.push(n); + } + i.bymonthday = r, i.bynmonthday = d; + } else + i.bymonthday < 0 ? (i.bynmonthday = [i.bymonthday], i.bymonthday = []) : (i.bynmonthday = [], i.bymonthday = [i.bymonthday]); + else + i.bymonthday = [], i.bynmonthday = []; + if (U(i.byweekno) && !G(i.byweekno) && (i.byweekno = [i.byweekno]), U(i.byweekday)) + if (te(i.byweekday)) + i.byweekday = [i.byweekday], i.bynweekday = null; + else if (Ge(i.byweekday)) + i.byweekday = [K.fromStr(i.byweekday).weekday], i.bynweekday = null; + else if (i.byweekday instanceof K) + !i.byweekday.n || i.freq > C.MONTHLY ? (i.byweekday = [i.byweekday.weekday], i.bynweekday = null) : (i.bynweekday = [[i.byweekday.weekday, i.byweekday.n]], i.byweekday = null); + else { + var s = [], _ = []; + for (t = 0; t < i.byweekday.length; t++) { + var a = i.byweekday[t]; + te(a) ? s.push(a) : Ge(a) ? s.push(K.fromStr(a).weekday) : !a.n || i.freq > C.MONTHLY ? s.push(a.weekday) : _.push([a.weekday, a.n]); + } + i.byweekday = B(s) ? s : null, i.bynweekday = B(_) ? _ : null; + } + else + i.bynweekday = null; + return U(i.byhour) ? te(i.byhour) && (i.byhour = [i.byhour]) : i.byhour = i.freq < C.HOURLY ? [i.dtstart.getUTCHours()] : null, U(i.byminute) ? te(i.byminute) && (i.byminute = [i.byminute]) : i.byminute = i.freq < C.MINUTELY ? [i.dtstart.getUTCMinutes()] : null, U(i.bysecond) ? te(i.bysecond) && (i.bysecond = [i.bysecond]) : i.bysecond = i.freq < C.SECONDLY ? [i.dtstart.getUTCSeconds()] : null, { parsedOptions: i }; +} +function Pe(e) { + var i = e.split(` +`).map(Ba).filter(function(t) { + return t !== null; + }); + return X(X({}, i[0]), i[1]); +} +function Ee(e) { + var i = {}, t = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(e); + if (!t) + return i; + var r = t[1], d = t[2]; + return r && (i.tzid = r), i.dtstart = Be(d), i; +} +function Ba(e) { + if (!(e = e.replace(/^\s+|\s+$/, "")).length) + return null; + var i = /^([A-Z]+?)[:;]/.exec(e.toUpperCase()); + if (!i) + return at(e); + var t = i[1]; + switch (t.toUpperCase()) { + case "RRULE": + case "EXRULE": + return at(e); + case "DTSTART": + return Ee(e); + default: + throw new Error("Unsupported RFC prop ".concat(t, " in ").concat(e)); + } +} +function at(e) { + var i = Ee(e.replace(/^RRULE:/i, "")); + return e.replace(/^(?:RRULE|EXRULE):/i, "").split(";").forEach(function(t) { + var r = t.split("="), d = r[0], n = r[1]; + switch (d.toUpperCase()) { + case "FREQ": + i.freq = I[n.toUpperCase()]; + break; + case "WKST": + i.wkst = Q[n.toUpperCase()]; + break; + case "COUNT": + case "INTERVAL": + case "BYSETPOS": + case "BYMONTH": + case "BYMONTHDAY": + case "BYYEARDAY": + case "BYWEEKNO": + case "BYHOUR": + case "BYMINUTE": + case "BYSECOND": + var s = function(o) { + return o.indexOf(",") !== -1 ? o.split(",").map(nt) : nt(o); + }(n), _ = d.toLowerCase(); + i[_] = s; + break; + case "BYWEEKDAY": + case "BYDAY": + i.byweekday = function(o) { + var l = o.split(","); + return l.map(function(h) { + if (h.length === 2) + return Q[h]; + var v = h.match(/^([+-]?\d{1,2})([A-Z]{2})$/); + if (!v || v.length < 3) + throw new SyntaxError("Invalid weekday string: ".concat(h)); + var u = Number(v[1]), f = v[2], c = Q[f].weekday; + return new K(c, u); + }); + }(n); + break; + case "DTSTART": + case "TZID": + var a = Ee(e); + i.tzid = a.tzid, i.dtstart = a.dtstart; + break; + case "UNTIL": + i.until = Be(n); + break; + case "BYEASTER": + i.byeaster = Number(n); + break; + default: + throw new Error("Unknown RRULE property '" + d + "'"); + } + }), i; +} +function nt(e) { + return /^[+-]?\d+$/.test(e) ? Number(e) : e; +} +var De = function() { + function e(i, t) { + if (isNaN(i.getTime())) + throw new RangeError("Invalid date passed to DateWithZone"); + this.date = i, this.tzid = t; + } + return Object.defineProperty(e.prototype, "isUTC", { get: function() { + return !this.tzid || this.tzid.toUpperCase() === "UTC"; + }, enumerable: !1, configurable: !0 }), e.prototype.toString = function() { + var i = Ve(this.date.getTime(), this.isUTC); + return this.isUTC ? ":".concat(i) : ";TZID=".concat(this.tzid, ":").concat(i); + }, e.prototype.getTime = function() { + return this.date.getTime(); + }, e.prototype.rezonedDate = function() { + return this.isUTC ? this.date : (i = this.date, t = this.tzid, r = Intl.DateTimeFormat().resolvedOptions().timeZone, d = new Date(Qe(i, r)), n = new Date(Qe(i, t ?? "UTC")).getTime() - d.getTime(), new Date(i.getTime() - n)); + var i, t, r, d, n; + }, e; +}(); +function Ie(e) { + for (var i, t = [], r = "", d = Object.keys(e), n = Object.keys(Je), s = 0; s < d.length; s++) + if (d[s] !== "tzid" && R(n, d[s])) { + var _ = d[s].toUpperCase(), a = e[d[s]], o = ""; + if (U(a) && (!G(a) || a.length)) { + switch (_) { + case "FREQ": + o = C.FREQUENCIES[e.freq]; + break; + case "WKST": + o = te(a) ? new K(a).toString() : a.toString(); + break; + case "BYWEEKDAY": + _ = "BYDAY", o = (i = a, G(i) ? i : [i]).map(function(f) { + return f instanceof K ? f : G(f) ? new K(f[0], f[1]) : new K(f); + }).toString(); + break; + case "DTSTART": + r = Fa(a, e.tzid); + break; + case "UNTIL": + o = Ve(a, !e.tzid); + break; + default: + if (G(a)) { + for (var l = [], h = 0; h < a.length; h++) + l[h] = String(a[h]); + o = l.toString(); + } else + o = String(a); + } + o && t.push([_, o]); + } + } + var v = t.map(function(f) { + var c = f[0], p = f[1]; + return "".concat(c, "=").concat(p.toString()); + }).join(";"), u = ""; + return v !== "" && (u = "RRULE:".concat(v)), [r, u].filter(function(f) { + return !!f; + }).join(` +`); +} +function Fa(e, i) { + return e ? "DTSTART" + new De(new Date(e), i).toString() : ""; +} +function Ja(e, i) { + return Array.isArray(e) ? !!Array.isArray(i) && e.length === i.length && e.every(function(t, r) { + return t.getTime() === i[r].getTime(); + }) : e instanceof Date ? i instanceof Date && e.getTime() === i.getTime() : e === i; +} +var Wa = function() { + function e() { + this.all = !1, this.before = [], this.after = [], this.between = []; + } + return e.prototype._cacheAdd = function(i, t, r) { + t && (t = t instanceof Date ? qe(t) : Ze(t)), i === "all" ? this.all = t : (r._value = t, this[i].push(r)); + }, e.prototype._cacheGet = function(i, t) { + var r = !1, d = t ? Object.keys(t) : [], n = function(l) { + for (var h = 0; h < d.length; h++) { + var v = d[h]; + if (!Ja(t[v], l[v])) + return !0; + } + return !1; + }, s = this[i]; + if (i === "all") + r = this.all; + else if (G(s)) + for (var _ = 0; _ < s.length; _++) { + var a = s[_]; + if (!d.length || !n(a)) { + r = a._value; + break; + } + } + if (!r && this.all) { + var o = new pe(i, t); + for (_ = 0; _ < this.all.length && o.accept(this.all[_]); _++) + ; + r = o.getValue(), this._cacheAdd(i, r, t); + } + return G(r) ? Ze(r) : r instanceof Date ? qe(r) : r; + }, e; +}(), Ka = O(O(O(O(O(O(O(O(O(O(O(O(O([], P(1, 31), !0), P(2, 28), !0), P(3, 31), !0), P(4, 30), !0), P(5, 31), !0), P(6, 30), !0), P(7, 31), !0), P(8, 31), !0), P(9, 30), !0), P(10, 31), !0), P(11, 30), !0), P(12, 31), !0), P(1, 7), !0), Ga = O(O(O(O(O(O(O(O(O(O(O(O(O([], P(1, 31), !0), P(2, 29), !0), P(3, 31), !0), P(4, 30), !0), P(5, 31), !0), P(6, 30), !0), P(7, 31), !0), P(8, 31), !0), P(9, 30), !0), P(10, 31), !0), P(11, 30), !0), P(12, 31), !0), P(1, 7), !0), Xa = ne(1, 29), Za = ne(1, 30), le = ne(1, 31), F = ne(1, 32), Qa = O(O(O(O(O(O(O(O(O(O(O(O(O([], F, !0), Za, !0), F, !0), le, !0), F, !0), le, !0), F, !0), F, !0), le, !0), F, !0), le, !0), F, !0), F.slice(0, 7), !0), en = O(O(O(O(O(O(O(O(O(O(O(O(O([], F, !0), Xa, !0), F, !0), le, !0), F, !0), le, !0), F, !0), F, !0), le, !0), F, !0), le, !0), F, !0), F.slice(0, 7), !0), tn = ne(-28, 0), an = ne(-29, 0), ce = ne(-30, 0), J = ne(-31, 0), nn = O(O(O(O(O(O(O(O(O(O(O(O(O([], J, !0), an, !0), J, !0), ce, !0), J, !0), ce, !0), J, !0), J, !0), ce, !0), J, !0), ce, !0), J, !0), J.slice(0, 7), !0), rn = O(O(O(O(O(O(O(O(O(O(O(O(O([], J, !0), tn, !0), J, !0), ce, !0), J, !0), ce, !0), J, !0), J, !0), ce, !0), J, !0), ce, !0), J, !0), J.slice(0, 7), !0), on = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], sn = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], rt = function() { + for (var e = [], i = 0; i < 55; i++) + e = e.concat(ne(7)); + return e; +}(); +function dn(e, i) { + var t, r, d = he(e, 1, 1), n = ge(e) ? 366 : 365, s = ge(e + 1) ? 366 : 365, _ = ze(d), a = me(d), o = X(X({ yearlen: n, nextyearlen: s, yearordinal: _, yearweekday: a }, function(E) { + var D = ge(E) ? 366 : 365, w = he(E, 1, 1), S = me(w); + return D === 365 ? { mmask: Ka, mdaymask: en, nmdaymask: rn, wdaymask: rt.slice(S), mrange: sn } : { mmask: Ga, mdaymask: Qa, nmdaymask: nn, wdaymask: rt.slice(S), mrange: on }; + }(e)), { wnomask: null }); + if (ae(i.byweekno)) + return o; + o.wnomask = P(0, n + 7); + var l = t = Z(7 - a + i.wkst, 7); + l >= 4 ? (l = 0, r = o.yearlen + Z(a - i.wkst, 7)) : r = n - l; + for (var h = Math.floor(r / 7), v = Z(r, 7), u = Math.floor(h + v / 4), f = 0; f < i.byweekno.length; f++) { + var c = i.byweekno[f]; + if (c < 0 && (c += u + 1), c > 0 && c <= u) { + var p = void 0; + c > 1 ? (p = l + 7 * (c - 1), l !== t && (p -= 7 - t)) : p = l; + for (var m = 0; m < 7 && (o.wnomask[p] = 1, p++, o.wdaymask[p] !== i.wkst); m++) + ; + } + } + if (R(i.byweekno, 1) && (p = l + 7 * u, l !== t && (p -= 7 - t), p < n)) + for (f = 0; f < 7 && (o.wnomask[p] = 1, p += 1, o.wdaymask[p] !== i.wkst); f++) + ; + if (l) { + var g = void 0; + if (R(i.byweekno, -1)) + g = -1; + else { + var y = me(he(e - 1, 1, 1)), x = Z(7 - y.valueOf() + i.wkst, 7), b = ge(e - 1) ? 366 : 365, k = void 0; + x >= 4 ? (x = 0, k = b + Z(y - i.wkst, 7)) : k = n - l, g = Math.floor(52 + Z(k, 7) / 4); + } + if (R(i.byweekno, g)) + for (p = 0; p < l; p++) + o.wnomask[p] = 1; + } + return o; +} +var _n = function() { + function e(i) { + this.options = i; + } + return e.prototype.rebuild = function(i, t) { + var r = this.options; + if (i !== this.lastyear && (this.yearinfo = dn(i, r)), B(r.bynweekday) && (t !== this.lastmonth || i !== this.lastyear)) { + var d = this.yearinfo, n = d.yearlen, s = d.mrange, _ = d.wdaymask; + this.monthinfo = function(a, o, l, h, v, u) { + var f = { lastyear: a, lastmonth: o, nwdaymask: [] }, c = []; + if (u.freq === C.YEARLY) + if (ae(u.bymonth)) + c = [[0, l]]; + else + for (var p = 0; p < u.bymonth.length; p++) + o = u.bymonth[p], c.push(h.slice(o - 1, o + 1)); + else + u.freq === C.MONTHLY && (c = [h.slice(o - 1, o + 1)]); + if (ae(c)) + return f; + for (f.nwdaymask = P(0, l), p = 0; p < c.length; p++) + for (var m = c[p], g = m[0], y = m[1] - 1, x = 0; x < u.bynweekday.length; x++) { + var b = void 0, k = u.bynweekday[x], E = k[0], D = k[1]; + D < 0 ? (b = y + 7 * (D + 1), b -= Z(v[b] - E, 7)) : (b = g + 7 * (D - 1), b += Z(7 - v[b] + E, 7)), g <= b && b <= y && (f.nwdaymask[b] = 1); + } + return f; + }(i, t, n, s, _, r); + } + U(r.byeaster) && (this.eastermask = function(a, o) { + o === void 0 && (o = 0); + var l = a % 19, h = Math.floor(a / 100), v = a % 100, u = Math.floor(h / 4), f = h % 4, c = Math.floor((h + 8) / 25), p = Math.floor((h - c + 1) / 3), m = Math.floor(19 * l + h - u - p + 15) % 30, g = Math.floor(v / 4), y = v % 4, x = Math.floor(32 + 2 * f + 2 * g - m - y) % 7, b = Math.floor((l + 11 * m + 22 * x) / 451), k = Math.floor((m + x - 7 * b + 114) / 31), E = (m + x - 7 * b + 114) % 31 + 1, D = Date.UTC(a, k - 1, E + o), w = Date.UTC(a, 0, 1); + return [Math.ceil((D - w) / 864e5)]; + }(i, r.byeaster)); + }, Object.defineProperty(e.prototype, "lastyear", { get: function() { + return this.monthinfo ? this.monthinfo.lastyear : null; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "lastmonth", { get: function() { + return this.monthinfo ? this.monthinfo.lastmonth : null; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "yearlen", { get: function() { + return this.yearinfo.yearlen; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "yearordinal", { get: function() { + return this.yearinfo.yearordinal; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "mrange", { get: function() { + return this.yearinfo.mrange; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "wdaymask", { get: function() { + return this.yearinfo.wdaymask; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "mmask", { get: function() { + return this.yearinfo.mmask; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "wnomask", { get: function() { + return this.yearinfo.wnomask; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "nwdaymask", { get: function() { + return this.monthinfo ? this.monthinfo.nwdaymask : []; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "nextyearlen", { get: function() { + return this.yearinfo.nextyearlen; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "mdaymask", { get: function() { + return this.yearinfo.mdaymask; + }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "nmdaymask", { get: function() { + return this.yearinfo.nmdaymask; + }, enumerable: !1, configurable: !0 }), e.prototype.ydayset = function() { + return [ne(this.yearlen), 0, this.yearlen]; + }, e.prototype.mdayset = function(i, t) { + for (var r = this.mrange[t - 1], d = this.mrange[t], n = P(null, this.yearlen), s = r; s < d; s++) + n[s] = s; + return [n, r, d]; + }, e.prototype.wdayset = function(i, t, r) { + for (var d = P(null, this.yearlen + 7), n = ze(he(i, t, r)) - this.yearordinal, s = n, _ = 0; _ < 7 && (d[n] = n, ++n, this.wdaymask[n] !== this.options.wkst); _++) + ; + return [d, s, n]; + }, e.prototype.ddayset = function(i, t, r) { + var d = P(null, this.yearlen), n = ze(he(i, t, r)) - this.yearordinal; + return d[n] = n, [d, n, n + 1]; + }, e.prototype.htimeset = function(i, t, r, d) { + var n = this, s = []; + return this.options.byminute.forEach(function(_) { + s = s.concat(n.mtimeset(i, _, r, d)); + }), be(s), s; + }, e.prototype.mtimeset = function(i, t, r, d) { + var n = this.options.bysecond.map(function(s) { + return new we(i, t, s, d); + }); + return be(n), n; + }, e.prototype.stimeset = function(i, t, r, d) { + return [new we(i, t, r, d)]; + }, e.prototype.getdayset = function(i) { + switch (i) { + case I.YEARLY: + return this.ydayset.bind(this); + case I.MONTHLY: + return this.mdayset.bind(this); + case I.WEEKLY: + return this.wdayset.bind(this); + case I.DAILY: + default: + return this.ddayset.bind(this); + } + }, e.prototype.gettimeset = function(i) { + switch (i) { + case I.HOURLY: + return this.htimeset.bind(this); + case I.MINUTELY: + return this.mtimeset.bind(this); + case I.SECONDLY: + return this.stimeset.bind(this); + } + }, e; +}(); +function ln(e, i, t, r, d, n) { + for (var s = [], _ = 0; _ < e.length; _++) { + var a = void 0, o = void 0, l = e[_]; + l < 0 ? (a = Math.floor(l / i.length), o = Z(l, i.length)) : (a = Math.floor((l - 1) / i.length), o = Z(l - 1, i.length)); + for (var h = [], v = t; v < r; v++) { + var u = n[v]; + U(u) && h.push(u); + } + var f = void 0; + f = a < 0 ? h.slice(a)[0] : h[a]; + var c = i[o], p = xt(d.yearordinal + f), m = kt(p, c); + R(s, m) || s.push(m); + } + return be(s), s; +} +function Dt(e, i) { + var t = i.dtstart, r = i.freq, d = i.interval, n = i.until, s = i.bysetpos, _ = i.count; + if (_ === 0 || d === 0) + return re(e); + var a = Ua.fromDate(t), o = new _n(i); + o.rebuild(a.year, a.month); + for (var l = function(D, w, S) { + var N = S.freq, M = S.byhour, T = S.byminute, A = S.bysecond; + return Ce(N) ? function(H) { + var $ = H.dtstart.getTime() % 1e3; + if (!Ce(H.freq)) + return []; + var j = []; + return H.byhour.forEach(function(z) { + H.byminute.forEach(function(W) { + H.bysecond.forEach(function(Y) { + j.push(new we(z, W, Y, $)); + }); + }); + }), j; + }(S) : N >= C.HOURLY && B(M) && !R(M, w.hour) || N >= C.MINUTELY && B(T) && !R(T, w.minute) || N >= C.SECONDLY && B(A) && !R(A, w.second) ? [] : D.gettimeset(N)(w.hour, w.minute, w.second, w.millisecond); + }(o, a, i); ; ) { + var h = o.getdayset(r)(a.year, a.month, a.day), v = h[0], u = h[1], f = h[2], c = hn(v, u, f, o, i); + if (B(s)) + for (var p = ln(s, l, u, f, o, v), m = 0; m < p.length; m++) { + var g = p[m]; + if (n && g > n) + return re(e); + if (g >= t) { + var y = it(g, i); + if (!e.accept(y) || _ && !--_) + return re(e); + } + } + else + for (m = u; m < f; m++) { + var x = v[m]; + if (U(x)) + for (var b = xt(o.yearordinal + x), k = 0; k < l.length; k++) { + var E = l[k]; + if (g = kt(b, E), n && g > n || g >= t && (y = it(g, i), !e.accept(y) || _ && !--_)) + return re(e); + } + } + if (i.interval === 0 || (a.add(i, c), a.year > gt)) + return re(e); + Ce(r) || (l = o.gettimeset(r)(a.hour, a.minute, a.second, 0)), o.rebuild(a.year, a.month); + } +} +function cn(e, i, t) { + var r = t.bymonth, d = t.byweekno, n = t.byweekday, s = t.byeaster, _ = t.bymonthday, a = t.bynmonthday, o = t.byyearday; + return B(r) && !R(r, e.mmask[i]) || B(d) && !e.wnomask[i] || B(n) && !R(n, e.wdaymask[i]) || B(e.nwdaymask) && !e.nwdaymask[i] || s !== null && !R(e.eastermask, i) || (B(_) || B(a)) && !R(_, e.mdaymask[i]) && !R(a, e.nmdaymask[i]) || B(o) && (i < e.yearlen && !R(o, i + 1) && !R(o, -e.yearlen + i) || i >= e.yearlen && !R(o, i + 1 - e.yearlen) && !R(o, -e.nextyearlen + i - e.yearlen)); +} +function it(e, i) { + return new De(e, i.tzid).rezonedDate(); +} +function re(e) { + return e.getValue(); +} +function hn(e, i, t, r, d) { + for (var n = !1, s = i; s < t; s++) { + var _ = e[s]; + (n = cn(r, _, d)) && (e[_] = null); + } + return n; +} +var Q = { MO: new K(0), TU: new K(1), WE: new K(2), TH: new K(3), FR: new K(4), SA: new K(5), SU: new K(6) }, Je = { freq: I.YEARLY, dtstart: null, interval: 1, wkst: Q.MO, count: null, until: null, tzid: null, bysetpos: null, bymonth: null, bymonthday: null, bynmonthday: null, byyearday: null, byweekno: null, byweekday: null, bynweekday: null, byhour: null, byminute: null, bysecond: null, byeaster: null }, un = Object.keys(Je), C = function() { + function e(i, t) { + i === void 0 && (i = {}), t === void 0 && (t = !1), this._cache = t ? null : new Wa(), this.origOptions = Et(i); + var r = Va(i).parsedOptions; + this.options = r; + } + return e.parseText = function(i, t) { + return wt(i, t); + }, e.fromText = function(i, t) { + return Ra(i, t); + }, e.fromString = function(i) { + return new e(e.parseString(i) || void 0); + }, e.prototype._iter = function(i) { + return Dt(i, this.options); + }, e.prototype._cacheGet = function(i, t) { + return !!this._cache && this._cache._cacheGet(i, t); + }, e.prototype._cacheAdd = function(i, t, r) { + if (this._cache) + return this._cache._cacheAdd(i, t, r); + }, e.prototype.all = function(i) { + if (i) + return this._iter(new et("all", {}, i)); + var t = this._cacheGet("all"); + return t === !1 && (t = this._iter(new pe("all", {})), this._cacheAdd("all", t)), t; + }, e.prototype.between = function(i, t, r, d) { + if (r === void 0 && (r = !1), !ye(i) || !ye(t)) + throw new Error("Invalid date passed in to RRule.between"); + var n = { before: t, after: i, inc: r }; + if (d) + return this._iter(new et("between", n, d)); + var s = this._cacheGet("between", n); + return s === !1 && (s = this._iter(new pe("between", n)), this._cacheAdd("between", s, n)), s; + }, e.prototype.before = function(i, t) { + if (t === void 0 && (t = !1), !ye(i)) + throw new Error("Invalid date passed in to RRule.before"); + var r = { dt: i, inc: t }, d = this._cacheGet("before", r); + return d === !1 && (d = this._iter(new pe("before", r)), this._cacheAdd("before", d, r)), d; + }, e.prototype.after = function(i, t) { + if (t === void 0 && (t = !1), !ye(i)) + throw new Error("Invalid date passed in to RRule.after"); + var r = { dt: i, inc: t }, d = this._cacheGet("after", r); + return d === !1 && (d = this._iter(new pe("after", r)), this._cacheAdd("after", d, r)), d; + }, e.prototype.count = function() { + return this.all().length; + }, e.prototype.toString = function() { + return Ie(this.origOptions); + }, e.prototype.toText = function(i, t, r) { + return function(d, n, s, _) { + return new ie(d, n, s, _).toString(); + }(this, i, t, r); + }, e.prototype.isFullyConvertibleToText = function() { + return Ya(this); + }, e.prototype.clone = function() { + return new e(this.origOptions); + }, e.FREQUENCIES = ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"], e.YEARLY = I.YEARLY, e.MONTHLY = I.MONTHLY, e.WEEKLY = I.WEEKLY, e.DAILY = I.DAILY, e.HOURLY = I.HOURLY, e.MINUTELY = I.MINUTELY, e.SECONDLY = I.SECONDLY, e.MO = Q.MO, e.TU = Q.TU, e.WE = Q.WE, e.TH = Q.TH, e.FR = Q.FR, e.SA = Q.SA, e.SU = Q.SU, e.parseString = Pe, e.optionsToString = Ie, e; +}(), ot = { dtstart: null, cache: !1, unfold: !1, forceset: !1, compatible: !1, tzid: null }; +function fn(e, i) { + var t = [], r = [], d = [], n = [], s = Ee(e), _ = s.dtstart, a = s.tzid, o = function(l, h) { + if (h === void 0 && (h = !1), l = l && l.trim(), !l) + throw new Error("Invalid empty string"); + if (!h) + return l.split(/\s/); + for (var v = l.split(` +`), u = 0; u < v.length; ) { + var f = v[u] = v[u].replace(/\s+$/g, ""); + f ? u > 0 && f[0] === " " ? (v[u - 1] += f.slice(1), v.splice(u, 1)) : u += 1 : v.splice(u, 1); + } + return v; + }(e, i.unfold); + return o.forEach(function(l) { + var h; + if (l) { + var v = function(m) { + var g = function(k) { + if (k.indexOf(":") === -1) + return { name: "RRULE", value: k }; + var E = Ha(k, ":", 1), D = E[0], w = E[1]; + return { name: D, value: w }; + }(m), y = g.name, x = g.value, b = y.split(";"); + if (!b) + throw new Error("empty property name"); + return { name: b[0].toUpperCase(), parms: b.slice(1), value: x }; + }(l), u = v.name, f = v.parms, c = v.value; + switch (u.toUpperCase()) { + case "RRULE": + if (f.length) + throw new Error("unsupported RRULE parm: ".concat(f.join(","))); + t.push(Pe(l)); + break; + case "RDATE": + var p = ((h = /RDATE(?:;TZID=([^:=]+))?/i.exec(l)) !== null && h !== void 0 ? h : [])[1]; + p && !a && (a = p), r = r.concat(st(c, f)); + break; + case "EXRULE": + if (f.length) + throw new Error("unsupported EXRULE parm: ".concat(f.join(","))); + d.push(Pe(c)); + break; + case "EXDATE": + n = n.concat(st(c, f)); + break; + case "DTSTART": + break; + default: + throw new Error("unsupported property: " + u); + } } - function i(_) { - return e._lame_copy({}, _); + }), { dtstart: _, tzid: a, rrulevals: t, rdatevals: r, exrulevals: d, exdatevals: n }; +} +function Se(e, i) { + return i === void 0 && (i = {}), function(t, r) { + var d = fn(t, r), n = d.rrulevals, s = d.rdatevals, _ = d.exrulevals, a = d.exdatevals, o = d.dtstart, l = d.tzid, h = r.cache === !1; + if (r.compatible && (r.forceset = !0, r.unfold = !0), r.forceset || n.length > 1 || s.length || _.length || a.length) { + var v = new pn(h); + return v.dtstart(o), v.tzid(l || void 0), n.forEach(function(f) { + v.rrule(new C(Oe(f, o, l), h)); + }), s.forEach(function(f) { + v.rdate(f); + }), _.forEach(function(f) { + v.exrule(new C(Oe(f, o, l), h)); + }), a.forEach(function(f) { + v.exdate(f); + }), r.compatible && r.dtstart && v.rdate(o), v; + } + var u = n[0] || {}; + return new C(Oe(u, u.dtstart || r.dtstart || o, u.tzid || r.tzid || l), h); + }(e, function(t) { + var r = [], d = Object.keys(t), n = Object.keys(ot); + if (d.forEach(function(s) { + R(n, s) || r.push(s); + }), r.length) + throw new Error("Invalid options: " + r.join(", ")); + return X(X({}, ot), t); + }(i)); +} +function Oe(e, i, t) { + return X(X({}, e), { dtstart: i, tzid: t }); +} +function st(e, i) { + return function(t) { + t.forEach(function(r) { + if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(r)) + throw new Error("unsupported RDATE/EXDATE parm: " + r); + }); + }(i), e.split(",").map(function(t) { + return Be(t); + }); +} +function dt(e) { + var i = this; + return function(t) { + if (t !== void 0 && (i["_".concat(e)] = t), i["_".concat(e)] !== void 0) + return i["_".concat(e)]; + for (var r = 0; r < i._rrule.length; r++) { + var d = i._rrule[r].origOptions[e]; + if (d) + return d; } - document.body ? e.event(document.body, "mousemove", r) : e.event(window, "load", function() { - e.event(document.body, "mousemove", r); - }), e.attachEvent("onMouseMove", function(_, o) { - var t = e.getState(); - if (t.mode && t.min_date) { - var n = e.getActionData(o); - e.$keyboardNavigation._pasteDate = n.date, e.$keyboardNavigation._pasteSection = n.section; - } - }), e._make_pasted_event = function(_) { - var o = e.$keyboardNavigation._pasteDate, t = e.$keyboardNavigation._pasteSection, n = _.end_date - _.start_date, s = i(_); - if (function(u) { - delete u.rec_type, delete u.rec_pattern, delete u.event_pid, delete u.event_length; - }(s), s.start_date = new Date(o), s.end_date = new Date(s.start_date.valueOf() + n), t) { - var c = e._get_section_property(); - e.config.multisection ? s[c] = _[c] : s[c] = t; + }; +} +var pn = function(e) { + function i(t) { + t === void 0 && (t = !1); + var r = e.call(this, {}, t) || this; + return r.dtstart = dt.apply(r, ["dtstart"]), r.tzid = dt.apply(r, ["tzid"]), r._rrule = [], r._rdate = [], r._exrule = [], r._exdate = [], r; + } + return Fe(i, e), i.prototype._iter = function(t) { + return function(r, d, n, s, _, a) { + var o = {}, l = r.accept; + function h(c, p) { + n.forEach(function(m) { + m.between(c, p, !0).forEach(function(g) { + o[Number(g)] = !0; + }); + }); } - return s; - }, e._do_paste = function(_, o, t) { - e.callEvent("onBeforeEventPasted", [_, o, t]) !== !1 && (e.addEvent(o), e.callEvent("onEventPasted", [_, o, t])); - }, e._is_key_nav_active = function() { - return !(!this._is_initialized() || this._is_lightbox_open() || !this.config.key_nav); - }, e.event(document, "keydown", function(_) { - (_.ctrlKey || _.metaKey) && _.keyCode == 86 && e._buffer_event && !e.$keyboardNavigation.dispatcher.isEnabled() && (e.$keyboardNavigation.dispatcher.isActive = d()); - }), e._key_nav_copy_paste = function(_) { - if (!e._is_key_nav_active()) - return !0; - if (_.keyCode == 37 || _.keyCode == 39) { - _.cancelBubble = !0; - var o = e.date.add(e._date, _.keyCode == 37 ? -1 : 1, e._mode); - return e.setCurrentView(o), !0; - } - var t, n = (t = e.$keyboardNavigation.dispatcher.getActiveNode()) && t.eventId ? t.eventId : e._select_id; - if ((_.ctrlKey || _.metaKey) && _.keyCode == 67) - return n && (e._buffer_event = i(e.getEvent(n)), h = !0, e.callEvent("onEventCopied", [e.getEvent(n)])), !0; - if ((_.ctrlKey || _.metaKey) && _.keyCode == 88 && n) { - h = !1; - var s = e._buffer_event = i(e.getEvent(n)); - e.updateEvent(s.id), e.callEvent("onEventCut", [s]); - } - if ((_.ctrlKey || _.metaKey) && _.keyCode == 86 && d()) { - if (s = (s = e._buffer_event ? e.getEvent(e._buffer_event.id) : e._buffer_event) || e._buffer_event) { - var c = e._make_pasted_event(s); - h ? (c.id = e.uid(), e._do_paste(h, c, s)) : e.callEvent("onBeforeEventChanged", [c, _, !1, s]) && (e._do_paste(h, c, s), h = !0); - } - return !0; + _.forEach(function(c) { + var p = new De(c, a).rezonedDate(); + o[Number(p)] = !0; + }), r.accept = function(c) { + var p = Number(c); + return isNaN(p) ? l.call(this, c) : !(!o[p] && (h(new Date(p - 1), new Date(p + 1)), !o[p])) || (o[p] = !0, l.call(this, c)); + }, r.method === "between" && (h(r.args.after, r.args.before), r.accept = function(c) { + var p = Number(c); + return !!o[p] || (o[p] = !0, l.call(this, c)); + }); + for (var v = 0; v < s.length; v++) { + var u = new De(s[v], a).rezonedDate(); + if (!r.accept(new Date(u.getTime()))) + break; } - }; - }, e._temp_key_scope(); -} -function st(e) { - e.$keyboardNavigation.attachSchedulerHandlers = function() { - var h, a = e.$keyboardNavigation.dispatcher, r = function(t) { - if (e.config.key_nav) - return a.keyDownHandler(t); - }, d = function() { - a.keepScrollPosition(function() { - a.focusGlobalNode(); + d.forEach(function(c) { + Dt(r, c.options); }); - }; - e.attachEvent("onDataRender", function() { - e.config.key_nav && a.isEnabled() && !e.getState().editor_id && (clearTimeout(h), h = setTimeout(function() { - if (e.$destroyed) - return !0; - a.isEnabled() || a.enable(), i(); - })); + var f = r._result; + switch (be(f), r.method) { + case "all": + case "between": + return f; + case "before": + return f.length && f[f.length - 1] || null; + default: + return f.length && f[0] || null; + } + }(t, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid()); + }, i.prototype.rrule = function(t) { + _t(t, this._rrule); + }, i.prototype.exrule = function(t) { + _t(t, this._exrule); + }, i.prototype.rdate = function(t) { + lt(t, this._rdate); + }, i.prototype.exdate = function(t) { + lt(t, this._exdate); + }, i.prototype.rrules = function() { + return this._rrule.map(function(t) { + return Se(t.toString()); }); - var i = function() { - if (a.isEnabled()) { - var t = a.getActiveNode(); - t && (t.isValid() || (t = t.fallback()), !t || t instanceof e.$keyboardNavigation.MinicalButton || t instanceof e.$keyboardNavigation.MinicalCell || a.keepScrollPosition(function() { - t.focus(!0); - })); - } - }; - function _(t) { - if (!e.config.key_nav) - return !0; - const n = e.getView(); - let s = !1; - if (e.getState().mode === "month") - s = e.$keyboardNavigation.isChildOf(t.target || t.srcElement, e.$container.querySelector(".dhx_cal_month_table")); - else if (n && n.layout === "timeline") - s = e.$keyboardNavigation.isChildOf(t.target || t.srcElement, e.$container.querySelector(".dhx_timeline_data_col")); - else { - const v = e.$container.querySelectorAll(".dhx_scale_holder"); - s = Array.from(v).some((m) => m === t.target.parentNode); - } - var c, u = e.getActionData(t); - e._locate_event(t.target || t.srcElement) ? c = new e.$keyboardNavigation.Event(e._locate_event(t.target || t.srcElement)) : s && (c = new e.$keyboardNavigation.TimeSlot(), u.date && s && (c = c.nextSlot(new e.$keyboardNavigation.TimeSlot(u.date, null, u.section)))), c && (a.isEnabled() ? u.date && s && a.delay(function() { - a.setActiveNode(c); - }) : a.activeNode = c); - } - e.attachEvent("onSchedulerReady", function() { - var t = e.$container; - e.eventRemove(document, "keydown", r), e.eventRemove(t, "mousedown", _), e.eventRemove(t, "focus", d), e.config.key_nav ? (e.event(document, "keydown", r), e.event(t, "mousedown", _), e.event(t, "focus", d), t.setAttribute("tabindex", "0")) : t.removeAttribute("tabindex"); + }, i.prototype.exrules = function() { + return this._exrule.map(function(t) { + return Se(t.toString()); }); - var o = e.updateEvent; - e.updateEvent = function(t) { - var n = o.apply(this, arguments); - if (e.config.key_nav && a.isEnabled() && e.getState().select_id == t) { - var s = new e.$keyboardNavigation.Event(t); - e.getState().lightbox_id || function(c) { - if (e.config.key_nav && a.isEnabled()) { - var u = c, v = new e.$keyboardNavigation.Event(u.eventId); - if (!v.isValid()) { - var m = v.start || u.start, l = v.end || u.end, f = v.section || u.section; - (v = new e.$keyboardNavigation.TimeSlot(m, l, f)).isValid() || (v = new e.$keyboardNavigation.TimeSlot()); - } - a.setActiveNode(v); - var g = a.getActiveNode(); - g && g.getNode && document.activeElement != g.getNode() && a.focusNode(a.getActiveNode()); - } - }(s); - } - return n; - }, e.attachEvent("onEventDeleted", function(t) { - return e.config.key_nav && a.isEnabled() && a.getActiveNode().eventId == t && a.setActiveNode(new e.$keyboardNavigation.TimeSlot()), !0; - }), e.attachEvent("onClearAll", function() { - if (!e.config.key_nav) - return !0; - a.isEnabled() && a.getActiveNode() instanceof e.$keyboardNavigation.Event && a.setActiveNode(new e.$keyboardNavigation.TimeSlot()); + }, i.prototype.rdates = function() { + return this._rdate.map(function(t) { + return new Date(t.getTime()); }); - }; + }, i.prototype.exdates = function() { + return this._exdate.map(function(t) { + return new Date(t.getTime()); + }); + }, i.prototype.valueOf = function() { + var t = []; + return !this._rrule.length && this._dtstart && (t = t.concat(Ie({ dtstart: this._dtstart }))), this._rrule.forEach(function(r) { + t = t.concat(r.toString().split(` +`)); + }), this._exrule.forEach(function(r) { + t = t.concat(r.toString().split(` +`).map(function(d) { + return d.replace(/^RRULE:/, "EXRULE:"); + }).filter(function(d) { + return !/^DTSTART/.test(d); + })); + }), this._rdate.length && t.push(ct("RDATE", this._rdate, this.tzid())), this._exdate.length && t.push(ct("EXDATE", this._exdate, this.tzid())), t; + }, i.prototype.toString = function() { + return this.valueOf().join(` +`); + }, i.prototype.clone = function() { + var t = new i(!!this._cache); + return this._rrule.forEach(function(r) { + return t.rrule(r.clone()); + }), this._exrule.forEach(function(r) { + return t.exrule(r.clone()); + }), this._rdate.forEach(function(r) { + return t.rdate(new Date(r.getTime())); + }), this._exdate.forEach(function(r) { + return t.exdate(new Date(r.getTime())); + }), t; + }, i; +}(C); +function _t(e, i) { + if (!(e instanceof C)) + throw new TypeError(String(e) + " is not RRule instance"); + R(i.map(String), String(e)) || i.push(e); } -class dt { - constructor(h) { - this._scheduler = h; +function lt(e, i) { + if (!(e instanceof Date)) + throw new TypeError(String(e) + " is not Date instance"); + R(i.map(Number), Number(e)) || (i.push(e), be(i)); +} +function ct(e, i, t) { + var r = !t || t.toUpperCase() === "UTC", d = r ? "".concat(e, ":") : "".concat(e, ";TZID=").concat(t, ":"), n = i.map(function(s) { + return Ve(s.valueOf(), r); + }).join(","); + return "".concat(d).concat(n); +} +class mn { + constructor(i) { + this._scheduler = i; } getNode() { - const h = this._scheduler; - return this._tooltipNode || (this._tooltipNode = document.createElement("div"), this._tooltipNode.className = "dhtmlXTooltip scheduler_tooltip tooltip", h._waiAria.tooltipAttr(this._tooltipNode)), h.config.rtl ? this._tooltipNode.classList.add("dhtmlXTooltip_rtl") : this._tooltipNode.classList.remove("dhtmlXTooltip_rtl"), this._tooltipNode; + const i = this._scheduler; + return this._tooltipNode || (this._tooltipNode = document.createElement("div"), this._tooltipNode.className = "dhtmlXTooltip scheduler_tooltip tooltip", i._waiAria.tooltipAttr(this._tooltipNode)), i.config.rtl ? this._tooltipNode.classList.add("dhtmlXTooltip_rtl") : this._tooltipNode.classList.remove("dhtmlXTooltip_rtl"), this._tooltipNode; } - setViewport(h) { - return this._root = h, this; + setViewport(i) { + return this._root = i, this; } - show(h, a) { - const r = this._scheduler, d = r.$domHelpers, i = document.body, _ = this.getNode(); - if (d.isChildOf(_, i) || (this.hide(), i.appendChild(_)), this._isLikeMouseEvent(h)) { - const o = this._calculateTooltipPosition(h); - a = o.top, h = o.left; + show(i, t) { + const r = this._scheduler, d = r.$domHelpers, n = document.body, s = this.getNode(); + if (d.isChildOf(s, n) || (this.hide(), n.appendChild(s)), this._isLikeMouseEvent(i)) { + const _ = this._calculateTooltipPosition(i); + t = _.top, i = _.left; } - return _.style.top = a + "px", _.style.left = h + "px", r._waiAria.tooltipVisibleAttr(_), this; + return s.style.top = t + "px", s.style.left = i + "px", r._waiAria.tooltipVisibleAttr(s), this; } hide() { - const h = this._scheduler, a = this.getNode(); - return a && a.parentNode && a.parentNode.removeChild(a), h._waiAria.tooltipHiddenAttr(a), this; + const i = this._scheduler, t = this.getNode(); + return t && t.parentNode && t.parentNode.removeChild(t), i._waiAria.tooltipHiddenAttr(t), this; } - setContent(h) { - return this.getNode().innerHTML = h, this; + setContent(i) { + return this.getNode().innerHTML = i, this; } - _isLikeMouseEvent(h) { - return !(!h || typeof h != "object") && "clientX" in h && "clientY" in h; + _isLikeMouseEvent(i) { + return !(!i || typeof i != "object") && "clientX" in i && "clientY" in i; } _getViewPort() { return this._root || document.body; } - _calculateTooltipPosition(h) { - const a = this._scheduler, r = a.$domHelpers, d = this._getViewPortSize(), i = this.getNode(), _ = { top: 0, left: 0, width: i.offsetWidth, height: i.offsetHeight, bottom: 0, right: 0 }, o = a.config.tooltip_offset_x, t = a.config.tooltip_offset_y, n = document.body, s = r.getRelativeEventPosition(h, n), c = r.getNodePosition(n); - s.y += c.y, _.top = s.y, _.left = s.x, _.top += t, _.left += o, _.bottom = _.top + _.height, _.right = _.left + _.width; - const u = window.scrollY + n.scrollTop; - return _.top < d.top - u ? (_.top = d.top, _.bottom = _.top + _.height) : _.bottom > d.bottom && (_.bottom = d.bottom, _.top = _.bottom - _.height), _.left < d.left ? (_.left = d.left, _.right = d.left + _.width) : _.right > d.right && (_.right = d.right, _.left = _.right - _.width), s.x >= _.left && s.x <= _.right && (_.left = s.x - _.width - o, _.right = _.left + _.width), s.y >= _.top && s.y <= _.bottom && (_.top = s.y - _.height - t, _.bottom = _.top + _.height), _; + _calculateTooltipPosition(i) { + const t = this._scheduler, r = t.$domHelpers, d = this._getViewPortSize(), n = this.getNode(), s = { top: 0, left: 0, width: n.offsetWidth, height: n.offsetHeight, bottom: 0, right: 0 }, _ = t.config.tooltip_offset_x, a = t.config.tooltip_offset_y, o = document.body, l = r.getRelativeEventPosition(i, o), h = r.getNodePosition(o); + l.y += h.y, s.top = l.y, s.left = l.x, s.top += a, s.left += _, s.bottom = s.top + s.height, s.right = s.left + s.width; + const v = window.scrollY + o.scrollTop; + return s.top < d.top - v ? (s.top = d.top, s.bottom = s.top + s.height) : s.bottom > d.bottom && (s.bottom = d.bottom, s.top = s.bottom - s.height), s.left < d.left ? (s.left = d.left, s.right = d.left + s.width) : s.right > d.right && (s.right = d.right, s.left = s.right - s.width), l.x >= s.left && l.x <= s.right && (s.left = l.x - s.width - _, s.right = s.left + s.width), l.y >= s.top && l.y <= s.bottom && (s.top = l.y - s.height - a, s.bottom = s.top + s.height), s; } _getViewPortSize() { - const h = this._scheduler, a = h.$domHelpers, r = this._getViewPort(); - let d, i = r, _ = window.scrollY + document.body.scrollTop, o = window.scrollX + document.body.scrollLeft; - return r === h.$event_data ? (i = h.$event, _ = 0, o = 0, d = a.getNodePosition(h.$event)) : d = a.getNodePosition(i), { left: d.x + o, top: d.y + _, width: d.width, height: d.height, bottom: d.y + d.height + _, right: d.x + d.width + o }; + const i = this._scheduler, t = i.$domHelpers, r = this._getViewPort(); + let d, n = r, s = window.scrollY + document.body.scrollTop, _ = window.scrollX + document.body.scrollLeft; + return r === i.$event_data ? (n = i.$event, s = 0, _ = 0, d = t.getNodePosition(i.$event)) : d = t.getNodePosition(n), { left: d.x + _, top: d.y + s, width: d.width, height: d.height, bottom: d.y + d.height + s, right: d.x + d.width + _ }; } } -class _t { - constructor(h) { - this._listeners = {}, this.tooltip = new dt(h), this._scheduler = h, this._domEvents = h._createDomEventScope(), this._initDelayedFunctions(); +class vn { + constructor(i) { + this._listeners = {}, this.tooltip = new mn(i), this._scheduler = i, this._domEvents = i._createDomEventScope(), this._initDelayedFunctions(); } destructor() { this.tooltip.hide(), this._domEvents.detachAll(); @@ -4089,138 +6268,138 @@ class _t { hideTooltip() { this.delayHide(); } - attach(h) { - let a = document.body; + attach(i) { + let t = document.body; const r = this._scheduler, d = r.$domHelpers; - h.global || (a = r.$root); - let i = null; - const _ = (o) => { - const t = d.getTargetNode(o), n = d.closest(t, h.selector); - if (d.isChildOf(t, this.tooltip.getNode())) + i.global || (t = r.$root); + let n = null; + const s = (_) => { + const a = d.getTargetNode(_), o = d.closest(a, i.selector); + if (d.isChildOf(a, this.tooltip.getNode())) return; - const s = () => { - i = n, h.onmouseenter(o, n); + const l = () => { + n = o, i.onmouseenter(_, o); }; - i ? n && n === i ? h.onmousemove(o, n) : (h.onmouseleave(o, i), i = null, n && n !== i && s()) : n && s(); + n ? o && o === n ? i.onmousemove(_, o) : (i.onmouseleave(_, n), n = null, o && o !== n && l()) : o && l(); }; - this.detach(h.selector), this._domEvents.attach(a, "mousemove", _), this._listeners[h.selector] = { node: a, handler: _ }; + this.detach(i.selector), this._domEvents.attach(t, "mousemove", s), this._listeners[i.selector] = { node: t, handler: s }; } - detach(h) { - const a = this._listeners[h]; - a && this._domEvents.detach(a.node, "mousemove", a.handler); + detach(i) { + const t = this._listeners[i]; + t && this._domEvents.detach(t.node, "mousemove", t.handler); } - tooltipFor(h) { - const a = (r) => { + tooltipFor(i) { + const t = (r) => { let d = r; return document.createEventObject && !document.createEvent && (d = document.createEventObject(r)), d; }; - this._initDelayedFunctions(), this.attach({ selector: h.selector, global: h.global, onmouseenter: (r, d) => { - const i = h.html(r, d); - i && this.delayShow(a(r), i); + this._initDelayedFunctions(), this.attach({ selector: i.selector, global: i.global, onmouseenter: (r, d) => { + const n = i.html(r, d); + n && this.delayShow(t(r), n); }, onmousemove: (r, d) => { - const i = h.html(r, d); - i ? this.delayShow(a(r), i) : (this.delayShow.$cancelTimeout(), this.delayHide()); + const n = i.html(r, d); + n ? this.delayShow(t(r), n) : (this.delayShow.$cancelTimeout(), this.delayHide()); }, onmouseleave: () => { this.delayShow.$cancelTimeout(), this.delayHide(); } }); } _initDelayedFunctions() { - const h = this._scheduler; - this.delayShow && this.delayShow.$cancelTimeout(), this.delayHide && this.delayHide.$cancelTimeout(), this.tooltip.hide(), this.delayShow = V.delay((a, r) => { - h.callEvent("onBeforeTooltip", [a]) === !1 ? this.tooltip.hide() : (this.tooltip.setContent(r), this.tooltip.show(a)); - }, h.config.tooltip_timeout || 1), this.delayHide = V.delay(() => { + const i = this._scheduler; + this.delayShow && this.delayShow.$cancelTimeout(), this.delayHide && this.delayHide.$cancelTimeout(), this.tooltip.hide(), this.delayShow = ee.delay((t, r) => { + i.callEvent("onBeforeTooltip", [t]) === !1 ? this.tooltip.hide() : (this.tooltip.setContent(r), this.tooltip.show(t)); + }, i.config.tooltip_timeout || 1), this.delayHide = ee.delay(() => { this.delayShow.$cancelTimeout(), this.tooltip.hide(); - }, h.config.tooltip_hide_timeout || 1); + }, i.config.tooltip_hide_timeout || 1); } } -const lt = { active_links: function(e) { - e.config.active_link_view = "day", e._active_link_click = function(h) { - var a = h.target.getAttribute("data-link-date"), r = e.date.str_to_date(e.config.api_date, !1, !0); - if (a) - return e.setCurrentView(r(a), e.config.active_link_view), h && h.preventDefault && h.preventDefault(), !1; +const gn = { active_links: function(e) { + e.config.active_link_view = "day", e._active_link_click = function(i) { + var t = i.target.getAttribute("data-link-date"), r = e.date.str_to_date(e.config.api_date, !1, !0); + if (t) + return e.setCurrentView(r(t), e.config.active_link_view), i && i.preventDefault && i.preventDefault(), !1; }, e.attachEvent("onTemplatesReady", function() { - var h = function(r, d) { + var i = function(r, d) { d = d || r + "_scale_date", e.templates["_active_links_old_" + d] || (e.templates["_active_links_old_" + d] = e.templates[d]); - var i = e.templates["_active_links_old_" + d], _ = e.date.date_to_str(e.config.api_date); - e.templates[d] = function(o) { - return "" + i(o) + ""; + var n = e.templates["_active_links_old_" + d], s = e.date.date_to_str(e.config.api_date); + e.templates[d] = function(_) { + return "" + n(_) + ""; }; }; - if (h("week"), h("", "month_day"), this.matrix) - for (var a in this.matrix) - h(a); + if (i("week"), i("", "month_day"), this.matrix) + for (var t in this.matrix) + i(t); this._detachDomEvent(this._obj, "click", e._active_link_click), e.event(this._obj, "click", e._active_link_click); }); }, agenda_legacy: function(e) { - e.date.add_agenda_legacy = function(h) { - return e.date.add(h, 1, "year"); - }, e.templates.agenda_legacy_time = function(h, a, r) { - return r._timed ? this.day_date(r.start_date, r.end_date, r) + " " + this.event_date(h) : e.templates.day_date(h) + " – " + e.templates.day_date(a); - }, e.templates.agenda_legacy_text = function(h, a, r) { + e.date.add_agenda_legacy = function(i) { + return e.date.add(i, 1, "year"); + }, e.templates.agenda_legacy_time = function(i, t, r) { + return r._timed ? this.day_date(r.start_date, r.end_date, r) + " " + this.event_date(i) : e.templates.day_date(i) + " – " + e.templates.day_date(t); + }, e.templates.agenda_legacy_text = function(i, t, r) { return r.text; }, e.templates.agenda_legacy_date = function() { return ""; }, e.date.agenda_legacy_start = function() { return e.date.date_part(e._currentDate()); }, e.attachEvent("onTemplatesReady", function() { - var h = e.dblclick_dhx_cal_data; + var i = e.dblclick_dhx_cal_data; e.dblclick_dhx_cal_data = function() { if (this._mode == "agenda_legacy") !this.config.readonly && this.config.dblclick_create && this.addEventNow(); - else if (h) - return h.apply(this, arguments); + else if (i) + return i.apply(this, arguments); }; - var a = e.render_data; - e.render_data = function(i) { + var t = e.render_data; + e.render_data = function(n) { if (this._mode != "agenda_legacy") - return a.apply(this, arguments); + return t.apply(this, arguments); d(); }; var r = e.render_view_data; function d() { - var i = e.get_visible_events(); - i.sort(function(g, p) { - return g.start_date > p.start_date ? 1 : -1; + var n = e.get_visible_events(); + n.sort(function(m, g) { + return m.start_date > g.start_date ? 1 : -1; }); - for (var _, o = "
", t = 0; t < i.length; t++) { - var n = i[t], s = n.color ? "--dhx-scheduler-event-background:" + n.color + ";" : "", c = n.textColor ? "--dhx-scheduler-event-color:" + n.textColor + ";" : "", u = e.templates.event_class(n.start_date, n.end_date, n); - _ = e._waiAria.agendaEventAttrString(n); - var v = e._waiAria.agendaDetailsBtnString(); - o += "
" + (e.config.rtl ? e.templates.agenda_time(n.end_date, n.start_date, n) : e.templates.agenda_time(n.start_date, n.end_date, n)) + "
", o += `
+ for (var s, _ = "
", a = 0; a < n.length; a++) { + var o = n[a], l = o.color ? "--dhx-scheduler-event-background:" + o.color + ";" : "", h = o.textColor ? "--dhx-scheduler-event-color:" + o.textColor + ";" : "", v = e.templates.event_class(o.start_date, o.end_date, o); + s = e._waiAria.agendaEventAttrString(o); + var u = e._waiAria.agendaDetailsBtnString(); + _ += "
" + (e.config.rtl ? e.templates.agenda_time(o.end_date, o.start_date, o) : e.templates.agenda_time(o.start_date, o.end_date, o)) + "
", _ += `
-
`, o += "" + e.templates.agenda_text(n.start_date, n.end_date, n) + "
"; +
`, _ += "" + e.templates.agenda_text(o.start_date, o.end_date, o) + "
"; } - o += "
", e._els.dhx_cal_data[0].innerHTML = o, e._els.dhx_cal_data[0].childNodes[0].scrollTop = e._agendaScrollTop || 0; - var m = e._els.dhx_cal_data[0].childNodes[0]; - m.childNodes[m.childNodes.length - 1].style.height = m.offsetHeight < e._els.dhx_cal_data[0].offsetHeight ? "100%" : m.offsetHeight + "px"; - var l = e._els.dhx_cal_data[0].firstChild.childNodes, f = e._getNavDateElement(); - for (f && (f.innerHTML = e.templates.agenda_date(e._min_date, e._max_date, e._mode)), e._rendered = [], t = 0; t < l.length - 1; t++) - e._rendered[t] = l[t]; + _ += "
", e._els.dhx_cal_data[0].innerHTML = _, e._els.dhx_cal_data[0].childNodes[0].scrollTop = e._agendaScrollTop || 0; + var f = e._els.dhx_cal_data[0].childNodes[0]; + f.childNodes[f.childNodes.length - 1].style.height = f.offsetHeight < e._els.dhx_cal_data[0].offsetHeight ? "100%" : f.offsetHeight + "px"; + var c = e._els.dhx_cal_data[0].firstChild.childNodes, p = e._getNavDateElement(); + for (p && (p.innerHTML = e.templates.agenda_date(e._min_date, e._max_date, e._mode)), e._rendered = [], a = 0; a < c.length - 1; a++) + e._rendered[a] = c[a]; } e.render_view_data = function() { return this._mode == "agenda_legacy" && (e._agendaScrollTop = e._els.dhx_cal_data[0].childNodes[0].scrollTop, e._els.dhx_cal_data[0].childNodes[0].scrollTop = 0), r.apply(this, arguments); - }, e.agenda_legacy_view = function(i) { - e._min_date = e.config.agenda_start || e.date.agenda_legacy_start(e._date), e._max_date = e.config.agenda_end || e.date.add_agenda_legacy(e._min_date, 1), function(_) { - if (_) { - var o = e.locale.labels, t = e._waiAria.agendaHeadAttrString(), n = e._waiAria.agendaHeadDateString(o.date), s = e._waiAria.agendaHeadDescriptionString(o.description); - e._els.dhx_cal_header[0].innerHTML = "
" + o.date + "
" + o.description + "
", e._table_view = !0, e.set_sizes(); + }, e.agenda_legacy_view = function(n) { + e._min_date = e.config.agenda_start || e.date.agenda_legacy_start(e._date), e._max_date = e.config.agenda_end || e.date.add_agenda_legacy(e._min_date, 1), function(s) { + if (s) { + var _ = e.locale.labels, a = e._waiAria.agendaHeadAttrString(), o = e._waiAria.agendaHeadDateString(_.date), l = e._waiAria.agendaHeadDescriptionString(_.description); + e._els.dhx_cal_header[0].innerHTML = "
" + _.date + "
" + _.description + "
", e._table_view = !0, e.set_sizes(); } - }(i), i ? (e._cols = null, e._colsS = null, e._table_view = !0, d()) : e._table_view = !1; + }(n), n ? (e._cols = null, e._colsS = null, e._table_view = !0, d()) : e._table_view = !1; }; }); }, agenda_view: function(e) { - e.date.add_agenda = function(d, i) { - return e.date.add(d, 1 * i, "month"); - }, e.templates.agenda_time = function(d, i, _) { - return _._timed ? `${this.event_date(d)} - ${this.event_date(i)}` : e.locale.labels.full_day; - }, e.templates.agenda_text = function(d, i, _) { - return _.text; + e.date.add_agenda = function(d, n) { + return e.date.add(d, 1 * n, "month"); + }, e.templates.agenda_time = function(d, n, s) { + return s._timed ? `${this.event_date(d)} - ${this.event_date(n)}` : e.locale.labels.full_day; + }, e.templates.agenda_text = function(d, n, s) { + return s.text; }; - const h = e.date.date_to_str("%F %j"), a = e.date.date_to_str("%l"); + const i = e.date.date_to_str("%F %j"), t = e.date.date_to_str("%l"); e.templates.agenda_day = function(d) { - return `
${h(d)}
-
${a(d)}
`; - }, e.templates.agenda_date = function(d, i) { + return `
${i(d)}
+
${t(d)}
`; + }, e.templates.agenda_date = function(d, n) { return e.templates.month_date(e.getState().date); }, e.date.agenda_start = function(d) { return e.date.month_start(new Date(d)); @@ -4234,369 +6413,369 @@ const lt = { active_links: function(e) { else if (d) return d.apply(this, arguments); }; - var i = e.render_data; - e.render_data = function(n) { + var n = e.render_data; + e.render_data = function(o) { if (this._mode != "agenda") - return i.apply(this, arguments); - o(); + return n.apply(this, arguments); + _(); }; - var _ = e.render_view_data; - function o() { - const n = e.get_visible_events(); - n.sort(function(f, g) { - return f.start_date > g.start_date ? 1 : -1; + var s = e.render_view_data; + function _() { + const o = e.get_visible_events(); + o.sort(function(p, m) { + return p.start_date > m.start_date ? 1 : -1; }); - const s = {}; - let c = e.getState().min_date; - const u = e.getState().max_date; - for (; c.valueOf() < u.valueOf(); ) - s[c.valueOf()] = [], c = e.date.add(c, 1, "day"); - let v = !1; - if (n.forEach((f) => { - let g = e.date.day_start(new Date(f.start_date)); - for (; g.valueOf() < f.end_date.valueOf(); ) - s[g.valueOf()] && (s[g.valueOf()].push(f), v = !0), g = e.date.day_start(e.date.add(g, 1, "day")); - }), v) { - let f = ""; - for (let g in s) - f += t(new Date(1 * g), s[g]); - e._els.dhx_cal_data[0].innerHTML = f; + const l = {}; + let h = e.getState().min_date; + const v = e.getState().max_date; + for (; h.valueOf() < v.valueOf(); ) + l[h.valueOf()] = [], h = e.date.add(h, 1, "day"); + let u = !1; + if (o.forEach((p) => { + let m = e.date.day_start(new Date(p.start_date)); + for (; m.valueOf() < p.end_date.valueOf(); ) + l[m.valueOf()] && (l[m.valueOf()].push(p), u = !0), m = e.date.day_start(e.date.add(m, 1, "day")); + }), u) { + let p = ""; + for (let m in l) + p += a(new Date(1 * m), l[m]); + e._els.dhx_cal_data[0].innerHTML = p; } else e._els.dhx_cal_data[0].innerHTML = `
${e.locale.labels.agenda_tab}
`; e._els.dhx_cal_data[0].scrollTop = r; - let m = e._els.dhx_cal_data[0].querySelectorAll(".dhx_cal_agenda_event_line"); + let f = e._els.dhx_cal_data[0].querySelectorAll(".dhx_cal_agenda_event_line"); e._rendered = []; - for (var l = 0; l < m.length - 1; l++) - e._rendered[l] = m[l]; + for (var c = 0; c < f.length - 1; c++) + e._rendered[c] = f[c]; } - function t(n, s) { - if (!s.length) + function a(o, l) { + if (!l.length) return ""; - let c = ` + let h = `
-
${e.templates.agenda_day(n)}
+
${e.templates.agenda_day(o)}
`; - return s.forEach((u) => { - c += function(v, m) { - const l = e.templates.agenda_time(m.start_date, m.end_date, m), f = e.getState().select_id, g = e.templates.event_class(m.start_date, m.end_date, m), p = e.templates.agenda_text(m.start_date, m.end_date, m); + return l.forEach((v) => { + h += function(u, f) { + const c = e.templates.agenda_time(f.start_date, f.end_date, f), p = e.getState().select_id, m = e.templates.event_class(f.start_date, f.end_date, f), g = e.templates.agenda_text(f.start_date, f.end_date, f); let y = ""; - return (m.color || m.textColor) && (y = ` style="${m.color ? "--dhx-scheduler-event-background:" + m.color + ";" : ""}${m.textColor ? "--dhx-scheduler-event-color:" + m.textColor + ";" : ""}" `), `
+ return (f.color || f.textColor) && (y = ` style="${f.color ? "--dhx-scheduler-event-background:" + f.color + ";" : ""}${f.textColor ? "--dhx-scheduler-event-color:" + f.textColor + ";" : ""}" `), `
-
${l}
-
${p}
+
${c}
+
${g}
`; - }(0, u); - }), c += "
", c; + }(0, v); + }), h += "
", h; } e.render_view_data = function() { - return this._mode == "agenda" && (r = e._els.dhx_cal_data[0].scrollTop, e._els.dhx_cal_data[0].scrollTop = 0), _.apply(this, arguments); - }, e.agenda_view = function(n) { - n ? (e._min_date = e.config.agenda_start || e.date.agenda_start(e._date), e._max_date = e.config.agenda_end || e.date.add_agenda(e._min_date, 1), e._cols = null, e._colsS = null, e._table_view = !0, e._getNavDateElement().innerHTML = e.templates.agenda_date(e._date), o()) : e._table_view = !1; + return this._mode == "agenda" && (r = e._els.dhx_cal_data[0].scrollTop, e._els.dhx_cal_data[0].scrollTop = 0), s.apply(this, arguments); + }, e.agenda_view = function(o) { + o ? (e._min_date = e.config.agenda_start || e.date.agenda_start(e._date), e._max_date = e.config.agenda_end || e.date.add_agenda(e._min_date, 1), e._cols = null, e._colsS = null, e._table_view = !0, e._getNavDateElement().innerHTML = e.templates.agenda_date(e._date), _()) : e._table_view = !1; }; }); }, all_timed: function(e) { e.config.all_timed = "short", e.config.all_timed_month = !1; - var h = function(o) { - return !((o.end_date - o.start_date) / 36e5 >= 24) || e._drag_mode == "resize" && e._drag_id == o.id; + var i = function(_) { + return !((_.end_date - _.start_date) / 36e5 >= 24) || e._drag_mode == "resize" && e._drag_id == _.id; }; - e._safe_copy = function(o) { - var t = null, n = e._copy_event(o); - return o.event_pid && (t = e.getEvent(o.event_pid)), t && t.isPrototypeOf(o) && (delete n.event_length, delete n.event_pid, delete n.rec_pattern, delete n.rec_type), n; + e._safe_copy = function(_) { + var a = null, o = e._copy_event(_); + return _.event_pid && (a = e.getEvent(_.event_pid)), a && a.isPrototypeOf(_) && (delete o.event_length, delete o.event_pid, delete o.rec_pattern, delete o.rec_type), o; }; - var a = e._pre_render_events_line, r = e._pre_render_events_table, d = function(o, t) { - return this._table_view ? r.call(this, o, t) : a.call(this, o, t); + var t = e._pre_render_events_line, r = e._pre_render_events_table, d = function(_, a) { + return this._table_view ? r.call(this, _, a) : t.call(this, _, a); }; - e._pre_render_events_line = e._pre_render_events_table = function(o, t) { + e._pre_render_events_line = e._pre_render_events_table = function(_, a) { if (!this.config.all_timed || this._table_view && this._mode != "month" || this._mode == "month" && !this.config.all_timed_month) - return d.call(this, o, t); - for (var n = 0; n < o.length; n++) { - var s = o[n]; - if (!s._timed) - if (this.config.all_timed != "short" || h(s)) { - var c = this._safe_copy(s); - s._virtual ? c._first_chunk = !1 : c._first_chunk = !0, c._drag_resize = !1, c._virtual = !0, c.start_date = new Date(c.start_date), l(s) ? (c.end_date = f(c.start_date), this.config.last_hour != 24 && (c.end_date = g(c.start_date, this.config.last_hour))) : c.end_date = new Date(s.end_date); - var u = !1; - c.start_date < this._max_date && c.end_date > this._min_date && c.start_date < c.end_date && (o[n] = c, u = !0); - var v = this._safe_copy(s); - if (v._virtual = !0, v.end_date = new Date(v.end_date), v.start_date < this._min_date ? v.start_date = g(this._min_date, this.config.first_hour) : v.start_date = g(f(s.start_date), this.config.first_hour), v.start_date < this._max_date && v.start_date < v.end_date) { - if (!u) { - o[n--] = v; + return d.call(this, _, a); + for (var o = 0; o < _.length; o++) { + var l = _[o]; + if (!l._timed) + if (this.config.all_timed != "short" || i(l)) { + var h = this._safe_copy(l); + l._virtual ? h._first_chunk = !1 : h._first_chunk = !0, h._drag_resize = !1, h._virtual = !0, h.start_date = new Date(h.start_date), c(l) ? (h.end_date = p(h.start_date), this.config.last_hour != 24 && (h.end_date = m(h.start_date, this.config.last_hour))) : h.end_date = new Date(l.end_date); + var v = !1; + h.start_date < this._max_date && h.end_date > this._min_date && h.start_date < h.end_date && (_[o] = h, v = !0); + var u = this._safe_copy(l); + if (u._virtual = !0, u.end_date = new Date(u.end_date), u.start_date < this._min_date ? u.start_date = m(this._min_date, this.config.first_hour) : u.start_date = m(p(l.start_date), this.config.first_hour), u.start_date < this._max_date && u.start_date < u.end_date) { + if (!v) { + _[o--] = u; continue; } - o.splice(n + 1, 0, v), v._last_chunk = !1; + _.splice(o + 1, 0, u), u._last_chunk = !1; } else - c._last_chunk = !0, c._drag_resize = !0; + h._last_chunk = !0, h._drag_resize = !0; } else - this._mode != "month" && o.splice(n--, 1); + this._mode != "month" && _.splice(o--, 1); } - var m = this._drag_mode != "move" && t; - return d.call(this, o, m); - function l(p) { - var y = f(p.start_date); - return +p.end_date > +y; + var f = this._drag_mode != "move" && a; + return d.call(this, _, f); + function c(g) { + var y = p(g.start_date); + return +g.end_date > +y; } - function f(p) { - var y = e.date.add(p, 1, "day"); + function p(g) { + var y = e.date.add(g, 1, "day"); return y = e.date.date_part(y); } - function g(p, y) { - var w = e.date.date_part(new Date(p)); - return w.setHours(y), w; + function m(g, y) { + var x = e.date.date_part(new Date(g)); + return x.setHours(y), x; } }; - var i = e.get_visible_events; - e.get_visible_events = function(o) { - return this.config.all_timed && this.config.multi_day ? i.call(this, !1) : i.call(this, o); - }, e.attachEvent("onBeforeViewChange", function(o, t, n, s) { - return e._allow_dnd = n == "day" || n == "week" || e.getView(n), !0; - }), e._is_main_area_event = function(o) { - return !!(o._timed || this.config.all_timed === !0 || this.config.all_timed == "short" && h(o)); + var n = e.get_visible_events; + e.get_visible_events = function(_) { + return this.config.all_timed && this.config.multi_day ? n.call(this, !1) : n.call(this, _); + }, e.attachEvent("onBeforeViewChange", function(_, a, o, l) { + return e._allow_dnd = o == "day" || o == "week" || e.getView(o), !0; + }), e._is_main_area_event = function(_) { + return !!(_._timed || this.config.all_timed === !0 || this.config.all_timed == "short" && i(_)); }; - var _ = e.updateEvent; - e.updateEvent = function(o) { - var t, n, s = e.getEvent(o); - s && (t = e.config.all_timed && !(e.isOneDayEvent(e._events[o]) || e.getState().drag_id)) && (n = e.config.update_render, e.config.update_render = !0), _.apply(e, arguments), s && t && (e.config.update_render = n); + var s = e.updateEvent; + e.updateEvent = function(_) { + var a, o, l = e.getEvent(_); + l && (a = e.config.all_timed && !(e.isOneDayEvent(e._events[_]) || e.getState().drag_id)) && (o = e.config.update_render, e.config.update_render = !0), s.apply(e, arguments), l && a && (e.config.update_render = o); }; }, collision: function(e) { - var h, a; + var i, t; function r(d) { - e._get_section_view() && d && (h = e.getEvent(d)[e._get_section_property()]); + e._get_section_view() && d && (i = e.getEvent(d)[e._get_section_property()]); } e.config.collision_limit = 1, e.attachEvent("onBeforeDrag", function(d) { return r(d), !0; }), e.attachEvent("onBeforeLightbox", function(d) { - var i = e.getEvent(d); - return a = [i.start_date, i.end_date], r(d), !0; + var n = e.getEvent(d); + return t = [n.start_date, n.end_date], r(d), !0; }), e.attachEvent("onEventChanged", function(d) { if (!d || !e.getEvent(d)) return !0; - var i = e.getEvent(d); - if (!e.checkCollision(i)) { - if (!a) + var n = e.getEvent(d); + if (!e.checkCollision(n)) { + if (!t) return !1; - i.start_date = a[0], i.end_date = a[1], i._timed = this.isOneDayEvent(i); + n.start_date = t[0], n.end_date = t[1], n._timed = this.isOneDayEvent(n); } return !0; - }), e.attachEvent("onBeforeEventChanged", function(d, i, _) { + }), e.attachEvent("onBeforeEventChanged", function(d, n, s) { return e.checkCollision(d); - }), e.attachEvent("onEventAdded", function(d, i) { - e.checkCollision(i) || e.deleteEvent(d); - }), e.attachEvent("onEventSave", function(d, i, _) { - if ((i = e._lame_clone(i)).id = d, !i.start_date || !i.end_date) { - var o = e.getEvent(d); - i.start_date = new Date(o.start_date), i.end_date = new Date(o.end_date); - } - return i.rec_type && e._roll_back_dates(i), e.checkCollision(i); - }), e._check_sections_collision = function(d, i) { - var _ = e._get_section_property(); - return d[_] == i[_] && d.id != i.id; + }), e.attachEvent("onEventAdded", function(d, n) { + e.checkCollision(n) || e.deleteEvent(d); + }), e.attachEvent("onEventSave", function(d, n, s) { + if ((n = e._lame_clone(n)).id = d, !n.start_date || !n.end_date) { + var _ = e.getEvent(d); + n.start_date = new Date(_.start_date), n.end_date = new Date(_.end_date); + } + return n.rec_type && e._roll_back_dates(n), e.checkCollision(n); + }), e._check_sections_collision = function(d, n) { + var s = e._get_section_property(); + return d[s] == n[s] && d.id != n.id; }, e.checkCollision = function(d) { - var i = [], _ = e.config.collision_limit; + var n = [], s = e.config.collision_limit; if (d.rec_type) - for (var o = e.getRecDates(d), t = 0; t < o.length; t++) - for (var n = e.getEvents(o[t].start_date, o[t].end_date), s = 0; s < n.length; s++) - (n[s].event_pid || n[s].id) != d.id && i.push(n[s]); + for (var _ = e.getRecDates(d), a = 0; a < _.length; a++) + for (var o = e.getEvents(_[a].start_date, _[a].end_date), l = 0; l < o.length; l++) + (o[l].event_pid || o[l].id) != d.id && n.push(o[l]); else { - i = e.getEvents(d.start_date, d.end_date); - for (var c = 0; c < i.length; c++) { - var u = i[c]; - if (u.id == d.id || u.event_length && [u.event_pid, u.event_length].join("#") == d.id) { - i.splice(c, 1); + n = e.getEvents(d.start_date, d.end_date); + for (var h = 0; h < n.length; h++) { + var v = n[h]; + if (v.id == d.id || v.event_length && [v.event_pid, v.event_length].join("#") == d.id) { + n.splice(h, 1); break; } } } - var v = e._get_section_view(), m = e._get_section_property(), l = !0; - if (v) { - var f = 0; - for (c = 0; c < i.length; c++) - i[c].id != d.id && this._check_sections_collision(i[c], d) && f++; - f >= _ && (l = !1); + var u = e._get_section_view(), f = e._get_section_property(), c = !0; + if (u) { + var p = 0; + for (h = 0; h < n.length; h++) + n[h].id != d.id && this._check_sections_collision(n[h], d) && p++; + p >= s && (c = !1); } else - i.length >= _ && (l = !1); - if (!l) { - var g = !e.callEvent("onEventCollision", [d, i]); - return g || (d[m] = h || d[m]), g; + n.length >= s && (c = !1); + if (!c) { + var m = !e.callEvent("onEventCollision", [d, n]); + return m || (d[f] = i || d[f]), m; } - return l; + return c; }; }, container_autoresize: function(e) { e.config.container_autoresize = !0, e.config.month_day_min_height = 90, e.config.min_grid_size = 25, e.config.min_map_size = 400; - var h = e._pre_render_events, a = !0, r = 0, d = 0; - e._pre_render_events = function(s, c) { - if (!e.config.container_autoresize || !a) - return h.apply(this, arguments); - var u = this.xy.bar_height, v = this._colsS.heights, m = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0], l = this._els.dhx_cal_data[0]; - if (s = this._table_view ? this._pre_render_events_table(s, c) : this._pre_render_events_line(s, c), this._table_view) - if (c) - this._colsS.heights = v; + var i = e._pre_render_events, t = !0, r = 0, d = 0; + e._pre_render_events = function(l, h) { + if (!e.config.container_autoresize || !t) + return i.apply(this, arguments); + var v = this.xy.bar_height, u = this._colsS.heights, f = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0], c = this._els.dhx_cal_data[0]; + if (l = this._table_view ? this._pre_render_events_table(l, h) : this._pre_render_events_line(l, h), this._table_view) + if (h) + this._colsS.heights = u; else { - var f = l.firstChild; - const E = f.querySelectorAll(".dhx_cal_month_row"); + var p = c.firstChild; + const E = p.querySelectorAll(".dhx_cal_month_row"); if (E) { - for (var g = 0; g < E.length; g++) { - if (m[g]++, m[g] * u > this._colsS.height - this.xy.month_head_height) { - var p = E[g].querySelectorAll(".dhx_cal_month_cell"), y = this._colsS.height - this.xy.month_head_height; - 1 * this.config.max_month_events !== this.config.max_month_events || m[g] <= this.config.max_month_events ? y = m[g] * u : (this.config.max_month_events + 1) * u > this._colsS.height - this.xy.month_head_height && (y = (this.config.max_month_events + 1) * u), E[g].style.height = y + this.xy.month_head_height + "px"; - for (var w = 0; w < p.length; w++) - p[w].childNodes[1].style.height = y + "px"; - m[g] = (m[g - 1] || 0) + p[0].offsetHeight; + for (var m = 0; m < E.length; m++) { + if (f[m]++, f[m] * v > this._colsS.height - this.xy.month_head_height) { + var g = E[m].querySelectorAll(".dhx_cal_month_cell"), y = this._colsS.height - this.xy.month_head_height; + 1 * this.config.max_month_events !== this.config.max_month_events || f[m] <= this.config.max_month_events ? y = f[m] * v : (this.config.max_month_events + 1) * v > this._colsS.height - this.xy.month_head_height && (y = (this.config.max_month_events + 1) * v), E[m].style.height = y + this.xy.month_head_height + "px"; + for (var x = 0; x < g.length; x++) + g[x].childNodes[1].style.height = y + "px"; + f[m] = (f[m - 1] || 0) + g[0].offsetHeight; } - m[g] = (m[g - 1] || 0) + E[g].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight; + f[m] = (f[m - 1] || 0) + E[m].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight; } - m.unshift(0), f.parentNode.offsetHeight < f.parentNode.scrollHeight && f._h_fix; - } else if (s.length || this._els.dhx_multi_day[0].style.visibility != "visible" || (m[0] = -1), s.length || m[0] == -1) { - var b = (m[0] + 1) * u + 1; + f.unshift(0), p.parentNode.offsetHeight < p.parentNode.scrollHeight && p._h_fix; + } else if (l.length || this._els.dhx_multi_day[0].style.visibility != "visible" || (f[0] = -1), l.length || f[0] == -1) { + var b = (f[0] + 1) * v + 1; d != b + 1 && (this._obj.style.height = r - d + b - 1 + "px"), b += "px"; - const D = this._els.dhx_cal_navline[0].offsetHeight, x = this._els.dhx_cal_header[0].offsetHeight; - l.style.height = this._obj.offsetHeight - D - x - (this.xy.margin_top || 0) + "px"; + const D = this._els.dhx_cal_navline[0].offsetHeight, w = this._els.dhx_cal_header[0].offsetHeight; + c.style.height = this._obj.offsetHeight - D - w - (this.xy.margin_top || 0) + "px"; var k = this._els.dhx_multi_day[0]; - k.style.height = b, k.style.visibility = m[0] == -1 ? "hidden" : "visible", (k = this._els.dhx_multi_day[1]).style.height = b, k.style.visibility = m[0] == -1 ? "hidden" : "visible", k.style.visibility == "hidden" ? k.style.display = "none" : k.style.display = "", k.className = m[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small", this._dy_shift = (m[0] + 1) * u, m[0] = 0; + k.style.height = b, k.style.visibility = f[0] == -1 ? "hidden" : "visible", (k = this._els.dhx_multi_day[1]).style.height = b, k.style.visibility = f[0] == -1 ? "hidden" : "visible", k.style.visibility == "hidden" ? k.style.display = "none" : k.style.display = "", k.className = f[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small", this._dy_shift = (f[0] + 1) * v, f[0] = 0; } } - return s; + return l; }; - var i = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"], _ = function(s) { + var n = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"], s = function(l) { r = 0; - for (var c = 0; c < i.length; c++) { - var u = i[c], v = e._els[u] ? e._els[u][0] : null, m = 0; - switch (u) { + for (var h = 0; h < n.length; h++) { + var v = n[h], u = e._els[v] ? e._els[v][0] : null, f = 0; + switch (v) { case "dhx_cal_navline": case "dhx_cal_header": - m = v.offsetHeight; + f = u.offsetHeight; break; case "dhx_multi_day": - m = v ? v.offsetHeight - 1 : 0, d = m; + f = u ? u.offsetHeight - 1 : 0, d = f; break; case "dhx_cal_data": - var l = e.getState().mode; - if (v.childNodes[1] && l != "month") { + var c = e.getState().mode; + if (u.childNodes[1] && c != "month") { let M = 0; - for (let A = 0; A < v.childNodes.length; A++) - v.childNodes[A].offsetHeight > M && (M = v.childNodes[A].offsetHeight); - m = M; + for (let T = 0; T < u.childNodes.length; T++) + u.childNodes[T].offsetHeight > M && (M = u.childNodes[T].offsetHeight); + f = M; } else - m = Math.max(v.offsetHeight - 1, v.scrollHeight); - if (l == "month") - e.config.month_day_min_height && !s && (m = v.querySelectorAll(".dhx_cal_month_row").length * e.config.month_day_min_height), s && (v.style.height = m + "px"); - else if (l == "year") - m = 190 * e.config.year_y; - else if (l == "agenda") { - if (m = 0, v.childNodes && v.childNodes.length) - for (var f = 0; f < v.childNodes.length; f++) - m += v.childNodes[f].offsetHeight; - m + 2 < e.config.min_grid_size ? m = e.config.min_grid_size : m += 2; - } else if (l == "week_agenda") { - for (var g, p, y = e.xy.week_agenda_scale_height + e.config.min_grid_size, w = 0; w < v.childNodes.length; w++) - for (p = v.childNodes[w], f = 0; f < p.childNodes.length; f++) { - for (var b = 0, k = p.childNodes[f].childNodes[1], E = 0; E < k.childNodes.length; E++) + f = Math.max(u.offsetHeight - 1, u.scrollHeight); + if (c == "month") + e.config.month_day_min_height && !l && (f = u.querySelectorAll(".dhx_cal_month_row").length * e.config.month_day_min_height), l && (u.style.height = f + "px"); + else if (c == "year") + f = 190 * e.config.year_y; + else if (c == "agenda") { + if (f = 0, u.childNodes && u.childNodes.length) + for (var p = 0; p < u.childNodes.length; p++) + f += u.childNodes[p].offsetHeight; + f + 2 < e.config.min_grid_size ? f = e.config.min_grid_size : f += 2; + } else if (c == "week_agenda") { + for (var m, g, y = e.xy.week_agenda_scale_height + e.config.min_grid_size, x = 0; x < u.childNodes.length; x++) + for (g = u.childNodes[x], p = 0; p < g.childNodes.length; p++) { + for (var b = 0, k = g.childNodes[p].childNodes[1], E = 0; E < k.childNodes.length; E++) b += k.childNodes[E].offsetHeight; - g = b + e.xy.week_agenda_scale_height, (g = w != 1 || f != 2 && f != 3 ? g : 2 * g) > y && (y = g); + m = b + e.xy.week_agenda_scale_height, (m = x != 1 || p != 2 && p != 3 ? m : 2 * m) > y && (y = m); } - m = 3 * y; - } else if (l == "map") { - m = 0; - var D = v.querySelectorAll(".dhx_map_line"); - for (f = 0; f < D.length; f++) - m += D[f].offsetHeight; - m + 2 < e.config.min_map_size ? m = e.config.min_map_size : m += 2; + f = 3 * y; + } else if (c == "map") { + f = 0; + var D = u.querySelectorAll(".dhx_map_line"); + for (p = 0; p < D.length; p++) + f += D[p].offsetHeight; + f + 2 < e.config.min_map_size ? f = e.config.min_map_size : f += 2; } else if (e._gridView) - if (m = 0, v.childNodes[1].childNodes[0].childNodes && v.childNodes[1].childNodes[0].childNodes.length) { - for (D = v.childNodes[1].childNodes[0].childNodes[0].childNodes, f = 0; f < D.length; f++) - m += D[f].offsetHeight; - (m += 2) < e.config.min_grid_size && (m = e.config.min_grid_size); + if (f = 0, u.childNodes[1].childNodes[0].childNodes && u.childNodes[1].childNodes[0].childNodes.length) { + for (D = u.childNodes[1].childNodes[0].childNodes[0].childNodes, p = 0; p < D.length; p++) + f += D[p].offsetHeight; + (f += 2) < e.config.min_grid_size && (f = e.config.min_grid_size); } else - m = e.config.min_grid_size; - if (e.matrix && e.matrix[l]) { - if (s) - m += 0, v.style.height = m + "px"; + f = e.config.min_grid_size; + if (e.matrix && e.matrix[c]) { + if (l) + f += 0, u.style.height = f + "px"; else { - m = 0; - for (var x = e.matrix[l], S = x.y_unit, N = 0; N < S.length; N++) - m += x.getSectionHeight(S[N].key); - e.$container.clientWidth != e.$container.scrollWidth && (m += n()); + f = 0; + for (var w = e.matrix[c], S = w.y_unit, N = 0; N < S.length; N++) + f += w.getSectionHeight(S[N].key); + e.$container.clientWidth != e.$container.scrollWidth && (f += o()); } - m -= 1; + f -= 1; } - (l == "day" || l == "week" || e._props && e._props[l]) && (m += 2); + (c == "day" || c == "week" || e._props && e._props[c]) && (f += 2); } - r += m += 1; + r += f += 1; } - e._obj.style.height = r + "px", s || e.updateView(); + e._obj.style.height = r + "px", l || e.updateView(); }; - function o() { - a = !1, e.callEvent("onAfterSchedulerResize", []), a = !0; + function _() { + t = !1, e.callEvent("onAfterSchedulerResize", []), t = !0; } - var t = function() { - if (!e.config.container_autoresize || !a) + var a = function() { + if (!e.config.container_autoresize || !t) return !0; - var s = e.getState().mode; - if (!s) + var l = e.getState().mode; + if (!l) return !0; - var c = window.requestAnimationFrame || window.setTimeout, u = document.documentElement.scrollTop; - c(function() { - !e.$destroyed && e.$initialized && _(); - }), e.matrix && e.matrix[s] || s == "month" ? c(function() { - !e.$destroyed && e.$initialized && (_(!0), document.documentElement.scrollTop = u, o()); - }, 1) : o(); + var h = window.requestAnimationFrame || window.setTimeout, v = document.documentElement.scrollTop; + h(function() { + !e.$destroyed && e.$initialized && s(); + }), e.matrix && e.matrix[l] || l == "month" ? h(function() { + !e.$destroyed && e.$initialized && (s(!0), document.documentElement.scrollTop = v, _()); + }, 1) : _(); }; - function n() { - var s = document.createElement("div"); - s.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;", document.body.appendChild(s); - var c = s.offsetWidth - s.clientWidth; - return document.body.removeChild(s), c; + function o() { + var l = document.createElement("div"); + l.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;", document.body.appendChild(l); + var h = l.offsetWidth - l.clientWidth; + return document.body.removeChild(l), h; } e.attachEvent("onBeforeViewChange", function() { - var s = e.config.container_autoresize; - if (e.xy.$original_scroll_width || (e.xy.$original_scroll_width = e.xy.scroll_width), e.xy.scroll_width = s ? 0 : e.xy.$original_scroll_width, e.matrix) - for (var c in e.matrix) { - var u = e.matrix[c]; - u.$original_section_autoheight || (u.$original_section_autoheight = u.section_autoheight), u.section_autoheight = !s && u.$original_section_autoheight; + var l = e.config.container_autoresize; + if (e.xy.$original_scroll_width || (e.xy.$original_scroll_width = e.xy.scroll_width), e.xy.scroll_width = l ? 0 : e.xy.$original_scroll_width, e.matrix) + for (var h in e.matrix) { + var v = e.matrix[h]; + v.$original_section_autoheight || (v.$original_section_autoheight = v.section_autoheight), v.section_autoheight = !l && v.$original_section_autoheight; } return !0; - }), e.attachEvent("onViewChange", t), e.attachEvent("onXLE", t), e.attachEvent("onEventChanged", t), e.attachEvent("onEventCreated", t), e.attachEvent("onEventAdded", t), e.attachEvent("onEventDeleted", t), e.attachEvent("onAfterSchedulerResize", t), e.attachEvent("onClearAll", t), e.attachEvent("onBeforeExpand", function() { - return a = !1, !0; + }), e.attachEvent("onViewChange", a), e.attachEvent("onXLE", a), e.attachEvent("onEventChanged", a), e.attachEvent("onEventCreated", a), e.attachEvent("onEventAdded", a), e.attachEvent("onEventDeleted", a), e.attachEvent("onAfterSchedulerResize", a), e.attachEvent("onClearAll", a), e.attachEvent("onBeforeExpand", function() { + return t = !1, !0; }), e.attachEvent("onBeforeCollapse", function() { - return a = !0, !0; + return t = !0, !0; }); }, cookie: function(e) { - function h(d) { + function i(d) { return (d._obj.id || "scheduler") + "_settings"; } - var a = !0; - e.attachEvent("onBeforeViewChange", function(d, i, _, o) { - if (a && e._get_url_nav) { - var t = e._get_url_nav(); - (t.date || t.mode || t.event) && (a = !1); + var t = !0; + e.attachEvent("onBeforeViewChange", function(d, n, s, _) { + if (t && e._get_url_nav) { + var a = e._get_url_nav(); + (a.date || a.mode || a.event) && (t = !1); } - var n = h(e); - if (a) { - a = !1; - var s = function(u) { - var v = u + "="; + var o = i(e); + if (t) { + t = !1; + var l = function(v) { + var u = v + "="; if (document.cookie.length > 0) { - var m = document.cookie.indexOf(v); - if (m != -1) { - m += v.length; - var l = document.cookie.indexOf(";", m); - return l == -1 && (l = document.cookie.length), document.cookie.substring(m, l); + var f = document.cookie.indexOf(u); + if (f != -1) { + f += u.length; + var c = document.cookie.indexOf(";", f); + return c == -1 && (c = document.cookie.length), document.cookie.substring(f, c); } } return ""; - }(n); - if (s) { - e._min_date || (e._min_date = o), (s = unescape(s).split("@"))[0] = this._helpers.parseDate(s[0]); - var c = this.isViewExists(s[1]) ? s[1] : _; - return o = isNaN(+s[0]) ? o : s[0], window.setTimeout(function() { - e.$destroyed || e.setCurrentView(o, c); + }(o); + if (l) { + e._min_date || (e._min_date = _), (l = unescape(l).split("@"))[0] = this._helpers.parseDate(l[0]); + var h = this.isViewExists(l[1]) ? l[1] : s; + return _ = isNaN(+l[0]) ? _ : l[0], window.setTimeout(function() { + e.$destroyed || e.setCurrentView(_, h); }, 1), !1; } } return !0; - }), e.attachEvent("onViewChange", function(d, i) { - var _, o, t = h(e), n = escape(this._helpers.formatDate(i) + "@" + d); - o = t + "=" + n + ((_ = "expires=Sun, 31 Jan 9999 22:00:00 GMT") ? "; " + _ : ""), document.cookie = o; + }), e.attachEvent("onViewChange", function(d, n) { + var s, _, a = i(e), o = escape(this._helpers.formatDate(n) + "@" + d); + _ = a + "=" + o + ((s = "expires=Sun, 31 Jan 9999 22:00:00 GMT") ? "; " + s : ""), document.cookie = _; }); var r = e._load; e._load = function() { @@ -4604,119 +6783,119 @@ const lt = { active_links: function(e) { if (e._date) r.apply(this, d); else { - var i = this; + var n = this; window.setTimeout(function() { - r.apply(i, d); + r.apply(n, d); }, 1); } }; }, daytimeline: function(e) { - R("Day Timeline", e.assert); + de("Day Timeline", e.assert); }, drag_between: function(e) { - R("Drag Between", e.assert); + de("Drag Between", e.assert); }, editors: function(e) { - e.form_blocks.combo = { render: function(h) { - h.cached_options || (h.cached_options = {}); - var a = ""; - return a += "
"; - }, set_value: function(h, a, r, d) { + e.form_blocks.combo = { render: function(i) { + i.cached_options || (i.cached_options = {}); + var t = ""; + return t += "
"; + }, set_value: function(i, t, r, d) { (function() { - v(); - var u = e.attachEvent("onAfterLightbox", function() { - v(), e.detachEvent(u); + u(); + var v = e.attachEvent("onAfterLightbox", function() { + u(), e.detachEvent(v); }); - function v() { - if (h._combo && h._combo.DOMParent) { - var m = h._combo; - m.unload ? m.unload() : m.destructor && m.destructor(), m.DOMParent = m.DOMelem = null; + function u() { + if (i._combo && i._combo.DOMParent) { + var f = i._combo; + f.unload ? f.unload() : f.destructor && f.destructor(), f.DOMParent = f.DOMelem = null; } } - })(), window.dhx_globalImgPath = d.image_path || "/", h._combo = new dhtmlXCombo(h, d.name, h.offsetWidth - 8), d.onchange && h._combo.attachEvent("onChange", d.onchange), d.options_height && h._combo.setOptionHeight(d.options_height); - var i = h._combo; - if (i.enableFilteringMode(d.filtering, d.script_path || null, !!d.cache), d.script_path) { - var _ = r[d.map_to]; - _ ? d.cached_options[_] ? (i.addOption(_, d.cached_options[_]), i.disable(1), i.selectOption(0), i.disable(0)) : e.ajax.get(d.script_path + "?id=" + _ + "&uid=" + e.uid(), function(u) { - var v, m = u.xmlDoc.responseText; + })(), window.dhx_globalImgPath = d.image_path || "/", i._combo = new dhtmlXCombo(i, d.name, i.offsetWidth - 8), d.onchange && i._combo.attachEvent("onChange", d.onchange), d.options_height && i._combo.setOptionHeight(d.options_height); + var n = i._combo; + if (n.enableFilteringMode(d.filtering, d.script_path || null, !!d.cache), d.script_path) { + var s = r[d.map_to]; + s ? d.cached_options[s] ? (n.addOption(s, d.cached_options[s]), n.disable(1), n.selectOption(0), n.disable(0)) : e.ajax.get(d.script_path + "?id=" + s + "&uid=" + e.uid(), function(v) { + var u, f = v.xmlDoc.responseText; try { - v = JSON.parse(m).options[0].text; + u = JSON.parse(f).options[0].text; } catch { - v = e.ajax.xpath("//option", u.xmlDoc)[0].childNodes[0].nodeValue; + u = e.ajax.xpath("//option", v.xmlDoc)[0].childNodes[0].nodeValue; } - d.cached_options[_] = v, i.addOption(_, v), i.disable(1), i.selectOption(0), i.disable(0); - }) : i.setComboValue(""); + d.cached_options[s] = u, n.addOption(s, u), n.disable(1), n.selectOption(0), n.disable(0); + }) : n.setComboValue(""); } else { - for (var o = [], t = 0; t < d.options.length; t++) { - var n = d.options[t], s = [n.key, n.label, n.css]; - o.push(s); - } - if (i.addOption(o), r[d.map_to]) { - var c = i.getIndexByValue(r[d.map_to]); - i.selectOption(c); - } - } - }, get_value: function(h, a, r) { - var d = h._combo.getSelectedValue(); - return r.script_path && (r.cached_options[d] = h._combo.getSelectedText()), d; - }, focus: function(h) { - } }, e.form_blocks.radio = { render: function(h) { - var a = ""; - a += `
`; - for (var r = 0; r < h.options.length; r++) { + for (var _ = [], a = 0; a < d.options.length; a++) { + var o = d.options[a], l = [o.key, o.label, o.css]; + _.push(l); + } + if (n.addOption(_), r[d.map_to]) { + var h = n.getIndexByValue(r[d.map_to]); + n.selectOption(h); + } + } + }, get_value: function(i, t, r) { + var d = i._combo.getSelectedValue(); + return r.script_path && (r.cached_options[d] = i._combo.getSelectedText()), d; + }, focus: function(i) { + } }, e.form_blocks.radio = { render: function(i) { + var t = ""; + t += `
`; + for (var r = 0; r < i.options.length; r++) { var d = e.uid(); - a += ""; - } - return a += "
"; - }, set_value: function(h, a, r, d) { - for (var i = h.getElementsByTagName("input"), _ = 0; _ < i.length; _++) { - i[_].checked = !1; - var o = r[d.map_to] || a; - i[_].value == o && (i[_].checked = !0); - } - }, get_value: function(h, a, r) { - for (var d = h.getElementsByTagName("input"), i = 0; i < d.length; i++) - if (d[i].checked) - return d[i].value; - }, focus: function(h) { - } }, e.form_blocks.checkbox = { render: function(h) { + t += ""; + } + return t += "
"; + }, set_value: function(i, t, r, d) { + for (var n = i.getElementsByTagName("input"), s = 0; s < n.length; s++) { + n[s].checked = !1; + var _ = r[d.map_to] || t; + n[s].value == _ && (n[s].checked = !0); + } + }, get_value: function(i, t, r) { + for (var d = i.getElementsByTagName("input"), n = 0; n < d.length; n++) + if (d[n].checked) + return d[n].value; + }, focus: function(i) { + } }, e.form_blocks.checkbox = { render: function(i) { return e.config.wide_form ? '
' : ""; - }, set_value: function(h, a, r, d) { - h = e._lightbox.querySelector(`#${d.id}`); - var i = e.uid(), _ = d.checked_value !== void 0 ? a == d.checked_value : !!a; - h.className += " dhx_cal_checkbox"; - var o = "", t = ""; - if (e.config.wide_form ? (h.innerHTML = t, h.nextSibling.innerHTML = o) : h.innerHTML = o + t, d.handler) { - var n = h.getElementsByTagName("input")[0]; - if (n.$_eventAttached) + }, set_value: function(i, t, r, d) { + i = e._lightbox.querySelector(`#${d.id}`); + var n = e.uid(), s = d.checked_value !== void 0 ? t == d.checked_value : !!t; + i.className += " dhx_cal_checkbox"; + var _ = "", a = ""; + if (e.config.wide_form ? (i.innerHTML = a, i.nextSibling.innerHTML = _) : i.innerHTML = _ + a, d.handler) { + var o = i.getElementsByTagName("input")[0]; + if (o.$_eventAttached) return; - n.$_eventAttached = !0, e.event(n, "click", d.handler); + o.$_eventAttached = !0, e.event(o, "click", d.handler); } - }, get_value: function(h, a, r) { - var d = (h = e._lightbox.querySelector(`#${r.id}`)).getElementsByTagName("input")[0]; - return d || (d = h.nextSibling.getElementsByTagName("input")[0]), d.checked ? r.checked_value || !0 : r.unchecked_value || !1; - }, focus: function(h) { + }, get_value: function(i, t, r) { + var d = (i = e._lightbox.querySelector(`#${r.id}`)).getElementsByTagName("input")[0]; + return d || (d = i.nextSibling.getElementsByTagName("input")[0]), d.checked ? r.checked_value || !0 : r.unchecked_value || !1; + }, focus: function(i) { } }; }, expand: function(e) { e.ext.fullscreen = { toggleIcon: null }, e.expand = function() { if (e.callEvent("onBeforeExpand", [])) { - var h = e._obj; + var i = e._obj; do - h._position = h.style.position || "", h.style.position = "static"; - while ((h = h.parentNode) && h.style); - (h = e._obj).style.position = "absolute", h._width = h.style.width, h._height = h.style.height, h.style.width = h.style.height = "100%", h.style.top = h.style.left = "0px"; - var a = document.body; - a.scrollTop = 0, (a = a.parentNode) && (a.scrollTop = 0), document.body._overflow = document.body.style.overflow || "", document.body.style.overflow = "hidden", e._maximize(), e.callEvent("onExpand", []); + i._position = i.style.position || "", i.style.position = "static"; + while ((i = i.parentNode) && i.style); + (i = e._obj).style.position = "absolute", i._width = i.style.width, i._height = i.style.height, i.style.width = i.style.height = "100%", i.style.top = i.style.left = "0px"; + var t = document.body; + t.scrollTop = 0, (t = t.parentNode) && (t.scrollTop = 0), document.body._overflow = document.body.style.overflow || "", document.body.style.overflow = "hidden", e._maximize(), e.callEvent("onExpand", []); } }, e.collapse = function() { if (e.callEvent("onBeforeCollapse", [])) { - var h = e._obj; + var i = e._obj; do - h.style.position = h._position; - while ((h = h.parentNode) && h.style); - (h = e._obj).style.width = h._width, h.style.height = h._height, document.body.style.overflow = document.body._overflow, e._maximize(), e.callEvent("onCollapse", []); + i.style.position = i._position; + while ((i = i.parentNode) && i.style); + (i = e._obj).style.width = i._width, i.style.height = i._height, document.body.style.overflow = document.body._overflow, e._maximize(), e.callEvent("onCollapse", []); } }, e.attachEvent("onTemplatesReady", function() { - var h = document.createElement("div"); - h.className = "dhx_expand_icon", e.ext.fullscreen.toggleIcon = h, h.innerHTML = ` + var i = document.createElement("div"); + i.className = "dhx_expand_icon", e.ext.fullscreen.toggleIcon = i, i.innerHTML = ` @@ -4728,175 +6907,175 @@ const lt = { active_links: function(e) { - `, e._obj.appendChild(h), e.event(h, "click", function() { + `, e._obj.appendChild(i), e.event(i, "click", function() { e.expanded ? e.collapse() : e.expand(); }); }), e._maximize = function() { this.expanded = !this.expanded, this.expanded ? this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded") : this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded"); - for (var h = ["left", "top"], a = 0; a < h.length; a++) { - var r = e["_prev_margin_" + h[a]]; - e.xy["margin_" + h[a]] ? (e["_prev_margin_" + h[a]] = e.xy["margin_" + h[a]], e.xy["margin_" + h[a]] = 0) : r && (e.xy["margin_" + h[a]] = e["_prev_margin_" + h[a]], delete e["_prev_margin_" + h[a]]); + for (var i = ["left", "top"], t = 0; t < i.length; t++) { + var r = e["_prev_margin_" + i[t]]; + e.xy["margin_" + i[t]] ? (e["_prev_margin_" + i[t]] = e.xy["margin_" + i[t]], e.xy["margin_" + i[t]] = 0) : r && (e.xy["margin_" + i[t]] = e["_prev_margin_" + i[t]], delete e["_prev_margin_" + i[t]]); } e.setCurrentView(); }; }, export_api: function(e) { (function() { - function h(r, d) { - for (var i in d) - r[i] || (r[i] = d[i]); + function i(r, d) { + for (var n in d) + r[n] || (r[n] = d[n]); return r; } - function a(r, d) { - var i = {}; - return (r = d._els[r]) && r[0] ? (i.x = r[0].scrollWidth, i.y = r[0].scrollHeight) : (i.x = 0, i.y = 0), i; + function t(r, d) { + var n = {}; + return (r = d._els[r]) && r[0] ? (n.x = r[0].scrollWidth, n.y = r[0].scrollHeight) : (n.x = 0, n.y = 0), n; } - window.dhtmlxAjax || (window.dhtmlxAjax = { post: function(r, d, i) { - return window.dhx4.ajax.post(r, d, i); + window.dhtmlxAjax || (window.dhtmlxAjax = { post: function(r, d, n) { + return window.dhx4.ajax.post(r, d, n); }, get: function(r, d) { return window.ajax.get(r, d); } }), function(r) { function d() { - var i = r.getState().mode; - return r.matrix && r.matrix[i] ? r.matrix[i] : null; - } - r.exportToPDF = function(i) { - (i = h(i || {}, { name: "calendar.pdf", format: "A4", orientation: "landscape", dpi: 96, zoom: 1, rtl: r.config.rtl })).html = this._export_html(i), i.mode = this.getState().mode, this._send_to_export(i, "pdf"); - }, r.exportToPNG = function(i) { - (i = h(i || {}, { name: "calendar.png", format: "A4", orientation: "landscape", dpi: 96, zoom: 1, rtl: r.config.rtl })).html = this._export_html(i), i.mode = this.getState().mode, this._send_to_export(i, "png"); - }, r.exportToICal = function(i) { - i = h(i || {}, { name: "calendar.ical", data: this._serialize_plain(null, i) }), this._send_to_export(i, "ical"); - }, r.exportToExcel = function(i) { - i = h(i || {}, { name: "calendar.xlsx", title: "Events", data: this._serialize_plain(this.templates.xml_format, i), columns: this._serialize_columns() }), this._send_to_export(i, "excel"); - }, r._ajax_to_export = function(i, _, o) { - delete i.callback; - var t = i.server || "https://export.dhtmlx.com/scheduler"; - window.dhtmlxAjax.post(t, "type=" + _ + "&store=1&data=" + encodeURIComponent(JSON.stringify(i)), function(n) { - var s = null; - if (!(n.xmlDoc.status > 400)) + var n = r.getState().mode; + return r.matrix && r.matrix[n] ? r.matrix[n] : null; + } + r.exportToPDF = function(n) { + (n = i(n || {}, { name: "calendar.pdf", format: "A4", orientation: "landscape", dpi: 96, zoom: 1, rtl: r.config.rtl })).html = this._export_html(n), n.mode = this.getState().mode, this._send_to_export(n, "pdf"); + }, r.exportToPNG = function(n) { + (n = i(n || {}, { name: "calendar.png", format: "A4", orientation: "landscape", dpi: 96, zoom: 1, rtl: r.config.rtl })).html = this._export_html(n), n.mode = this.getState().mode, this._send_to_export(n, "png"); + }, r.exportToICal = function(n) { + n = i(n || {}, { name: "calendar.ical", data: this._serialize_plain(null, n) }), this._send_to_export(n, "ical"); + }, r.exportToExcel = function(n) { + n = i(n || {}, { name: "calendar.xlsx", title: "Events", data: this._serialize_plain(this.templates.xml_format, n), columns: this._serialize_columns() }), this._send_to_export(n, "excel"); + }, r._ajax_to_export = function(n, s, _) { + delete n.callback; + var a = n.server || "https://export.dhtmlx.com/scheduler"; + window.dhtmlxAjax.post(a, "type=" + s + "&store=1&data=" + encodeURIComponent(JSON.stringify(n)), function(o) { + var l = null; + if (!(o.xmlDoc.status > 400)) try { - s = JSON.parse(n.xmlDoc.responseText); + l = JSON.parse(o.xmlDoc.responseText); } catch { } - o(s); + _(l); }); - }, r._plain_export_copy = function(i, _) { - var o = {}; - for (var t in i) - o[t] = i[t]; - return o.start_date = _(o.start_date), o.end_date = _(o.end_date), o.$text = this.templates.event_text(i.start_date, i.end_date, i), o; - }, r._serialize_plain = function(i, _) { - var o; - i = i || r.date.date_to_str("%Y%m%dT%H%i%s", !0), o = _ && _.start && _.end ? r.getEvents(_.start, _.end) : r.getEvents(); - for (var t = [], n = 0; n < o.length; n++) - t[n] = this._plain_export_copy(o[n], i); - return t; + }, r._plain_export_copy = function(n, s) { + var _ = {}; + for (var a in n) + _[a] = n[a]; + return _.start_date = s(_.start_date), _.end_date = s(_.end_date), _.$text = this.templates.event_text(n.start_date, n.end_date, n), _; + }, r._serialize_plain = function(n, s) { + var _; + n = n || r.date.date_to_str("%Y%m%dT%H%i%s", !0), _ = s && s.start && s.end ? r.getEvents(s.start, s.end) : r.getEvents(); + for (var a = [], o = 0; o < _.length; o++) + a[o] = this._plain_export_copy(_[o], n); + return a; }, r._serialize_columns = function() { return [{ id: "start_date", header: "Start Date", width: 30 }, { id: "end_date", header: "End Date", width: 30 }, { id: "$text", header: "Text", width: 100 }]; - }, r._send_to_export = function(i, _) { - if (i.version || (i.version = r.version), i.skin || (i.skin = r.skin), i.callback) - return r._ajax_to_export(i, _, i.callback); - var o = this._create_hidden_form(); - o.firstChild.action = i.server || "https://export.dhtmlx.com/scheduler", o.firstChild.childNodes[0].value = JSON.stringify(i), o.firstChild.childNodes[1].value = _, o.firstChild.submit(); + }, r._send_to_export = function(n, s) { + if (n.version || (n.version = r.version), n.skin || (n.skin = r.skin), n.callback) + return r._ajax_to_export(n, s, n.callback); + var _ = this._create_hidden_form(); + _.firstChild.action = n.server || "https://export.dhtmlx.com/scheduler", _.firstChild.childNodes[0].value = JSON.stringify(n), _.firstChild.childNodes[1].value = s, _.firstChild.submit(); }, r._create_hidden_form = function() { if (!this._hidden_export_form) { - var i = this._hidden_export_form = document.createElement("div"); - i.style.display = "none", i.innerHTML = "
", document.body.appendChild(i); + var n = this._hidden_export_form = document.createElement("div"); + n.style.display = "none", n.innerHTML = "
", document.body.appendChild(n); } return this._hidden_export_form; - }, r._get_export_size = function(i, _, o, t, n, s, c) { - t = parseInt(t) / 25.4 || 4; - var u = { A5: { x: 148, y: 210 }, A4: { x: 210, y: 297 }, A3: { x: 297, y: 420 }, A2: { x: 420, y: 594 }, A1: { x: 594, y: 841 }, A0: { x: 841, y: 1189 } }, v = a("dhx_cal_data", this).x, m = { y: a("dhx_cal_data", this).y + a("dhx_cal_header", this).y + a("dhx_multi_day", this).y }; - return m.x = i === "full" ? v : Math.floor((_ === "landscape" ? u[i].y : u[i].x) * t), c && (m.x *= parseFloat(c.x) || 1, m.y *= parseFloat(c.y) || 1), m; - }, r._export_html = function(i) { - var _, o, t, n = (_ = void 0, o = void 0, (t = d()) && (o = t.scrollable, _ = t.smart_rendering), { nav_height: r.xy.nav_height, scroll_width: r.xy.scroll_width, style_width: r._obj.style.width, style_height: r._obj.style.height, timeline_scrollable: o, timeline_smart_rendering: _ }), s = r._get_export_size(i.format, i.orientation, i.zoom, i.dpi, i.header, i.footer, i.scales), c = ""; + }, r._get_export_size = function(n, s, _, a, o, l, h) { + a = parseInt(a) / 25.4 || 4; + var v = { A5: { x: 148, y: 210 }, A4: { x: 210, y: 297 }, A3: { x: 297, y: 420 }, A2: { x: 420, y: 594 }, A1: { x: 594, y: 841 }, A0: { x: 841, y: 1189 } }, u = t("dhx_cal_data", this).x, f = { y: t("dhx_cal_data", this).y + t("dhx_cal_header", this).y + t("dhx_multi_day", this).y }; + return f.x = n === "full" ? u : Math.floor((s === "landscape" ? v[n].y : v[n].x) * a), h && (f.x *= parseFloat(h.x) || 1, f.y *= parseFloat(h.y) || 1), f; + }, r._export_html = function(n) { + var s, _, a, o = (s = void 0, _ = void 0, (a = d()) && (_ = a.scrollable, s = a.smart_rendering), { nav_height: r.xy.nav_height, scroll_width: r.xy.scroll_width, style_width: r._obj.style.width, style_height: r._obj.style.height, timeline_scrollable: _, timeline_smart_rendering: s }), l = r._get_export_size(n.format, n.orientation, n.zoom, n.dpi, n.header, n.footer, n.scales), h = ""; try { - (function(u, v) { - r._obj.style.width = u.x + "px", r._obj.style.height = u.y + "px", r.xy.nav_height = 0, r.xy.scroll_width = 0; - var m = d(); - (v.timeline_scrollable || v.timeline_smart_rendering) && (m.scrollable = !1, m.smart_rendering = !1); - })(s, n), r.setCurrentView(), c = r._obj.innerHTML; - } catch (u) { - console.error(u); + (function(v, u) { + r._obj.style.width = v.x + "px", r._obj.style.height = v.y + "px", r.xy.nav_height = 0, r.xy.scroll_width = 0; + var f = d(); + (u.timeline_scrollable || u.timeline_smart_rendering) && (f.scrollable = !1, f.smart_rendering = !1); + })(l, o), r.setCurrentView(), h = r._obj.innerHTML; + } catch (v) { + console.error(v); } finally { - (function(u) { - r.xy.scroll_width = u.scroll_width, r.xy.nav_height = u.nav_height, r._obj.style.width = u.style_width, r._obj.style.height = u.style_height; - var v = d(); - (u.timeline_scrollable || u.timeline_smart_rendering) && (v.scrollable = u.timeline_scrollable, v.smart_rendering = u.timeline_smart_rendering); - })(n), r.setCurrentView(); + (function(v) { + r.xy.scroll_width = v.scroll_width, r.xy.nav_height = v.nav_height, r._obj.style.width = v.style_width, r._obj.style.height = v.style_height; + var u = d(); + (v.timeline_scrollable || v.timeline_smart_rendering) && (u.scrollable = v.timeline_scrollable, u.smart_rendering = v.timeline_smart_rendering); + })(o), r.setCurrentView(); } - return c; + return h; }; }(e); })(); }, grid_view: function(e) { - R("Grid", e.assert); + de("Grid", e.assert); }, html_templates: function(e) { e.attachEvent("onTemplatesReady", function() { - for (var h = document.body.getElementsByTagName("DIV"), a = 0; a < h.length; a++) { - var r = h[a].className || ""; + for (var i = document.body.getElementsByTagName("DIV"), t = 0; t < i.length; t++) { + var r = i[t].className || ""; if ((r = r.split(":")).length == 2 && r[0] == "template") { - var d = 'return "' + (h[a].innerHTML || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\n\r]+/g, "") + '";'; - d = unescape(d).replace(/\{event\.([a-z]+)\}/g, function(i, _) { - return '"+ev.' + _ + '+"'; - }), e.templates[r[1]] = Function("start", "end", "ev", d), h[a].style.display = "none"; + var d = 'return "' + (i[t].innerHTML || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\n\r]+/g, "") + '";'; + d = unescape(d).replace(/\{event\.([a-z]+)\}/g, function(n, s) { + return '"+ev.' + s + '+"'; + }), e.templates[r[1]] = Function("start", "end", "ev", d), i[t].style.display = "none"; } } }); }, key_nav: function(e) { - function h(a) { + function i(t) { var r = { minicalButton: e.$keyboardNavigation.MinicalButton, minicalDate: e.$keyboardNavigation.MinicalCell, scheduler: e.$keyboardNavigation.SchedulerNode, dataArea: e.$keyboardNavigation.DataArea, timeSlot: e.$keyboardNavigation.TimeSlot, event: e.$keyboardNavigation.Event }, d = {}; - for (var i in r) - d[i.toLowerCase()] = r[i]; - return d[a = (a + "").toLowerCase()] || r.scheduler; - } - e.config.key_nav = !0, e.config.key_nav_step = 30, e.addShortcut = function(a, r, d) { - var i = h(d); - i && i.prototype.bind(a, r); - }, e.getShortcutHandler = function(a, r) { - var d = h(r); + for (var n in r) + d[n.toLowerCase()] = r[n]; + return d[t = (t + "").toLowerCase()] || r.scheduler; + } + e.config.key_nav = !0, e.config.key_nav_step = 30, e.addShortcut = function(t, r, d) { + var n = i(d); + n && n.prototype.bind(t, r); + }, e.getShortcutHandler = function(t, r) { + var d = i(r); if (d) { - var i = e.$keyboardNavigation.shortcuts.parse(a); - if (i.length) - return d.prototype.findHandler(i[0]); + var n = e.$keyboardNavigation.shortcuts.parse(t); + if (n.length) + return d.prototype.findHandler(n[0]); } - }, e.removeShortcut = function(a, r) { - var d = h(r); - d && d.prototype.unbind(a); + }, e.removeShortcut = function(t, r) { + var d = i(r); + d && d.prototype.unbind(t); }, e.focus = function() { if (e.config.key_nav) { - var a = e.$keyboardNavigation.dispatcher; - a.enable(); - var r = a.getActiveNode(); - !r || r instanceof e.$keyboardNavigation.MinicalButton || r instanceof e.$keyboardNavigation.MinicalCell ? a.setDefaultNode() : a.focusNode(a.getActiveNode()); + var t = e.$keyboardNavigation.dispatcher; + t.enable(); + var r = t.getActiveNode(); + !r || r instanceof e.$keyboardNavigation.MinicalButton || r instanceof e.$keyboardNavigation.MinicalCell ? t.setDefaultNode() : t.focusNode(t.getActiveNode()); } }, e.$keyboardNavigation = {}, e._compose = function() { - for (var a = Array.prototype.slice.call(arguments, 0), r = {}, d = 0; d < a.length; d++) { - var i = a[d]; - for (var _ in typeof i == "function" && (i = new i()), i) - r[_] = i[_]; + for (var t = Array.prototype.slice.call(arguments, 0), r = {}, d = 0; d < t.length; d++) { + var n = t[d]; + for (var s in typeof n == "function" && (n = new n()), n) + r[s] = n[s]; } return r; - }, function(a) { - a.$keyboardNavigation.shortcuts = { createCommand: function() { + }, function(t) { + t.$keyboardNavigation.shortcuts = { createCommand: function() { return { modifiers: { shift: !1, alt: !1, ctrl: !1, meta: !1 }, keyCode: null }; }, parse: function(r) { - for (var d = [], i = this.getExpressions(this.trim(r)), _ = 0; _ < i.length; _++) { - for (var o = this.getWords(i[_]), t = this.createCommand(), n = 0; n < o.length; n++) - this.commandKeys[o[n]] ? t.modifiers[o[n]] = !0 : this.specialKeys[o[n]] ? t.keyCode = this.specialKeys[o[n]] : t.keyCode = o[n].charCodeAt(0); - d.push(t); + for (var d = [], n = this.getExpressions(this.trim(r)), s = 0; s < n.length; s++) { + for (var _ = this.getWords(n[s]), a = this.createCommand(), o = 0; o < _.length; o++) + this.commandKeys[_[o]] ? a.modifiers[_[o]] = !0 : this.specialKeys[_[o]] ? a.keyCode = this.specialKeys[_[o]] : a.keyCode = _[o].charCodeAt(0); + d.push(a); } return d; }, getCommandFromEvent: function(r) { var d = this.createCommand(); d.modifiers.shift = !!r.shiftKey, d.modifiers.alt = !!r.altKey, d.modifiers.ctrl = !!r.ctrlKey, d.modifiers.meta = !!r.metaKey, d.keyCode = r.which || r.keyCode, d.keyCode >= 96 && d.keyCode <= 105 && (d.keyCode -= 48); - var i = String.fromCharCode(d.keyCode); - return i && (d.keyCode = i.toLowerCase().charCodeAt(0)), d; + var n = String.fromCharCode(d.keyCode); + return n && (d.keyCode = n.toLowerCase().charCodeAt(0)), d; }, getHashFromEvent: function(r) { return this.getHash(this.getCommandFromEvent(r)); }, getHash: function(r) { var d = []; - for (var i in r.modifiers) - r.modifiers[i] && d.push(i); + for (var n in r.modifiers) + r.modifiers[n] && d.push(n); return d.push(r.keyCode), d.join(this.junctionChar); }, getExpressions: function(r) { return r.split(this.junctionChar); @@ -4905,281 +7084,281 @@ const lt = { active_links: function(e) { }, trim: function(r) { return r.replace(/\s/g, ""); }, junctionChar: ",", combinationChar: "+", commandKeys: { shift: 16, alt: 18, ctrl: 17, meta: !0 }, specialKeys: { backspace: 8, tab: 9, enter: 13, esc: 27, space: 32, up: 38, down: 40, left: 37, right: 39, home: 36, end: 35, pageup: 33, pagedown: 34, delete: 46, insert: 45, plus: 107, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 } }; - }(e), function(a) { - a.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(r) { + }(e), function(t) { + t.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(r) { this._handlers || (this._handlers = {}); - var d = a.$keyboardNavigation.shortcuts.getHash(r); + var d = t.$keyboardNavigation.shortcuts.getHash(r); return this._handlers[d]; }, doAction: function(r, d) { - var i = this.findHandler(r); - i && (i.call(this, d), d.preventDefault ? d.preventDefault() : d.returnValue = !1); + var n = this.findHandler(r); + n && (n.call(this, d), d.preventDefault ? d.preventDefault() : d.returnValue = !1); }, bind: function(r, d) { this._handlers || (this._handlers = {}); - for (var i = a.$keyboardNavigation.shortcuts, _ = i.parse(r), o = 0; o < _.length; o++) - this._handlers[i.getHash(_[o])] = d; + for (var n = t.$keyboardNavigation.shortcuts, s = n.parse(r), _ = 0; _ < s.length; _++) + this._handlers[n.getHash(s[_])] = d; }, unbind: function(r) { - for (var d = a.$keyboardNavigation.shortcuts, i = d.parse(r), _ = 0; _ < i.length; _++) - this._handlers[d.getHash(i[_])] && delete this._handlers[d.getHash(i[_])]; + for (var d = t.$keyboardNavigation.shortcuts, n = d.parse(r), s = 0; s < n.length; s++) + this._handlers[d.getHash(n[s])] && delete this._handlers[d.getHash(n[s])]; }, bindAll: function(r) { for (var d in r) this.bind(d, r[d]); }, initKeys: function() { this._handlers || (this._handlers = {}), this.keys && this.bindAll(this.keys); } }; - }(e), function(a) { - a.$keyboardNavigation.getFocusableNodes = a._getFocusableNodes, a.$keyboardNavigation.trapFocus = function(r, d) { + }(e), function(t) { + t.$keyboardNavigation.getFocusableNodes = t._getFocusableNodes, t.$keyboardNavigation.trapFocus = function(r, d) { if (d.keyCode != 9) return !1; - for (var i, _ = a.$keyboardNavigation.getFocusableNodes(r), o = document.activeElement, t = -1, n = 0; n < _.length; n++) - if (_[n] == o) { - t = n; + for (var n, s = t.$keyboardNavigation.getFocusableNodes(r), _ = document.activeElement, a = -1, o = 0; o < s.length; o++) + if (s[o] == _) { + a = o; break; } if (d.shiftKey) { - if (i = _[t <= 0 ? _.length - 1 : t - 1]) - return i.focus(), d.preventDefault(), !0; - } else if (i = _[t >= _.length - 1 ? 0 : t + 1]) - return i.focus(), d.preventDefault(), !0; + if (n = s[a <= 0 ? s.length - 1 : a - 1]) + return n.focus(), d.preventDefault(), !0; + } else if (n = s[a >= s.length - 1 ? 0 : a + 1]) + return n.focus(), d.preventDefault(), !0; return !1; }; - }(e), function(a) { - a.$keyboardNavigation.marker = { clear: function() { - for (var r = a.$container.querySelectorAll(".dhx_focus_slot"), d = 0; d < r.length; d++) + }(e), function(t) { + t.$keyboardNavigation.marker = { clear: function() { + for (var r = t.$container.querySelectorAll(".dhx_focus_slot"), d = 0; d < r.length; d++) r[d].parentNode.removeChild(r[d]); }, createElement: function() { var r = document.createElement("div"); return r.setAttribute("tabindex", -1), r.className = "dhx_focus_slot", r; - }, renderMultiple: function(r, d, i) { - for (var _ = [], o = new Date(r), t = new Date(Math.min(d.valueOf(), a.date.add(a.date.day_start(new Date(r)), 1, "day").valueOf())); o.valueOf() < d.valueOf(); ) - _ = _.concat(i.call(this, o, new Date(Math.min(t.valueOf(), d.valueOf())))), o = a.date.day_start(a.date.add(o, 1, "day")), t = a.date.day_start(a.date.add(o, 1, "day")), t = new Date(Math.min(t.valueOf(), d.valueOf())); - return _; - }, render: function(r, d, i) { + }, renderMultiple: function(r, d, n) { + for (var s = [], _ = new Date(r), a = new Date(Math.min(d.valueOf(), t.date.add(t.date.day_start(new Date(r)), 1, "day").valueOf())); _.valueOf() < d.valueOf(); ) + s = s.concat(n.call(this, _, new Date(Math.min(a.valueOf(), d.valueOf())))), _ = t.date.day_start(t.date.add(_, 1, "day")), a = t.date.day_start(t.date.add(_, 1, "day")), a = new Date(Math.min(a.valueOf(), d.valueOf())); + return s; + }, render: function(r, d, n) { this.clear(); - var _ = [], o = a.$keyboardNavigation.TimeSlot.prototype._modes; - switch (a.$keyboardNavigation.TimeSlot.prototype._getMode()) { - case o.units: - _ = this.renderVerticalMarker(r, d, i); + var s = [], _ = t.$keyboardNavigation.TimeSlot.prototype._modes; + switch (t.$keyboardNavigation.TimeSlot.prototype._getMode()) { + case _.units: + s = this.renderVerticalMarker(r, d, n); break; - case o.timeline: - _ = this.renderTimelineMarker(r, d, i); + case _.timeline: + s = this.renderTimelineMarker(r, d, n); break; - case o.year: - _ = _.concat(this.renderMultiple(r, d, this.renderYearMarker)); + case _.year: + s = s.concat(this.renderMultiple(r, d, this.renderYearMarker)); break; - case o.month: - _ = this.renderMonthMarker(r, d); + case _.month: + s = this.renderMonthMarker(r, d); break; - case o.weekAgenda: - _ = _.concat(this.renderMultiple(r, d, this.renderWeekAgendaMarker)); + case _.weekAgenda: + s = s.concat(this.renderMultiple(r, d, this.renderWeekAgendaMarker)); break; - case o.list: - _ = this.renderAgendaMarker(r, d); + case _.list: + s = this.renderAgendaMarker(r, d); break; - case o.dayColumns: - _ = _.concat(this.renderMultiple(r, d, this.renderVerticalMarker)); + case _.dayColumns: + s = s.concat(this.renderMultiple(r, d, this.renderVerticalMarker)); } - this.addWaiAriaLabel(_, r, d, i), this.addDataAttributes(_, r, d, i); - for (var t = _.length - 1; t >= 0; t--) - if (_[t].offsetWidth) - return _[t]; + this.addWaiAriaLabel(s, r, d, n), this.addDataAttributes(s, r, d, n); + for (var a = s.length - 1; a >= 0; a--) + if (s[a].offsetWidth) + return s[a]; return null; - }, addDataAttributes: function(r, d, i, _) { - for (var o = a.date.date_to_str(a.config.api_date), t = o(d), n = o(i), s = 0; s < r.length; s++) - r[s].setAttribute("data-start-date", t), r[s].setAttribute("data-end-date", n), _ && r[s].setAttribute("data-section", _); - }, addWaiAriaLabel: function(r, d, i, _) { - var o = "", t = a.getState().mode, n = !1; - if (o += a.templates.day_date(d), a.date.day_start(new Date(d)).valueOf() != d.valueOf() && (o += " " + a.templates.hour_scale(d), n = !0), a.date.day_start(new Date(d)).valueOf() != a.date.day_start(new Date(i)).valueOf() && (o += " - " + a.templates.day_date(i), (n || a.date.day_start(new Date(i)).valueOf() != i.valueOf()) && (o += " " + a.templates.hour_scale(i))), _) { - if (a.matrix && a.matrix[t]) { - const c = a.matrix[t], u = c.y_unit[c.order[_]]; - o += ", " + a.templates[t + "_scale_label"](u.key, u.label, u); - } else if (a._props && a._props[t]) { - const c = a._props[t], u = c.options[c.order[_]]; - o += ", " + a.templates[t + "_scale_text"](u.key, u.label, u); + }, addDataAttributes: function(r, d, n, s) { + for (var _ = t.date.date_to_str(t.config.api_date), a = _(d), o = _(n), l = 0; l < r.length; l++) + r[l].setAttribute("data-start-date", a), r[l].setAttribute("data-end-date", o), s && r[l].setAttribute("data-section", s); + }, addWaiAriaLabel: function(r, d, n, s) { + var _ = "", a = t.getState().mode, o = !1; + if (_ += t.templates.day_date(d), t.date.day_start(new Date(d)).valueOf() != d.valueOf() && (_ += " " + t.templates.hour_scale(d), o = !0), t.date.day_start(new Date(d)).valueOf() != t.date.day_start(new Date(n)).valueOf() && (_ += " - " + t.templates.day_date(n), (o || t.date.day_start(new Date(n)).valueOf() != n.valueOf()) && (_ += " " + t.templates.hour_scale(n))), s) { + if (t.matrix && t.matrix[a]) { + const h = t.matrix[a], v = h.y_unit[h.order[s]]; + _ += ", " + t.templates[a + "_scale_label"](v.key, v.label, v); + } else if (t._props && t._props[a]) { + const h = t._props[a], v = h.options[h.order[s]]; + _ += ", " + t.templates[a + "_scale_text"](v.key, v.label, v); } } - for (var s = 0; s < r.length; s++) - a._waiAria.setAttributes(r[s], { "aria-label": o, "aria-live": "polite" }); + for (var l = 0; l < r.length; l++) + t._waiAria.setAttributes(r[l], { "aria-label": _, "aria-live": "polite" }); }, renderWeekAgendaMarker: function(r, d) { - for (var i = a.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar"), _ = a.date.week_start(new Date(a.getState().min_date)), o = -1, t = a.date.day_start(new Date(r)), n = 0; n < i.length && (o++, a.date.day_start(new Date(_)).valueOf() != t.valueOf()); n++) - _ = a.date.add(_, 1, "day"); - return o != -1 ? this._wrapDiv(i[o]) : []; + for (var n = t.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar"), s = t.date.week_start(new Date(t.getState().min_date)), _ = -1, a = t.date.day_start(new Date(r)), o = 0; o < n.length && (_++, t.date.day_start(new Date(s)).valueOf() != a.valueOf()); o++) + s = t.date.add(s, 1, "day"); + return _ != -1 ? this._wrapDiv(n[_]) : []; }, _wrapDiv: function(r) { var d = this.createElement(); return d.style.top = r.offsetTop + "px", d.style.left = r.offsetLeft + "px", d.style.width = r.offsetWidth + "px", d.style.height = r.offsetHeight + "px", r.appendChild(d), [d]; }, renderYearMarker: function(r, d) { - var i = a._get_year_cell(r); - i.style.position = "relative"; - var _ = this.createElement(); - return _.style.top = "0px", _.style.left = "0px", _.style.width = "100%", _.style.height = "100%", i.appendChild(_), [_]; + var n = t._get_year_cell(r); + n.style.position = "relative"; + var s = this.createElement(); + return s.style.top = "0px", s.style.left = "0px", s.style.width = "100%", s.style.height = "100%", n.appendChild(s), [s]; }, renderAgendaMarker: function(r, d) { - var i = this.createElement(); - return i.style.height = "1px", i.style.width = "100%", i.style.opacity = 1, i.style.top = "0px", i.style.left = "0px", a.$container.querySelector(".dhx_cal_data").appendChild(i), [i]; - }, renderTimelineMarker: function(r, d, i) { - var _ = a._lame_copy({}, a.matrix[a._mode]), o = _._scales; - _.round_position = !1; - var t = [], n = r ? new Date(r) : a._min_date, s = d ? new Date(d) : a._max_date; - if (n.valueOf() < a._min_date.valueOf() && (n = new Date(a._min_date)), s.valueOf() > a._max_date.valueOf() && (s = new Date(a._max_date)), !_._trace_x) - return t; - for (var c = 0; c < _._trace_x.length && !a._is_column_visible(_._trace_x[c]); c++) + var n = this.createElement(); + return n.style.height = "1px", n.style.width = "100%", n.style.opacity = 1, n.style.top = "0px", n.style.left = "0px", t.$container.querySelector(".dhx_cal_data").appendChild(n), [n]; + }, renderTimelineMarker: function(r, d, n) { + var s = t._lame_copy({}, t.matrix[t._mode]), _ = s._scales; + s.round_position = !1; + var a = [], o = r ? new Date(r) : t._min_date, l = d ? new Date(d) : t._max_date; + if (o.valueOf() < t._min_date.valueOf() && (o = new Date(t._min_date)), l.valueOf() > t._max_date.valueOf() && (l = new Date(t._max_date)), !s._trace_x) + return a; + for (var h = 0; h < s._trace_x.length && !t._is_column_visible(s._trace_x[h]); h++) ; - if (c == _._trace_x.length) - return t; - var u = o[i]; - if (!(n < d && s > r)) - return t; - var v = this.createElement(); - let m, l; - function f(b, k) { + if (h == s._trace_x.length) + return a; + var v = _[n]; + if (!(o < d && l > r)) + return a; + var u = this.createElement(); + let f, c; + function p(b, k) { k.setDate(1), k.setFullYear(b.getFullYear()), k.setMonth(b.getMonth()), k.setDate(b.getDate()); } - if (a.getView().days) { + if (t.getView().days) { const b = new Date(r); - f(a._min_date, b); + p(t._min_date, b); const k = new Date(d); - f(a._min_date, k), m = a._timeline_getX({ start_date: b }, !1, _), l = a._timeline_getX({ start_date: k }, !1, _); + p(t._min_date, k), f = t._timeline_getX({ start_date: b }, !1, s), c = t._timeline_getX({ start_date: k }, !1, s); } else - m = a._timeline_getX({ start_date: r }, !1, _), l = a._timeline_getX({ start_date: d }, !1, _); - var g = _._section_height[i] - 1 || _.dy - 1, p = 0; - a._isRender("cell") && (p = u.offsetTop, m += _.dx, l += _.dx, u = a.$container.querySelector(".dhx_cal_data")); - var y = Math.max(1, l - m - 1); - let w = "left"; - return a.config.rtl && (w = "right"), v.style.cssText = `height:${g}px; ${w}:${m}px; width:${y}px; top:${p}px;`, u && (u.appendChild(v), t.push(v)), t; + f = t._timeline_getX({ start_date: r }, !1, s), c = t._timeline_getX({ start_date: d }, !1, s); + var m = s._section_height[n] - 1 || s.dy - 1, g = 0; + t._isRender("cell") && (g = v.offsetTop, f += s.dx, c += s.dx, v = t.$container.querySelector(".dhx_cal_data")); + var y = Math.max(1, c - f - 1); + let x = "left"; + return t.config.rtl && (x = "right"), u.style.cssText = `height:${m}px; ${x}:${f}px; width:${y}px; top:${g}px;`, v && (v.appendChild(u), a.push(u)), a; }, renderMonthCell: function(r) { - for (var d = a.$container.querySelectorAll(".dhx_month_head"), i = [], _ = 0; _ < d.length; _++) - i.push(d[_].parentNode); - var o = -1, t = 0, n = -1, s = a.date.week_start(new Date(a.getState().min_date)), c = a.date.day_start(new Date(r)); - for (_ = 0; _ < i.length && (o++, n == 6 ? (t++, n = 0) : n++, a.date.day_start(new Date(s)).valueOf() != c.valueOf()); _++) - s = a.date.add(s, 1, "day"); - if (o == -1) + for (var d = t.$container.querySelectorAll(".dhx_month_head"), n = [], s = 0; s < d.length; s++) + n.push(d[s].parentNode); + var _ = -1, a = 0, o = -1, l = t.date.week_start(new Date(t.getState().min_date)), h = t.date.day_start(new Date(r)); + for (s = 0; s < n.length && (_++, o == 6 ? (a++, o = 0) : o++, t.date.day_start(new Date(l)).valueOf() != h.valueOf()); s++) + l = t.date.add(l, 1, "day"); + if (_ == -1) return []; - var u = a._colsS[n], v = a._colsS.heights[t], m = this.createElement(); - m.style.top = v + "px", m.style.left = u + "px", m.style.width = a._cols[n] + "px", m.style.height = (a._colsS.heights[t + 1] - v || a._colsS.height) + "px"; - var l = a.$container.querySelector(".dhx_cal_data"), f = l.querySelector(".dhx_cal_month_table"); - return f.nextSibling ? l.insertBefore(m, f.nextSibling) : l.appendChild(m), m; + var v = t._colsS[o], u = t._colsS.heights[a], f = this.createElement(); + f.style.top = u + "px", f.style.left = v + "px", f.style.width = t._cols[o] + "px", f.style.height = (t._colsS.heights[a + 1] - u || t._colsS.height) + "px"; + var c = t.$container.querySelector(".dhx_cal_data"), p = c.querySelector(".dhx_cal_month_table"); + return p.nextSibling ? c.insertBefore(f, p.nextSibling) : c.appendChild(f), f; }, renderMonthMarker: function(r, d) { - for (var i = [], _ = r; _.valueOf() < d.valueOf(); ) - i.push(this.renderMonthCell(_)), _ = a.date.add(_, 1, "day"); - return i; - }, renderVerticalMarker: function(r, d, i) { - var _ = a.locate_holder_day(r), o = [], t = null, n = a.config; - if (a._ignores[_]) - return o; - if (a._props && a._props[a._mode] && i) { - var s = a._props[a._mode]; - _ = s.order[i]; - var c = s.order[i]; - s.days > 1 ? _ = a.locate_holder_day(r) + c : (_ = c, s.size && _ > s.position + s.size && (_ = 0)); + for (var n = [], s = r; s.valueOf() < d.valueOf(); ) + n.push(this.renderMonthCell(s)), s = t.date.add(s, 1, "day"); + return n; + }, renderVerticalMarker: function(r, d, n) { + var s = t.locate_holder_day(r), _ = [], a = null, o = t.config; + if (t._ignores[s]) + return _; + if (t._props && t._props[t._mode] && n) { + var l = t._props[t._mode]; + s = l.order[n]; + var h = l.order[n]; + l.days > 1 ? s = t.locate_holder_day(r) + h : (s = h, l.size && s > l.position + l.size && (s = 0)); } - if (!(t = a.locate_holder(_)) || t.querySelector(".dhx_scale_hour")) + if (!(a = t.locate_holder(s)) || a.querySelector(".dhx_scale_hour")) return document.createElement("div"); - var u = Math.max(60 * r.getHours() + r.getMinutes(), 60 * n.first_hour), v = Math.min(60 * d.getHours() + d.getMinutes(), 60 * n.last_hour); - if (!v && a.date.day_start(new Date(d)).valueOf() > a.date.day_start(new Date(r)).valueOf() && (v = 60 * n.last_hour), v <= u) + var v = Math.max(60 * r.getHours() + r.getMinutes(), 60 * o.first_hour), u = Math.min(60 * d.getHours() + d.getMinutes(), 60 * o.last_hour); + if (!u && t.date.day_start(new Date(d)).valueOf() > t.date.day_start(new Date(r)).valueOf() && (u = 60 * o.last_hour), u <= v) return []; - var m = this.createElement(), l = a.config.hour_size_px * n.last_hour + 1, f = 36e5; - return m.style.top = Math.round((60 * u * 1e3 - a.config.first_hour * f) * a.config.hour_size_px / f) % l + "px", m.style.lineHeight = m.style.height = Math.max(Math.round(60 * (v - u) * 1e3 * a.config.hour_size_px / f) % l, 1) + "px", m.style.width = "100%", t.appendChild(m), o.push(m), o[0]; + var f = this.createElement(), c = t.config.hour_size_px * o.last_hour + 1, p = 36e5; + return f.style.top = Math.round((60 * v * 1e3 - t.config.first_hour * p) * t.config.hour_size_px / p) % c + "px", f.style.lineHeight = f.style.height = Math.max(Math.round(60 * (u - v) * 1e3 * t.config.hour_size_px / p) % c, 1) + "px", f.style.width = "100%", a.appendChild(f), _.push(f), _[0]; } }; - }(e), function(a) { - a.$keyboardNavigation.SchedulerNode = function() { - }, a.$keyboardNavigation.SchedulerNode.prototype = a._compose(a.$keyboardNavigation.EventHandler, { getDefaultNode: function() { - var r = new a.$keyboardNavigation.TimeSlot(); + }(e), function(t) { + t.$keyboardNavigation.SchedulerNode = function() { + }, t.$keyboardNavigation.SchedulerNode.prototype = t._compose(t.$keyboardNavigation.EventHandler, { getDefaultNode: function() { + var r = new t.$keyboardNavigation.TimeSlot(); return r.isValid() || (r = r.fallback()), r; }, _modes: { month: "month", year: "year", dayColumns: "dayColumns", timeline: "timeline", units: "units", weekAgenda: "weekAgenda", list: "list" }, getMode: function() { - var r = a.getState().mode; - return a.matrix && a.matrix[r] ? this._modes.timeline : a._props && a._props[r] ? this._modes.units : r == "month" ? this._modes.month : r == "year" ? this._modes.year : r == "week_agenda" ? this._modes.weekAgenda : r == "map" || r == "agenda" || a._grid && a["grid_" + r] ? this._modes.list : this._modes.dayColumns; + var r = t.getState().mode; + return t.matrix && t.matrix[r] ? this._modes.timeline : t._props && t._props[r] ? this._modes.units : r == "month" ? this._modes.month : r == "year" ? this._modes.year : r == "week_agenda" ? this._modes.weekAgenda : r == "map" || r == "agenda" || t._grid && t["grid_" + r] ? this._modes.list : this._modes.dayColumns; }, focus: function() { - a.focus(); + t.focus(); }, blur: function() { }, disable: function() { - a.$container.setAttribute("tabindex", "0"); + t.$container.setAttribute("tabindex", "0"); }, enable: function() { - a.$container && a.$container.removeAttribute("tabindex"); + t.$container && t.$container.removeAttribute("tabindex"); }, isEnabled: function() { - return a.$container.hasAttribute("tabindex"); + return t.$container.hasAttribute("tabindex"); }, _compareEvents: function(r, d) { return r.start_date.valueOf() == d.start_date.valueOf() ? r.id > d.id ? 1 : -1 : r.start_date.valueOf() > d.start_date.valueOf() ? 1 : -1; - }, _pickEvent: function(r, d, i, _) { - var o = a.getState(); - r = new Date(Math.max(o.min_date.valueOf(), r.valueOf())), d = new Date(Math.min(o.max_date.valueOf(), d.valueOf())); - var t = a.getEvents(r, d); - t.sort(this._compareEvents), _ && (t = t.reverse()); - for (var n = !!i, s = 0; s < t.length && n; s++) - t[s].id == i && (n = !1), t.splice(s, 1), s--; - for (s = 0; s < t.length; s++) - if (new a.$keyboardNavigation.Event(t[s].id).getNode()) - return t[s]; + }, _pickEvent: function(r, d, n, s) { + var _ = t.getState(); + r = new Date(Math.max(_.min_date.valueOf(), r.valueOf())), d = new Date(Math.min(_.max_date.valueOf(), d.valueOf())); + var a = t.getEvents(r, d); + a.sort(this._compareEvents), s && (a = a.reverse()); + for (var o = !!n, l = 0; l < a.length && o; l++) + a[l].id == n && (o = !1), a.splice(l, 1), l--; + for (l = 0; l < a.length; l++) + if (new t.$keyboardNavigation.Event(a[l].id).getNode()) + return a[l]; return null; }, nextEventHandler: function(r) { - var d = a.$keyboardNavigation.dispatcher.activeNode, i = r || d && d.eventId, _ = null; - if (i && a.getEvent(i)) { - var o = a.getEvent(i); - _ = a.$keyboardNavigation.SchedulerNode.prototype._pickEvent(o.start_date, a.date.add(o.start_date, 1, "year"), o.id, !1); + var d = t.$keyboardNavigation.dispatcher.activeNode, n = r || d && d.eventId, s = null; + if (n && t.getEvent(n)) { + var _ = t.getEvent(n); + s = t.$keyboardNavigation.SchedulerNode.prototype._pickEvent(_.start_date, t.date.add(_.start_date, 1, "year"), _.id, !1); } - if (!_ && !r) { - var t = a.getState(); - _ = a.$keyboardNavigation.SchedulerNode.prototype._pickEvent(t.min_date, a.date.add(t.min_date, 1, "year"), null, !1); + if (!s && !r) { + var a = t.getState(); + s = t.$keyboardNavigation.SchedulerNode.prototype._pickEvent(a.min_date, t.date.add(a.min_date, 1, "year"), null, !1); } - if (_) { - var n = new a.$keyboardNavigation.Event(_.id); - n.isValid() ? (d && d.blur(), a.$keyboardNavigation.dispatcher.setActiveNode(n)) : this.nextEventHandler(_.id); + if (s) { + var o = new t.$keyboardNavigation.Event(s.id); + o.isValid() ? (d && d.blur(), t.$keyboardNavigation.dispatcher.setActiveNode(o)) : this.nextEventHandler(s.id); } }, prevEventHandler: function(r) { - var d = a.$keyboardNavigation.dispatcher.activeNode, i = r || d && d.eventId, _ = null; - if (i && a.getEvent(i)) { - var o = a.getEvent(i); - _ = a.$keyboardNavigation.SchedulerNode.prototype._pickEvent(a.date.add(o.end_date, -1, "year"), o.end_date, o.id, !0); + var d = t.$keyboardNavigation.dispatcher.activeNode, n = r || d && d.eventId, s = null; + if (n && t.getEvent(n)) { + var _ = t.getEvent(n); + s = t.$keyboardNavigation.SchedulerNode.prototype._pickEvent(t.date.add(_.end_date, -1, "year"), _.end_date, _.id, !0); } - if (!_ && !r) { - var t = a.getState(); - _ = a.$keyboardNavigation.SchedulerNode.prototype._pickEvent(a.date.add(t.max_date, -1, "year"), t.max_date, null, !0); + if (!s && !r) { + var a = t.getState(); + s = t.$keyboardNavigation.SchedulerNode.prototype._pickEvent(t.date.add(a.max_date, -1, "year"), a.max_date, null, !0); } - if (_) { - var n = new a.$keyboardNavigation.Event(_.id); - n.isValid() ? (d && d.blur(), a.$keyboardNavigation.dispatcher.setActiveNode(n)) : this.prevEventHandler(_.id); + if (s) { + var o = new t.$keyboardNavigation.Event(s.id); + o.isValid() ? (d && d.blur(), t.$keyboardNavigation.dispatcher.setActiveNode(o)) : this.prevEventHandler(s.id); } }, keys: { "alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9": function(r) { - var d = a.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab"), i = r.key; - i === void 0 && (i = r.keyCode - 48), d[1 * i - 1] && d[1 * i - 1].click(); + var d = t.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab"), n = r.key; + n === void 0 && (n = r.keyCode - 48), d[1 * n - 1] && d[1 * n - 1].click(); }, "ctrl+left,meta+left": function(r) { - a._click.dhx_cal_prev_button(); + t._click.dhx_cal_prev_button(); }, "ctrl+right,meta+right": function(r) { - a._click.dhx_cal_next_button(); + t._click.dhx_cal_next_button(); }, "ctrl+up,meta+up": function(r) { - a.$container.querySelector(".dhx_cal_data").scrollTop -= 20; + t.$container.querySelector(".dhx_cal_data").scrollTop -= 20; }, "ctrl+down,meta+down": function(r) { - a.$container.querySelector(".dhx_cal_data").scrollTop += 20; + t.$container.querySelector(".dhx_cal_data").scrollTop += 20; }, e: function() { this.nextEventHandler(); }, home: function() { - a.setCurrentView(/* @__PURE__ */ new Date()); + t.setCurrentView(/* @__PURE__ */ new Date()); }, "shift+e": function() { this.prevEventHandler(); }, "ctrl+enter,meta+enter": function() { - a.addEventNow({ start_date: new Date(a.getState().date) }); + t.addEventNow({ start_date: new Date(t.getState().date) }); }, "ctrl+c,meta+c": function(r) { - a._key_nav_copy_paste(r); + t._key_nav_copy_paste(r); }, "ctrl+v,meta+v": function(r) { - a._key_nav_copy_paste(r); + t._key_nav_copy_paste(r); }, "ctrl+x,meta+x": function(r) { - a._key_nav_copy_paste(r); - } } }), a.$keyboardNavigation.SchedulerNode.prototype.bindAll(a.$keyboardNavigation.SchedulerNode.prototype.keys); - }(e), function(a) { - a.$keyboardNavigation.KeyNavNode = function() { - }, a.$keyboardNavigation.KeyNavNode.prototype = a._compose(a.$keyboardNavigation.EventHandler, { isValid: function() { + t._key_nav_copy_paste(r); + } } }), t.$keyboardNavigation.SchedulerNode.prototype.bindAll(t.$keyboardNavigation.SchedulerNode.prototype.keys); + }(e), function(t) { + t.$keyboardNavigation.KeyNavNode = function() { + }, t.$keyboardNavigation.KeyNavNode.prototype = t._compose(t.$keyboardNavigation.EventHandler, { isValid: function() { return !0; }, fallback: function() { return null; }, moveTo: function(r) { - a.$keyboardNavigation.dispatcher.setActiveNode(r); + t.$keyboardNavigation.dispatcher.setActiveNode(r); }, compareTo: function(r) { if (!r) return !1; for (var d in this) { if (!!this[d] != !!r[d]) return !1; - var i = !(!this[d] || !this[d].toString), _ = !(!r[d] || !r[d].toString); - if (_ != i) + var n = !(!this[d] || !this[d].toString), s = !(!r[d] || !r[d].toString); + if (s != n) return !1; - if (_ && i) { + if (s && n) { if (r[d].toString() != this[d].toString()) return !1; } else if (r[d] != this[d]) @@ -5194,381 +7373,381 @@ const lt = { active_links: function(e) { var r = this.getNode(); r && r.setAttribute("tabindex", "-1"); } }); - }(e), function(a) { - a.$keyboardNavigation.HeaderCell = function(r) { + }(e), function(t) { + t.$keyboardNavigation.HeaderCell = function(r) { this.index = r || 0; - }, a.$keyboardNavigation.HeaderCell.prototype = a._compose(a.$keyboardNavigation.KeyNavNode, { getNode: function(r) { + }, t.$keyboardNavigation.HeaderCell.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, { getNode: function(r) { r = r || this.index || 0; var d = this.getNodes(); if (d[r]) return d[r]; }, getNodes: function(r) { r = r || [".dhx_cal_navline .dhx_cal_prev_button", ".dhx_cal_navline .dhx_cal_next_button", ".dhx_cal_navline .dhx_cal_today_button", ".dhx_cal_navline .dhx_cal_tab"].join(", "); - var d = Array.prototype.slice.call(a.$container.querySelectorAll(r)); - return d.sort(function(i, _) { - return i.offsetLeft - _.offsetLeft; + var d = Array.prototype.slice.call(t.$container.querySelectorAll(r)); + return d.sort(function(n, s) { + return n.offsetLeft - s.offsetLeft; }), d; }, _handlers: null, isValid: function() { return !!this.getNode(this.index); }, fallback: function() { var r = this.getNode(0); - return r || (r = new a.$keyboardNavigation.TimeSlot()), r; + return r || (r = new t.$keyboardNavigation.TimeSlot()), r; }, keys: { left: function() { var r = this.index - 1; - r < 0 && (r = this.getNodes().length - 1), this.moveTo(new a.$keyboardNavigation.HeaderCell(r)); + r < 0 && (r = this.getNodes().length - 1), this.moveTo(new t.$keyboardNavigation.HeaderCell(r)); }, right: function() { var r = this.index + 1; - r >= this.getNodes().length && (r = 0), this.moveTo(new a.$keyboardNavigation.HeaderCell(r)); + r >= this.getNodes().length && (r = 0), this.moveTo(new t.$keyboardNavigation.HeaderCell(r)); }, down: function() { - this.moveTo(new a.$keyboardNavigation.TimeSlot()); + this.moveTo(new t.$keyboardNavigation.TimeSlot()); }, enter: function() { var r = this.getNode(); r && r.click(); - } } }), a.$keyboardNavigation.HeaderCell.prototype.bindAll(a.$keyboardNavigation.HeaderCell.prototype.keys); - }(e), function(a) { - a.$keyboardNavigation.Event = function(r) { - if (this.eventId = null, a.getEvent(r)) { - var d = a.getEvent(r); + } } }), t.$keyboardNavigation.HeaderCell.prototype.bindAll(t.$keyboardNavigation.HeaderCell.prototype.keys); + }(e), function(t) { + t.$keyboardNavigation.Event = function(r) { + if (this.eventId = null, t.getEvent(r)) { + var d = t.getEvent(r); this.start = new Date(d.start_date), this.end = new Date(d.end_date), this.section = this._getSection(d), this.eventId = r; } - }, a.$keyboardNavigation.Event.prototype = a._compose(a.$keyboardNavigation.KeyNavNode, { _getNodes: function() { - return Array.prototype.slice.call(a.$container.querySelectorAll("[" + a.config.event_attribute + "]")); - }, _modes: a.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: a.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { - return !(!a.getEvent(this.eventId) || !this.getNode()); + }, t.$keyboardNavigation.Event.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, { _getNodes: function() { + return Array.prototype.slice.call(t.$container.querySelectorAll("[" + t.config.event_attribute + "]")); + }, _modes: t.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: t.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { + return !(!t.getEvent(this.eventId) || !this.getNode()); }, fallback: function() { var r = this._getNodes()[0], d = null; - if (r && a._locate_event(r)) { - var i = a._locate_event(r); - d = new a.$keyboardNavigation.Event(i); + if (r && t._locate_event(r)) { + var n = t._locate_event(r); + d = new t.$keyboardNavigation.Event(n); } else - d = new a.$keyboardNavigation.TimeSlot(); + d = new t.$keyboardNavigation.TimeSlot(); return d; }, isScrolledIntoView: function(r) { - var d = r.getBoundingClientRect(), i = a.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); - return !(d.bottom < i.top || d.top > i.bottom); + var d = r.getBoundingClientRect(), n = t.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); + return !(d.bottom < n.top || d.top > n.bottom); }, getNode: function() { - var r = "[" + a.config.event_attribute + "='" + this.eventId + "']", d = a.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); + var r = "[" + t.config.event_attribute + "='" + this.eventId + "']", d = t.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); if (d) return d; - if (a.isMultisectionEvent && a.isMultisectionEvent(a.getEvent(this.eventId))) { - for (var i = a.$container.querySelectorAll(r), _ = 0; _ < i.length; _++) - if (this.isScrolledIntoView(i[_])) - return i[_]; - return i[0]; + if (t.isMultisectionEvent && t.isMultisectionEvent(t.getEvent(this.eventId))) { + for (var n = t.$container.querySelectorAll(r), s = 0; s < n.length; s++) + if (this.isScrolledIntoView(n[s])) + return n[s]; + return n[0]; } - return a.$container.querySelector(r); + return t.$container.querySelector(r); }, focus: function() { - var r = a.getEvent(this.eventId), d = a.getState(); - (r.start_date.valueOf() > d.max_date.valueOf() || r.end_date.valueOf() <= d.min_date.valueOf()) && a.setCurrentView(r.start_date); - var i = this.getNode(); - this.isScrolledIntoView(i) ? a.$keyboardNavigation.dispatcher.keepScrollPosition((function() { - a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }).bind(this)) : a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + var r = t.getEvent(this.eventId), d = t.getState(); + (r.start_date.valueOf() > d.max_date.valueOf() || r.end_date.valueOf() <= d.min_date.valueOf()) && t.setCurrentView(r.start_date); + var n = this.getNode(); + this.isScrolledIntoView(n) ? t.$keyboardNavigation.dispatcher.keepScrollPosition((function() { + t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }).bind(this)) : t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); }, blur: function() { - a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); }, _getSection: function(r) { - var d = null, i = a.getState().mode; - return a.matrix && a.matrix[i] ? d = r[a.matrix[a.getState().mode].y_property] : a._props && a._props[i] && (d = r[a._props[i].map_to]), d; + var d = null, n = t.getState().mode; + return t.matrix && t.matrix[n] ? d = r[t.matrix[t.getState().mode].y_property] : t._props && t._props[n] && (d = r[t._props[n].map_to]), d; }, _moveToSlot: function(r) { - var d = a.getEvent(this.eventId); + var d = t.getEvent(this.eventId); if (d) { - var i = this._getSection(d), _ = new a.$keyboardNavigation.TimeSlot(d.start_date, null, i); - this.moveTo(_.nextSlot(_, r)); + var n = this._getSection(d), s = new t.$keyboardNavigation.TimeSlot(d.start_date, null, n); + this.moveTo(s.nextSlot(s, r)); } else - this.moveTo(new a.$keyboardNavigation.TimeSlot()); + this.moveTo(new t.$keyboardNavigation.TimeSlot()); }, keys: { left: function() { this._moveToSlot("left"); }, right: function() { this._moveToSlot("right"); }, down: function() { - this.getMode() == this._modes.list ? a.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler() : this._moveToSlot("down"); + this.getMode() == this._modes.list ? t.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler() : this._moveToSlot("down"); }, space: function() { var r = this.getNode(); - r && r.click ? r.click() : this.moveTo(new a.$keyboardNavigation.TimeSlot()); + r && r.click ? r.click() : this.moveTo(new t.$keyboardNavigation.TimeSlot()); }, up: function() { - this.getMode() == this._modes.list ? a.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler() : this._moveToSlot("up"); + this.getMode() == this._modes.list ? t.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler() : this._moveToSlot("up"); }, delete: function() { - a.getEvent(this.eventId) ? a._click.buttons.delete(this.eventId) : this.moveTo(new a.$keyboardNavigation.TimeSlot()); + t.getEvent(this.eventId) ? t._click.buttons.delete(this.eventId) : this.moveTo(new t.$keyboardNavigation.TimeSlot()); }, enter: function() { - a.getEvent(this.eventId) ? a.showLightbox(this.eventId) : this.moveTo(new a.$keyboardNavigation.TimeSlot()); - } } }), a.$keyboardNavigation.Event.prototype.bindAll(a.$keyboardNavigation.Event.prototype.keys); - }(e), function(a) { - a.$keyboardNavigation.TimeSlot = function(r, d, i, _) { - var o = a.getState(), t = a.matrix && a.matrix[o.mode]; - r || (r = this.getDefaultDate()), d || (d = t ? a.date.add(r, t.x_step, t.x_unit) : a.date.add(r, a.config.key_nav_step, "minute")), this.section = i || this._getDefaultSection(), this.start_date = new Date(r), this.end_date = new Date(d), this.movingDate = _ || null; - }, a.$keyboardNavigation.TimeSlot.prototype = a._compose(a.$keyboardNavigation.KeyNavNode, { _handlers: null, getDefaultDate: function() { - var r, d = a.getState(), i = new Date(d.date); - i.setSeconds(0), i.setMilliseconds(0); - var _ = /* @__PURE__ */ new Date(); - _.setSeconds(0), _.setMilliseconds(0); - var o = a.matrix && a.matrix[d.mode], t = !1; - if (i.valueOf() === _.valueOf() && (t = !0), o) - t ? (o.x_unit === "day" ? (_.setHours(0), _.setMinutes(0)) : o.x_unit === "hour" && _.setMinutes(0), r = _) : r = a.date[o.name + "_start"](new Date(d.date)), r = this.findVisibleColumn(r); - else if (r = new Date(a.getState().min_date), t && (r = _), r = this.findVisibleColumn(r), t || r.setHours(a.config.first_hour), !a._table_view) { - var n = a.$container.querySelector(".dhx_cal_data"); - n.scrollTop && r.setHours(a.config.first_hour + Math.ceil(n.scrollTop / a.config.hour_size_px)); + t.getEvent(this.eventId) ? t.showLightbox(this.eventId) : this.moveTo(new t.$keyboardNavigation.TimeSlot()); + } } }), t.$keyboardNavigation.Event.prototype.bindAll(t.$keyboardNavigation.Event.prototype.keys); + }(e), function(t) { + t.$keyboardNavigation.TimeSlot = function(r, d, n, s) { + var _ = t.getState(), a = t.matrix && t.matrix[_.mode]; + r || (r = this.getDefaultDate()), d || (d = a ? t.date.add(r, a.x_step, a.x_unit) : t.date.add(r, t.config.key_nav_step, "minute")), this.section = n || this._getDefaultSection(), this.start_date = new Date(r), this.end_date = new Date(d), this.movingDate = s || null; + }, t.$keyboardNavigation.TimeSlot.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, { _handlers: null, getDefaultDate: function() { + var r, d = t.getState(), n = new Date(d.date); + n.setSeconds(0), n.setMilliseconds(0); + var s = /* @__PURE__ */ new Date(); + s.setSeconds(0), s.setMilliseconds(0); + var _ = t.matrix && t.matrix[d.mode], a = !1; + if (n.valueOf() === s.valueOf() && (a = !0), _) + a ? (_.x_unit === "day" ? (s.setHours(0), s.setMinutes(0)) : _.x_unit === "hour" && s.setMinutes(0), r = s) : r = t.date[_.name + "_start"](new Date(d.date)), r = this.findVisibleColumn(r); + else if (r = new Date(t.getState().min_date), a && (r = s), r = this.findVisibleColumn(r), a || r.setHours(t.config.first_hour), !t._table_view) { + var o = t.$container.querySelector(".dhx_cal_data"); + o.scrollTop && r.setHours(t.config.first_hour + Math.ceil(o.scrollTop / t.config.hour_size_px)); } return r; }, clone: function(r) { - return new a.$keyboardNavigation.TimeSlot(r.start_date, r.end_date, r.section, r.movingDate); + return new t.$keyboardNavigation.TimeSlot(r.start_date, r.end_date, r.section, r.movingDate); }, _getMultisectionView: function() { - var r, d = a.getState(); - return a._props && a._props[d.mode] ? r = a._props[d.mode] : a.matrix && a.matrix[d.mode] && (r = a.matrix[d.mode]), r; + var r, d = t.getState(); + return t._props && t._props[d.mode] ? r = t._props[d.mode] : t.matrix && t.matrix[d.mode] && (r = t.matrix[d.mode]), r; }, _getDefaultSection: function() { var r = null; return this._getMultisectionView() && !r && (r = this._getNextSection()), r; }, _getNextSection: function(r, d) { - var i = this._getMultisectionView(), _ = i.order[r], o = _; - (o = _ !== void 0 ? _ + d : i.size && i.position ? i.position : 0) < 0 && (o = 0); - var t = i.options || i.y_unit; - return o >= t.length && (o = t.length - 1), t[o] ? t[o].key : null; + var n = this._getMultisectionView(), s = n.order[r], _ = s; + (_ = s !== void 0 ? s + d : n.size && n.position ? n.position : 0) < 0 && (_ = 0); + var a = n.options || n.y_unit; + return _ >= a.length && (_ = a.length - 1), a[_] ? a[_].key : null; }, isValid: function() { - var r = a.getState(); + var r = t.getState(); if (this.start_date.valueOf() < r.min_date.valueOf() || this.start_date.valueOf() >= r.max_date.valueOf() || !this.isVisible(this.start_date, this.end_date)) return !1; var d = this._getMultisectionView(); return !d || d.order[this.section] !== void 0; }, fallback: function() { - var r = new a.$keyboardNavigation.TimeSlot(); - return r.isValid() ? r : new a.$keyboardNavigation.DataArea(); + var r = new t.$keyboardNavigation.TimeSlot(); + return r.isValid() ? r : new t.$keyboardNavigation.DataArea(); }, getNodes: function() { - return Array.prototype.slice.call(a.$container.querySelectorAll(".dhx_focus_slot")); + return Array.prototype.slice.call(t.$container.querySelectorAll(".dhx_focus_slot")); }, getNode: function() { return this.getNodes()[0]; }, focus: function() { - this.section && a.getView() && a.getView().smart_rendering && a.getView().scrollTo && !a.$container.querySelector(`[data-section-id="${this.section}"]`) && a.getView().scrollTo({ section: this.section }), a.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section), a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this), a.$keyboardNavigation._pasteDate = this.start_date, a.$keyboardNavigation._pasteSection = this.section; + this.section && t.getView() && t.getView().smart_rendering && t.getView().scrollTo && !t.$container.querySelector(`[data-section-id="${this.section}"]`) && t.getView().scrollTo({ section: this.section }), t.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section), t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this), t.$keyboardNavigation._pasteDate = this.start_date, t.$keyboardNavigation._pasteSection = this.section; }, blur: function() { - a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this), a.$keyboardNavigation.marker.clear(); - }, _modes: a.$keyboardNavigation.SchedulerNode.prototype._modes, _getMode: a.$keyboardNavigation.SchedulerNode.prototype.getMode, addMonthDate: function(r, d, i) { - var _; + t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this), t.$keyboardNavigation.marker.clear(); + }, _modes: t.$keyboardNavigation.SchedulerNode.prototype._modes, _getMode: t.$keyboardNavigation.SchedulerNode.prototype.getMode, addMonthDate: function(r, d, n) { + var s; switch (d) { case "up": - _ = a.date.add(r, -1, "week"); + s = t.date.add(r, -1, "week"); break; case "down": - _ = a.date.add(r, 1, "week"); + s = t.date.add(r, 1, "week"); break; case "left": - _ = a.date.day_start(a.date.add(r, -1, "day")), _ = this.findVisibleColumn(_, -1); + s = t.date.day_start(t.date.add(r, -1, "day")), s = this.findVisibleColumn(s, -1); break; case "right": - _ = a.date.day_start(a.date.add(r, 1, "day")), _ = this.findVisibleColumn(_, 1); + s = t.date.day_start(t.date.add(r, 1, "day")), s = this.findVisibleColumn(s, 1); break; default: - _ = a.date.day_start(new Date(r)); - } - var o = a.getState(); - return (r.valueOf() < o.min_date.valueOf() || !i && r.valueOf() >= o.max_date.valueOf()) && (_ = new Date(o.min_date)), _; - }, nextMonthSlot: function(r, d, i) { - var _, o; - return (_ = this.addMonthDate(r.start_date, d, i)).setHours(a.config.first_hour), (o = new Date(_)).setHours(a.config.last_hour), { start_date: _, end_date: o }; - }, _alignTimeSlot: function(r, d, i, _) { - for (var o = new Date(d); o.valueOf() < r.valueOf(); ) - o = a.date.add(o, _, i); - return o.valueOf() > r.valueOf() && (o = a.date.add(o, -_, i)), o; - }, nextTimelineSlot: function(r, d, i) { - var _ = a.getState(), o = a.matrix[_.mode], t = this._alignTimeSlot(r.start_date, a.date[o.name + "_start"](new Date(r.start_date)), o.x_unit, o.x_step), n = this._alignTimeSlot(r.end_date, a.date[o.name + "_start"](new Date(r.end_date)), o.x_unit, o.x_step); - n.valueOf() <= t.valueOf() && (n = a.date.add(t, o.x_step, o.x_unit)); - var s = this.clone(r); - switch (s.start_date = t, s.end_date = n, s.section = r.section || this._getNextSection(), d) { + s = t.date.day_start(new Date(r)); + } + var _ = t.getState(); + return (r.valueOf() < _.min_date.valueOf() || !n && r.valueOf() >= _.max_date.valueOf()) && (s = new Date(_.min_date)), s; + }, nextMonthSlot: function(r, d, n) { + var s, _; + return (s = this.addMonthDate(r.start_date, d, n)).setHours(t.config.first_hour), (_ = new Date(s)).setHours(t.config.last_hour), { start_date: s, end_date: _ }; + }, _alignTimeSlot: function(r, d, n, s) { + for (var _ = new Date(d); _.valueOf() < r.valueOf(); ) + _ = t.date.add(_, s, n); + return _.valueOf() > r.valueOf() && (_ = t.date.add(_, -s, n)), _; + }, nextTimelineSlot: function(r, d, n) { + var s = t.getState(), _ = t.matrix[s.mode], a = this._alignTimeSlot(r.start_date, t.date[_.name + "_start"](new Date(r.start_date)), _.x_unit, _.x_step), o = this._alignTimeSlot(r.end_date, t.date[_.name + "_start"](new Date(r.end_date)), _.x_unit, _.x_step); + o.valueOf() <= a.valueOf() && (o = t.date.add(a, _.x_step, _.x_unit)); + var l = this.clone(r); + switch (l.start_date = a, l.end_date = o, l.section = r.section || this._getNextSection(), d) { case "up": - s.section = this._getNextSection(r.section, -1); + l.section = this._getNextSection(r.section, -1); break; case "down": - s.section = this._getNextSection(r.section, 1); + l.section = this._getNextSection(r.section, 1); break; case "left": - s.start_date = this.findVisibleColumn(a.date.add(s.start_date, -o.x_step, o.x_unit), -1), s.end_date = a.date.add(s.start_date, o.x_step, o.x_unit); + l.start_date = this.findVisibleColumn(t.date.add(l.start_date, -_.x_step, _.x_unit), -1), l.end_date = t.date.add(l.start_date, _.x_step, _.x_unit); break; case "right": - s.start_date = this.findVisibleColumn(a.date.add(s.start_date, o.x_step, o.x_unit), 1), s.end_date = a.date.add(s.start_date, o.x_step, o.x_unit); + l.start_date = this.findVisibleColumn(t.date.add(l.start_date, _.x_step, _.x_unit), 1), l.end_date = t.date.add(l.start_date, _.x_step, _.x_unit); } - return (s.start_date.valueOf() < _.min_date.valueOf() || s.start_date.valueOf() >= _.max_date.valueOf()) && (i && s.start_date.valueOf() >= _.max_date.valueOf() ? s.start_date = new Date(_.max_date) : (s.start_date = a.date[_.mode + "_start"](a.date.add(_.date, d == "left" ? -1 : 1, _.mode)), s.end_date = a.date.add(s.start_date, o.x_step, o.x_unit))), s; - }, nextUnitsSlot: function(r, d, i) { - var _ = this.clone(r); - _.section = r.section || this._getNextSection(); - var o = r.section || this._getNextSection(), t = a.getState(), n = a._props[t.mode]; + return (l.start_date.valueOf() < s.min_date.valueOf() || l.start_date.valueOf() >= s.max_date.valueOf()) && (n && l.start_date.valueOf() >= s.max_date.valueOf() ? l.start_date = new Date(s.max_date) : (l.start_date = t.date[s.mode + "_start"](t.date.add(s.date, d == "left" ? -1 : 1, s.mode)), l.end_date = t.date.add(l.start_date, _.x_step, _.x_unit))), l; + }, nextUnitsSlot: function(r, d, n) { + var s = this.clone(r); + s.section = r.section || this._getNextSection(); + var _ = r.section || this._getNextSection(), a = t.getState(), o = t._props[a.mode]; switch (d) { case "left": - o = this._getNextSection(r.section, -1); - var s = n.size ? n.size - 1 : n.options.length; - n.days > 1 && n.order[o] == s - 1 && a.date.add(r.start_date, -1, "day").valueOf() >= t.min_date.valueOf() && (_ = this.nextDaySlot(r, d, i)); + _ = this._getNextSection(r.section, -1); + var l = o.size ? o.size - 1 : o.options.length; + o.days > 1 && o.order[_] == l - 1 && t.date.add(r.start_date, -1, "day").valueOf() >= a.min_date.valueOf() && (s = this.nextDaySlot(r, d, n)); break; case "right": - o = this._getNextSection(r.section, 1), n.days > 1 && !n.order[o] && a.date.add(r.start_date, 1, "day").valueOf() < t.max_date.valueOf() && (_ = this.nextDaySlot(r, d, i)); + _ = this._getNextSection(r.section, 1), o.days > 1 && !o.order[_] && t.date.add(r.start_date, 1, "day").valueOf() < a.max_date.valueOf() && (s = this.nextDaySlot(r, d, n)); break; default: - _ = this.nextDaySlot(r, d, i), o = r.section; + s = this.nextDaySlot(r, d, n), _ = r.section; } - return _.section = o, _; + return s.section = _, s; }, _moveDate: function(r, d) { - var i = this.findVisibleColumn(a.date.add(r, d, "day"), d); - return i.setHours(r.getHours()), i.setMinutes(r.getMinutes()), i; + var n = this.findVisibleColumn(t.date.add(r, d, "day"), d); + return n.setHours(r.getHours()), n.setMinutes(r.getMinutes()), n; }, isBeforeLastHour: function(r, d) { - var i = r.getMinutes(), _ = r.getHours(), o = a.config.last_hour; - return _ < o || !d && (o == 24 || _ == o) && !i; + var n = r.getMinutes(), s = r.getHours(), _ = t.config.last_hour; + return s < _ || !d && (_ == 24 || s == _) && !n; }, isAfterFirstHour: function(r, d) { - var i = r.getMinutes(), _ = r.getHours(), o = a.config.first_hour, t = a.config.last_hour; - return _ >= o || !d && !i && (!_ && t == 24 || _ == t); + var n = r.getMinutes(), s = r.getHours(), _ = t.config.first_hour, a = t.config.last_hour; + return s >= _ || !d && !n && (!s && a == 24 || s == a); }, isInVisibleDayTime: function(r, d) { return this.isBeforeLastHour(r, d) && this.isAfterFirstHour(r, d); - }, nextDaySlot: function(r, d, i) { - var _, o, t = a.config.key_nav_step, n = this._alignTimeSlot(r.start_date, a.date.day_start(new Date(r.start_date)), "minute", t), s = r.start_date; + }, nextDaySlot: function(r, d, n) { + var s, _, a = t.config.key_nav_step, o = this._alignTimeSlot(r.start_date, t.date.day_start(new Date(r.start_date)), "minute", a), l = r.start_date; switch (d) { case "up": - if (_ = a.date.add(n, -t, "minute"), !this.isInVisibleDayTime(_, !0) && (!i || this.isInVisibleDayTime(s, !0))) { - var c = !0; - i && a.date.date_part(new Date(_)).valueOf() != a.date.date_part(new Date(s)).valueOf() && (c = !1), c && (_ = this.findVisibleColumn(a.date.add(r.start_date, -1, "day"), -1)), _.setHours(a.config.last_hour), _.setMinutes(0), _ = a.date.add(_, -t, "minute"); + if (s = t.date.add(o, -a, "minute"), !this.isInVisibleDayTime(s, !0) && (!n || this.isInVisibleDayTime(l, !0))) { + var h = !0; + n && t.date.date_part(new Date(s)).valueOf() != t.date.date_part(new Date(l)).valueOf() && (h = !1), h && (s = this.findVisibleColumn(t.date.add(r.start_date, -1, "day"), -1)), s.setHours(t.config.last_hour), s.setMinutes(0), s = t.date.add(s, -a, "minute"); } - o = a.date.add(_, t, "minute"); + _ = t.date.add(s, a, "minute"); break; case "down": - _ = a.date.add(n, t, "minute"); - var u = i ? _ : a.date.add(_, t, "minute"); - this.isInVisibleDayTime(u, !1) || i && !this.isInVisibleDayTime(s, !1) || (i ? (c = !0, a.date.date_part(new Date(s)).valueOf() == s.valueOf() && (c = !1), c && (_ = this.findVisibleColumn(a.date.add(r.start_date, 1, "day"), 1)), _.setHours(a.config.first_hour), _.setMinutes(0), _ = a.date.add(_, t, "minute")) : ((_ = this.findVisibleColumn(a.date.add(r.start_date, 1, "day"), 1)).setHours(a.config.first_hour), _.setMinutes(0))), o = a.date.add(_, t, "minute"); + s = t.date.add(o, a, "minute"); + var v = n ? s : t.date.add(s, a, "minute"); + this.isInVisibleDayTime(v, !1) || n && !this.isInVisibleDayTime(l, !1) || (n ? (h = !0, t.date.date_part(new Date(l)).valueOf() == l.valueOf() && (h = !1), h && (s = this.findVisibleColumn(t.date.add(r.start_date, 1, "day"), 1)), s.setHours(t.config.first_hour), s.setMinutes(0), s = t.date.add(s, a, "minute")) : ((s = this.findVisibleColumn(t.date.add(r.start_date, 1, "day"), 1)).setHours(t.config.first_hour), s.setMinutes(0))), _ = t.date.add(s, a, "minute"); break; case "left": - _ = this._moveDate(r.start_date, -1), o = this._moveDate(r.end_date, -1); + s = this._moveDate(r.start_date, -1), _ = this._moveDate(r.end_date, -1); break; case "right": - _ = this._moveDate(r.start_date, 1), o = this._moveDate(r.end_date, 1); + s = this._moveDate(r.start_date, 1), _ = this._moveDate(r.end_date, 1); break; default: - _ = n, o = a.date.add(_, t, "minute"); + s = o, _ = t.date.add(s, a, "minute"); } - return { start_date: _, end_date: o }; + return { start_date: s, end_date: _ }; }, nextWeekAgendaSlot: function(r, d) { - var i, _, o = a.getState(); + var n, s, _ = t.getState(); switch (d) { case "down": case "left": - i = a.date.day_start(a.date.add(r.start_date, -1, "day")), i = this.findVisibleColumn(i, -1); + n = t.date.day_start(t.date.add(r.start_date, -1, "day")), n = this.findVisibleColumn(n, -1); break; case "up": case "right": - i = a.date.day_start(a.date.add(r.start_date, 1, "day")), i = this.findVisibleColumn(i, 1); + n = t.date.day_start(t.date.add(r.start_date, 1, "day")), n = this.findVisibleColumn(n, 1); break; default: - i = a.date.day_start(r.start_date); + n = t.date.day_start(r.start_date); } - return (r.start_date.valueOf() < o.min_date.valueOf() || r.start_date.valueOf() >= o.max_date.valueOf()) && (i = new Date(o.min_date)), (_ = new Date(i)).setHours(a.config.last_hour), { start_date: i, end_date: _ }; + return (r.start_date.valueOf() < _.min_date.valueOf() || r.start_date.valueOf() >= _.max_date.valueOf()) && (n = new Date(_.min_date)), (s = new Date(n)).setHours(t.config.last_hour), { start_date: n, end_date: s }; }, nextAgendaSlot: function(r, d) { return { start_date: r.start_date, end_date: r.end_date }; }, isDateVisible: function(r) { - if (!a._ignores_detected) + if (!t._ignores_detected) return !0; - var d, i = a.matrix && a.matrix[a.getState().mode]; - return d = i ? a._get_date_index(i, r) : a.locate_holder_day(r), !a._ignores[d]; + var d, n = t.matrix && t.matrix[t.getState().mode]; + return d = n ? t._get_date_index(n, r) : t.locate_holder_day(r), !t._ignores[d]; }, findVisibleColumn: function(r, d) { - var i = r; + var n = r; d = d || 1; - for (var _ = a.getState(); !this.isDateVisible(i) && (d > 0 && i.valueOf() <= _.max_date.valueOf() || d < 0 && i.valueOf() >= _.min_date.valueOf()); ) - i = this.nextDateColumn(i, d); - return i; + for (var s = t.getState(); !this.isDateVisible(n) && (d > 0 && n.valueOf() <= s.max_date.valueOf() || d < 0 && n.valueOf() >= s.min_date.valueOf()); ) + n = this.nextDateColumn(n, d); + return n; }, nextDateColumn: function(r, d) { d = d || 1; - var i = a.matrix && a.matrix[a.getState().mode]; - return i ? a.date.add(r, d * i.x_step, i.x_unit) : a.date.day_start(a.date.add(r, d, "day")); + var n = t.matrix && t.matrix[t.getState().mode]; + return n ? t.date.add(r, d * n.x_step, n.x_unit) : t.date.day_start(t.date.add(r, d, "day")); }, isVisible: function(r, d) { - if (!a._ignores_detected) + if (!t._ignores_detected) return !0; - for (var i = new Date(r); i.valueOf() < d.valueOf(); ) { - if (this.isDateVisible(i)) + for (var n = new Date(r); n.valueOf() < d.valueOf(); ) { + if (this.isDateVisible(n)) return !0; - i = this.nextDateColumn(i); + n = this.nextDateColumn(n); } return !1; - }, nextSlot: function(r, d, i, _) { - var o; - i = i || this._getMode(); - var t = a.$keyboardNavigation.TimeSlot.prototype.clone(r); - switch (i) { + }, nextSlot: function(r, d, n, s) { + var _; + n = n || this._getMode(); + var a = t.$keyboardNavigation.TimeSlot.prototype.clone(r); + switch (n) { case this._modes.units: - o = this.nextUnitsSlot(t, d, _); + _ = this.nextUnitsSlot(a, d, s); break; case this._modes.timeline: - o = this.nextTimelineSlot(t, d, _); + _ = this.nextTimelineSlot(a, d, s); break; case this._modes.year: case this._modes.month: - o = this.nextMonthSlot(t, d, _); + _ = this.nextMonthSlot(a, d, s); break; case this._modes.weekAgenda: - o = this.nextWeekAgendaSlot(t, d, _); + _ = this.nextWeekAgendaSlot(a, d, s); break; case this._modes.list: - o = this.nextAgendaSlot(t, d, _); + _ = this.nextAgendaSlot(a, d, s); break; case this._modes.dayColumns: - o = this.nextDaySlot(t, d, _); + _ = this.nextDaySlot(a, d, s); } - return o.start_date.valueOf() >= o.end_date.valueOf() && (o = this.nextSlot(o, d, i)), a.$keyboardNavigation.TimeSlot.prototype.clone(o); + return _.start_date.valueOf() >= _.end_date.valueOf() && (_ = this.nextSlot(_, d, n)), t.$keyboardNavigation.TimeSlot.prototype.clone(_); }, extendSlot: function(r, d) { - var i; + var n; switch (this._getMode()) { case this._modes.units: - i = d == "left" || d == "right" ? this.nextUnitsSlot(r, d) : this.extendUnitsSlot(r, d); + n = d == "left" || d == "right" ? this.nextUnitsSlot(r, d) : this.extendUnitsSlot(r, d); break; case this._modes.timeline: - i = d == "down" || d == "up" ? this.nextTimelineSlot(r, d) : this.extendTimelineSlot(r, d); + n = d == "down" || d == "up" ? this.nextTimelineSlot(r, d) : this.extendTimelineSlot(r, d); break; case this._modes.year: case this._modes.month: - i = this.extendMonthSlot(r, d); + n = this.extendMonthSlot(r, d); break; case this._modes.dayColumns: - i = this.extendDaySlot(r, d); + n = this.extendDaySlot(r, d); break; case this._modes.weekAgenda: - i = this.extendWeekAgendaSlot(r, d); + n = this.extendWeekAgendaSlot(r, d); break; default: - i = r; + n = r; } - var _ = a.getState(); - return i.start_date.valueOf() < _.min_date.valueOf() && (i.start_date = this.findVisibleColumn(_.min_date), i.start_date.setHours(a.config.first_hour)), i.end_date.valueOf() > _.max_date.valueOf() && (i.end_date = this.findVisibleColumn(_.max_date, -1)), a.$keyboardNavigation.TimeSlot.prototype.clone(i); + var s = t.getState(); + return n.start_date.valueOf() < s.min_date.valueOf() && (n.start_date = this.findVisibleColumn(s.min_date), n.start_date.setHours(t.config.first_hour)), n.end_date.valueOf() > s.max_date.valueOf() && (n.end_date = this.findVisibleColumn(s.max_date, -1)), t.$keyboardNavigation.TimeSlot.prototype.clone(n); }, extendTimelineSlot: function(r, d) { return this.extendGenericSlot({ left: "start_date", right: "end_date" }, r, d, "timeline"); }, extendWeekAgendaSlot: function(r, d) { return this.extendGenericSlot({ left: "start_date", right: "end_date" }, r, d, "weekAgenda"); - }, extendGenericSlot: function(r, d, i, _) { - var o, t = d.movingDate; - if (t || (t = r[i]), !t || !r[i]) + }, extendGenericSlot: function(r, d, n, s) { + var _, a = d.movingDate; + if (a || (a = r[n]), !a || !r[n]) return d; - if (!i) - return a.$keyboardNavigation.TimeSlot.prototype.clone(d); - (o = this.nextSlot({ start_date: d[t], section: d.section }, i, _, !0)).start_date.valueOf() == d.start_date.valueOf() && (o = this.nextSlot({ start_date: o.start_date, section: o.section }, i, _, !0)), o.movingDate = t; - var n = this.extendSlotDates(d, o, o.movingDate); - return n.end_date.valueOf() <= n.start_date.valueOf() && (o.movingDate = o.movingDate == "end_date" ? "start_date" : "end_date"), n = this.extendSlotDates(d, o, o.movingDate), o.start_date = n.start_date, o.end_date = n.end_date, o; - }, extendSlotDates: function(r, d, i) { - var _ = { start_date: null, end_date: null }; - return i == "start_date" ? (_.start_date = d.start_date, _.end_date = r.end_date) : (_.start_date = r.start_date, _.end_date = d.start_date), _; + if (!n) + return t.$keyboardNavigation.TimeSlot.prototype.clone(d); + (_ = this.nextSlot({ start_date: d[a], section: d.section }, n, s, !0)).start_date.valueOf() == d.start_date.valueOf() && (_ = this.nextSlot({ start_date: _.start_date, section: _.section }, n, s, !0)), _.movingDate = a; + var o = this.extendSlotDates(d, _, _.movingDate); + return o.end_date.valueOf() <= o.start_date.valueOf() && (_.movingDate = _.movingDate == "end_date" ? "start_date" : "end_date"), o = this.extendSlotDates(d, _, _.movingDate), _.start_date = o.start_date, _.end_date = o.end_date, _; + }, extendSlotDates: function(r, d, n) { + var s = { start_date: null, end_date: null }; + return n == "start_date" ? (s.start_date = d.start_date, s.end_date = r.end_date) : (s.start_date = r.start_date, s.end_date = d.start_date), s; }, extendMonthSlot: function(r, d) { - return (r = this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, r, d, "month")).start_date.setHours(a.config.first_hour), r.end_date = a.date.add(r.end_date, -1, "day"), r.end_date.setHours(a.config.last_hour), r; + return (r = this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, r, d, "month")).start_date.setHours(t.config.first_hour), r.end_date = t.date.add(r.end_date, -1, "day"), r.end_date.setHours(t.config.last_hour), r; }, extendUnitsSlot: function(r, d) { - var i; + var n; switch (d) { case "down": case "up": - i = this.extendDaySlot(r, d); + n = this.extendDaySlot(r, d); break; default: - i = r; + n = r; } - return i.section = r.section, i; + return n.section = r.section, n; }, extendDaySlot: function(r, d) { return this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, r, d, "dayColumns"); }, scrollSlot: function(r) { - var d = a.getState(), i = this.nextSlot(this, r); - (i.start_date.valueOf() < d.min_date.valueOf() || i.start_date.valueOf() >= d.max_date.valueOf()) && a.setCurrentView(new Date(i.start_date)), this.moveTo(i); + var d = t.getState(), n = this.nextSlot(this, r); + (n.start_date.valueOf() < d.min_date.valueOf() || n.start_date.valueOf() >= d.max_date.valueOf()) && t.setCurrentView(new Date(n.start_date)), this.moveTo(n); }, keys: { left: function() { this.scrollSlot("left"); }, right: function() { this.scrollSlot("right"); }, down: function() { - this._getMode() == this._modes.list ? a.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler() : this.scrollSlot("down"); + this._getMode() == this._modes.list ? t.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler() : this.scrollSlot("down"); }, up: function() { - this._getMode() == this._modes.list ? a.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler() : this.scrollSlot("up"); + this._getMode() == this._modes.list ? t.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler() : this.scrollSlot("up"); }, "shift+down": function() { this.moveTo(this.extendSlot(this, "down")); }, "shift+up": function() { @@ -5578,118 +7757,118 @@ const lt = { active_links: function(e) { }, "shift+left": function() { this.moveTo(this.extendSlot(this, "left")); }, enter: function() { - var r = { start_date: new Date(this.start_date), end_date: new Date(this.end_date) }, d = a.getState().mode; - a.matrix && a.matrix[d] ? r[a.matrix[a.getState().mode].y_property] = this.section : a._props && a._props[d] && (r[a._props[d].map_to] = this.section), a.addEventNow(r); - } } }), a.$keyboardNavigation.TimeSlot.prototype.bindAll(a.$keyboardNavigation.TimeSlot.prototype.keys); - }(e), function(a) { - a.$keyboardNavigation.MinicalButton = function(r, d) { + var r = { start_date: new Date(this.start_date), end_date: new Date(this.end_date) }, d = t.getState().mode; + t.matrix && t.matrix[d] ? r[t.matrix[t.getState().mode].y_property] = this.section : t._props && t._props[d] && (r[t._props[d].map_to] = this.section), t.addEventNow(r); + } } }), t.$keyboardNavigation.TimeSlot.prototype.bindAll(t.$keyboardNavigation.TimeSlot.prototype.keys); + }(e), function(t) { + t.$keyboardNavigation.MinicalButton = function(r, d) { this.container = r, this.index = d || 0; - }, a.$keyboardNavigation.MinicalButton.prototype = a._compose(a.$keyboardNavigation.KeyNavNode, { isValid: function() { + }, t.$keyboardNavigation.MinicalButton.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, { isValid: function() { return !!this.container.offsetWidth; }, fallback: function() { - var r = new a.$keyboardNavigation.TimeSlot(); - return r.isValid() ? r : new a.$keyboardNavigation.DataArea(); + var r = new t.$keyboardNavigation.TimeSlot(); + return r.isValid() ? r : new t.$keyboardNavigation.DataArea(); }, focus: function() { - a.$keyboardNavigation.dispatcher.globalNode.disable(), this.container.removeAttribute("tabindex"), a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + t.$keyboardNavigation.dispatcher.globalNode.disable(), this.container.removeAttribute("tabindex"), t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); }, blur: function() { - this.container.setAttribute("tabindex", "0"), a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + this.container.setAttribute("tabindex", "0"), t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); }, getNode: function() { return this.index ? this.container.querySelector(".dhx_cal_next_button") : this.container.querySelector(".dhx_cal_prev_button"); }, keys: { right: function(r) { - this.moveTo(new a.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); + this.moveTo(new t.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); }, left: function(r) { - this.moveTo(new a.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); + this.moveTo(new t.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); }, down: function() { - var r = new a.$keyboardNavigation.MinicalCell(this.container, 0, 0); + var r = new t.$keyboardNavigation.MinicalCell(this.container, 0, 0); r && !r.isValid() && (r = r.fallback()), this.moveTo(r); }, enter: function(r) { this.getNode().click(); - } } }), a.$keyboardNavigation.MinicalButton.prototype.bindAll(a.$keyboardNavigation.MinicalButton.prototype.keys); - }(e), function(a) { - a.$keyboardNavigation.MinicalCell = function(r, d, i) { - this.container = r, this.row = d || 0, this.col = i || 0; - }, a.$keyboardNavigation.MinicalCell.prototype = a._compose(a.$keyboardNavigation.KeyNavNode, { isValid: function() { + } } }), t.$keyboardNavigation.MinicalButton.prototype.bindAll(t.$keyboardNavigation.MinicalButton.prototype.keys); + }(e), function(t) { + t.$keyboardNavigation.MinicalCell = function(r, d, n) { + this.container = r, this.row = d || 0, this.col = n || 0; + }, t.$keyboardNavigation.MinicalCell.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, { isValid: function() { var r = this._getGrid(); return !(!r[this.row] || !r[this.row][this.col]); }, fallback: function() { - var r = this.row, d = this.col, i = this._getGrid(); - i[r] || (r = 0); - var _ = !0; - if (r > i.length / 2 && (_ = !1), !i[r]) { - var o = new a.$keyboardNavigation.TimeSlot(); - return o.isValid() ? o : new a.$keyboardNavigation.DataArea(); + var r = this.row, d = this.col, n = this._getGrid(); + n[r] || (r = 0); + var s = !0; + if (r > n.length / 2 && (s = !1), !n[r]) { + var _ = new t.$keyboardNavigation.TimeSlot(); + return _.isValid() ? _ : new t.$keyboardNavigation.DataArea(); } - if (_) { - for (var t = d; i[r] && t < i[r].length; t++) - if (i[r][t] || t != i[r].length - 1 || (r++, d = 0), i[r][t]) - return new a.$keyboardNavigation.MinicalCell(this.container, r, t); + if (s) { + for (var a = d; n[r] && a < n[r].length; a++) + if (n[r][a] || a != n[r].length - 1 || (r++, d = 0), n[r][a]) + return new t.$keyboardNavigation.MinicalCell(this.container, r, a); } else - for (t = d; i[r] && t < i[r].length; t--) - if (i[r][t] || t || (d = i[--r].length - 1), i[r][t]) - return new a.$keyboardNavigation.MinicalCell(this.container, r, t); - return new a.$keyboardNavigation.MinicalButton(this.container, 0); + for (a = d; n[r] && a < n[r].length; a--) + if (n[r][a] || a || (d = n[--r].length - 1), n[r][a]) + return new t.$keyboardNavigation.MinicalCell(this.container, r, a); + return new t.$keyboardNavigation.MinicalButton(this.container, 0); }, focus: function() { - a.$keyboardNavigation.dispatcher.globalNode.disable(), this.container.removeAttribute("tabindex"), a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + t.$keyboardNavigation.dispatcher.globalNode.disable(), this.container.removeAttribute("tabindex"), t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); }, blur: function() { - this.container.setAttribute("tabindex", "0"), a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + this.container.setAttribute("tabindex", "0"), t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); }, _getNode: function(r, d) { return this.container.querySelector(".dhx_year_body tr:nth-child(" + (r + 1) + ") td:nth-child(" + (d + 1) + ")"); }, getNode: function() { return this._getNode(this.row, this.col); }, _getGrid: function() { - for (var r = this.container.querySelectorAll(".dhx_year_body tr"), d = [], i = 0; i < r.length; i++) { - d[i] = []; - for (var _ = r[i].querySelectorAll("td"), o = 0; o < _.length; o++) { - var t = _[o], n = !0, s = a._getClassName(t); - (s.indexOf("dhx_after") > -1 || s.indexOf("dhx_before") > -1 || s.indexOf("dhx_scale_ignore") > -1) && (n = !1), d[i][o] = n; + for (var r = this.container.querySelectorAll(".dhx_year_body tr"), d = [], n = 0; n < r.length; n++) { + d[n] = []; + for (var s = r[n].querySelectorAll("td"), _ = 0; _ < s.length; _++) { + var a = s[_], o = !0, l = t._getClassName(a); + (l.indexOf("dhx_after") > -1 || l.indexOf("dhx_before") > -1 || l.indexOf("dhx_scale_ignore") > -1) && (o = !1), d[n][_] = o; } } return d; }, keys: { right: function(r) { - var d = this._getGrid(), i = this.row, _ = this.col + 1; - d[i] && d[i][_] || (d[i + 1] ? (i += 1, _ = 0) : _ = this.col); - var o = new a.$keyboardNavigation.MinicalCell(this.container, i, _); - o.isValid() || (o = o.fallback()), this.moveTo(o); + var d = this._getGrid(), n = this.row, s = this.col + 1; + d[n] && d[n][s] || (d[n + 1] ? (n += 1, s = 0) : s = this.col); + var _ = new t.$keyboardNavigation.MinicalCell(this.container, n, s); + _.isValid() || (_ = _.fallback()), this.moveTo(_); }, left: function(r) { - var d = this._getGrid(), i = this.row, _ = this.col - 1; - d[i] && d[i][_] || (_ = d[i - 1] ? d[i -= 1].length - 1 : this.col); - var o = new a.$keyboardNavigation.MinicalCell(this.container, i, _); - o.isValid() || (o = o.fallback()), this.moveTo(o); - }, down: function() { - var r = this._getGrid(), d = this.row + 1, i = this.col; - r[d] && r[d][i] || (d = this.row); - var _ = new a.$keyboardNavigation.MinicalCell(this.container, d, i); + var d = this._getGrid(), n = this.row, s = this.col - 1; + d[n] && d[n][s] || (s = d[n - 1] ? d[n -= 1].length - 1 : this.col); + var _ = new t.$keyboardNavigation.MinicalCell(this.container, n, s); _.isValid() || (_ = _.fallback()), this.moveTo(_); + }, down: function() { + var r = this._getGrid(), d = this.row + 1, n = this.col; + r[d] && r[d][n] || (d = this.row); + var s = new t.$keyboardNavigation.MinicalCell(this.container, d, n); + s.isValid() || (s = s.fallback()), this.moveTo(s); }, up: function() { - var r = this._getGrid(), d = this.row - 1, i = this.col; - if (r[d] && r[d][i]) { - var _ = new a.$keyboardNavigation.MinicalCell(this.container, d, i); - _.isValid() || (_ = _.fallback()), this.moveTo(_); + var r = this._getGrid(), d = this.row - 1, n = this.col; + if (r[d] && r[d][n]) { + var s = new t.$keyboardNavigation.MinicalCell(this.container, d, n); + s.isValid() || (s = s.fallback()), this.moveTo(s); } else { - var o = 0; - this.col > r[this.row].length / 2 && (o = 1), this.moveTo(new a.$keyboardNavigation.MinicalButton(this.container, o)); + var _ = 0; + this.col > r[this.row].length / 2 && (_ = 1), this.moveTo(new t.$keyboardNavigation.MinicalButton(this.container, _)); } }, enter: function(r) { this.getNode().querySelector(".dhx_month_head").click(); - } } }), a.$keyboardNavigation.MinicalCell.prototype.bindAll(a.$keyboardNavigation.MinicalCell.prototype.keys); - }(e), function(a) { - a.$keyboardNavigation.DataArea = function(r) { + } } }), t.$keyboardNavigation.MinicalCell.prototype.bindAll(t.$keyboardNavigation.MinicalCell.prototype.keys); + }(e), function(t) { + t.$keyboardNavigation.DataArea = function(r) { this.index = r || 0; - }, a.$keyboardNavigation.DataArea.prototype = a._compose(a.$keyboardNavigation.KeyNavNode, { getNode: function(r) { - return a.$container.querySelector(".dhx_cal_data"); + }, t.$keyboardNavigation.DataArea.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, { getNode: function(r) { + return t.$container.querySelector(".dhx_cal_data"); }, _handlers: null, isValid: function() { return !0; }, fallback: function() { return this; }, keys: { "up,down,right,left": function() { - this.moveTo(new a.$keyboardNavigation.TimeSlot()); - } } }), a.$keyboardNavigation.DataArea.prototype.bindAll(a.$keyboardNavigation.DataArea.prototype.keys); - }(e), rt(e), function(a) { - a.$keyboardNavigation.dispatcher = { isActive: !1, activeNode: null, globalNode: new a.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(r) { - var d, i, _ = a.$container.querySelector(".dhx_timeline_scrollable_data"); - _ || (_ = a.$container.querySelector(".dhx_cal_data")), _ && (d = _.scrollTop, i = _.scrollLeft), r(), _ && (_.scrollTop = d, _.scrollLeft = i); + this.moveTo(new t.$keyboardNavigation.TimeSlot()); + } } }), t.$keyboardNavigation.DataArea.prototype.bindAll(t.$keyboardNavigation.DataArea.prototype.keys); + }(e), Ma(e), function(t) { + t.$keyboardNavigation.dispatcher = { isActive: !1, activeNode: null, globalNode: new t.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(r) { + var d, n, s = t.$container.querySelector(".dhx_timeline_scrollable_data"); + s || (s = t.$container.querySelector(".dhx_cal_data")), s && (d = s.scrollTop, n = s.scrollLeft), r(), s && (s.scrollTop = d, s.scrollLeft = n); }, enable: function() { - if (a.$container) { + if (t.$container) { this.isActive = !0; var r = this; this.keepScrollPosition(function() { @@ -5712,98 +7891,98 @@ const lt = { active_links: function(e) { }, setActiveNode: function(r) { r && r.isValid() && (this.activeNode && this.activeNode.compareTo(r) || this.isEnabled() && (this.blurNode(this.activeNode), this.activeNode = r, this.focusNode(this.activeNode))); }, focusNode: function(r) { - r && r.focus && (r.focus(), r.getNode && document.activeElement != r.getNode() && this.setActiveNode(new a.$keyboardNavigation.DataArea())); + r && r.focus && (r.focus(), r.getNode && document.activeElement != r.getNode() && this.setActiveNode(new t.$keyboardNavigation.DataArea())); }, blurNode: function(r) { r && r.blur && r.blur(); }, getInlineEditor: function(r) { - var d = a.$container.querySelector(".dhx_cal_editor[" + a.config.event_attribute + "='" + r + "'] textarea"); + var d = t.$container.querySelector(".dhx_cal_editor[" + t.config.event_attribute + "='" + r + "'] textarea"); return d && d.offsetWidth ? d : null; }, keyDownHandler: function(r) { if (!r.defaultPrevented) { var d = this.getActiveNode(); - if ((!a.$keyboardNavigation.isModal() || d && d.container && a.utils.dom.locateCss({ target: d.container }, "dhx_minical_popup", !1)) && (!a.getState().editor_id || !this.getInlineEditor(a.getState().editor_id)) && this.isEnabled()) { + if ((!t.$keyboardNavigation.isModal() || d && d.container && t.utils.dom.locateCss({ target: d.container }, "dhx_minical_popup", !1)) && (!t.getState().editor_id || !this.getInlineEditor(t.getState().editor_id)) && this.isEnabled()) { r = r || window.event; - var i = this.globalNode, _ = a.$keyboardNavigation.shortcuts.getCommandFromEvent(r); - d ? d.findHandler(_) ? d.doAction(_, r) : i.findHandler(_) && i.doAction(_, r) : this.setDefaultNode(); + var n = this.globalNode, s = t.$keyboardNavigation.shortcuts.getCommandFromEvent(r); + d ? d.findHandler(s) ? d.doAction(s, r) : n.findHandler(s) && n.doAction(s, r) : this.setDefaultNode(); } } }, _timeout: null, delay: function(r, d) { clearTimeout(this._timeout), this._timeout = setTimeout(r, d || 1); } }; - }(e), ot(e), function() { - st(e), function(o) { - o.$keyboardNavigation._minicalendars = [], o.$keyboardNavigation.isMinical = function(t) { - for (var n = o.$keyboardNavigation._minicalendars, s = 0; s < n.length; s++) - if (this.isChildOf(t, n[s])) + }(e), Ta(e), function() { + Aa(e), function(_) { + _.$keyboardNavigation._minicalendars = [], _.$keyboardNavigation.isMinical = function(a) { + for (var o = _.$keyboardNavigation._minicalendars, l = 0; l < o.length; l++) + if (this.isChildOf(a, o[l])) return !0; return !1; - }, o.$keyboardNavigation.isChildOf = function(t, n) { - for (; t && t !== n; ) - t = t.parentNode; - return t === n; - }, o.$keyboardNavigation.patchMinicalendar = function() { - var t = o.$keyboardNavigation.dispatcher; - function n(v) { - var m = v.target; - t.enable(), t.setActiveNode(new o.$keyboardNavigation.MinicalButton(m, 0)); + }, _.$keyboardNavigation.isChildOf = function(a, o) { + for (; a && a !== o; ) + a = a.parentNode; + return a === o; + }, _.$keyboardNavigation.patchMinicalendar = function() { + var a = _.$keyboardNavigation.dispatcher; + function o(u) { + var f = u.target; + a.enable(), a.setActiveNode(new _.$keyboardNavigation.MinicalButton(f, 0)); } - function s(v) { - var m = v.target || v.srcElement, l = o.utils.dom.locateCss(v, "dhx_cal_prev_button", !1), f = o.utils.dom.locateCss(v, "dhx_cal_next_button", !1), g = o.utils.dom.locateCss(v, "dhx_year_body", !1), p = 0, y = 0; - if (g) { - for (var w, b, k = m; k && k.tagName.toLowerCase() != "td"; ) + function l(u) { + var f = u.target || u.srcElement, c = _.utils.dom.locateCss(u, "dhx_cal_prev_button", !1), p = _.utils.dom.locateCss(u, "dhx_cal_next_button", !1), m = _.utils.dom.locateCss(u, "dhx_year_body", !1), g = 0, y = 0; + if (m) { + for (var x, b, k = f; k && k.tagName.toLowerCase() != "td"; ) k = k.parentNode; - if (k && (w = (b = k).parentNode), w && b) { - for (var E = w.parentNode.querySelectorAll("tr"), D = 0; D < E.length; D++) - if (E[D] == w) { - p = D; + if (k && (x = (b = k).parentNode), x && b) { + for (var E = x.parentNode.querySelectorAll("tr"), D = 0; D < E.length; D++) + if (E[D] == x) { + g = D; break; } - var x = w.querySelectorAll("td"); - for (D = 0; D < x.length; D++) - if (x[D] == b) { + var w = x.querySelectorAll("td"); + for (D = 0; D < w.length; D++) + if (w[D] == b) { y = D; break; } } } - var S = v.currentTarget; - t.delay(function() { + var S = u.currentTarget; + a.delay(function() { var N; - (l || f || g) && (l ? (N = new o.$keyboardNavigation.MinicalButton(S, 0), t.setActiveNode(new o.$keyboardNavigation.MinicalButton(S, 0))) : f ? N = new o.$keyboardNavigation.MinicalButton(S, 1) : g && (N = new o.$keyboardNavigation.MinicalCell(S, p, y)), N && (t.enable(), N.isValid() && (t.activeNode = null, t.setActiveNode(N)))); + (c || p || m) && (c ? (N = new _.$keyboardNavigation.MinicalButton(S, 0), a.setActiveNode(new _.$keyboardNavigation.MinicalButton(S, 0))) : p ? N = new _.$keyboardNavigation.MinicalButton(S, 1) : m && (N = new _.$keyboardNavigation.MinicalCell(S, g, y)), N && (a.enable(), N.isValid() && (a.activeNode = null, a.setActiveNode(N)))); }); } - if (o.renderCalendar) { - var c = o.renderCalendar; - o.renderCalendar = function() { - var v = c.apply(this, arguments), m = o.$keyboardNavigation._minicalendars; - o.eventRemove(v, "click", s), o.event(v, "click", s), o.eventRemove(v, "focus", n), o.event(v, "focus", n); - for (var l = !1, f = 0; f < m.length; f++) - if (m[f] == v) { - l = !0; + if (_.renderCalendar) { + var h = _.renderCalendar; + _.renderCalendar = function() { + var u = h.apply(this, arguments), f = _.$keyboardNavigation._minicalendars; + _.eventRemove(u, "click", l), _.event(u, "click", l), _.eventRemove(u, "focus", o), _.event(u, "focus", o); + for (var c = !1, p = 0; p < f.length; p++) + if (f[p] == u) { + c = !0; break; } - if (l || m.push(v), t.isEnabled()) { - var g = t.getActiveNode(); - g && g.container == v ? t.focusNode(g) : v.setAttribute("tabindex", "0"); + if (c || f.push(u), a.isEnabled()) { + var m = a.getActiveNode(); + m && m.container == u ? a.focusNode(m) : u.setAttribute("tabindex", "0"); } else - v.setAttribute("tabindex", "0"); - return v; + u.setAttribute("tabindex", "0"); + return u; }; } - if (o.destroyCalendar) { - var u = o.destroyCalendar; - o.destroyCalendar = function(v, m) { - v = v || (o._def_count ? o._def_count.firstChild : null); - var l = u.apply(this, arguments); - if (!v || !v.parentNode) - for (var f = o.$keyboardNavigation._minicalendars, g = 0; g < f.length; g++) - f[g] == v && (o.eventRemove(f[g], "focus", n), f.splice(g, 1), g--); - return l; + if (_.destroyCalendar) { + var v = _.destroyCalendar; + _.destroyCalendar = function(u, f) { + u = u || (_._def_count ? _._def_count.firstChild : null); + var c = v.apply(this, arguments); + if (!u || !u.parentNode) + for (var p = _.$keyboardNavigation._minicalendars, m = 0; m < p.length; m++) + p[m] == u && (_.eventRemove(p[m], "focus", o), p.splice(m, 1), m--); + return c; }; } }; }(e); - var a = e.$keyboardNavigation.dispatcher; + var t = e.$keyboardNavigation.dispatcher; if (e.$keyboardNavigation.attachSchedulerHandlers(), e.renderCalendar) e.$keyboardNavigation.patchMinicalendar(); else @@ -5812,973 +7991,556 @@ const lt = { active_links: function(e) { }); function d() { if (e.config.key_nav) { - var o = document.activeElement; - return !(!o || e.utils.dom.locateCss(o, "dhx_cal_quick_info", !1)) && (e.$keyboardNavigation.isChildOf(o, e.$container) || e.$keyboardNavigation.isMinical(o)); + var _ = document.activeElement; + return !(!_ || e.utils.dom.locateCss(_, "dhx_cal_quick_info", !1)) && (e.$keyboardNavigation.isChildOf(_, e.$container) || e.$keyboardNavigation.isMinical(_)); } } - function i(o) { - o && !a.isEnabled() ? a.enable() : !o && a.isEnabled() && a.disable(); + function n(_) { + _ && !t.isEnabled() ? t.enable() : !_ && t.isEnabled() && t.disable(); } - const _ = setInterval(function() { + const s = setInterval(function() { if (e.$container && e.$keyboardNavigation.isChildOf(e.$container, document.body)) { - var o = d(); - o ? i(o) : !o && a.isEnabled() && setTimeout(function() { - e.$destroyed || (e.config.key_nav ? i(d()) : e.$container.removeAttribute("tabindex")); + var _ = d(); + _ ? n(_) : !_ && t.isEnabled() && setTimeout(function() { + e.$destroyed || (e.config.key_nav ? n(d()) : e.$container.removeAttribute("tabindex")); }, 100); } }, 500); e.attachEvent("onDestroy", function() { - clearInterval(_); + clearInterval(s); }); }(); }, layer: function(e) { e.attachEvent("onTemplatesReady", function() { - this.layers.sort(function(a, r) { - return a.zIndex - r.zIndex; - }), e._dp_init = function(a) { - a._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"], this.attachEvent("onEventAdded", function(r) { - !this._loading && this.validId(r) && this.getEvent(r) && this.getEvent(r).layer == a.layer && a.setUpdated(r, !0, "inserted"); + this.layers.sort(function(t, r) { + return t.zIndex - r.zIndex; + }), e._dp_init = function(t) { + t._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"], this.attachEvent("onEventAdded", function(r) { + !this._loading && this.validId(r) && this.getEvent(r) && this.getEvent(r).layer == t.layer && t.setUpdated(r, !0, "inserted"); }), this.attachEvent("onBeforeEventDelete", function(r) { - if (this.getEvent(r) && this.getEvent(r).layer == a.layer) { + if (this.getEvent(r) && this.getEvent(r).layer == t.layer) { if (!this.validId(r)) return; - var d = a.getState(r); - return d == "inserted" || this._new_event ? (a.setUpdated(r, !1), !0) : d != "deleted" && (d == "true_deleted" || (a.setUpdated(r, !0, "deleted"), !1)); + var d = t.getState(r); + return d == "inserted" || this._new_event ? (t.setUpdated(r, !1), !0) : d != "deleted" && (d == "true_deleted" || (t.setUpdated(r, !0, "deleted"), !1)); } return !0; }), this.attachEvent("onEventChanged", function(r) { - !this._loading && this.validId(r) && this.getEvent(r) && this.getEvent(r).layer == a.layer && a.setUpdated(r, !0, "updated"); - }), a._getRowData = function(r, d) { - var i = this.obj.getEvent(r), _ = {}; - for (var o in i) - o.indexOf("_") !== 0 && (i[o] && i[o].getUTCFullYear ? _[o] = this.obj._helpers.formatDate(i[o]) : _[o] = i[o]); - return _; - }, a._clearUpdateFlag = function() { - }, a.attachEvent("insertCallback", e._update_callback), a.attachEvent("updateCallback", e._update_callback), a.attachEvent("deleteCallback", function(r, d) { + !this._loading && this.validId(r) && this.getEvent(r) && this.getEvent(r).layer == t.layer && t.setUpdated(r, !0, "updated"); + }), t._getRowData = function(r, d) { + var n = this.obj.getEvent(r), s = {}; + for (var _ in n) + _.indexOf("_") !== 0 && (n[_] && n[_].getUTCFullYear ? s[_] = this.obj._helpers.formatDate(n[_]) : s[_] = n[_]); + return s; + }, t._clearUpdateFlag = function() { + }, t.attachEvent("insertCallback", e._update_callback), t.attachEvent("updateCallback", e._update_callback), t.attachEvent("deleteCallback", function(r, d) { this.obj.setUserData(d, this.action_param, "true_deleted"), this.obj.deleteEvent(d); }); }, function() { - var a = function(i) { - if (i === null || typeof i != "object") - return i; - var _ = new i.constructor(); - for (var o in i) - _[o] = a(i[o]); - return _; + var t = function(n) { + if (n === null || typeof n != "object") + return n; + var s = new n.constructor(); + for (var _ in n) + s[_] = t(n[_]); + return s; }; e._dataprocessors = [], e._layers_zindex = {}; for (var r = 0; r < e.layers.length; r++) { - if (e.config["lightbox_" + e.layers[r].name] = {}, e.config["lightbox_" + e.layers[r].name].sections = a(e.config.lightbox.sections), e._layers_zindex[e.layers[r].name] = e.config.initial_layer_zindex || 5 + 3 * r, e.layers[r].url) { + if (e.config["lightbox_" + e.layers[r].name] = {}, e.config["lightbox_" + e.layers[r].name].sections = t(e.config.lightbox.sections), e._layers_zindex[e.layers[r].name] = e.config.initial_layer_zindex || 5 + 3 * r, e.layers[r].url) { var d = e.createDataProcessor({ url: e.layers[r].url }); d.layer = e.layers[r].name, e._dataprocessors.push(d), e._dataprocessors[r].init(e); } - e.layers[r].isDefault && (e.defaultLayer = e.layers[r].name); - } - }(), e.showLayer = function(a) { - this.toggleLayer(a, !0); - }, e.hideLayer = function(a) { - this.toggleLayer(a, !1); - }, e.toggleLayer = function(a, r) { - var d = this.getLayer(a); - d.visible = r !== void 0 ? !!r : !d.visible, this.setCurrentView(this._date, this._mode); - }, e.getLayer = function(a) { - var r, d; - typeof a == "string" && (d = a), typeof a == "object" && (d = a.layer); - for (var i = 0; i < e.layers.length; i++) - e.layers[i].name == d && (r = e.layers[i]); - return r; - }, e.attachEvent("onBeforeLightbox", function(a) { - var r = this.getEvent(a); - return this.config.lightbox.sections = this.config["lightbox_" + r.layer].sections, e.resetLightbox(), !0; - }), e.attachEvent("onClick", function(a, r) { - var d = e.getEvent(a); - return !e.getLayer(d.layer).noMenu; - }), e.attachEvent("onEventCollision", function(a, r) { - var d = this.getLayer(a); - if (!d.checkCollision) - return !1; - for (var i = 0, _ = 0; _ < r.length; _++) - r[_].layer == d.name && r[_].id != a.id && i++; - return i >= e.config.collision_limit; - }), e.addEvent = function(a, r, d, i, _) { - var o = a; - arguments.length != 1 && ((o = _ || {}).start_date = a, o.end_date = r, o.text = d, o.id = i, o.layer = this.defaultLayer), o.id = o.id || e.uid(), o.text = o.text || "", typeof o.start_date == "string" && (o.start_date = this.templates.api_date(o.start_date)), typeof o.end_date == "string" && (o.end_date = this.templates.api_date(o.end_date)), o._timed = this.isOneDayEvent(o); - var t = !this._events[o.id]; - this._events[o.id] = o, this.event_updated(o), this._loading || this.callEvent(t ? "onEventAdded" : "onEventChanged", [o.id, o]); - }, this._evs_layer = {}; - for (var h = 0; h < this.layers.length; h++) - this._evs_layer[this.layers[h].name] = []; - e.addEventNow = function(a, r, d) { - var i = {}; - typeof a == "object" && (i = a, a = null); - var _ = 6e4 * (this.config.event_duration || this.config.time_step); - a || (a = Math.round(e._currentDate().valueOf() / _) * _); - var o = new Date(a); - if (!r) { - var t = this.config.first_hour; - t > o.getHours() && (o.setHours(t), a = o.valueOf()), r = a + _; - } - i.start_date = i.start_date || o, i.end_date = i.end_date || new Date(r), i.text = i.text || this.locale.labels.new_event, i.id = this._drag_id = this.uid(), i.layer = this.defaultLayer, this._drag_mode = "new-size", this._loading = !0, this.addEvent(i), this.callEvent("onEventCreated", [this._drag_id, d]), this._loading = !1, this._drag_event = {}, this._on_mouse_up(d); - }, e._t_render_view_data = function(a) { - if (this.config.multi_day && !this._table_view) { - for (var r = [], d = [], i = 0; i < a.length; i++) - a[i]._timed ? r.push(a[i]) : d.push(a[i]); - this._table_view = !0, this.render_data(d), this._table_view = !1, this.render_data(r); - } else - this.render_data(a); - }, e.render_view_data = function() { - if (this._not_render) - this._render_wait = !0; - else { - this._render_wait = !1, this.clear_view(), this._evs_layer = {}; - for (var a = 0; a < this.layers.length; a++) - this._evs_layer[this.layers[a].name] = []; - var r = this.get_visible_events(); - for (a = 0; a < r.length; a++) - this._evs_layer[r[a].layer] && this._evs_layer[r[a].layer].push(r[a]); - if (this._mode == "month") { - var d = []; - for (a = 0; a < this.layers.length; a++) - this.layers[a].visible && (d = d.concat(this._evs_layer[this.layers[a].name])); - this._t_render_view_data(d); - } else - for (a = 0; a < this.layers.length; a++) - if (this.layers[a].visible) { - var i = this._evs_layer[this.layers[a].name]; - this._t_render_view_data(i); - } - } - }, e._render_v_bar = function(a, r, d, i, _, o, t, n, s) { - var c = a.id; - t.indexOf("
'; - return k += '
 
', k += '
' + t + "
", k += '
' + n + "
", k += '
', u.innerHTML = k, u.style.zIndex = 100, u.firstChild; - }, e.render_event_bar = function(a) { - var r = this._els.dhx_cal_data[0], d = this._colsS[a._sday], i = this._colsS[a._eday]; - i == d && (i = this._colsS[a._eday + 1]); - var _ = this.xy.bar_height, o = this._colsS.heights[a._sweek] + (this._colsS.height ? this.xy.month_scale_height + 2 : 2) + a._sorder * _, t = document.createElement("div"), n = a._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line", s = e.templates["event_class_" + a.layer] ? e.templates["event_class_" + a.layer](a.start_date, a.end_date, a) : e.templates.event_class(a.start_date, a.end_date, a); - s && (n = n + " " + s); - var c = '
'; - a._timed && (c += e.templates["event_bar_date_" + a.layer] ? e.templates["event_bar_date_" + a.layer](a.start_date, a.end_date, a) : e.templates.event_bar_date(a.start_date, a.end_date, a)), c += e.templates["event_bar_text_" + a.layer] ? e.templates["event_bar_text_" + a.layer](a.start_date, a.end_date, a) : e.templates.event_bar_text(a.start_date, a.end_date, a) + "
)", c += "
", t.innerHTML = c, this._rendered.push(t.firstChild), r.appendChild(t.firstChild); - }, e.render_event = function(a) { - var r = e.xy.menu_width; - if (e.getLayer(a.layer).noMenu && (r = 0), !(a._sday < 0)) { - var d = e.locate_holder(a._sday); - if (d) { - var i = 60 * a.start_date.getHours() + a.start_date.getMinutes(), _ = 60 * a.end_date.getHours() + a.end_date.getMinutes() || 60 * e.config.last_hour, o = Math.round((60 * i * 1e3 - 60 * this.config.first_hour * 60 * 1e3) * this.config.hour_size_px / 36e5) % (24 * this.config.hour_size_px) + 1, t = Math.max(e.xy.min_event_height, (_ - i) * this.config.hour_size_px / 60) + 1, n = Math.floor((d.clientWidth - r) / a._count), s = a._sorder * n + 1; - a._inner || (n *= a._count - a._sorder); - var c = this._render_v_bar(a.id, r + s, o, n, t, a._text_style, e.templates.event_header(a.start_date, a.end_date, a), e.templates.event_text(a.start_date, a.end_date, a)); - if (this._rendered.push(c), d.appendChild(c), s = s + parseInt(d.style.left, 10) + r, o += this._dy_shift, c.style.zIndex = this._layers_zindex[a.layer], this._edit_id == a.id) { - c.style.zIndex = parseInt(c.style.zIndex) + 1; - var u = c.style.zIndex; - n = Math.max(n - 4, e.xy.editor_width), (c = document.createElement("div")).setAttribute("event_id", a.id), c.setAttribute(this.config.event_attribute, a.id), this.set_xy(c, n, t - 20, s, o + 14), c.className = "dhx_cal_editor", c.style.zIndex = u; - var v = document.createElement("div"); - this.set_xy(v, n - 6, t - 26), v.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;", v.style.zIndex = u, c.appendChild(v), this._els.dhx_cal_data[0].appendChild(c), this._rendered.push(c), v.innerHTML = "", this._editor = v.firstChild, this._editor.addEventListener("keypress", function(p) { - if (p.shiftKey) - return !0; - var y = p.keyCode; - y == e.keys.edit_save && e.editStop(!0), y == e.keys.edit_cancel && e.editStop(!1); - }), this._editor.addEventListener("selectstart", function(p) { - return p.cancelBubble = !0, !0; - }), v.firstChild.focus(), this._els.dhx_cal_data[0].scrollLeft = 0, v.firstChild.select(); - } - if (this._select_id == a.id) { - c.style.zIndex = parseInt(c.style.zIndex) + 1; - for (var m = this.config["icons_" + (this._edit_id == a.id ? "edit" : "select")], l = "", f = 0; f < m.length; f++) - l += "
"; - var g = this._render_v_bar(a.id, s - r + 1, o, r, 20 * m.length + 26, "", "
", l, !0); - g.style.left = s - r + 1, g.style.zIndex = c.style.zIndex, this._els.dhx_cal_data[0].appendChild(g), this._rendered.push(g); - } - } - } - }, e.filter_agenda = function(a, r) { - var d = e.getLayer(r.layer); - return d && d.visible; - }; - }); -}, limit: function(e) { - e.config.limit_start = null, e.config.limit_end = null, e.config.limit_view = !1, e.config.check_limits = !0, e.config.mark_now = !0, e.config.display_marked_timespans = !0, e.config.overwrite_marked_timespans = !0, e._temp_limit_scope = function() { - var h = null, a = "dhx_time_block", r = "default", d = function(o, t, n) { - var s = typeof o == "object" ? o : { days: o }; - return s.type = a, s.css = "", t && (n && (s.sections = n), s = function(c, u, v) { - return u instanceof Date && v instanceof Date ? (c.start_date = u, c.end_date = v) : (c.days = u, c.zones = v), c; - }(s, o, t)), s; - }; - e.blockTime = function(o, t, n) { - var s = d(o, t, n); - return e.addMarkedTimespan(s); - }, e.unblockTime = function(o, t, n) { - var s = d(o, t = t || "fullday", n); - return e.deleteMarkedTimespan(s); - }, e.attachEvent("onBeforeViewChange", function(o, t, n, s) { - function c(u, v) { - var m = e.config.limit_start, l = e.config.limit_end, f = e.date.add(u, 1, v); - return u.valueOf() > l.valueOf() || f <= m.valueOf(); - } - return !e.config.limit_view || !c(s = s || t, n = n || o) || t.valueOf() == s.valueOf() || (setTimeout(function() { - if (e.$destroyed) - return !0; - var u = c(t, n) ? e.config.limit_start : t; - e.setCurrentView(c(u, n) ? null : u, n); - }, 1), !1); - }), e.checkInMarkedTimespan = function(o, t, n) { - t = t || r; - for (var s = !0, c = new Date(o.start_date.valueOf()), u = e.date.add(c, 1, "day"), v = e._marked_timespans; c < o.end_date; c = e.date.date_part(u), u = e.date.add(c, 1, "day")) { - var m = +e.date.date_part(new Date(c)), l = _(o, v, c.getDay(), m, t); - if (l) - for (var f = 0; f < l.length; f += 2) { - var g = e._get_zone_minutes(c), p = o.end_date > u || o.end_date.getDate() != c.getDate() ? 1440 : e._get_zone_minutes(o.end_date), y = l[f], w = l[f + 1]; - if (y < p && w > g && !(s = typeof n == "function" && n(o, g, p, y, w))) - break; - } - } - return !s; - }; - var i = e.checkLimitViolation = function(o) { - if (!o || !e.config.check_limits) - return !0; - var t = e, n = t.config, s = []; - if (o.rec_type) - for (var c = e.getRecDates(o), u = 0; u < c.length; u++) { - var v = e._copy_event(o); - e._lame_copy(v, c[u]), s.push(v); - } - else - s = [o]; - for (var m = !0, l = 0; l < s.length; l++) { - var f = !0; - (v = s[l])._timed = e.isOneDayEvent(v), (f = !n.limit_start || !n.limit_end || v.start_date.valueOf() >= n.limit_start.valueOf() && v.end_date.valueOf() <= n.limit_end.valueOf()) && (f = !e.checkInMarkedTimespan(v, a, function(g, p, y, w, b) { - var k = !0; - return p <= b && p >= w && ((b == 1440 || y <= b) && (k = !1), g._timed && t._drag_id && t._drag_mode == "new-size" ? (g.start_date.setHours(0), g.start_date.setMinutes(b)) : k = !1), (y >= w && y <= b || p < w && y > b) && (g._timed && t._drag_id && t._drag_mode == "new-size" ? (g.end_date.setHours(0), g.end_date.setMinutes(w)) : k = !1), k; - })), f || (f = t.checkEvent("onLimitViolation") ? t.callEvent("onLimitViolation", [v.id, v]) : f), m = m && f; - } - return m || (t._drag_id = null, t._drag_mode = null), m; - }; - function _(o, t, n, s, c) { - var u = e, v = [], m = { _props: "map_to", matrix: "y_property" }; - for (var l in m) { - var f = m[l]; - if (u[l]) - for (var g in u[l]) { - var p = u[l][g][f]; - o[p] && (v = u._add_timespan_zones(v, e._get_blocked_zones(t[g], o[p], n, s, c))); - } - } - return v = u._add_timespan_zones(v, e._get_blocked_zones(t, "global", n, s, c)); - } - e._get_blocked_zones = function(o, t, n, s, c) { - var u = []; - if (o && o[t]) - for (var v = o[t], m = this._get_relevant_blocked_zones(n, s, v, c), l = 0; l < m.length; l++) - u = this._add_timespan_zones(u, m[l].zones); - return u; - }, e._get_relevant_blocked_zones = function(o, t, n, s) { - var c; - return e.config.overwrite_marked_timespans ? c = n[t] && n[t][s] ? n[t][s] : n[o] && n[o][s] ? n[o][s] : [] : (c = [], n[t] && n[t][s] && (c = c.concat(n[t][s])), n[o] && n[o][s] && (c = c.concat(n[o][s]))), c; - }, e.attachEvent("onMouseDown", function(o) { - return o != a; - }), e.attachEvent("onBeforeDrag", function(o) { - return !o || i(e.getEvent(o)); - }), e.attachEvent("onClick", function(o, t) { - return i(e.getEvent(o)); - }), e.attachEvent("onBeforeLightbox", function(o) { - var t = e.getEvent(o); - return h = [t.start_date, t.end_date], i(t); - }), e.attachEvent("onEventSave", function(o, t, n) { - if (!t.start_date || !t.end_date) { - var s = e.getEvent(o); - t.start_date = new Date(s.start_date), t.end_date = new Date(s.end_date); - } - if (t.rec_type) { - var c = e._lame_clone(t); - return e._roll_back_dates(c), i(c); - } - return i(t); - }), e.attachEvent("onEventAdded", function(o) { - if (!o) - return !0; - var t = e.getEvent(o); - return !i(t) && e.config.limit_start && e.config.limit_end && (t.start_date < e.config.limit_start && (t.start_date = new Date(e.config.limit_start)), t.start_date.valueOf() >= e.config.limit_end.valueOf() && (t.start_date = this.date.add(e.config.limit_end, -1, "day")), t.end_date < e.config.limit_start && (t.end_date = new Date(e.config.limit_start)), t.end_date.valueOf() >= e.config.limit_end.valueOf() && (t.end_date = this.date.add(e.config.limit_end, -1, "day")), t.start_date.valueOf() >= t.end_date.valueOf() && (t.end_date = this.date.add(t.start_date, this.config.event_duration || this.config.time_step, "minute")), t._timed = this.isOneDayEvent(t)), !0; - }), e.attachEvent("onEventChanged", function(o) { - if (!o) - return !0; - var t = e.getEvent(o); - if (!i(t)) { - if (!h) - return !1; - t.start_date = h[0], t.end_date = h[1], t._timed = this.isOneDayEvent(t); - } - return !0; - }), e.attachEvent("onBeforeEventChanged", function(o, t, n) { - return i(o); - }), e.attachEvent("onBeforeEventCreated", function(o) { - var t = e.getActionData(o).date, n = { _timed: !0, start_date: t, end_date: e.date.add(t, e.config.time_step, "minute") }; - return i(n); - }), e.attachEvent("onViewChange", function() { - e._mark_now(); - }), e.attachEvent("onAfterSchedulerResize", function() { - return window.setTimeout(function() { - if (e.$destroyed) - return !0; - e._mark_now(); - }, 1), !0; - }), e.attachEvent("onTemplatesReady", function() { - e._mark_now_timer = window.setInterval(function() { - e._is_initialized() && e._mark_now(); - }, 6e4); - }), e.attachEvent("onDestroy", function() { - clearInterval(e._mark_now_timer); - }), e._mark_now = function(o) { - var t = "dhx_now_time"; - this._els[t] || (this._els[t] = []); - var n = e._currentDate(), s = this.config; - if (e._remove_mark_now(), !o && s.mark_now && n < this._max_date && n > this._min_date && n.getHours() >= s.first_hour && n.getHours() < s.last_hour) { - var c = this.locate_holder_day(n); - this._els[t] = e._append_mark_now(c, n); - } - }, e._append_mark_now = function(o, t) { - var n = "dhx_now_time", s = e._get_zone_minutes(t), c = { zones: [s, s + 1], css: n, type: n }; - if (!this._table_view) { - if (this._props && this._props[this._mode]) { - var u, v, m = this._props[this._mode], l = m.size || m.options.length; - m.days > 1 ? (m.size && m.options.length && (o = (m.position + o) / m.options.length * m.size), u = o, v = o + l) : v = (u = 0) + l; - for (var f = [], g = u; g < v; g++) { - var p = g; - c.days = p; - var y = e._render_marked_timespan(c, null, p)[0]; - f.push(y); - } - return f; - } - return c.days = o, e._render_marked_timespan(c, null, o); - } - if (this._mode == "month") - return c.days = +e.date.date_part(t), e._render_marked_timespan(c, null, null); - }, e._remove_mark_now = function() { - for (var o = "dhx_now_time", t = this._els[o], n = 0; n < t.length; n++) { - var s = t[n], c = s.parentNode; - c && c.removeChild(s); - } - this._els[o] = []; - }, e._marked_timespans = { global: {} }, e._get_zone_minutes = function(o) { - return 60 * o.getHours() + o.getMinutes(); - }, e._prepare_timespan_options = function(o) { - var t = [], n = []; - if (o.days == "fullweek" && (o.days = [0, 1, 2, 3, 4, 5, 6]), o.days instanceof Array) { - for (var s = o.days.slice(), c = 0; c < s.length; c++) { - var u = e._lame_clone(o); - u.days = s[c], t.push.apply(t, e._prepare_timespan_options(u)); - } - return t; - } - if (!o || !(o.start_date && o.end_date && o.end_date > o.start_date || o.days !== void 0 && o.zones) && !o.type) - return t; - o.zones == "fullday" && (o.zones = [0, 1440]), o.zones && o.invert_zones && (o.zones = e.invertZones(o.zones)), o.id = e.uid(), o.css = o.css || "", o.type = o.type || r; - var v = o.sections; - if (v) { - for (var m in v) - if (v.hasOwnProperty(m)) { - var l = v[m]; - for (l instanceof Array || (l = [l]), c = 0; c < l.length; c++) - (k = e._lame_copy({}, o)).sections = {}, k.sections[m] = l[c], n.push(k); - } - } else - n.push(o); - for (var f = 0; f < n.length; f++) { - var g = n[f], p = g.start_date, y = g.end_date; - if (p && y) - for (var w = e.date.date_part(new Date(p)), b = e.date.add(w, 1, "day"); w < y; ) { - var k; - delete (k = e._lame_copy({}, g)).start_date, delete k.end_date, k.days = w.valueOf(); - var E = p > w ? e._get_zone_minutes(p) : 0, D = y > b || y.getDate() != w.getDate() ? 1440 : e._get_zone_minutes(y); - k.zones = [E, D], t.push(k), w = b, b = e.date.add(b, 1, "day"); - } - else - g.days instanceof Date && (g.days = e.date.date_part(g.days).valueOf()), g.zones = o.zones.slice(), t.push(g); - } - return t; - }, e._get_dates_by_index = function(o, t, n) { - var s = []; - t = e.date.date_part(new Date(t || e._min_date)), n = new Date(n || e._max_date); - for (var c = t.getDay(), u = o - c >= 0 ? o - c : 7 - t.getDay() + o, v = e.date.add(t, u, "day"); v < n; v = e.date.add(v, 1, "week")) - s.push(v); - return s; - }, e._get_css_classes_by_config = function(o) { - var t = []; - return o.type == a && (t.push(a), o.css && t.push(a + "_reset")), t.push("dhx_marked_timespan", o.css), t.join(" "); - }, e._get_block_by_config = function(o) { - var t = document.createElement("div"); - return o.html && (typeof o.html == "string" ? t.innerHTML = o.html : t.appendChild(o.html)), t; - }, e._render_marked_timespan = function(o, t, n) { - var s = [], c = e.config, u = this._min_date, v = this._max_date, m = !1; - if (!c.display_marked_timespans) - return s; - if (!n && n !== 0) { - if (o.days < 7) - n = o.days; - else { - var l = new Date(o.days); - if (m = +l, !(+v > +l && +u <= +l)) - return s; - n = l.getDay(); - } - var f = u.getDay(); - f > n ? n = 7 - (f - n) : n -= f; - } - var g = o.zones, p = e._get_css_classes_by_config(o); - if (e._table_view && e._mode == "month") { - var y = [], w = []; - if (t) - y.push(t), w.push(n); - else { - w = m ? [m] : e._get_dates_by_index(n); - for (var b = 0; b < w.length; b++) - y.push(this._scales[w[b]]); - } - for (b = 0; b < y.length; b++) { - t = y[b], n = w[b]; - var k = this.locate_holder_day(n, !1) % this._cols.length; - if (!this._ignores[k]) { - var E = e._get_block_by_config(o); - E.className = p, E.style.top = "0px", E.style.height = "100%"; - for (var D = 0; D < g.length; D += 2) { - var x = g[b]; - if ((A = g[b + 1]) <= x) - return []; - (C = E.cloneNode(!0)).style.left = "0px", C.style.width = "100%", t.appendChild(C), s.push(C); - } - } - } - } else { - var S = n; - if (this._ignores[this.locate_holder_day(n, !1)]) - return s; - if (this._props && this._props[this._mode] && o.sections && o.sections[this._mode]) { - var N = this._props[this._mode]; - S = N.order[o.sections[this._mode]]; - var M = N.order[o.sections[this._mode]]; - N.days > 1 ? S = S * (N.size || N.options.length) + M : (S = M, N.size && S > N.position + N.size && (S = 0)); - } - for (t = t || e.locate_holder(S), b = 0; b < g.length; b += 2) { - var A, C; - if (x = Math.max(g[b], 60 * c.first_hour), (A = Math.min(g[b + 1], 60 * c.last_hour)) <= x) { - if (b + 2 < g.length) - continue; - return []; - } - (C = e._get_block_by_config(o)).className = p; - var T = 24 * this.config.hour_size_px + 1, O = 36e5; - C.style.top = Math.round((60 * x * 1e3 - this.config.first_hour * O) * this.config.hour_size_px / O) % T + "px", C.style.height = Math.max(Math.round(60 * (A - x) * 1e3 * this.config.hour_size_px / O) % T, 1) + "px", t.appendChild(C), s.push(C); - } - } - return s; - }, e._mark_timespans = function() { - var o = this._els.dhx_cal_data[0], t = []; - if (e._table_view && e._mode == "month") - for (var n in this._scales) { - var s = /* @__PURE__ */ new Date(+n); - t.push.apply(t, e._on_scale_add_marker(this._scales[n], s)); - } - else { - s = new Date(e._min_date); - for (var c = 0, u = o.childNodes.length; c < u; c++) { - var v = o.childNodes[c]; - v.firstChild && e._getClassName(v.firstChild).indexOf("dhx_scale_hour") > -1 || (t.push.apply(t, e._on_scale_add_marker(v, s)), s = e.date.add(s, 1, "day")); - } - } - return t; - }, e.markTimespan = function(o) { - if (!this._els) - throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`."); - var t = !1; - this._els.dhx_cal_data || (e.get_elements(), t = !0); - var n = e._marked_timespans_ids, s = e._marked_timespans_types, c = e._marked_timespans; - e.deleteMarkedTimespan(), e.addMarkedTimespan(o); - var u = e._mark_timespans(); - return t && (e._els = []), e._marked_timespans_ids = n, e._marked_timespans_types = s, e._marked_timespans = c, u; - }, e.unmarkTimespan = function(o) { - if (o) - for (var t = 0; t < o.length; t++) { - var n = o[t]; - n.parentNode && n.parentNode.removeChild(n); - } - }, e._addMarkerTimespanConfig = function(o) { - var t = "global", n = e._marked_timespans, s = o.id, c = e._marked_timespans_ids; - c[s] || (c[s] = []); - var u = o.days, v = o.sections, m = o.type; - if (o.id = s, v) { - for (var l in v) - if (v.hasOwnProperty(l)) { - n[l] || (n[l] = {}); - var f = v[l], g = n[l]; - g[f] || (g[f] = {}), g[f][u] || (g[f][u] = {}), g[f][u][m] || (g[f][u][m] = [], e._marked_timespans_types || (e._marked_timespans_types = {}), e._marked_timespans_types[m] || (e._marked_timespans_types[m] = !0)); - var p = g[f][u][m]; - o._array = p, p.push(o), c[s].push(o); - } - } else - n[t][u] || (n[t][u] = {}), n[t][u][m] || (n[t][u][m] = []), e._marked_timespans_types || (e._marked_timespans_types = {}), e._marked_timespans_types[m] || (e._marked_timespans_types[m] = !0), p = n[t][u][m], o._array = p, p.push(o), c[s].push(o); - }, e._marked_timespans_ids = {}, e.addMarkedTimespan = function(o) { - var t = e._prepare_timespan_options(o); - if (t.length) { - for (var n = t[0].id, s = 0; s < t.length; s++) - e._addMarkerTimespanConfig(t[s]); - return n; - } - }, e._add_timespan_zones = function(o, t) { - var n = o.slice(); - if (t = t.slice(), !n.length) - return t; - for (var s = 0; s < n.length; s += 2) - for (var c = n[s], u = n[s + 1], v = s + 2 == n.length, m = 0; m < t.length; m += 2) { - var l = t[m], f = t[m + 1]; - if (f > u && l <= u || l < c && f >= c) - n[s] = Math.min(c, l), n[s + 1] = Math.max(u, f), s -= 2; - else { - if (!v) - continue; - var g = c > l ? 0 : 2; - n.splice(s + g, 0, l, f); - } - t.splice(m--, 2); - break; - } - return n; - }, e._subtract_timespan_zones = function(o, t) { - for (var n = o.slice(), s = 0; s < n.length; s += 2) - for (var c = n[s], u = n[s + 1], v = 0; v < t.length; v += 2) { - var m = t[v], l = t[v + 1]; - if (l > c && m < u) { - var f = !1; - c >= m && u <= l && n.splice(s, 2), c < m && (n.splice(s, 2, c, m), f = !0), u > l && n.splice(f ? s + 2 : s, f ? 0 : 2, l, u), s -= 2; - break; - } - } - return n; - }, e.invertZones = function(o) { - return e._subtract_timespan_zones([0, 1440], o.slice()); - }, e._delete_marked_timespan_by_id = function(o) { - var t = e._marked_timespans_ids[o]; - if (t) { - for (var n = 0; n < t.length; n++) - for (var s = t[n], c = s._array, u = 0; u < c.length; u++) - if (c[u] == s) { - c.splice(u, 1); - break; - } + e.layers[r].isDefault && (e.defaultLayer = e.layers[r].name); } - }, e._delete_marked_timespan_by_config = function(o) { - var t, n = e._marked_timespans, s = o.sections, c = o.days, u = o.type || r; - if (s) { - for (var v in s) - if (s.hasOwnProperty(v) && n[v]) { - var m = s[v]; - n[v][m] && (t = n[v][m]); - } - } else - t = n.global; - if (t) { - if (c !== void 0) - t[c] && t[c][u] && (e._addMarkerTimespanConfig(o), e._delete_marked_timespans_list(t[c][u], o)); - else - for (var l in t) - if (t[l][u]) { - var f = e._lame_clone(o); - o.days = l, e._addMarkerTimespanConfig(f), e._delete_marked_timespans_list(t[l][u], o); - } + }(), e.showLayer = function(t) { + this.toggleLayer(t, !0); + }, e.hideLayer = function(t) { + this.toggleLayer(t, !1); + }, e.toggleLayer = function(t, r) { + var d = this.getLayer(t); + d.visible = r !== void 0 ? !!r : !d.visible, this.setCurrentView(this._date, this._mode); + }, e.getLayer = function(t) { + var r, d; + typeof t == "string" && (d = t), typeof t == "object" && (d = t.layer); + for (var n = 0; n < e.layers.length; n++) + e.layers[n].name == d && (r = e.layers[n]); + return r; + }, e.attachEvent("onBeforeLightbox", function(t) { + var r = this.getEvent(t); + return this.config.lightbox.sections = this.config["lightbox_" + r.layer].sections, e.resetLightbox(), !0; + }), e.attachEvent("onClick", function(t, r) { + var d = e.getEvent(t); + return !e.getLayer(d.layer).noMenu; + }), e.attachEvent("onEventCollision", function(t, r) { + var d = this.getLayer(t); + if (!d.checkCollision) + return !1; + for (var n = 0, s = 0; s < r.length; s++) + r[s].layer == d.name && r[s].id != t.id && n++; + return n >= e.config.collision_limit; + }), e.addEvent = function(t, r, d, n, s) { + var _ = t; + arguments.length != 1 && ((_ = s || {}).start_date = t, _.end_date = r, _.text = d, _.id = n, _.layer = this.defaultLayer), _.id = _.id || e.uid(), _.text = _.text || "", typeof _.start_date == "string" && (_.start_date = this.templates.api_date(_.start_date)), typeof _.end_date == "string" && (_.end_date = this.templates.api_date(_.end_date)), _._timed = this.isOneDayEvent(_); + var a = !this._events[_.id]; + this._events[_.id] = _, this.event_updated(_), this._loading || this.callEvent(a ? "onEventAdded" : "onEventChanged", [_.id, _]); + }, this._evs_layer = {}; + for (var i = 0; i < this.layers.length; i++) + this._evs_layer[this.layers[i].name] = []; + e.addEventNow = function(t, r, d) { + var n = {}; + typeof t == "object" && (n = t, t = null); + var s = 6e4 * (this.config.event_duration || this.config.time_step); + t || (t = Math.round(e._currentDate().valueOf() / s) * s); + var _ = new Date(t); + if (!r) { + var a = this.config.first_hour; + a > _.getHours() && (_.setHours(a), t = _.valueOf()), r = t + s; } - }, e._delete_marked_timespans_list = function(o, t) { - for (var n = 0; n < o.length; n++) { - var s = o[n], c = e._subtract_timespan_zones(s.zones, t.zones); - if (c.length) - s.zones = c; - else { - o.splice(n, 1), n--; - for (var u = e._marked_timespans_ids[s.id], v = 0; v < u.length; v++) - if (u[v] == s) { - u.splice(v, 1); - break; + n.start_date = n.start_date || _, n.end_date = n.end_date || new Date(r), n.text = n.text || this.locale.labels.new_event, n.id = this._drag_id = this.uid(), n.layer = this.defaultLayer, this._drag_mode = "new-size", this._loading = !0, this.addEvent(n), this.callEvent("onEventCreated", [this._drag_id, d]), this._loading = !1, this._drag_event = {}, this._on_mouse_up(d); + }, e._t_render_view_data = function(t) { + if (this.config.multi_day && !this._table_view) { + for (var r = [], d = [], n = 0; n < t.length; n++) + t[n]._timed ? r.push(t[n]) : d.push(t[n]); + this._table_view = !0, this.render_data(d), this._table_view = !1, this.render_data(r); + } else + this.render_data(t); + }, e.render_view_data = function() { + if (this._not_render) + this._render_wait = !0; + else { + this._render_wait = !1, this.clear_view(), this._evs_layer = {}; + for (var t = 0; t < this.layers.length; t++) + this._evs_layer[this.layers[t].name] = []; + var r = this.get_visible_events(); + for (t = 0; t < r.length; t++) + this._evs_layer[r[t].layer] && this._evs_layer[r[t].layer].push(r[t]); + if (this._mode == "month") { + var d = []; + for (t = 0; t < this.layers.length; t++) + this.layers[t].visible && (d = d.concat(this._evs_layer[this.layers[t].name])); + this._t_render_view_data(d); + } else + for (t = 0; t < this.layers.length; t++) + if (this.layers[t].visible) { + var n = this._evs_layer[this.layers[t].name]; + this._t_render_view_data(n); } - } } - }, e.deleteMarkedTimespan = function(o) { - if (arguments.length || (e._marked_timespans = { global: {} }, e._marked_timespans_ids = {}, e._marked_timespans_types = {}), typeof o != "object") - e._delete_marked_timespan_by_id(o); - else { - o.start_date && o.end_date || (o.days !== void 0 || o.type || (o.days = "fullweek"), o.zones || (o.zones = "fullday")); - var t = []; - if (o.type) - t.push(o.type); - else - for (var n in e._marked_timespans_types) - t.push(n); - for (var s = e._prepare_timespan_options(o), c = 0; c < s.length; c++) - for (var u = s[c], v = 0; v < t.length; v++) { - var m = e._lame_clone(u); - m.type = t[v], e._delete_marked_timespan_by_config(m); + }, e._render_v_bar = function(t, r, d, n, s, _, a, o, l) { + var h = t.id; + a.indexOf("
'; + return k += '
 
', k += '
' + a + "
", k += '
' + o + "
", k += '
', v.innerHTML = k, v.style.zIndex = 100, v.firstChild; + }, e.render_event_bar = function(t) { + var r = this._els.dhx_cal_data[0], d = this._colsS[t._sday], n = this._colsS[t._eday]; + n == d && (n = this._colsS[t._eday + 1]); + var s = this.xy.bar_height, _ = this._colsS.heights[t._sweek] + (this._colsS.height ? this.xy.month_scale_height + 2 : 2) + t._sorder * s, a = document.createElement("div"), o = t._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line", l = e.templates["event_class_" + t.layer] ? e.templates["event_class_" + t.layer](t.start_date, t.end_date, t) : e.templates.event_class(t.start_date, t.end_date, t); + l && (o = o + " " + l); + var h = '
'; + t._timed && (h += e.templates["event_bar_date_" + t.layer] ? e.templates["event_bar_date_" + t.layer](t.start_date, t.end_date, t) : e.templates.event_bar_date(t.start_date, t.end_date, t)), h += e.templates["event_bar_text_" + t.layer] ? e.templates["event_bar_text_" + t.layer](t.start_date, t.end_date, t) : e.templates.event_bar_text(t.start_date, t.end_date, t) + "
)", h += "
", a.innerHTML = h, this._rendered.push(a.firstChild), r.appendChild(a.firstChild); + }, e.render_event = function(t) { + var r = e.xy.menu_width; + if (e.getLayer(t.layer).noMenu && (r = 0), !(t._sday < 0)) { + var d = e.locate_holder(t._sday); + if (d) { + var n = 60 * t.start_date.getHours() + t.start_date.getMinutes(), s = 60 * t.end_date.getHours() + t.end_date.getMinutes() || 60 * e.config.last_hour, _ = Math.round((60 * n * 1e3 - 60 * this.config.first_hour * 60 * 1e3) * this.config.hour_size_px / 36e5) % (24 * this.config.hour_size_px) + 1, a = Math.max(e.xy.min_event_height, (s - n) * this.config.hour_size_px / 60) + 1, o = Math.floor((d.clientWidth - r) / t._count), l = t._sorder * o + 1; + t._inner || (o *= t._count - t._sorder); + var h = this._render_v_bar(t.id, r + l, _, o, a, t._text_style, e.templates.event_header(t.start_date, t.end_date, t), e.templates.event_text(t.start_date, t.end_date, t)); + if (this._rendered.push(h), d.appendChild(h), l = l + parseInt(d.style.left, 10) + r, _ += this._dy_shift, h.style.zIndex = this._layers_zindex[t.layer], this._edit_id == t.id) { + h.style.zIndex = parseInt(h.style.zIndex) + 1; + var v = h.style.zIndex; + o = Math.max(o - 4, e.xy.editor_width), (h = document.createElement("div")).setAttribute("event_id", t.id), h.setAttribute(this.config.event_attribute, t.id), this.set_xy(h, o, a - 20, l, _ + 14), h.className = "dhx_cal_editor", h.style.zIndex = v; + var u = document.createElement("div"); + this.set_xy(u, o - 6, a - 26), u.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;", u.style.zIndex = v, h.appendChild(u), this._els.dhx_cal_data[0].appendChild(h), this._rendered.push(h), u.innerHTML = "", this._editor = u.firstChild, this._editor.addEventListener("keypress", function(g) { + if (g.shiftKey) + return !0; + var y = g.keyCode; + y == e.keys.edit_save && e.editStop(!0), y == e.keys.edit_cancel && e.editStop(!1); + }), this._editor.addEventListener("selectstart", function(g) { + return g.cancelBubble = !0, !0; + }), u.firstChild.focus(), this._els.dhx_cal_data[0].scrollLeft = 0, u.firstChild.select(); } - } - }, e._get_types_to_render = function(o, t) { - var n = o ? e._lame_copy({}, o) : {}; - for (var s in t || {}) - t.hasOwnProperty(s) && (n[s] = t[s]); - return n; - }, e._get_configs_to_render = function(o) { - var t = []; - for (var n in o) - o.hasOwnProperty(n) && t.push.apply(t, o[n]); - return t; - }, e._on_scale_add_marker = function(o, t) { - if (!e._table_view || e._mode == "month") { - var n = t.getDay(), s = t.valueOf(), c = this._mode, u = e._marked_timespans, v = [], m = []; - if (this._props && this._props[c]) { - var l = this._props[c], f = l.options, g = f[e._get_unit_index(l, t)]; - if (l.days > 1) { - var p = Math.round((t - e._min_date) / 864e5), y = l.size || f.length; - t = e.date.add(e._min_date, Math.floor(p / y), "day"), t = e.date.date_part(t); - } else - t = e.date.date_part(new Date(this._date)); - if (n = t.getDay(), s = t.valueOf(), u[c] && u[c][g.key]) { - var w = u[c][g.key], b = e._get_types_to_render(w[n], w[s]); - v.push.apply(v, e._get_configs_to_render(b)); + if (this._select_id == t.id) { + h.style.zIndex = parseInt(h.style.zIndex) + 1; + for (var f = this.config["icons_" + (this._edit_id == t.id ? "edit" : "select")], c = "", p = 0; p < f.length; p++) + c += "
"; + var m = this._render_v_bar(t.id, l - r + 1, _, r, 20 * f.length + 26, "", "
", c, !0); + m.style.left = l - r + 1, m.style.zIndex = h.style.zIndex, this._els.dhx_cal_data[0].appendChild(m), this._rendered.push(m); } } - var k = u.global; - if (e.config.overwrite_marked_timespans) { - var E = k[s] || k[n]; - v.push.apply(v, e._get_configs_to_render(E)); - } else - k[s] && v.push.apply(v, e._get_configs_to_render(k[s])), k[n] && v.push.apply(v, e._get_configs_to_render(k[n])); - for (var D = 0; D < v.length; D++) - m.push.apply(m, e._render_marked_timespan(v[D], o, t)); - return m; - } - }, e.attachEvent("onScaleAdd", function() { - e._on_scale_add_marker.apply(e, arguments); - }), e.dblclick_dhx_marked_timespan = function(o, t) { - e.callEvent("onScaleDblClick", [e.getActionData(o).date, t, o]), e.config.dblclick_create && e.addEventNow(e.getActionData(o).date, null, o); + } + }, e.filter_agenda = function(t, r) { + var d = e.getLayer(r.layer); + return d && d.visible; }; + }); +}, limit: function(e) { + e.config.limit_start = null, e.config.limit_end = null, e.config.limit_view = !1, e.config.check_limits = !0, e._temp_limit_scope = function() { + var i = null; + e.attachEvent("onBeforeViewChange", function(t, r, d, n) { + function s(_, a) { + var o = e.config.limit_start, l = e.config.limit_end, h = e.date.add(_, 1, a); + return _.valueOf() > l.valueOf() || h <= o.valueOf(); + } + return !e.config.limit_view || !s(n = n || r, d = d || t) || r.valueOf() == n.valueOf() || (setTimeout(function() { + if (e.$destroyed) + return !0; + var _ = s(r, d) ? e.config.limit_start : r; + e.setCurrentView(s(_, d) ? null : _, d); + }, 1), !1); + }), e.attachEvent("onMouseDown", function(t) { + return t != "dhx_time_block"; + }), e.attachEvent("onBeforeDrag", function(t) { + return !t || e.checkLimitViolation(e.getEvent(t)); + }), e.attachEvent("onClick", function(t, r) { + return e.checkLimitViolation(e.getEvent(t)); + }), e.attachEvent("onBeforeLightbox", function(t) { + var r = e.getEvent(t); + return i = [r.start_date, r.end_date], e.checkLimitViolation(r); + }), e.attachEvent("onEventSave", function(t, r, d) { + if (!r.start_date || !r.end_date) { + var n = e.getEvent(t); + r.start_date = new Date(n.start_date), r.end_date = new Date(n.end_date); + } + if (r.rec_type) { + var s = e._lame_clone(r); + return e._roll_back_dates(s), e.checkLimitViolation(s); + } + return e.checkLimitViolation(r); + }), e.attachEvent("onEventAdded", function(t) { + if (!t) + return !0; + var r = e.getEvent(t); + return !e.checkLimitViolation(r) && e.config.limit_start && e.config.limit_end && (r.start_date < e.config.limit_start && (r.start_date = new Date(e.config.limit_start)), r.start_date.valueOf() >= e.config.limit_end.valueOf() && (r.start_date = this.date.add(e.config.limit_end, -1, "day")), r.end_date < e.config.limit_start && (r.end_date = new Date(e.config.limit_start)), r.end_date.valueOf() >= e.config.limit_end.valueOf() && (r.end_date = this.date.add(e.config.limit_end, -1, "day")), r.start_date.valueOf() >= r.end_date.valueOf() && (r.end_date = this.date.add(r.start_date, this.config.event_duration || this.config.time_step, "minute")), r._timed = this.isOneDayEvent(r)), !0; + }), e.attachEvent("onEventChanged", function(t) { + if (!t) + return !0; + var r = e.getEvent(t); + if (!e.checkLimitViolation(r)) { + if (!i) + return !1; + r.start_date = i[0], r.end_date = i[1], r._timed = this.isOneDayEvent(r); + } + return !0; + }), e.attachEvent("onBeforeEventChanged", function(t, r, d) { + return e.checkLimitViolation(t); + }), e.attachEvent("onBeforeEventCreated", function(t) { + var r = e.getActionData(t).date, d = { _timed: !0, start_date: r, end_date: e.date.add(r, e.config.time_step, "minute") }; + return e.checkLimitViolation(d); + }), e.attachEvent("onViewChange", function() { + e._mark_now(); + }), e.attachEvent("onAfterSchedulerResize", function() { + return window.setTimeout(function() { + if (e.$destroyed) + return !0; + e._mark_now(); + }, 1), !0; + }), e.attachEvent("onTemplatesReady", function() { + e._mark_now_timer = window.setInterval(function() { + e._is_initialized() && e._mark_now(); + }, 6e4); + }), e.attachEvent("onDestroy", function() { + clearInterval(e._mark_now_timer); + }); }, e._temp_limit_scope(); }, map_view: function(e) { - e.ext || (e.ext = {}), e.ext.mapView = { geocoder: null, map: null, points: null, markers: null, infoWindow: null, createMarker: function(h) { - return new google.maps.Marker(h); - } }, e.xy.map_date_width = 188, e.xy.map_icon_width = 25, e.xy.map_description_width = 400, e.config.map_resolve_event_location = !0, e.config.map_resolve_user_location = !0, e.config.map_initial_position = new google.maps.LatLng(48.724, 8.215), e.config.map_error_position = new google.maps.LatLng(15, 15), e.config.map_infowindow_max_width = 300, e.config.map_type = google.maps.MapTypeId.ROADMAP, e.config.map_zoom_after_resolve = 15, e.locale.labels.marker_geo_success = "It seems you are here.", e.locale.labels.marker_geo_fail = "Sorry, could not get your current position using geolocation.", e.templates.marker_date = e.date.date_to_str("%Y-%m-%d %H:%i"), e.templates.marker_text = function(h, a, r) { - return "
" + r.text + "

" + (r.event_location || "") + "

" + e.templates.marker_date(h) + " - " + e.templates.marker_date(a) + "
"; - }, e.dblclick_dhx_map_area = function() { - !this.config.readonly && this.config.dblclick_create && this.addEventNow({ start_date: e._date, end_date: e.date.add(e._date, e.config.time_step, "minute") }); - }, e.templates.map_time = function(h, a, r) { - return e.config.rtl && !r._timed ? e.templates.day_date(a) + " – " + e.templates.day_date(h) : r._timed ? this.day_date(r.start_date, r.end_date, r) + " " + this.event_date(h) : e.templates.day_date(h) + " – " + e.templates.day_date(a); - }, e.templates.map_text = function(h, a, r) { - return r.text; - }, e.date.map_start = function(h) { - return h; - }, e.date.add_map = function(h, a, r) { - return new Date(h.valueOf()); - }, e.templates.map_date = function(h, a, r) { + let i = null, t = []; + const r = { googleMap: new Ca(e), openStreetMaps: new Oa(e), mapbox: new La(e) }; + function d(s) { + i = s.ext.mapView.createAdapter(), t.push(e.attachEvent("onEventSave", function(_, a, o) { + let l = e.getEvent(_); + return l && l.event_location != a.event_location && (e._eventLocationChanged = !0), !0; + }), e.attachEvent("onEventChanged", (_, a) => { + const { start_date: o, end_date: l } = a, { min_date: h, max_date: v } = e.getState(); + return o.valueOf() < v.valueOf() && l.valueOf() > h.valueOf() && i && (e.config.map_settings.resolve_event_location && a.event_location && !e._latLngUpdate ? n(a, i) : i.updateEventMarker(a)), e._latLngUpdate = !1, !0; + }), e.attachEvent("onEventIdChange", function(_, a) { + let o = e.getEvent(a); + i == null || i.removeEventMarker(_), i == null || i.addEventMarker(o); + }), e.attachEvent("onEventAdded", (_, a) => { + const { start_date: o, end_date: l } = a, { min_date: h, max_date: v } = e.getState(); + o.valueOf() < v.valueOf() && l.valueOf() > h.valueOf() && i && (e.config.map_settings.resolve_event_location && a.event_location && e._eventLocationChanged ? (n(a, i), e._eventLocationChanged = !1) : (i.addEventMarker(a), i.onEventClick(a))); + }), e.attachEvent("onClick", function(_, a) { + const o = e.getEvent(_); + return i && o && i.onEventClick(o), !1; + }), e.attachEvent("onBeforeEventDelete", (_, a) => (i && i.removeEventMarker(_), !0))); + } + async function n(s, _) { + let a = await _.resolveAddress(s.event_location); + return s.lat = a.lat, s.lng = a.lng, _.removeEventMarker(String(s.id)), _.addEventMarker(s), s; + } + e.ext || (e.ext = {}), e.ext.mapView = { createAdapter: function() { + return r[e.config.map_view_provider]; + }, createMarker: function(s) { + return new google.maps.Marker(s); + }, currentAdapter: null, adapters: r }, e._latLngUpdate = !1, e._eventLocationChanged = !1, e.config.map_view_provider = "googleMap", e.config.map_settings = { initial_position: { lat: 48.724, lng: 8.215 }, error_position: { lat: 15, lng: 15 }, initial_zoom: 1, zoom_after_resolve: 15, info_window_max_width: 300, resolve_user_location: !0, resolve_event_location: !0, view_provider: "googleMap" }, e.config.map_initial_position && (e.config.map_settings.initial_position = { lat: e.config.map_initial_position.lat(), lng: e.config.map_initial_position.lng() }), e.config.map_error_position && (e.config.map_settings.error_position = { lat: e.config.map_error_position.lat(), lng: e.config.map_error_position.lng() }), e.xy.map_date_width = 188, e.xy.map_icon_width = 25, e.xy.map_description_width = 400, e.date.add_map = function(s, _, a) { + return new Date(s.valueOf()); + }, e.templates.map_date = function(s, _, a) { return ""; - }, e._latLngUpdate = !1, e.attachEvent("onSchedulerReady", function() { - e._isMapPositionSet = !1; - const h = document.createElement("div"); - h.className = "dhx_map", h.id = "dhx_gmap", h.style.display = "none", e._obj.appendChild(h), e._els.dhx_gmap = [], e._els.dhx_gmap.push(h), o("dhx_gmap"); - const a = { zoom: e.config.map_initial_zoom || 10, center: e.config.map_initial_position, mapTypeId: e.config.map_type || google.maps.MapTypeId.ROADMAP }, r = new google.maps.Map(document.getElementById("dhx_gmap"), a); - r.disableDefaultUI = !1, r.disableDoubleClickZoom = !e.config.readonly, google.maps.event.addListener(r, "dblclick", function(u) { - const v = e.ext.mapView.geocoder; - if (!e.config.readonly && e.config.dblclick_create) { - var m = u.latLng; - v.geocode({ latLng: m }, function(l, f) { - f == google.maps.GeocoderStatus.OK && (m = l[0].geometry.location, e.addEventNow({ lat: m.lat(), lng: m.lng(), event_location: l[0].formatted_address, start_date: e._date, end_date: e.date.add(e._date, e.config.time_step, "minute") })); - }); - } - }); - var d = { content: "" }; - e.config.map_infowindow_max_width && (d.maxWidth = e.config.map_infowindow_max_width), e.map = { _points: [], _markers: [], _infowindow: new google.maps.InfoWindow(d), _infowindows_content: [], _initialization_count: -1, _obj: r }, e.ext.mapView.geocoder = new google.maps.Geocoder(), e.ext.mapView.map = r, e.ext.mapView.points = e.map._points, e.ext.mapView.markers = e.map._markers, e.ext.mapView.infoWindow = e.map._infowindow, e.config.map_resolve_user_location && navigator.geolocation && (e._isMapPositionSet || navigator.geolocation.getCurrentPosition(function(u) { - var v = new google.maps.LatLng(u.coords.latitude, u.coords.longitude); - r.setCenter(v), r.setZoom(e.config.map_zoom_after_resolve || 10), e.map._infowindow.setContent(e.locale.labels.marker_geo_success), e.map._infowindow.position = r.getCenter(), e.map._infowindow.open(r), e._isMapPositionSet = !0; - }, function() { - e.map._infowindow.setContent(e.locale.labels.marker_geo_fail), e.map._infowindow.setPosition(r.getCenter()), e.map._infowindow.open(r), e._isMapPositionSet = !0; - })), google.maps.event.addListener(r, "resize", function(u) { - h.style.zIndex = "5", r.setZoom(r.getZoom()); - }), google.maps.event.addListener(r, "tilesloaded", function(u) { - h.style.zIndex = "5"; - }), h.style.display = "none"; - const i = e.render_data; - function _() { - var u = e.get_visible_events(); - u.sort(function(E, D) { - return E.start_date.valueOf() == D.start_date.valueOf() ? E.id > D.id ? 1 : -1 : E.start_date > D.start_date ? 1 : -1; + }, e.templates.map_time = function(s, _, a) { + return e.config.rtl && !a._timed ? e.templates.day_date(_) + " – " + e.templates.day_date(s) : a._timed ? this.day_date(a.start_date, a.end_date, a) + " " + this.event_date(s) : e.templates.day_date(s) + " – " + e.templates.day_date(_); + }, e.templates.map_text = function(s, _, a) { + return a.text; + }, e.templates.map_info_content = function(s) { + return `
Event's text: ${s.text} +
Location: ${s.event_location}
+
Starts: ${e.templates.tooltip_date_format(s.start_date)}
+
Ends: ${e.templates.tooltip_date_format(s.end_date)}
+
`; + }, e.date.map_start = function(s) { + return s; + }, e.dblclick_dhx_map_area = function(s) { + let _ = s.target.closest(`[${e.config.event_attribute}]`); + if (_) { + let a = _.getAttribute(`${e.config.event_attribute}`); + e.showLightbox(a); + } + this.config.readonly || !this.config.dblclick_create || _ || this.addEventNow({ start_date: e.config.map_start, end_date: e.date.add(e.config.map_start, e.config.time_step, "minute") }); + }, e.attachEvent("onSchedulerReady", function() { + e.config.map_initial_zoom !== void 0 && (e.config.map_settings.initial_zoom = e.config.map_initial_zoom), e.config.map_zoom_after_resolve !== void 0 && (e.config.map_settings.zoom_after_resolve = e.config.map_zoom_after_resolve), e.config.map_infowindow_max_width !== void 0 && (e.config.map_settings.info_window_max_width = e.config.map_infowindow_max_width), e.config.map_resolve_user_location !== void 0 && (e.config.map_settings.resolve_user_location = e.config.map_resolve_user_location), e.config.map_view_provider !== void 0 && (e.config.map_settings.view_provider = e.config.map_view_provider), e.config.map_type !== void 0 && (e.config.map_settings.type = e.config.map_type), e.config.map_resolve_event_location !== void 0 && (e.config.map_settings.resolve_event_location = e.config.map_resolve_event_location), e.ext.mapView.currentAdapter = e.config.map_view_provider; + let s = document.createElement("div"); + s.className = "mapContainer", s.id = "mapContainer", s.style.display = "none", s.style.zIndex = "1", e._obj.appendChild(s); + const _ = e.render_data; + function a() { + let l = e.get_visible_events(); + l.sort(function(f, c) { + return f.start_date.valueOf() == c.start_date.valueOf() ? f.id > c.id ? 1 : -1 : f.start_date > c.start_date ? 1 : -1; }); - for (var v = "
", m = 0; m < u.length; m++) { - var l = u[m], f = l.id == e._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line", g = l.color ? "--dhx-scheduler-event-background:" + l.color + ";" : "", p = l.textColor ? "--dhx-scheduler-event-color:" + l.textColor + ";" : "", y = e._waiAria.mapRowAttrString(l), w = e._waiAria.mapDetailsBtnString(); - v += "
" + e.templates.map_time(l.start_date, l.end_date, l) + "
", v += `
+ let h = "
"; + for (let f = 0; f < l.length; f++) { + let c = l[f], p = c.id == e._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line", m = c.color ? "--dhx-scheduler-event-background:" + c.color + ";" : "", g = c.textColor ? "--dhx-scheduler-event-color:" + c.textColor + ";" : "", y = e._waiAria.mapRowAttrString(c), x = e._waiAria.mapDetailsBtnString(); + h += "
" + e.templates.map_time(c.start_date, c.end_date, c) + "
", h += `
-
`, v += "
" + e.templates.map_text(l.start_date, l.end_date, l) + "
"; - } - v += "
", e._els.dhx_cal_data[0].scrollTop = 0, e._els.dhx_cal_data[0].innerHTML = v; - var b = e._els.dhx_cal_data[0].firstChild.childNodes, k = e._getNavDateElement(); - for (k && (k.innerHTML = e.templates[e._mode + "_date"](e._min_date, e._max_date, e._mode)), e._rendered = [], m = 0; m < b.length - 2; m++) - e._rendered[m] = b[m]; - } - function o(u) { - var v = document.getElementById(u); - const m = e.$container.querySelector(".dhx_cal_navline").offsetHeight; - var l = e._y - m; - l < 0 && (l = 0); - var f = e._x - e.xy.map_date_width - e.xy.map_description_width - 1; - f < 0 && (f = 0), v.style.height = l + "px", v.style.width = f + "px", v.style.position = "absolute", v.style.top = m + "px", e.config.rtl ? v.style.marginRight = e.xy.map_date_width + e.xy.map_description_width + 1 + "px" : v.style.marginLeft = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", v.style.marginTop = e.xy.nav_height + 2 + "px"; - } - e.render_data = function(u, v) { +
`, h += "
" + e.templates.map_text(c.start_date, c.end_date, c) + "
"; + } + h += "
", e._els.dhx_cal_data[0].scrollTop = 0, e._els.dhx_cal_data[0].innerHTML = h; + let v = e._els.dhx_cal_data[0].firstChild.childNodes, u = e._getNavDateElement(); + u && (u.innerHTML = e.templates[e._mode + "_date"](e._min_date, e._max_date, e._mode)), e._rendered = []; + for (let f = 0; f < v.length - 2; f++) + e._rendered[f] = v[f]; + } + e.render_data = function(l, h) { if (this._mode != "map") - return i.apply(this, arguments); - _(); - for (var m = e.get_visible_events(), l = 0; l < m.length; l++) - e.map._markers[m[l].id] || n(m[l], !1, !1); - }, e.map_view = function(u) { - e.map._initialization_count++; - var v, m = e._els.dhx_gmap[0]; - if (e._min_date = e.config.map_start || e._currentDate(), e._max_date = e.config.map_end || e.date.add(e._currentDate(), 1, "year"), e._table_view = !0, function(g) { - if (g) { - var p = e.locale.labels; - e._els.dhx_cal_header[0].innerHTML = "
" + p.date + "
" + p.description + "
", e._table_view = !0, e.set_sizes(); + return _.apply(this, arguments); + { + a(); + let v = e.get_visible_events(); + i && (i.clearEventMarkers(), v.forEach((u) => i == null ? void 0 : i.addEventMarker(u))); + } + }, e.map_view = function(l) { + e._els.dhx_cal_data[0].style.width = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", e._min_date = e.config.map_start || e._currentDate(), e._max_date = e.config.map_end || e.date.add(e._currentDate(), 1, "year"), e._table_view = !0, function(f) { + if (f) { + const c = e.locale.labels; + e._els.dhx_cal_header[0].innerHTML = "
" + c.date + "
" + c.description + "
", e._table_view = !0, e.set_sizes(); } - }(u), u) { - (function() { - e._selected_event_id = null, e.map._infowindow.close(); - var g = e.map._markers; - for (var p in g) - g.hasOwnProperty(p) && (g[p].setMap(null), delete e.map._markers[p], e.map._infowindows_content[p] && delete e.map._infowindows_content[p]); - })(), _(), m.style.display = "block", o("dhx_gmap"), v = e.map._obj.getCenter(); - for (var l = e.get_visible_events(), f = 0; f < l.length; f++) - e.map._markers[l[f].id] || n(l[f]); - } else - m.style.display = "none"; - google.maps.event.trigger(e.map._obj, "resize"), e.map._initialization_count === 0 && v && e.map._obj.setCenter(v), e._selected_event_id && t(e._selected_event_id); - }; - var t = function(u) { - e.map._obj.setCenter(e.map._points[u]), e.callEvent("onClick", [u]); - }, n = function(u, v, m) { - var l = e.config.map_error_position; - u.lat && u.lng && (l = new google.maps.LatLng(u.lat, u.lng)); - var f = e.templates.marker_text(u.start_date, u.end_date, u); - e._new_event || (e.map._infowindows_content[u.id] = f, e.map._markers[u.id] && e.map._markers[u.id].setMap(null), e.map._markers[u.id] = e.ext.mapView.createMarker({ position: l, map: e.map._obj }), google.maps.event.addListener(e.map._markers[u.id], "click", function() { - e.map._infowindow.setContent(e.map._infowindows_content[u.id]), e.map._infowindow.open(e.map._obj, e.map._markers[u.id]), e._selected_event_id = u.id, e.render_data(); - }), e.map._points[u.id] = l, v && e.map._obj.setCenter(e.map._points[u.id]), m && e.callEvent("onClick", [u.id])); - }; - e.attachEvent("onClick", function(u, v) { - if (this._mode == "map") { - e._selected_event_id = u; - for (var m = 0; m < e._rendered.length; m++) - e._rendered[m].className = "dhx_map_line", e._rendered[m].getAttribute(e.config.event_attribute) == u && (e._rendered[m].className += " highlight"); - e.map._points[u] && e.map._markers[u] && (e.map._obj.setCenter(e.map._points[u]), google.maps.event.trigger(e.map._markers[u], "click")); - } - return !0; + }(l); + let h = document.getElementById("mapContainer"); + var v, u; + (function(f) { + let c = document.getElementById(f); + if (c) { + const p = e.$container.querySelector(".dhx_cal_navline").offsetHeight; + let m = e.$container.querySelector(".dhx_cal_data").offsetHeight + e.$container.querySelector(".dhx_cal_header").offsetHeight; + m < 0 && (m = 0); + let g = e._x - e.xy.map_date_width - e.xy.map_description_width - 1; + g < 0 && (g = 0), c.style.height = m + "px", c.style.width = g + "px", c.style.position = "absolute", c.style.top = p + "px", e.config.rtl ? c.style.marginRight = e.xy.map_date_width + e.xy.map_description_width + 1 + "px" : c.style.marginLeft = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", c.style.marginTop = e.xy.nav_height + 2 + "px"; + } + })("mapContainer"), l && h ? (s.style.display = "block", a(), e.config.map_view_provider == e.ext.mapView.currentAdapter ? (i == null || i.destroy(h), d(e), i == null || i.initialize(h, e.config.map_settings)) : (i == null || i.destroy(h), d(e), i == null || i.initialize(h, e.config.map_settings), e.ext.mapView.currentAdapter = e.config.map_view_provider), i && (v = e.config.map_settings, u = i, v.resolve_user_location ? navigator.geolocation && navigator.geolocation.getCurrentPosition(function(f) { + u.setView(f.coords.latitude, f.coords.longitude, v.zoom_after_resolve || v.initial_zoom); + }) : u.setView(v.initial_position.lat, v.initial_position.lng, v.initial_zoom))) : (s.style.display = "none", e._els.dhx_cal_data[0].style.width = "100%", i && h && (i.destroy(h), i = null, e.ext.mapView.currentAdapter = e.config.map_view_provider), t.forEach((f) => e.detachEvent(f)), t = []); + }, e.attachEvent("onLocationError", function(l) { + return alert("Location can't be found"), google.maps.LatLng(51.47784, -1492e-6); }); - var s = function(u) { - const v = e.ext.mapView.geocoder; - u.event_location && v ? v.geocode({ address: u.event_location, language: e.uid().toString() }, function(m, l) { - var f = {}; - l != google.maps.GeocoderStatus.OK ? (f = e.callEvent("onLocationError", [u.id])) && f !== !0 || (f = e.config.map_error_position) : f = m[0].geometry.location, u.lat = f.lat(), u.lng = f.lng(), e._selected_event_id = u.id, e._latLngUpdate = !0, e.callEvent("onEventChanged", [u.id, u]), n(u, !0, !0); - }) : n(u, !0, !0); - }, c = function(u) { - const v = e.ext.mapView.geocoder; - u.event_location && v && v.geocode({ address: u.event_location, language: e.uid().toString() }, function(m, l) { - var f = {}; - l != google.maps.GeocoderStatus.OK ? (f = e.callEvent("onLocationError", [u.id])) && f !== !0 || (f = e.config.map_error_position) : f = m[0].geometry.location, u.lat = f.lat(), u.lng = f.lng(), e._latLngUpdate = !0, e.callEvent("onEventChanged", [u.id, u]); - }); + let o = async function(l) { + if (i) { + const h = await i.resolveAddress(l.event_location); + h.lat && h.lng ? (l.lat = +h.lat, l.lng = +h.lng) : (e.callEvent("onLocationError", [l.id]), l.lng = e.config.map_settings.error_position.lng, l.lat = e.config.map_settings.error_position.lat), e._latLngUpdate = !0, e.callEvent("onEventChanged", [l.id, l]); + } }; - e.attachEvent("onEventChanged", function(u, v) { - return this._latLngUpdate ? this._latLngUpdate = !1 : (v = e.getEvent(u)).start_date < e._min_date && v.end_date > e._min_date || v.start_date < e._max_date && v.end_date > e._max_date || v.start_date.valueOf() >= e._min_date && v.end_date.valueOf() <= e._max_date ? (e.map._markers[u] && e.map._markers[u].setMap(null), s(v)) : (e._selected_event_id = null, e.map._infowindow.close(), e.map._markers[u] && e.map._markers[u].setMap(null)), !0; - }), e.attachEvent("onEventIdChange", function(u, v) { - var m = e.getEvent(v); - return (m.start_date < e._min_date && m.end_date > e._min_date || m.start_date < e._max_date && m.end_date > e._max_date || m.start_date.valueOf() >= e._min_date && m.end_date.valueOf() <= e._max_date) && (e.map._markers[u] && (e.map._markers[u].setMap(null), delete e.map._markers[u]), e.map._infowindows_content[u] && delete e.map._infowindows_content[u], s(m)), !0; - }), e.attachEvent("onEventAdded", function(u, v) { - return e._dataprocessor || (v.start_date < e._min_date && v.end_date > e._min_date || v.start_date < e._max_date && v.end_date > e._max_date || v.start_date.valueOf() >= e._min_date && v.end_date.valueOf() <= e._max_date) && (e.map._markers[u] && e.map._markers[u].setMap(null), s(v)), !0; - }), e.attachEvent("onBeforeEventDelete", function(u, v) { - return e.map._markers[u] && e.map._markers[u].setMap(null), e._selected_event_id = null, e.map._infowindow.close(), !0; - }), e._event_resolve_delay = 1500, e.attachEvent("onEventLoading", function(u) { - return e.config.map_resolve_event_location && u.event_location && !u.lat && !u.lng && (e._event_resolve_delay += 1500, function(v, m, l, f) { + e._event_resolve_delay = 1500, e.attachEvent("onEventLoading", function(l) { + return l.lat && l.lng && (l.lat = +l.lat, l.lng = +l.lng), e.config.map_settings.resolve_event_location && l.event_location && !l.lat && !l.lng && (e._event_resolve_delay += 1500, function(h, v, u, f) { setTimeout(function() { if (e.$destroyed) return !0; - var g = v.apply(m, l); - return v = m = l = null, g; + let c = h.apply(v, u); + return h = v = u = null, c; }, f || 1); - }(c, this, [u], e._event_resolve_delay)), !0; - }), e.attachEvent("onEventCancel", function(u, v) { - return v && (e.map._markers[u] && e.map._markers[u].setMap(null), e.map._infowindow.close()), !0; + }(o, this, [l], e._event_resolve_delay)), !0; }); }); }, minical: function(e) { - const h = e._createDomEventScope(); - e.config.minicalendar = { mark_events: !0 }, e._synced_minicalendars = [], e.renderCalendar = function(a, r, d) { - var i = null, _ = a.date || e._currentDate(); - if (typeof _ == "string" && (_ = this.templates.api_date(_)), r) - i = this._render_calendar(r.parentNode, _, a, r), e.unmarkCalendar(i); + const i = e._createDomEventScope(); + e.config.minicalendar = { mark_events: !0 }, e._synced_minicalendars = [], e.renderCalendar = function(t, r, d) { + var n = null, s = t.date || e._currentDate(); + if (typeof s == "string" && (s = this.templates.api_date(s)), r) + n = this._render_calendar(r.parentNode, s, t, r), e.unmarkCalendar(n); else { - var o = a.container, t = a.position; - if (typeof o == "string" && (o = document.getElementById(o)), typeof t == "string" && (t = document.getElementById(t)), t && t.left === void 0 && t.right === void 0) { - var n = e.$domHelpers.getOffset(t); - t = { top: n.top + t.offsetHeight, left: n.left }; - } - o || (o = e._get_def_cont(t)), (i = this._render_calendar(o, _, a)).$_eventAttached || (i.$_eventAttached = !0, h.attach(i, "click", (function(p) { - var y = p.target || p.srcElement, w = e.$domHelpers; - if (w.closest(y, ".dhx_month_head") && !w.closest(y, ".dhx_after") && !w.closest(y, ".dhx_before")) { - var b = w.closest(y, "[data-cell-date]").getAttribute("data-cell-date"), k = e.templates.parse_date(b); + var _ = t.container, a = t.position; + if (typeof _ == "string" && (_ = document.getElementById(_)), typeof a == "string" && (a = document.getElementById(a)), a && a.left === void 0 && a.right === void 0) { + var o = e.$domHelpers.getOffset(a); + a = { top: o.top + a.offsetHeight, left: o.left }; + } + _ || (_ = e._get_def_cont(a)), (n = this._render_calendar(_, s, t)).$_eventAttached || (n.$_eventAttached = !0, i.attach(n, "click", (function(g) { + var y = g.target || g.srcElement, x = e.$domHelpers; + if (x.closest(y, ".dhx_month_head") && !x.closest(y, ".dhx_after") && !x.closest(y, ".dhx_before")) { + var b = x.closest(y, "[data-cell-date]").getAttribute("data-cell-date"), k = e.templates.parse_date(b); e.unmarkCalendar(this), e.markCalendar(this, k, "dhx_calendar_click"), this._last_date = k, this.conf.handler && this.conf.handler.call(e, k, this); } - }).bind(i))); + }).bind(n))); } if (e.config.minicalendar.mark_events) - for (var s = e.date.month_start(_), c = e.date.add(s, 1, "month"), u = this.getEvents(s, c), v = this["filter_" + this._mode], m = {}, l = 0; l < u.length; l++) { - var f = u[l]; - if (!v || v(f.id, f)) { - var g = f.start_date; - for (g.valueOf() < s.valueOf() && (g = s), g = e.date.date_part(new Date(g.valueOf())); g < f.end_date && (m[+g] || (m[+g] = !0, this.markCalendar(i, g, "dhx_year_event")), !((g = this.date.add(g, 1, "day")).valueOf() >= c.valueOf())); ) + for (var l = e.date.month_start(s), h = e.date.add(l, 1, "month"), v = this.getEvents(l, h), u = this["filter_" + this._mode], f = {}, c = 0; c < v.length; c++) { + var p = v[c]; + if (!u || u(p.id, p)) { + var m = p.start_date; + for (m.valueOf() < l.valueOf() && (m = l), m = e.date.date_part(new Date(m.valueOf())); m < p.end_date && (f[+m] || (f[+m] = !0, this.markCalendar(n, m, "dhx_year_event")), !((m = this.date.add(m, 1, "day")).valueOf() >= h.valueOf())); ) ; } } - return this._markCalendarCurrentDate(i), i.conf = a, a.sync && !d && this._synced_minicalendars.push(i), i.conf._on_xle_handler || (i.conf._on_xle_handler = e.attachEvent("onXLE", function() { - e.updateCalendar(i, i.conf.date); - })), this.config.wai_aria_attributes && this.config.wai_aria_application_role && i.setAttribute("role", "application"), i; - }, e._get_def_cont = function(a) { + return this._markCalendarCurrentDate(n), n.conf = t, t.sync && !d && this._synced_minicalendars.push(n), n.conf._on_xle_handler || (n.conf._on_xle_handler = e.attachEvent("onXLE", function() { + e.updateCalendar(n, n.conf.date); + })), this.config.wai_aria_attributes && this.config.wai_aria_application_role && n.setAttribute("role", "application"), n; + }, e._get_def_cont = function(t) { return this._def_count || (this._def_count = document.createElement("div"), this._def_count.className = "dhx_minical_popup", e.event(this._def_count, "click", function(r) { r.cancelBubble = !0; - }), document.body.appendChild(this._def_count)), a.left && (this._def_count.style.left = a.left + "px"), a.right && (this._def_count.style.right = a.right + "px"), a.top && (this._def_count.style.top = a.top + "px"), a.bottom && (this._def_count.style.bottom = a.bottom + "px"), this._def_count._created = /* @__PURE__ */ new Date(), this._def_count; - }, e._locateCalendar = function(a, r) { - if (typeof r == "string" && (r = e.templates.api_date(r)), +r > +a._max_date || +r < +a._min_date) + }), document.body.appendChild(this._def_count)), t.left && (this._def_count.style.left = t.left + "px"), t.right && (this._def_count.style.right = t.right + "px"), t.top && (this._def_count.style.top = t.top + "px"), t.bottom && (this._def_count.style.bottom = t.bottom + "px"), this._def_count._created = /* @__PURE__ */ new Date(), this._def_count; + }, e._locateCalendar = function(t, r) { + if (typeof r == "string" && (r = e.templates.api_date(r)), +r > +t._max_date || +r < +t._min_date) return null; - for (var d = a.querySelector(".dhx_year_body").childNodes[0], i = 0, _ = new Date(a._min_date); +this.date.add(_, 1, "week") <= +r; ) - _ = this.date.add(_, 1, "week"), i++; - var o = e.config.start_on_monday, t = (r.getDay() || (o ? 7 : 0)) - (o ? 1 : 0); - const n = d.querySelector(`.dhx_cal_month_row:nth-child(${i + 1}) .dhx_cal_month_cell:nth-child(${t + 1})`); - return n ? n.firstChild : null; - }, e.markCalendar = function(a, r, d) { - var i = this._locateCalendar(a, r); - i && (i.className += " " + d); - }, e.unmarkCalendar = function(a, r, d) { - if (d = d || "dhx_calendar_click", r = r || a._last_date) { - var i = this._locateCalendar(a, r); - i && (i.className = (i.className || "").replace(RegExp(d, "g"))); - } - }, e._week_template = function(a) { - for (var r = a || 250, d = 0, i = document.createElement("div"), _ = this.date.week_start(e._currentDate()), o = 0; o < 7; o++) - this._cols[o] = Math.floor(r / (7 - o)), this._render_x_header(o, d, _, i), _ = this.date.add(_, 1, "day"), r -= this._cols[o], d += this._cols[o]; - return i.lastChild.className += " dhx_scale_bar_last", i; - }, e.updateCalendar = function(a, r) { - a.conf.date = r, this.renderCalendar(a.conf, a, !0); - }, e._mini_cal_arrows = [" ", " "], e._render_calendar = function(a, r, d, i) { - var _ = e.templates, o = this._cols; + for (var d = t.querySelector(".dhx_year_body").childNodes[0], n = 0, s = new Date(t._min_date); +this.date.add(s, 1, "week") <= +r; ) + s = this.date.add(s, 1, "week"), n++; + var _ = e.config.start_on_monday, a = (r.getDay() || (_ ? 7 : 0)) - (_ ? 1 : 0); + const o = d.querySelector(`.dhx_cal_month_row:nth-child(${n + 1}) .dhx_cal_month_cell:nth-child(${a + 1})`); + return o ? o.firstChild : null; + }, e.markCalendar = function(t, r, d) { + var n = this._locateCalendar(t, r); + n && (n.className += " " + d); + }, e.unmarkCalendar = function(t, r, d) { + if (d = d || "dhx_calendar_click", r = r || t._last_date) { + var n = this._locateCalendar(t, r); + n && (n.className = (n.className || "").replace(RegExp(d, "g"))); + } + }, e._week_template = function(t) { + for (var r = t || 250, d = 0, n = document.createElement("div"), s = this.date.week_start(e._currentDate()), _ = 0; _ < 7; _++) + this._cols[_] = Math.floor(r / (7 - _)), this._render_x_header(_, d, s, n), s = this.date.add(s, 1, "day"), r -= this._cols[_], d += this._cols[_]; + return n.lastChild.className += " dhx_scale_bar_last", n; + }, e.updateCalendar = function(t, r) { + t.conf.date = r, this.renderCalendar(t.conf, t, !0); + }, e._mini_cal_arrows = [" ", " "], e._render_calendar = function(t, r, d, n) { + var s = e.templates, _ = this._cols; this._cols = []; - var t = this._mode; + var a = this._mode; this._mode = "calendar"; - var n = this._colsS; + var o = this._colsS; this._colsS = { height: 0 }; - var s = new Date(this._min_date), c = new Date(this._max_date), u = new Date(e._date), v = _.month_day, m = this._ignores_detected; - this._ignores_detected = 0, _.month_day = _.calendar_date, r = this.date.month_start(r); - var l, f = this._week_template(a.offsetWidth - 1 - this.config.minicalendar.padding); - i ? l = i : (l = document.createElement("div")).className = "dhx_cal_container dhx_mini_calendar", l.setAttribute("date", this._helpers.formatDate(r)), l.innerHTML = "
" : "'>") + "
" + (f ? f.innerHTML : "") + "
"; - var g = l.querySelector(".dhx_year_month"), p = l.querySelector(".dhx_year_week"), y = l.querySelector(".dhx_year_body"); - if (g.innerHTML = this.templates.calendar_month(r), d.navigation) - for (var w = function(H, P) { - var z = e.date.add(H._date, P, "month"); - e.updateCalendar(H, z), e._date.getMonth() == H._date.getMonth() && e._date.getFullYear() == H._date.getFullYear() && e._markCalendarCurrentDate(H); - }, b = ["dhx_cal_prev_button", "dhx_cal_next_button"], k = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"], E = [-1, 1], D = function(H) { + var l = new Date(this._min_date), h = new Date(this._max_date), v = new Date(e._date), u = s.month_day, f = this._ignores_detected; + this._ignores_detected = 0, s.month_day = s.calendar_date, r = this.date.month_start(r); + var c, p = this._week_template(t.offsetWidth - 1 - this.config.minicalendar.padding); + n ? c = n : (c = document.createElement("div")).className = "dhx_cal_container dhx_mini_calendar", c.setAttribute("date", this._helpers.formatDate(r)), c.innerHTML = "
" : "'>") + "
" + (p ? p.innerHTML : "") + "
"; + var m = c.querySelector(".dhx_year_month"), g = c.querySelector(".dhx_year_week"), y = c.querySelector(".dhx_year_body"); + if (m.innerHTML = this.templates.calendar_month(r), d.navigation) + for (var x = function(z, W) { + var Y = e.date.add(z._date, W, "month"); + e.updateCalendar(z, Y), e._date.getMonth() == z._date.getMonth() && e._date.getFullYear() == z._date.getFullYear() && e._markCalendarCurrentDate(z); + }, b = ["dhx_cal_prev_button", "dhx_cal_next_button"], k = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"], E = [-1, 1], D = function(z) { return function() { if (d.sync) - for (var P = e._synced_minicalendars, z = 0; z < P.length; z++) - w(P[z], H); + for (var W = e._synced_minicalendars, Y = 0; Y < W.length; Y++) + x(W[Y], z); else - e.config.rtl && (H = -H), w(l, H); + e.config.rtl && (z = -z), x(c, z); }; - }, x = [e.locale.labels.prev, e.locale.labels.next], S = 0; S < 2; S++) { + }, w = [e.locale.labels.prev, e.locale.labels.next], S = 0; S < 2; S++) { var N = document.createElement("div"); - N.className = b[S], e._waiAria.headerButtonsAttributes(N, x[S]), N.style.cssText = k[S], N.innerHTML = this._mini_cal_arrows[S], g.appendChild(N), h.attach(N, "click", D(E[S])); - } - l._date = new Date(r), l.week_start = (r.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7; - var M = l._min_date = this.date.week_start(r); - l._max_date = this.date.add(l._min_date, 6, "week"), this._reset_month_scale(y, r, M, 6), i || a.appendChild(l), p.style.height = p.childNodes[0].offsetHeight - 1 + "px"; - var A = e.uid(); - e._waiAria.minicalHeader(g, A), e._waiAria.minicalGrid(l.querySelector(".dhx_year_grid"), A), e._waiAria.minicalRow(p); - for (var C = p.querySelectorAll(".dhx_scale_bar"), T = 0; T < C.length; T++) - e._waiAria.minicalHeadCell(C[T]); - var O = y.querySelectorAll(".dhx_cal_month_cell"), L = new Date(M); - for (T = 0; T < O.length; T++) - e._waiAria.minicalDayCell(O[T], new Date(L)), L = e.date.add(L, 1, "day"); - return e._waiAria.minicalHeader(g, A), this._cols = o, this._mode = t, this._colsS = n, this._min_date = s, this._max_date = c, e._date = u, _.month_day = v, this._ignores_detected = m, l; - }, e.destroyCalendar = function(a, r) { - !a && this._def_count && this._def_count.firstChild && (r || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) && (a = this._def_count.firstChild), a && (h.detachAll(), a.innerHTML = "", a.parentNode && a.parentNode.removeChild(a), this._def_count && (this._def_count.style.top = "-1000px"), a.conf && a.conf._on_xle_handler && e.detachEvent(a.conf._on_xle_handler)); + N.className = b[S], e._waiAria.headerButtonsAttributes(N, w[S]), N.style.cssText = k[S], N.innerHTML = this._mini_cal_arrows[S], m.appendChild(N), i.attach(N, "click", D(E[S])); + } + c._date = new Date(r), c.week_start = (r.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7; + var M = c._min_date = this.date.week_start(r); + c._max_date = this.date.add(c._min_date, 6, "week"), this._reset_month_scale(y, r, M, 6), n || t.appendChild(c), g.style.height = g.childNodes[0].offsetHeight - 1 + "px"; + var T = e.uid(); + e._waiAria.minicalHeader(m, T), e._waiAria.minicalGrid(c.querySelector(".dhx_year_grid"), T), e._waiAria.minicalRow(g); + for (var A = g.querySelectorAll(".dhx_scale_bar"), H = 0; H < A.length; H++) + e._waiAria.minicalHeadCell(A[H]); + var $ = y.querySelectorAll(".dhx_cal_month_cell"), j = new Date(M); + for (H = 0; H < $.length; H++) + e._waiAria.minicalDayCell($[H], new Date(j)), j = e.date.add(j, 1, "day"); + return e._waiAria.minicalHeader(m, T), this._cols = _, this._mode = a, this._colsS = o, this._min_date = l, this._max_date = h, e._date = v, s.month_day = u, this._ignores_detected = f, c; + }, e.destroyCalendar = function(t, r) { + !t && this._def_count && this._def_count.firstChild && (r || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) && (t = this._def_count.firstChild), t && (i.detachAll(), t.innerHTML = "", t.parentNode && t.parentNode.removeChild(t), this._def_count && (this._def_count.style.top = "-1000px"), t.conf && t.conf._on_xle_handler && e.detachEvent(t.conf._on_xle_handler)); }, e.isCalendarVisible = function() { return !!(this._def_count && parseInt(this._def_count.style.top, 10) > 0) && this._def_count; }, e.attachEvent("onTemplatesReady", function() { e.event(document.body, "click", function() { e.destroyCalendar(); }); - }, { once: !0 }), e.form_blocks.calendar_time = { render: function(a) { - var r = "", d = e.config, i = this.date.date_part(e._currentDate()), _ = 1440, o = 0; - d.limit_time_select && (o = 60 * d.first_hour, _ = 60 * d.last_hour + 1), i.setHours(o / 60), a._time_values = [], r += " ", d = e.config, n = this.date.date_part(e._currentDate()), s = 1440, _ = 0; + d.limit_time_select && (_ = 60 * d.first_hour, s = 60 * d.last_hour + 1), n.setHours(_ / 60), t._time_values = [], r += " ") + "  –  " + r + "
"; - }, set_value: function(a, r, d, i) { - var _, o, t = a.getElementsByTagName("input"), n = a.getElementsByTagName("select"), s = function(g, p, y) { - e.event(g, "click", function() { - e.destroyCalendar(null, !0), e.renderCalendar({ position: g, date: new Date(this._date), navigation: !0, handler: function(w) { - g.value = e.templates.calendar_time(w), g._date = new Date(w), e.destroyCalendar(), e.config.event_duration && e.config.auto_end_date && y === 0 && m(); + }, set_value: function(t, r, d, n) { + var s, _, a = t.getElementsByTagName("input"), o = t.getElementsByTagName("select"), l = function(m, g, y) { + e.event(m, "click", function() { + e.destroyCalendar(null, !0), e.renderCalendar({ position: m, date: new Date(this._date), navigation: !0, handler: function(x) { + m.value = e.templates.calendar_time(x), m._date = new Date(x), e.destroyCalendar(), e.config.event_duration && e.config.auto_end_date && y === 0 && f(); } }); }); }; if (e.config.full_day) { - if (!a._full_day) { - var c = ""; - e.config.wide_form || (c = a.previousSibling.innerHTML + c), a.previousSibling.innerHTML = c, a._full_day = !0; - } - var u = a.previousSibling.getElementsByTagName("input")[0], v = e.date.time_part(d.start_date) === 0 && e.date.time_part(d.end_date) === 0; - u.checked = v, n[0].disabled = u.checked, n[1].disabled = u.checked, u.$_eventAttached || (u.$_eventAttached = !0, e.event(u, "click", function() { - if (u.checked === !0) { - var g = {}; - e.form_blocks.calendar_time.get_value(a, g), _ = e.date.date_part(g.start_date), (+(o = e.date.date_part(g.end_date)) == +_ || +o >= +_ && (d.end_date.getHours() !== 0 || d.end_date.getMinutes() !== 0)) && (o = e.date.add(o, 1, "day")); + if (!t._full_day) { + var h = ""; + e.config.wide_form || (h = t.previousSibling.innerHTML + h), t.previousSibling.innerHTML = h, t._full_day = !0; + } + var v = t.previousSibling.getElementsByTagName("input")[0], u = e.date.time_part(d.start_date) === 0 && e.date.time_part(d.end_date) === 0; + v.checked = u, o[0].disabled = v.checked, o[1].disabled = v.checked, v.$_eventAttached || (v.$_eventAttached = !0, e.event(v, "click", function() { + if (v.checked === !0) { + var m = {}; + e.form_blocks.calendar_time.get_value(t, m), s = e.date.date_part(m.start_date), (+(_ = e.date.date_part(m.end_date)) == +s || +_ >= +s && (d.end_date.getHours() !== 0 || d.end_date.getMinutes() !== 0)) && (_ = e.date.add(_, 1, "day")); } - var p = _ || d.start_date, y = o || d.end_date; - l(t[0], p), l(t[1], y), n[0].value = 60 * p.getHours() + p.getMinutes(), n[1].value = 60 * y.getHours() + y.getMinutes(), n[0].disabled = u.checked, n[1].disabled = u.checked; + var g = s || d.start_date, y = _ || d.end_date; + c(a[0], g), c(a[1], y), o[0].value = 60 * g.getHours() + g.getMinutes(), o[1].value = 60 * y.getHours() + y.getMinutes(), o[0].disabled = v.checked, o[1].disabled = v.checked; })); } if (e.config.event_duration && e.config.auto_end_date) { - var m = function() { - e.config.auto_end_date && e.config.event_duration && (_ = e.date.add(t[0]._date, n[0].value, "minute"), o = new Date(_.getTime() + 60 * e.config.event_duration * 1e3), t[1].value = e.templates.calendar_time(o), t[1]._date = e.date.date_part(new Date(o)), n[1].value = 60 * o.getHours() + o.getMinutes()); + var f = function() { + e.config.auto_end_date && e.config.event_duration && (s = e.date.add(a[0]._date, o[0].value, "minute"), _ = new Date(s.getTime() + 60 * e.config.event_duration * 1e3), a[1].value = e.templates.calendar_time(_), a[1]._date = e.date.date_part(new Date(_)), o[1].value = 60 * _.getHours() + _.getMinutes()); }; - n[0].$_eventAttached || n[0].addEventListener("change", m); + o[0].$_eventAttached || o[0].addEventListener("change", f); } - function l(g, p, y) { - s(g, p, y), g.value = e.templates.calendar_time(p), g._date = e.date.date_part(new Date(p)); + function c(m, g, y) { + l(m, g, y), m.value = e.templates.calendar_time(g), m._date = e.date.date_part(new Date(g)); } - function f(g) { - for (var p = i._time_values, y = 60 * g.getHours() + g.getMinutes(), w = y, b = !1, k = 0; k < p.length; k++) { - var E = p[k]; + function p(m) { + for (var g = n._time_values, y = 60 * m.getHours() + m.getMinutes(), x = y, b = !1, k = 0; k < g.length; k++) { + var E = g[k]; if (E === y) { b = !0; break; } - E < y && (w = E); + E < y && (x = E); } - return b || w ? b ? y : w : -1; + return b || x ? b ? y : x : -1; } - l(t[0], d.start_date, 0), l(t[1], d.end_date, 1), s = function() { - }, n[0].value = f(d.start_date), n[1].value = f(d.end_date); - }, get_value: function(a, r) { - var d = a.getElementsByTagName("input"), i = a.getElementsByTagName("select"); - return r.start_date = e.date.add(d[0]._date, i[0].value, "minute"), r.end_date = e.date.add(d[1]._date, i[1].value, "minute"), r.end_date <= r.start_date && (r.end_date = e.date.add(r.start_date, e.config.time_step, "minute")), { start_date: new Date(r.start_date), end_date: new Date(r.end_date) }; - }, focus: function(a) { - } }, e.linkCalendar = function(a, r) { + c(a[0], d.start_date, 0), c(a[1], d.end_date, 1), l = function() { + }, o[0].value = p(d.start_date), o[1].value = p(d.end_date); + }, get_value: function(t, r) { + var d = t.getElementsByTagName("input"), n = t.getElementsByTagName("select"); + return r.start_date = e.date.add(d[0]._date, n[0].value, "minute"), r.end_date = e.date.add(d[1]._date, n[1].value, "minute"), r.end_date <= r.start_date && (r.end_date = e.date.add(r.start_date, e.config.time_step, "minute")), { start_date: new Date(r.start_date), end_date: new Date(r.end_date) }; + }, focus: function(t) { + } }, e.linkCalendar = function(t, r) { var d = function() { - var i = e._date, _ = new Date(i.valueOf()); - return r && (_ = r(_)), _.setDate(1), e.updateCalendar(a, _), !0; + var n = e._date, s = new Date(n.valueOf()); + return r && (s = r(s)), s.setDate(1), e.updateCalendar(t, s), !0; }; e.attachEvent("onViewChange", d), e.attachEvent("onXLE", d), e.attachEvent("onEventAdded", d), e.attachEvent("onEventChanged", d), e.attachEvent("onEventDeleted", d), d(); - }, e._markCalendarCurrentDate = function(a) { - var r = e.getState(), d = r.min_date, i = r.max_date, _ = r.mode, o = e.date.month_start(new Date(a._date)), t = e.date.add(o, 1, "month"); - if (!({ month: !0, year: !0, agenda: !0, grid: !0 }[_] || d.valueOf() <= o.valueOf() && i.valueOf() >= t.valueOf())) - for (var n = d; n.valueOf() < i.valueOf(); ) - o.valueOf() <= n.valueOf() && t > n && e.markCalendar(a, n, "dhx_calendar_click"), n = e.date.add(n, 1, "day"); + }, e._markCalendarCurrentDate = function(t) { + var r = e.getState(), d = r.min_date, n = r.max_date, s = r.mode, _ = e.date.month_start(new Date(t._date)), a = e.date.add(_, 1, "month"); + if (!({ month: !0, year: !0, agenda: !0, grid: !0 }[s] || d.valueOf() <= _.valueOf() && n.valueOf() >= a.valueOf())) + for (var o = d; o.valueOf() < n.valueOf(); ) + _.valueOf() <= o.valueOf() && a > o && e.markCalendar(t, o, "dhx_calendar_click"), o = e.date.add(o, 1, "day"); }, e.attachEvent("onEventCancel", function() { e.destroyCalendar(null, !0); }), e.attachEvent("onDestroy", function() { @@ -6787,452 +8549,477 @@ const lt = { active_links: function(e) { }, monthheight: function(e) { e.attachEvent("onTemplatesReady", function() { e.xy.scroll_width = 0; - var h = e.render_view_data; + var i = e.render_view_data; e.render_view_data = function() { var r = this._els.dhx_cal_data[0]; - r.firstChild._h_fix = !0, h.apply(e, arguments); + r.firstChild._h_fix = !0, i.apply(e, arguments); var d = parseInt(r.style.height); r.style.height = "1px", r.style.height = r.scrollHeight + "px", this._obj.style.height = this._obj.clientHeight + r.scrollHeight - d + "px"; }; - var a = e._reset_month_scale; - e._reset_month_scale = function(r, d, i, _) { - var o = { clientHeight: 100 }; - a.apply(e, [o, d, i, _]), r.innerHTML = o.innerHTML; + var t = e._reset_month_scale; + e._reset_month_scale = function(r, d, n, s) { + var _ = { clientHeight: 100 }; + t.apply(e, [_, d, n, s]), r.innerHTML = _.innerHTML; }; }); }, multisection: function(e) { - R("Multisection", e.assert); + de("Multisection", e.assert); }, multiselect: function(e) { - e.form_blocks.multiselect = { render: function(h) { - var a = "dhx_multi_select_control dhx_multi_select_" + h.name; - h.vertical && (a += " dhx_multi_select_control_vertical"); - for (var r = "
", d = 0; d < h.options.length; d++) - r += ""; + e.form_blocks.multiselect = { render: function(i) { + var t = "dhx_multi_select_control dhx_multi_select_" + i.name; + i.vertical && (t += " dhx_multi_select_control_vertical"); + for (var r = "
", d = 0; d < i.options.length; d++) + r += ""; return r += "
"; - }, set_value: function(h, a, r, d) { - for (var i = h.getElementsByTagName("input"), _ = 0; _ < i.length; _++) - i[_].checked = !1; - function o(u) { - for (var v = h.getElementsByTagName("input"), m = 0; m < v.length; m++) - v[m].checked = !!u[v[m].value]; - } - var t = {}; + }, set_value: function(i, t, r, d) { + for (var n = i.getElementsByTagName("input"), s = 0; s < n.length; s++) + n[s].checked = !1; + function _(v) { + for (var u = i.getElementsByTagName("input"), f = 0; f < u.length; f++) + u[f].checked = !!v[u[f].value]; + } + var a = {}; if (r[d.map_to]) { - var n = (r[d.map_to] + "").split(d.delimiter || e.config.section_delimiter || ","); - for (_ = 0; _ < n.length; _++) - t[n[_]] = !0; - o(t); + var o = (r[d.map_to] + "").split(d.delimiter || e.config.section_delimiter || ","); + for (s = 0; s < o.length; s++) + a[o[s]] = !0; + _(a); } else { if (e._new_event || !d.script_url) return; - var s = document.createElement("div"); - s.className = "dhx_loading", s.style.cssText = "position: absolute; top: 40%; left: 40%;", h.appendChild(s); - var c = [d.script_url, d.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + d.map_to + "=" + r.id + "&uid=" + e.uid()].join(""); - e.ajax.get(c, function(u) { - var v = function(m, l) { + var l = document.createElement("div"); + l.className = "dhx_loading", l.style.cssText = "position: absolute; top: 40%; left: 40%;", i.appendChild(l); + var h = [d.script_url, d.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + d.map_to + "=" + r.id + "&uid=" + e.uid()].join(""); + e.ajax.get(h, function(v) { + var u = function(f, c) { try { - for (var f = JSON.parse(m.xmlDoc.responseText), g = {}, p = 0; p < f.length; p++) { - var y = f[p]; - g[y.value || y.key || y.id] = !0; + for (var p = JSON.parse(f.xmlDoc.responseText), m = {}, g = 0; g < p.length; g++) { + var y = p[g]; + m[y.value || y.key || y.id] = !0; } - return g; + return m; } catch { return null; } - }(u); - v || (v = function(m, l) { - for (var f = e.ajax.xpath("//data/item", m.xmlDoc), g = {}, p = 0; p < f.length; p++) - g[f[p].getAttribute(l.map_to)] = !0; - return g; - }(u, d)), o(v), h.removeChild(s); + }(v); + u || (u = function(f, c) { + for (var p = e.ajax.xpath("//data/item", f.xmlDoc), m = {}, g = 0; g < p.length; g++) + m[p[g].getAttribute(c.map_to)] = !0; + return m; + }(v, d)), _(u), i.removeChild(l); }); } - }, get_value: function(h, a, r) { - for (var d = [], i = h.getElementsByTagName("input"), _ = 0; _ < i.length; _++) - i[_].checked && d.push(i[_].value); + }, get_value: function(i, t, r) { + for (var d = [], n = i.getElementsByTagName("input"), s = 0; s < n.length; s++) + n[s].checked && d.push(n[s].value); return d.join(r.delimiter || e.config.section_delimiter || ","); - }, focus: function(h) { + }, focus: function(i) { } }; }, multisource: function(e) { - var h = e._load; - e._load = function(a, r) { - if (typeof (a = a || this._load_url) == "object") - for (var d = function(_) { - var o = function() { + var i = e._load; + e._load = function(t, r) { + if (typeof (t = t || this._load_url) == "object") + for (var d = function(s) { + var _ = function() { }; - return o.prototype = _, o; - }(this._loaded), i = 0; i < a.length; i++) - this._loaded = new d(), h.call(this, a[i], r); + return _.prototype = s, _; + }(this._loaded), n = 0; n < t.length; n++) + this._loaded = new d(), i.call(this, t[n], r); else - h.apply(this, arguments); + i.apply(this, arguments); }; }, mvc: function(e) { - var h, a = { use_id: !1 }; - function r(_) { - var o = {}; - for (var t in _) - t.indexOf("_") !== 0 && (o[t] = _[t]); - return a.use_id || delete o.id, o; + var i, t = { use_id: !1 }; + function r(s) { + var _ = {}; + for (var a in s) + a.indexOf("_") !== 0 && (_[a] = s[a]); + return t.use_id || delete _.id, _; } - function d(_) { - _._not_render = !1, _._render_wait && _.render_view_data(), _._loading = !1, _.callEvent("onXLE", []); + function d(s) { + s._not_render = !1, s._render_wait && s.render_view_data(), s._loading = !1, s.callEvent("onXLE", []); } - function i(_) { - return a.use_id ? _.id : _.cid; + function n(s) { + return t.use_id ? s.id : s.cid; } - e.backbone = function(_, o) { - o && (a = o), _.bind("change", function(s, c) { - var u = i(s), v = e._events[u] = s.toJSON(); - v.id = u, e._init_event(v), clearTimeout(h), h = setTimeout(function() { + e.backbone = function(s, _) { + _ && (t = _), s.bind("change", function(l, h) { + var v = n(l), u = e._events[v] = l.toJSON(); + u.id = v, e._init_event(u), clearTimeout(i), i = setTimeout(function() { if (e.$destroyed) return !0; e.updateView(); }, 1); - }), _.bind("remove", function(s, c) { - var u = i(s); - e._events[u] && e.deleteEvent(u); + }), s.bind("remove", function(l, h) { + var v = n(l); + e._events[v] && e.deleteEvent(v); }); - var t = []; - function n() { + var a = []; + function o() { if (e.$destroyed) return !0; - t.length && (e.parse(t, "json"), t = []); - } - _.bind("add", function(s, c) { - var u = i(s); - if (!e._events[u]) { - var v = s.toJSON(); - v.id = u, e._init_event(v), t.push(v), t.length == 1 && setTimeout(n, 1); - } - }), _.bind("request", function(s) { - var c; - s instanceof Backbone.Collection && ((c = e)._loading = !0, c._not_render = !0, c.callEvent("onXLS", [])); - }), _.bind("sync", function(s) { - s instanceof Backbone.Collection && d(e); - }), _.bind("error", function(s) { - s instanceof Backbone.Collection && d(e); - }), e.attachEvent("onEventCreated", function(s) { - var c = new _.model(e.getEvent(s)); - return e._events[s] = c.toJSON(), e._events[s].id = s, !0; - }), e.attachEvent("onEventAdded", function(s) { - if (!_.get(s)) { - var c = r(e.getEvent(s)), u = new _.model(c), v = i(u); - v != s && this.changeEventId(s, v), _.add(u), _.trigger("scheduler:add", u); + a.length && (e.parse(a, "json"), a = []); + } + s.bind("add", function(l, h) { + var v = n(l); + if (!e._events[v]) { + var u = l.toJSON(); + u.id = v, e._init_event(u), a.push(u), a.length == 1 && setTimeout(o, 1); + } + }), s.bind("request", function(l) { + var h; + l instanceof Backbone.Collection && ((h = e)._loading = !0, h._not_render = !0, h.callEvent("onXLS", [])); + }), s.bind("sync", function(l) { + l instanceof Backbone.Collection && d(e); + }), s.bind("error", function(l) { + l instanceof Backbone.Collection && d(e); + }), e.attachEvent("onEventCreated", function(l) { + var h = new s.model(e.getEvent(l)); + return e._events[l] = h.toJSON(), e._events[l].id = l, !0; + }), e.attachEvent("onEventAdded", function(l) { + if (!s.get(l)) { + var h = r(e.getEvent(l)), v = new s.model(h), u = n(v); + u != l && this.changeEventId(l, u), s.add(v), s.trigger("scheduler:add", v); } return !0; - }), e.attachEvent("onEventChanged", function(s) { - var c = _.get(s), u = r(e.getEvent(s)); - return c.set(u), _.trigger("scheduler:change", c), !0; - }), e.attachEvent("onEventDeleted", function(s) { - var c = _.get(s); - return c && (_.trigger("scheduler:remove", c), _.remove(s)), !0; + }), e.attachEvent("onEventChanged", function(l) { + var h = s.get(l), v = r(e.getEvent(l)); + return h.set(v), s.trigger("scheduler:change", h), !0; + }), e.attachEvent("onEventDeleted", function(l) { + var h = s.get(l); + return h && (s.trigger("scheduler:remove", h), s.remove(l)), !0; }); }; }, outerdrag: function(e) { e.attachEvent("onTemplatesReady", function() { - var h, a = new dhtmlDragAndDropObject(), r = a.stopDrag; - function d(i, _, o, t) { - if (!e.checkEvent("onBeforeExternalDragIn") || e.callEvent("onBeforeExternalDragIn", [i, _, o, t, h])) { - var n = e.attachEvent("onEventCreated", function(m) { - e.callEvent("onExternalDragIn", [m, i, h]) || (this._drag_mode = this._drag_id = null, this.deleteEvent(m)); - }), s = e.getActionData(h), c = { start_date: new Date(s.date) }; + var i, t = new dhtmlDragAndDropObject(), r = t.stopDrag; + function d(n, s, _, a) { + if (!e.checkEvent("onBeforeExternalDragIn") || e.callEvent("onBeforeExternalDragIn", [n, s, _, a, i])) { + var o = e.attachEvent("onEventCreated", function(f) { + e.callEvent("onExternalDragIn", [f, n, i]) || (this._drag_mode = this._drag_id = null, this.deleteEvent(f)); + }), l = e.getActionData(i), h = { start_date: new Date(l.date) }; if (e.matrix && e.matrix[e._mode]) { - var u = e.matrix[e._mode]; - c[u.y_property] = s.section; - var v = e._locate_cell_timeline(h); - c.start_date = u._trace_x[v.x], c.end_date = e.date.add(c.start_date, u.x_step, u.x_unit); + var v = e.matrix[e._mode]; + h[v.y_property] = l.section; + var u = e._locate_cell_timeline(i); + h.start_date = v._trace_x[u.x], h.end_date = e.date.add(h.start_date, v.x_step, v.x_unit); } - e._props && e._props[e._mode] && (c[e._props[e._mode].map_to] = s.section), e.addEventNow(c), e.detachEvent(n); + e._props && e._props[e._mode] && (h[e._props[e._mode].map_to] = l.section), e.addEventNow(h), e.detachEvent(o); } } - a.stopDrag = function(i) { - return h = i, r.apply(this, arguments); - }, a.addDragLanding(e._els.dhx_cal_data[0], { _drag: function(i, _, o, t) { - d(i, _, o, t); - }, _dragIn: function(i, _) { - return i; - }, _dragOut: function(i) { + t.stopDrag = function(n) { + return i = n, r.apply(this, arguments); + }, t.addDragLanding(e._els.dhx_cal_data[0], { _drag: function(n, s, _, a) { + d(n, s, _, a); + }, _dragIn: function(n, s) { + return n; + }, _dragOut: function(n) { return this; - } }), dhtmlx.DragControl && dhtmlx.DragControl.addDrop(e._els.dhx_cal_data[0], { onDrop: function(i, _, o, t) { - var n = dhtmlx.DragControl.getMaster(i); - h = t, d(i, n, _, t.target || t.srcElement); - }, onDragIn: function(i, _, o) { - return _; + } }), dhtmlx.DragControl && dhtmlx.DragControl.addDrop(e._els.dhx_cal_data[0], { onDrop: function(n, s, _, a) { + var o = dhtmlx.DragControl.getMaster(n); + i = a, d(n, o, s, a.target || a.srcElement); + }, onDragIn: function(n, s, _) { + return s; } }, !0); }); }, pdf: function(e) { - var h, a, r = new RegExp("<[^>]*>", "g"), d = new RegExp("]*>", "g"); - function i(b) { + var i, t, r = new RegExp("<[^>]*>", "g"), d = new RegExp("]*>", "g"); + function n(b) { return b.replace(d, ` `).replace(r, ""); } - function _(b, k) { + function s(b, k) { b = parseFloat(b), k = parseFloat(k), isNaN(k) || (b -= k); - var E = t(b); - return b = b - E.width + E.cols * h, isNaN(b) ? "auto" : 100 * b / h; + var E = a(b); + return b = b - E.width + E.cols * i, isNaN(b) ? "auto" : 100 * b / i; } - function o(b, k, E) { + function _(b, k, E) { b = parseFloat(b), k = parseFloat(k), !isNaN(k) && E && (b -= k); - var D = t(b); - return b = b - D.width + D.cols * h, isNaN(b) ? "auto" : 100 * b / (h - (isNaN(k) ? 0 : k)); + var D = a(b); + return b = b - D.width + D.cols * i, isNaN(b) ? "auto" : 100 * b / (i - (isNaN(k) ? 0 : k)); } - function t(b) { - for (var k = 0, E = e._els.dhx_cal_header[0].childNodes, D = E[1] ? E[1].childNodes : E[0].childNodes, x = 0; x < D.length; x++) { - var S = D[x].style ? D[x] : D[x].parentNode, N = parseFloat(S.style.width); + function a(b) { + for (var k = 0, E = e._els.dhx_cal_header[0].childNodes, D = E[1] ? E[1].childNodes : E[0].childNodes, w = 0; w < D.length; w++) { + var S = D[w].style ? D[w] : D[w].parentNode, N = parseFloat(S.style.width); if (!(b > N)) break; b -= N + 1, k += N + 1; } - return { width: k, cols: x }; + return { width: k, cols: w }; } - function n(b) { - return b = parseFloat(b), isNaN(b) ? "auto" : 100 * b / a; + function o(b) { + return b = parseFloat(b), isNaN(b) ? "auto" : 100 * b / t; } - function s(b, k) { + function l(b, k) { return (window.getComputedStyle ? window.getComputedStyle(b, null)[k] : b.currentStyle ? b.currentStyle[k] : null) || ""; } - function c(b, k) { + function h(b, k) { for (var E = parseInt(b.style.left, 10), D = 0; D < e._cols.length; D++) if ((E -= e._cols[D]) < 0) return D; return k; } - function u(b, k) { + function v(b, k) { for (var E = parseInt(b.style.top, 10), D = 0; D < e._colsS.heights.length; D++) if (e._colsS.heights[D] > E) return D; return k; } - function v(b) { + function u(b) { return b ? "" : ""; } - function m(b, k, E, D) { - var x = "<" + b + " profile='" + k + "'"; - return E && (x += " header='" + E + "'"), D && (x += " footer='" + D + "'"), x += ">"; + function f(b, k, E, D) { + var w = "<" + b + " profile='" + k + "'"; + return E && (w += " header='" + E + "'"), D && (w += " footer='" + D + "'"), w += ">"; } - function l() { + function c() { var b = "", k = e._mode; if (e.matrix && e.matrix[e._mode] && (k = e.matrix[e._mode].render == "cell" ? "matrix" : "timeline"), b += "", e._mode == "week_agenda") for (var E = e._els.dhx_cal_data[0].getElementsByTagName("DIV"), D = 0; D < E.length; D++) - E[D].className == "dhx_wa_scale_bar" && (b += "" + i(E[D].innerHTML) + ""); + E[D].className == "dhx_wa_scale_bar" && (b += "" + n(E[D].innerHTML) + ""); else if (e._mode == "agenda" || e._mode == "map") - b += "" + i((E = e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML) + "" + i(E[1].innerHTML) + ""; + b += "" + n((E = e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML) + "" + n(E[1].innerHTML) + ""; else if (e._mode == "year") for (E = e._els.dhx_cal_data[0].childNodes, D = 0; D < E.length; D++) - b += "", b += g(E[D].querySelector(".dhx_year_week").childNodes), b += f(E[D].querySelector(".dhx_year_body")), b += ""; + b += "", b += m(E[D].querySelector(".dhx_year_week").childNodes), b += p(E[D].querySelector(".dhx_year_body")), b += ""; else { - b += "", b += g(E = e._els.dhx_cal_header[0].childNodes), b += ""; - var x = e._els.dhx_cal_data[0]; + b += "", b += m(E = e._els.dhx_cal_header[0].childNodes), b += ""; + var w = e._els.dhx_cal_data[0]; if (e.matrix && e.matrix[e._mode]) { - for (b += "", D = 0; D < x.firstChild.rows.length; D++) - b += ""; - b += "", a = x.firstChild.rows[0].cells[0].offsetHeight; - } else if (x.firstChild.tagName == "TABLE") - b += f(x); + for (b += "", D = 0; D < w.firstChild.rows.length; D++) + b += ""; + b += "", t = w.firstChild.rows[0].cells[0].offsetHeight; + } else if (w.firstChild.tagName == "TABLE") + b += p(w); else { - for (x = x.childNodes[x.childNodes.length - 1]; x.className.indexOf("dhx_scale_holder") == -1; ) - x = x.previousSibling; - for (x = x.childNodes, b += "", D = 0; D < x.length; D++) + for (w = w.childNodes[w.childNodes.length - 1]; w.className.indexOf("dhx_scale_holder") == -1; ) + w = w.previousSibling; + for (w = w.childNodes, b += "", D = 0; D < w.length; D++) b += ` -"; - b += "", a = x[0].offsetHeight; +"; + b += "", t = w[0].offsetHeight; } } return b += ""; } - function f(b) { + function p(b) { for (var k = "", E = b.querySelectorAll("tr"), D = 0; D < E.length; D++) { - for (var x = [], S = E[D].querySelectorAll("td"), N = 0; N < S.length; N++) - x.push(S[N].querySelector(".dhx_month_head").innerHTML); + for (var w = [], S = E[D].querySelectorAll("td"), N = 0; N < S.length; N++) + w.push(S[N].querySelector(".dhx_month_head").innerHTML); k += ` -", a = S[0].offsetHeight; +", t = S[0].offsetHeight; } return k; } - function g(b) { + function m(b) { var k, E = ""; e.matrix && e.matrix[e._mode] && (e.matrix[e._mode].second_scale && (k = b[1].childNodes), b = b[0].childNodes); for (var D = 0; D < b.length; D++) E += ` -"; - if (h = b[0].offsetWidth, k) { - var x = 0, S = b[0].offsetWidth, N = 1; +"; + if (i = b[0].offsetWidth, k) { + var w = 0, S = b[0].offsetWidth, N = 1; for (D = 0; D < k.length; D++) E += ` -", (x += k[D].offsetWidth) >= S && (S += b[N] ? b[N].offsetWidth : 0, N++), h = k[0].offsetWidth; +", (w += k[D].offsetWidth) >= S && (S += b[N] ? b[N].offsetWidth : 0, N++), i = k[0].offsetWidth; } return E; } - function p(b) { + function g(b) { var k = "", E = e._rendered, D = e.matrix && e.matrix[e._mode]; if (e._mode == "agenda" || e._mode == "map") - for (var x = 0; x < E.length; x++) - k += ""; + for (var w = 0; w < E.length; w++) + k += ""; else if (e._mode == "week_agenda") - for (x = 0; x < E.length; x++) - k += "" + i(E[x].innerHTML) + ""; + for (w = 0; w < E.length; w++) + k += "" + n(E[w].innerHTML) + ""; else if (e._mode == "year") - for (E = e.get_visible_events(), x = 0; x < E.length; x++) { - var S = E[x].start_date; - for (S.valueOf() < e._min_date.valueOf() && (S = e._min_date); S < E[x].end_date; ) { - var N = S.getMonth() + 12 * (S.getFullYear() - e._min_date.getFullYear()) - e.week_starts._month, M = e.week_starts[N] + S.getDate() - 1, A = b ? s(e._get_year_cell(S), "color") : "", C = b ? s(e._get_year_cell(S), "backgroundColor") : ""; - if (k += "", (S = e.date.add(S, 1, "day")).valueOf() >= e._max_date.valueOf()) + for (E = e.get_visible_events(), w = 0; w < E.length; w++) { + var S = E[w].start_date; + for (S.valueOf() < e._min_date.valueOf() && (S = e._min_date); S < E[w].end_date; ) { + var N = S.getMonth() + 12 * (S.getFullYear() - e._min_date.getFullYear()) - e.week_starts._month, M = e.week_starts[N] + S.getDate() - 1, T = b ? l(e._get_year_cell(S), "color") : "", A = b ? l(e._get_year_cell(S), "backgroundColor") : ""; + if (k += "", (S = e.date.add(S, 1, "day")).valueOf() >= e._max_date.valueOf()) break; } } else if (D && D.render == "cell") - for (E = e._els.dhx_cal_data[0].getElementsByTagName("TD"), x = 0; x < E.length; x++) - A = b ? s(E[x], "color") : "", k += ` -"; + for (E = e._els.dhx_cal_data[0].getElementsByTagName("TD"), w = 0; w < E.length; w++) + T = b ? l(E[w], "color") : "", k += ` +"; else - for (x = 0; x < E.length; x++) { - var T, O; + for (w = 0; w < E.length; w++) { + var H, $; if (e.matrix && e.matrix[e._mode]) - T = _(E[x].style.left), O = _(E[x].offsetWidth) - 1; + H = s(E[w].style.left), $ = s(E[w].offsetWidth) - 1; else { - var L = e.config.use_select_menu_space ? 0 : 26; - T = o(E[x].style.left, L, !0), O = o(E[x].style.width, L) - 1; + var j = e.config.use_select_menu_space ? 0 : 26; + H = _(E[w].style.left, j, !0), $ = _(E[w].style.width, j) - 1; } - if (!isNaN(1 * O)) { - var H = n(E[x].style.top), P = n(E[x].style.height), z = E[x].className.split(" ")[0].replace("dhx_cal_", ""); - if (z !== "dhx_tooltip_line") { - var $ = e.getEvent(E[x].getAttribute(e.config.event_attribute)); - if ($) { - M = $._sday; - var j = $._sweek, F = $._length || 0; + if (!isNaN(1 * $)) { + var z = o(E[w].style.top), W = o(E[w].style.height), Y = E[w].className.split(" ")[0].replace("dhx_cal_", ""); + if (Y !== "dhx_tooltip_line") { + var q = e.getEvent(E[w].getAttribute(e.config.event_attribute)); + if (q) { + M = q._sday; + var V = q._sweek, ve = q._length || 0; if (e._mode == "month") - P = parseInt(E[x].offsetHeight, 10), H = parseInt(E[x].style.top, 10) - e.xy.month_head_height, M = c(E[x], M), j = u(E[x], j); + W = parseInt(E[w].offsetHeight, 10), z = parseInt(E[w].style.top, 10) - e.xy.month_head_height, M = h(E[w], M), V = v(E[w], V); else if (e.matrix && e.matrix[e._mode]) { - M = 0, j = E[x].parentNode.parentNode.parentNode.rowIndex; - var U = a; - a = E[x].parentNode.offsetHeight, H = n(E[x].style.top), H -= 0.2 * H, a = U; + M = 0, V = E[w].parentNode.parentNode.parentNode.rowIndex; + var Ne = t; + t = E[w].parentNode.offsetHeight, z = o(E[w].style.top), z -= 0.2 * z, t = Ne; } else { - if (E[x].parentNode == e._els.dhx_cal_data[0]) + if (E[w].parentNode == e._els.dhx_cal_data[0]) continue; - var J = e._els.dhx_cal_data[0].childNodes[0], se = parseFloat(J.className.indexOf("dhx_scale_holder") != -1 ? J.style.left : 0); - T += _(E[x].parentNode.style.left, se); + var xe = e._els.dhx_cal_data[0].childNodes[0], St = parseFloat(xe.className.indexOf("dhx_scale_holder") != -1 ? xe.style.left : 0); + H += s(E[w].parentNode.style.left, St); } k += ` -", z == "event" ? (k += "
", A = b ? s(E[x].childNodes[2], "color") : "", k += "") : (A = b ? s(E[x], "color") : "", k += ""), k += "
"; +", Y == "event" ? (k += "
", T = b ? l(E[w].childNodes[2], "color") : "", k += "") : (T = b ? l(E[w], "color") : "", k += ""), k += "
"; } } } } return k; } - function y(b, k, E, D, x, S) { + function y(b, k, E, D, w, S) { var N = !1; D == "fullcolor" && (N = !0, D = "color"), D = D || "color"; - var M, A = ""; + var M, T = ""; if (b) { - var C = e._date, T = e._mode; - k = e.date[E + "_start"](k), k = e.date["get_" + E + "_end"] ? e.date["get_" + E + "_end"](k) : e.date.add(k, 1, E), A = m("pages", D, x, S); - for (var O = new Date(b); +O < +k; O = this.date.add(O, 1, E)) - this.setCurrentView(O, E), A += ((M = "page") ? "<" + M + ">" : "") + l().replace("–", "-") + p(N) + v("page"); - A += v("pages"), this.setCurrentView(C, T); + var A = e._date, H = e._mode; + k = e.date[E + "_start"](k), k = e.date["get_" + E + "_end"] ? e.date["get_" + E + "_end"](k) : e.date.add(k, 1, E), T = f("pages", D, w, S); + for (var $ = new Date(b); +$ < +k; $ = this.date.add($, 1, E)) + this.setCurrentView($, E), T += ((M = "page") ? "<" + M + ">" : "") + c().replace("–", "-") + g(N) + u("page"); + T += u("pages"), this.setCurrentView(A, H); } else - A = m("data", D, x, S) + l().replace("–", "-") + p(N) + v("data"); - return A; - } - function w(b, k, E, D, x, S, N) { - (function(M, A) { - var C = e.uid(), T = document.createElement("div"); - T.style.display = "none", document.body.appendChild(T), T.innerHTML = '
', document.getElementById(C).firstChild.value = encodeURIComponent(M), document.getElementById(C).submit(), T.parentNode.removeChild(T); - })(typeof x == "object" ? function(M) { - for (var A = "", C = 0; C < M.length; C++) - A += M[C].source.getPDFData(M[C].start, M[C].end, M[C].view, M[C].mode, M[C].header, M[C].footer); - return A += "", A; - }(x) : y.apply(this, [b, k, E, x, S, N]), D); + T = f("data", D, w, S) + c().replace("–", "-") + g(N) + u("data"); + return T; + } + function x(b, k, E, D, w, S, N) { + (function(M, T) { + var A = e.uid(), H = document.createElement("div"); + H.style.display = "none", document.body.appendChild(H), H.innerHTML = '
', document.getElementById(A).firstChild.value = encodeURIComponent(M), document.getElementById(A).submit(), H.parentNode.removeChild(H); + })(typeof w == "object" ? function(M) { + for (var T = "", A = 0; A < M.length; A++) + T += M[A].source.getPDFData(M[A].start, M[A].end, M[A].view, M[A].mode, M[A].header, M[A].footer); + return T += "", T; + }(w) : y.apply(this, [b, k, E, w, S, N]), D); } e.getPDFData = y, e.toPDF = function(b, k, E, D) { - return w.apply(this, [null, null, null, b, k, E, D]); - }, e.toPDFRange = function(b, k, E, D, x, S, N) { - return typeof b == "string" && (b = e.templates.api_date(b), k = e.templates.api_date(k)), w.apply(this, arguments); + return x.apply(this, [null, null, null, b, k, E, D]); + }, e.toPDFRange = function(b, k, E, D, w, S, N) { + return typeof b == "string" && (b = e.templates.api_date(b), k = e.templates.api_date(k)), x.apply(this, arguments); }; }, quick_info: function(e) { - e.config.icons_select = ["icon_form", "icon_delete"], e.config.details_on_create = !0, e.config.show_quick_info = !0, e.xy.menu_width = 0, e.attachEvent("onClick", function(h) { + e.config.icons_select = ["icon_form", "icon_delete"], e.config.details_on_create = !0, e.config.show_quick_info = !0, e.xy.menu_width = 0; + let i = null; + function t(d) { + const n = d.getBoundingClientRect(), s = e.$container.getBoundingClientRect().bottom - n.bottom; + s < 0 && (d.style.top = `${parseFloat(d.style.top) + s}px`); + } + function r(d) { + let n = 0, s = 0, _ = d; + for (; _ && _ != e._obj; ) + n += _.offsetLeft, s += _.offsetTop - _.scrollTop, _ = _.offsetParent; + return _ ? { left: n, top: s, dx: n + d.offsetWidth / 2 > e._x / 2 ? 1 : 0, dy: s + d.offsetHeight / 2 > e._y / 2 ? 1 : 0, width: d.offsetWidth, height: d.offsetHeight } : 0; + } + e.attachEvent("onSchedulerReady", function() { + const d = e.$container; + d._$quickInfoHandler || (d._$quickInfoHandler = !0, e.event(d, "mousedown", function(n) { + const s = n.target.closest(`[${e.config.event_attribute}]`); + s && (i = { id: s.getAttribute(e.config.event_attribute), position: r(s) }); + }), e.attachEvent("onDestroy", () => { + delete d._$quickInfoHandler; + })); + }), e.attachEvent("onClick", function(d) { if (e.config.show_quick_info) - return e.showQuickInfo(h), !0; + return e.showQuickInfo(d), !0; }), function() { - for (var h = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"], a = function() { + for (var d = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"], n = function() { return e.hideQuickInfo(!0), !0; - }, r = 0; r < h.length; r++) - e.attachEvent(h[r], a); - }(), e.templates.quick_info_title = function(h, a, r) { - return r.text.substr(0, 50); - }, e.templates.quick_info_content = function(h, a, r) { - return r.details || ""; - }, e.templates.quick_info_date = function(h, a, r) { - return e.isOneDayEvent(r) && e.config.rtl ? e.templates.day_date(h, a, r) + " " + e.templates.event_header(a, h, r) : e.isOneDayEvent(r) ? e.templates.day_date(h, a, r) + " " + e.templates.event_header(h, a, r) : e.config.rtl ? e.templates.week_date(a, h, r) : e.templates.week_date(h, a, r); - }, e.showQuickInfo = function(h) { - if (h != this._quick_info_box_id && (this.hideQuickInfo(!0), this.callEvent("onBeforeQuickInfo", [h]) !== !1)) { - var a = this._get_event_counter_part(h); - a && (this._quick_info_box = this._init_quick_info(a), this._fill_quick_data(h), this._show_quick_info(a), this.callEvent("onQuickInfo", [h])); - } + }, s = 0; s < d.length; s++) + e.attachEvent(d[s], n); + }(), e.templates.quick_info_title = function(d, n, s) { + return s.text.substr(0, 50); + }, e.templates.quick_info_content = function(d, n, s) { + return s.details || ""; + }, e.templates.quick_info_date = function(d, n, s) { + return e.isOneDayEvent(s) && e.config.rtl ? e.templates.day_date(d, n, s) + " " + e.templates.event_header(n, d, s) : e.isOneDayEvent(s) ? e.templates.day_date(d, n, s) + " " + e.templates.event_header(d, n, s) : e.config.rtl ? e.templates.week_date(n, d, s) : e.templates.week_date(d, n, s); + }, e.showQuickInfo = function(d) { + if (d == this._quick_info_box_id || (this.hideQuickInfo(!0), this.callEvent("onBeforeQuickInfo", [d]) === !1)) + return; + let n; + n = i && i.id == d ? i.position : this._get_event_counter_part(d), n && (this._quick_info_box = this._init_quick_info(n), this._fill_quick_data(d), this._show_quick_info(n), this.callEvent("onQuickInfo", [d])); }, function() { - function h(a) { - a = a || ""; - var r, d = parseFloat(a), i = a.match(/m?s/); - switch (i && (i = i[0]), i) { + function d(n) { + n = n || ""; + var s, _ = parseFloat(n), a = n.match(/m?s/); + switch (a && (a = a[0]), a) { case "s": - r = 1e3 * d; + s = 1e3 * _; break; case "ms": - r = d; + s = _; break; default: - r = 0; + s = 0; } - return r; + return s; } - e.hideQuickInfo = function(a) { - var r = this._quick_info_box, d = this._quick_info_box_id; - if (this._quick_info_box_id = 0, r && r.parentNode) { - var i = r.offsetWidth; + e.hideQuickInfo = function(n) { + var s = this._quick_info_box, _ = this._quick_info_box_id; + if (this._quick_info_box_id = 0, s && s.parentNode) { + var a = s.offsetWidth; if (e.config.quick_info_detached) - return this.callEvent("onAfterQuickInfo", [d]), r.parentNode.removeChild(r); - if (r.style.right == "auto" ? r.style.left = -i + "px" : r.style.right = -i + "px", a) - r.parentNode.removeChild(r); + return this.callEvent("onAfterQuickInfo", [_]), s.parentNode.removeChild(s); + if (s.style.right == "auto" ? s.style.left = -a + "px" : s.style.right = -a + "px", n) + s.parentNode.removeChild(s); else { - var _; - window.getComputedStyle ? _ = window.getComputedStyle(r, null) : r.currentStyle && (_ = r.currentStyle); - var o = h(_["transition-delay"]) + h(_["transition-duration"]); + var o; + window.getComputedStyle ? o = window.getComputedStyle(s, null) : s.currentStyle && (o = s.currentStyle); + var l = d(o["transition-delay"]) + d(o["transition-duration"]); setTimeout(function() { - r.parentNode && r.parentNode.removeChild(r); - }, o); + s.parentNode && s.parentNode.removeChild(s); + }, l); } - this.callEvent("onAfterQuickInfo", [d]); + this.callEvent("onAfterQuickInfo", [_]); } }; - }(), e.event(window, "keydown", function(h) { - h.keyCode == 27 && e.hideQuickInfo(); - }), e._show_quick_info = function(h) { - var a = e._quick_info_box; - e._obj.appendChild(a); - var r = a.offsetWidth, d = a.offsetHeight; + }(), e.event(window, "keydown", function(d) { + d.keyCode == 27 && e.hideQuickInfo(); + }), e._show_quick_info = function(d) { + var n = e._quick_info_box; + e._obj.appendChild(n); + var s = n.offsetWidth, _ = n.offsetHeight; if (e.config.quick_info_detached) { - var i = h.left - h.dx * (r - h.width); - e.getView() && e.getView()._x_scroll && (e.config.rtl ? i += e.getView()._x_scroll : i -= e.getView()._x_scroll), i + r > window.innerWidth && (i = window.innerWidth - r), i = Math.max(0, i), a.style.left = i + "px", a.style.top = h.top - (h.dy ? d : -h.height) + "px"; + var a = d.left - d.dx * (s - d.width); + e.getView() && e.getView()._x_scroll && (e.config.rtl ? a += e.getView()._x_scroll : a -= e.getView()._x_scroll), a + s > window.innerWidth && (a = window.innerWidth - s), a = Math.max(0, a), n.style.left = a + "px", n.style.top = d.top - (d.dy ? _ : -d.height) + "px"; } else { - const _ = e.$container.querySelector(".dhx_cal_data").offsetTop; - a.style.top = _ + 20 + "px", h.dx == 1 ? (a.style.right = "auto", a.style.left = -r + "px", setTimeout(function() { - a.style.left = "-10px"; - }, 1)) : (a.style.left = "auto", a.style.right = -r + "px", setTimeout(function() { - a.style.right = "-10px"; - }, 1)), a.className = a.className.replace(" dhx_qi_left", "").replace(" dhx_qi_right", "") + " dhx_qi_" + (h.dx == 1 ? "left" : "right"); - } + const o = e.$container.querySelector(".dhx_cal_data").offsetTop; + n.style.top = o + 20 + "px", d.dx == 1 ? (n.style.right = "auto", n.style.left = -s + "px", setTimeout(function() { + n.style.left = "-10px"; + }, 1)) : (n.style.left = "auto", n.style.right = -s + "px", setTimeout(function() { + n.style.right = "-10px"; + }, 1)), n.className = n.className.replace(" dhx_qi_left", "").replace(" dhx_qi_right", "") + " dhx_qi_" + (d.dx == 1 ? "left" : "right"); + } + n.ontransitionend = () => { + t(n), n.ontransitionend = null; + }, setTimeout(() => { + t(n); + }, 1); }, e.attachEvent("onTemplatesReady", function() { if (e.hideQuickInfo(), this._quick_info_box) { - var h = this._quick_info_box; - h.parentNode && h.parentNode.removeChild(h), this._quick_info_box = null; + var d = this._quick_info_box; + d.parentNode && d.parentNode.removeChild(d), this._quick_info_box = null; } - }), e._quick_info_onscroll_handler = function(h) { + }), e._quick_info_onscroll_handler = function(d) { e.hideQuickInfo(); }, e._init_quick_info = function() { if (!this._quick_info_box) { - var h = this._quick_info_box = document.createElement("div"); - this._waiAria.quickInfoAttr(h), h.className = "dhx_cal_quick_info", e.$testmode && (h.className += " dhx_no_animate"), e.config.rtl && (h.className += " dhx_quick_info_rtl"); - var a = ` + var d = this._quick_info_box = document.createElement("div"); + this._waiAria.quickInfoAttr(d), d.className = "dhx_cal_quick_info", e.$testmode && (d.className += " dhx_no_animate"), e.config.rtl && (d.className += " dhx_quick_info_rtl"); + var n = `
@@ -7242,207 +9029,712 @@ const lt = { active_links: function(e) {
`; - a += '
'; - for (var r = e.config.icons_select, d = 0; d < r.length; d++) - a += `
-
${e.locale.labels[r[d]]}
`; - a += "
", h.innerHTML = a, e.event(h, "click", function(i) { - e._qi_button_click(i.target || i.srcElement); + n += '
'; + for (var s = e.config.icons_select, _ = 0; _ < s.length; _++) + n += `
+
${e.locale.labels[s[_]]}
`; + n += "
", d.innerHTML = n, e.event(d, "click", function(a) { + e._qi_button_click(a.target || a.srcElement); }), e.config.quick_info_detached && (e._detachDomEvent(e._els.dhx_cal_data[0], "scroll", e._quick_info_onscroll_handler), e.event(e._els.dhx_cal_data[0], "scroll", e._quick_info_onscroll_handler)); } return this._quick_info_box; - }, e._qi_button_click = function(h) { - var a = e._quick_info_box; - if (h && h != a) - if (h.closest(".dhx_cal_qi_close_btn")) + }, e._qi_button_click = function(d) { + var n = e._quick_info_box; + if (d && d != n) + if (d.closest(".dhx_cal_qi_close_btn")) e.hideQuickInfo(); else { - var r = e._getClassName(h); - if (r.indexOf("_icon") != -1) { - var d = e._quick_info_box_id; - e._click.buttons[r.split(" ")[1].replace("icon_", "")](d); + var s = e._getClassName(d); + if (s.indexOf("_icon") != -1) { + var _ = e._quick_info_box_id; + e._click.buttons[s.split(" ")[1].replace("icon_", "")](_); } else - e._qi_button_click(h.parentNode); - } - }, e._get_event_counter_part = function(h) { - for (var a = e.getRenderedEvent(h), r = 0, d = 0, i = a; i && i != e._obj; ) - r += i.offsetLeft, d += i.offsetTop - i.scrollTop, i = i.offsetParent; - return i ? { left: r, top: d, dx: r + a.offsetWidth / 2 > e._x / 2 ? 1 : 0, dy: d + a.offsetHeight / 2 > e._y / 2 ? 1 : 0, width: a.offsetWidth, height: a.offsetHeight } : 0; - }, e._fill_quick_data = function(h) { - var a = e.getEvent(h), r = e._quick_info_box; - e._quick_info_box_id = h; - var d = { content: e.templates.quick_info_title(a.start_date, a.end_date, a), date: e.templates.quick_info_date(a.start_date, a.end_date, a) }; - r.querySelector(".dhx_cal_qi_tcontent").innerHTML = `${d.content}`, r.querySelector(".dhx_cal_qi_tdate").innerHTML = d.date, e._waiAria.quickInfoHeader(r, [d.content, d.date].join(" ")); - var i = r.querySelector(".dhx_cal_qi_content"); - const _ = e.templates.quick_info_content(a.start_date, a.end_date, a); - _ ? (i.classList.remove("dhx_hidden"), i.innerHTML = _) : i.classList.add("dhx_hidden"); + e._qi_button_click(d.parentNode); + } + }, e._get_event_counter_part = function(d) { + return r(e.getRenderedEvent(d)); + }, e._fill_quick_data = function(d) { + var n = e.getEvent(d), s = e._quick_info_box; + e._quick_info_box_id = d; + var _ = { content: e.templates.quick_info_title(n.start_date, n.end_date, n), date: e.templates.quick_info_date(n.start_date, n.end_date, n) }; + s.querySelector(".dhx_cal_qi_tcontent").innerHTML = `${_.content}`, s.querySelector(".dhx_cal_qi_tdate").innerHTML = _.date, e._waiAria.quickInfoHeader(s, [_.content, _.date].join(" ")); + var a = s.querySelector(".dhx_cal_qi_content"); + const o = e.templates.quick_info_content(n.start_date, n.end_date, n); + o ? (a.classList.remove("dhx_hidden"), a.innerHTML = o) : a.classList.add("dhx_hidden"); }; }, readonly: function(e) { e.attachEvent("onTemplatesReady", function() { - var h; - e.form_blocks.recurring && (h = e.form_blocks.recurring.set_value); - var a = e.config.buttons_left.slice(), r = e.config.buttons_right.slice(); - function d(o, t, n, s) { - for (var c = t.getElementsByTagName(o), u = n.getElementsByTagName(o), v = u.length - 1; v >= 0; v--) - if (n = u[v], s) { - var m = document.createElement("span"); - m.className = "dhx_text_disabled", m.innerHTML = s(c[v]), n.parentNode.insertBefore(m, n), n.parentNode.removeChild(n); + var i; + e.form_blocks.recurring && (i = e.form_blocks.recurring.set_value); + var t = e.config.buttons_left.slice(), r = e.config.buttons_right.slice(); + function d(_, a, o, l) { + for (var h = a.getElementsByTagName(_), v = o.getElementsByTagName(_), u = v.length - 1; u >= 0; u--) + if (o = v[u], l) { + var f = document.createElement("span"); + f.className = "dhx_text_disabled", f.innerHTML = l(h[u]), o.parentNode.insertBefore(f, o), o.parentNode.removeChild(o); } else - n.disabled = !0, t.checked && (n.checked = !0); + o.disabled = !0, a.checked && (o.checked = !0); } - e.attachEvent("onBeforeLightbox", function(o) { - this.config.readonly_form || this.getEvent(o).readonly ? this.config.readonly_active = !0 : (this.config.readonly_active = !1, e.config.buttons_left = a.slice(), e.config.buttons_right = r.slice(), e.form_blocks.recurring && (e.form_blocks.recurring.set_value = h)); - var t = this.config.lightbox.sections; + e.attachEvent("onBeforeLightbox", function(_) { + this.config.readonly_form || this.getEvent(_).readonly ? this.config.readonly_active = !0 : (this.config.readonly_active = !1, e.config.buttons_left = t.slice(), e.config.buttons_right = r.slice(), e.form_blocks.recurring && (e.form_blocks.recurring.set_value = i)); + var a = this.config.lightbox.sections; if (this.config.readonly_active) { - for (var n = 0; n < t.length; n++) - t[n].type == "recurring" && this.config.readonly_active && e.form_blocks.recurring && (e.form_blocks.recurring.set_value = function(g, p, y) { - var w = e.$domHelpers.closest(g, ".dhx_wrap_section"), b = "none"; - w.querySelector(".dhx_cal_lsection").display = b, w.querySelector(".dhx_form_repeat").display = b, w.style.display = b, e.setLightboxSize(); + for (var o = 0; o < a.length; o++) + a[o].type == "recurring" && this.config.readonly_active && e.form_blocks.recurring && (e.form_blocks.recurring.set_value = function(m, g, y) { + var x = e.$domHelpers.closest(m, ".dhx_wrap_section"), b = "none"; + x.querySelector(".dhx_cal_lsection").display = b, x.querySelector(".dhx_form_repeat").display = b, x.style.display = b, e.setLightboxSize(); }); - var s = ["dhx_delete_btn", "dhx_save_btn"], c = [e.config.buttons_left, e.config.buttons_right]; - for (n = 0; n < s.length; n++) - for (var u = s[n], v = 0; v < c.length; v++) { - for (var m = c[v], l = -1, f = 0; f < m.length; f++) - if (m[f] == u) { - l = f; + var l = ["dhx_delete_btn", "dhx_save_btn"], h = [e.config.buttons_left, e.config.buttons_right]; + for (o = 0; o < l.length; o++) + for (var v = l[o], u = 0; u < h.length; u++) { + for (var f = h[u], c = -1, p = 0; p < f.length; p++) + if (f[p] == v) { + c = p; break; } - l != -1 && m.splice(l, 1); + c != -1 && f.splice(c, 1); } } return this.resetLightbox(), !0; }); - var i = e._fill_lightbox; + var n = e._fill_lightbox; e._fill_lightbox = function() { - var o = this.getLightbox(); - this.config.readonly_active && (o.style.visibility = "hidden", o.style.display = "block"); - var t = i.apply(this, arguments); - if (this.config.readonly_active && (o.style.visibility = "", o.style.display = "none"), this.config.readonly_active) { - var n = this.getLightbox(), s = this._lightbox_r = n.cloneNode(!0); - s.id = e.uid(), s.className += " dhx_cal_light_readonly", d("textarea", n, s, function(c) { - return c.value; - }), d("input", n, s, !1), d("select", n, s, function(c) { - return c.options.length ? c.options[Math.max(c.selectedIndex || 0, 0)].text : ""; - }), n.parentNode.insertBefore(s, n), this.showCover(s), e._lightbox && e._lightbox.parentNode.removeChild(e._lightbox), this._lightbox = s, e.config.drag_lightbox && e.event(s.firstChild, "mousedown", e._ready_to_dnd), e._init_lightbox_events(), this.setLightboxSize(); + var _ = this.getLightbox(); + this.config.readonly_active && (_.style.visibility = "hidden", _.style.display = "block"); + var a = n.apply(this, arguments); + if (this.config.readonly_active && (_.style.visibility = "", _.style.display = "none"), this.config.readonly_active) { + var o = this.getLightbox(), l = this._lightbox_r = o.cloneNode(!0); + l.id = e.uid(), l.className += " dhx_cal_light_readonly", d("textarea", o, l, function(h) { + return h.value; + }), d("input", o, l, !1), d("select", o, l, function(h) { + return h.options.length ? h.options[Math.max(h.selectedIndex || 0, 0)].text : ""; + }), o.parentNode.insertBefore(l, o), this.showCover(l), e._lightbox && e._lightbox.parentNode.removeChild(e._lightbox), this._lightbox = l, e.config.drag_lightbox && e.event(l.firstChild, "mousedown", e._ready_to_dnd), e._init_lightbox_events(), this.setLightboxSize(); } - return t; + return a; }; - var _ = e.hide_lightbox; + var s = e.hide_lightbox; e.hide_lightbox = function() { - return this._lightbox_r && (this._lightbox_r.parentNode.removeChild(this._lightbox_r), this._lightbox_r = this._lightbox = null), _.apply(this, arguments); + return this._lightbox_r && (this._lightbox_r.parentNode.removeChild(this._lightbox_r), this._lightbox_r = this._lightbox = null), s.apply(this, arguments); }; }); }, recurring: function(e) { - function h() { - var i = e.formSection("recurring"); - if (i || (i = a("recurring")), !i) + function i(u) { + return new Date(u.getFullYear(), u.getMonth(), u.getDate(), u.getHours(), u.getMinutes(), u.getSeconds(), 0); + } + function t(u) { + return !!u.rrule && !u.recurring_event_id; + } + var r; + function d() { + const u = {}; + for (const f in e._events) { + const c = e._events[f]; + c.recurring_event_id && (u[c.recurring_event_id] || (u[c.recurring_event_id] = {}), u[c.recurring_event_id][c.original_start.valueOf()] = c); + } + return u; + } + e._rec_temp = [], e._rec_markers_pull = {}, e._rec_markers = {}, e._add_rec_marker = function(u, f) { + u._pid_time = f, this._rec_markers[u.id] = u, this._rec_markers_pull[u.event_pid] || (this._rec_markers_pull[u.event_pid] = {}), this._rec_markers_pull[u.event_pid][f] = u; + }, e._get_rec_marker = function(u, f) { + let c = this._rec_markers_pull[f]; + return c ? c[u] : null; + }, e._get_rec_markers = function(u) { + return this._rec_markers_pull[u] || []; + }, r = e.addEvent, e.addEvent = function(u, f, c, p, m) { + var g = r.apply(this, arguments); + if (g && e.getEvent(g)) { + var y = e.getEvent(g); + y.start_date && (y.start_date = i(y.start_date)), y.end_date && (y.end_date = i(y.end_date)); + } + return g; + }, e.attachEvent("onEventLoading", function(u) { + return u.original_start && (u.original_start = e.templates.parse_date(u.original_start)), !0; + }), e.attachEvent("onEventIdChange", function(u, f) { + if (!this._ignore_call) { + this._ignore_call = !0, e._rec_markers[u] && (e._rec_markers[f] = e._rec_markers[u], delete e._rec_markers[u]), e._rec_markers_pull[u] && (e._rec_markers_pull[f] = e._rec_markers_pull[u], delete e._rec_markers_pull[u]); + for (var c = 0; c < this._rec_temp.length; c++) + (p = this._rec_temp[c]).recurring_event_id == u && (p.recurring_event_id = f, this.changeEventId(p.id, f + "#" + p.id.split("#")[1])); + for (var c in this._rec_markers) { + var p; + (p = this._rec_markers[c]).recurring_event_id == u && (p.recurring_event_id = f, p._pid_changed = !0); + } + var m = e._rec_markers[f]; + m && m._pid_changed && (delete m._pid_changed, setTimeout(function() { + if (e.$destroyed) + return !0; + e.callEvent("onEventChanged", [f, e.getEvent(f)]); + }, 1)), delete this._ignore_call; + } + }), e.attachEvent("onConfirmedBeforeEventDelete", function(u) { + var f = this.getEvent(u); + if (this._is_virtual_event(u) || this._is_modified_occurence(f) && !function(m) { + return !!m.deleted; + }(f)) + (function(m, g) { + m = m.split("#"); + let y = e.uid(), x = m[1] ? m[1] : g._pid_time, b = e._copy_event(g); + b.id = y, b.recurring_event_id = g.recurring_event_id || m[0], b.original_start = new Date(Number(x)), b.deleted = !0, e.addEvent(b); + })(u, f); + else { + t(f) && this._lightbox_id && this._roll_back_dates(f); + var c = this._get_rec_markers(u); + for (var p in c) + c.hasOwnProperty(p) && (u = c[p].id, this.getEvent(u) && this.deleteEvent(u, !0)); + } + return !0; + }), e.attachEvent("onEventDeleted", function(u, f) { + !this._is_virtual_event(u) && this._is_modified_occurence(f) && (e._events[u] || (f.deleted = !0, this.setEvent(u, f))); + }), e.attachEvent("onEventChanged", function(u, f) { + if (this._loading) + return !0; + var c = this.getEvent(u); + if (this._is_virtual_event(u)) + (function(x) { + let b = x.id.split("#"), k = e.uid(); + e._not_render = !0; + let E = e._copy_event(x); + E.id = k, E.recurring_event_id = b[0]; + let D = b[1]; + E.original_start = new Date(Number(D)), e._add_rec_marker(E, D), e.addEvent(E), e._not_render = !1; + })(c); + else { + c.start_date && (c.start_date = i(c.start_date)), c.end_date && (c.end_date = i(c.end_date)), t(c) && this._lightbox_id && this._roll_back_dates(c); + var p = this._get_rec_markers(u); + for (var m in p) + p.hasOwnProperty(m) && (delete this._rec_markers[p[m].id], this.deleteEvent(p[m].id, !0)); + delete this._rec_markers_pull[u]; + for (var g = !1, y = 0; y < this._rendered.length; y++) + this._rendered[y].getAttribute(this.config.event_attribute) == u && (g = !0); + g || (this._select_id = null); + } + return !0; + }), e.attachEvent("onEventAdded", function(u) { + if (!this._loading) { + var f = this.getEvent(u); + t(f) && this._roll_back_dates(f); + } + return !0; + }), e.attachEvent("onEventSave", function(u, f, c) { + return t(this.getEvent(u)) && (this._select_id = null), !0; + }), e.attachEvent("onEventCreated", function(u) { + var f = this.getEvent(u); + return t(f) || function(c) { + c.rrule = "", c.original_start = null, c.recurring_event_id = null, c.duration = null, c.deleted = null; + }(f), !0; + }), e.attachEvent("onEventCancel", function(u) { + var f = this.getEvent(u); + t(f) && (this._roll_back_dates(f), this.render_view_data()); + }), e._roll_back_dates = function(u) { + u.start_date && (u.start_date = i(u.start_date)), u.end_date && (u.end_date = i(u.end_date)), u.duration = Math.round((u.end_date.valueOf() - u.start_date.valueOf()) / 1e3), u.end_date = u._end_date, u._start_date && (u.start_date.setMonth(0), u.start_date.setDate(u._start_date.getDate()), u.start_date.setMonth(u._start_date.getMonth()), u.start_date.setFullYear(u._start_date.getFullYear())); + }, e._is_virtual_event = function(u) { + return u.toString().indexOf("#") != -1; + }, e._is_modified_occurence = function(u) { + return u.recurring_event_id && u.recurring_event_id != "0"; + }, e.showLightbox_rec = e.showLightbox, e.showLightbox = function(u) { + var f = this.locale, c = e.config.lightbox_recurring, p = this.getEvent(u), m = p.recurring_event_id, g = this._is_virtual_event(u); + g && (m = u.split("#")[0]); + var y = function(b) { + var k = e.getEvent(b); + return k._end_date = k.end_date, k.end_date = new Date(k.start_date.valueOf() + 1e3 * k.duration), e.showLightbox_rec(b); + }; + if ((m || 1 * m == 0) && t(p)) + return y(u); + if (!m || m === "0" || !f.labels.confirm_recurring || c == "instance" || c == "series" && !g) + return this.showLightbox_rec(u); + if (c == "ask") { + var x = this; + e.modalbox({ text: f.labels.confirm_recurring, title: f.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [f.labels.button_edit_series, f.labels.button_edit_occurrence, f.labels.icon_cancel], callback: function(b) { + switch (+b) { + case 0: + return y(m); + case 1: + return x.showLightbox_rec(u); + case 2: + return; + } + } }); + } else + y(m); + }, e.get_visible_events_rec = e.get_visible_events, e.get_visible_events = function(u) { + for (var f = 0; f < this._rec_temp.length; f++) + delete this._events[this._rec_temp[f].id]; + this._rec_temp = []; + const c = d(); + var p = this.get_visible_events_rec(u), m = []; + for (f = 0; f < p.length; f++) + p[f].deleted || p[f].recurring_event_id || (t(p[f]) ? this.repeat_date(p[f], m, void 0, void 0, void 0, void 0, c) : m.push(p[f])); + return m; + }, function() { + var u = e.isOneDayEvent; + e.isOneDayEvent = function(c) { + return !!t(c) || u.call(this, c); + }; + var f = e.updateEvent; + e.updateEvent = function(c) { + var p = e.getEvent(c); + p && t(p) && !this._is_virtual_event(c) ? e.update_view() : f.call(this, c); + }; + }(); + const n = e.date.date_to_str("%Y%m%dT%H%i%s"); + function s(u) { + const f = u.getDay(), c = u.getDate(); + return { dayOfWeek: f, dayNumber: Math.ceil(c / 7) }; + } + e.repeat_date = function(u, f, c, p, m, g, y) { + if (!u.rrule) + return; + let x = y ? y[u.id] : d()[u.id]; + x || (x = {}), p || (p = e._min_date), m || (m = e._max_date); + const b = new Date(Date.UTC(u.start_date.getFullYear(), u.start_date.getMonth(), u.start_date.getDate(), u.start_date.getHours(), u.start_date.getMinutes(), u.start_date.getSeconds())), k = Se(`RRULE:${u.rrule};UNTIL=${n(u.end_date)}`, { dtstart: b }).between(p, m).map((w) => { + const S = new Date(w); + return S.setHours(u.start_date.getHours()), S.setMinutes(u.start_date.getMinutes()), S.setSeconds(u.start_date.getSeconds()), S; + }); + let E = 0; + const D = u.duration; + for (let w = 0; w < k.length && !(g && E >= g); w++) { + const S = k[w]; + let N = x[S.valueOf()]; + if (N) { + if (N.deleted) + continue; + E++, f.push(N); + } else { + const M = e._copy_event(u); + if (M.text = u.text, M.start_date = S, M.id = u.id + "#" + Math.ceil(S.valueOf()), M.end_date = new Date(S.valueOf() + 1e3 * D), M.end_date = e._fix_daylight_saving_date(M.start_date, M.end_date, u, S, M.end_date), M._timed = e.isOneDayEvent(M), !M._timed && !e._table_view && !e.config.multi_day) + continue; + f.push(M), c || (e._events[M.id] = M, e._rec_temp.push(M)), E++; + } + } + }, e._fix_daylight_saving_date = function(u, f, c, p, m) { + var g = u.getTimezoneOffset() - f.getTimezoneOffset(); + return g ? g > 0 ? new Date(p.valueOf() + 1e3 * c.duration - 60 * g * 1e3) : new Date(f.valueOf() - 60 * g * 1e3) : new Date(m.valueOf()); + }, e.getRecDates = function(u, f) { + var c = typeof u == "object" ? u : e.getEvent(u), p = []; + if (f = f || 100, !t(c)) + return [{ start_date: c.start_date, end_date: c.end_date }]; + if (c.deleted) + return []; + e.repeat_date(c, p, !0, c.start_date, c.end_date, f); + for (var m = [], g = 0; g < p.length; g++) + p[g].deleted || m.push({ start_date: p[g].start_date, end_date: p[g].end_date }); + return m; + }, e.getEvents = function(u, f) { + var c = []; + const p = d(); + for (var m in this._events) { + var g = this._events[m]; + if (!g.recurring_event_id) + if (t(g)) + if (u && f && g.start_date < f && g.end_date > u) { + var y = []; + this.repeat_date(g, y, !0, u, f, void 0, p), y.forEach(function(x) { + x.start_date < f && x.end_date > u && c.push(x); + }); + } else + u || f || c.push(g); + else + this._is_virtual_event(g.id) || c.push(g); + } + return c; + }, e._copy_dummy = function(u) { + var f = new Date(this.start_date), c = new Date(this.end_date); + this.start_date = f, this.end_date = c, this.duration = this.rrule = null; + }, e.config.include_end_by = !1, e.config.lightbox_recurring = "ask", e.config.recurring_workdays = [C.MO.weekday, C.TU.weekday, C.WE.weekday, C.TH.weekday, C.FR.weekday], e.config.repeat_date = "%m.%d.%Y", e.config.lightbox.sections = [{ name: "description", map_to: "text", type: "textarea", focus: !0 }, { name: "recurring", type: "recurring", map_to: "rec_type" }, { name: "time", height: 72, type: "time", map_to: "auto" }], e.attachEvent("onClearAll", function() { + e._rec_markers = {}, e._rec_markers_pull = {}, e._rec_temp = []; + }); + const _ = { 0: "SU", 1: "MO", 2: "TU", 3: "WE", 4: "TH", 5: "FR", 6: "SA" }, a = { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0 }; + function o(u) { + switch (u) { + case 1: + case 31: + return `${u}st`; + case 2: + return `${u}nd`; + case 3: + return `${u}rd`; + default: + return `${u}th`; + } + } + e.templates.repeat_monthly_date = function(u, f) { + return `Every ${o(u.getDate())}`; + }, e.templates.repeat_monthly_weekday = function(u, f) { + const c = s(u); + return `Every ${o(c.dayNumber)} ${e.locale.date.day_full[c.dayOfWeek]}`; + }, e.templates.repeat_yearly_month_date = function(u, f) { + const c = u.getDate(), p = e.locale.date.month_full[u.getMonth()]; + return `Every ${o(c)} day of ${p}`; + }, e.templates.repeat_yearly_month_weekday = function(u, f) { + const c = s(u), p = e.locale.date.month_full[u.getMonth()]; + return `Every ${o(c.dayNumber)} ${e.locale.date.day_full[c.dayOfWeek]} of ${p}`; + }; + const l = { MONTHLY: function(u) { + return { rrule: { freq: C.MONTHLY, interval: 1, bymonthday: u.start.getDate() }, until: new Date(9999, 1, 1) }; + }, WEEKLY: function(u) { + let f = u.start.getDay() - 1; + return f == -1 && (f = 6), { rrule: { freq: C.WEEKLY, interval: 1, byweekday: [f] }, until: new Date(9999, 1, 1) }; + }, DAILY: function(u) { + return { rrule: { freq: C.DAILY, interval: 1 }, until: new Date(9999, 1, 1) }; + }, YEARLY: function(u) { + return { rrule: { freq: C.YEARLY, bymonth: u.start.getMonth() + 1, interval: 1, bymonthday: u.start.getDate() }, until: new Date(9999, 1, 1) }; + }, WORKDAYS: function(u) { + return { rrule: { freq: C.WEEKLY, interval: 1, byweekday: e.config.recurring_workdays }, until: new Date(9999, 1, 1) }; + }, CUSTOM: function(u, f) { + const c = {}, p = f.querySelector('[name="repeat_interval_unit"]').value, m = Math.max(1, f.querySelector('[name="repeat_interval_value"]').value), g = f.querySelector('[name="dhx_custom_month_option"]').value, y = f.querySelector('[name="dhx_custom_year_option"]').value; + let x, b; + switch (c.interval = m, p) { + case "DAILY": + c.freq = C.DAILY; + break; + case "WEEKLY": + c.freq = C.WEEKLY, x = [], f.querySelectorAll('.dhx_form_repeat_custom_week [name="week_day"]').forEach((D) => { + D.checked && x.push(D.value); + }), c.byweekday = x.map((D) => { + switch (D) { + case "MO": + return C.MO.weekday; + case "TU": + return C.TU.weekday; + case "WE": + return C.WE.weekday; + case "TH": + return C.TH.weekday; + case "FR": + return C.FR.weekday; + case "SA": + return C.SA.weekday; + case "SU": + return C.SU.weekday; + } + }); + break; + case "MONTHLY": + c.freq = C.MONTHLY, g === "month_date" ? c.bymonthday = u.start.getDate() : (b = u.start.getDay() - 1, b == -1 && (b = 6), c.byweekday = [b], c.bysetpos = s(u.start).dayNumber); + break; + case "YEARLY": + c.freq = C.YEARLY, c.bymonth = u.start.getMonth() + 1, y == "month_date" ? c.bymonthday = u.start.getDate() : (b = u.start.getDay() - 1, b == -1 && (b = 6), c.byweekday = [b], c.bysetpos = s(u.start).dayNumber); + } + let k = new Date(9999, 1, 1); + const E = f.querySelector('[name="dhx_custom_repeat_ends"]'); + return E === "ON" ? k = f.querySelector('[name="dhx_form_repeat_ends_ondate"]').value : E === "AFTER" && (c.count = Math.max(1, f.querySelector('[name="dhx_form_repeat_ends_after"]').value)), { rrule: c, until: k }; + }, NEVER: function() { + } }; + function h(u, f, c) { + (function(p, m) { + p.querySelector("[name='repeat_interval_value']").value = (m ? m.interval : 1) || 1; + })(u, f), function(p, m, g) { + if (p.querySelector("[name='repeat_interval_value']").value = (m ? m.interval : 1) || 1, p.querySelectorAll(".dhx_form_repeat_custom_week input").forEach((y) => y.checked = !1), m && m.byweekday) + m.byweekday.forEach((y) => { + const x = a[y.weekday], b = _[x]; + p.querySelector(`.dhx_form_repeat_custom_week input[value="${b}"]`).checked = !0; + }); + else { + const y = _[g.start_date.getDay()]; + p.querySelector(`.dhx_form_repeat_custom_week input[value="${y}"]`).checked = !0; + } + }(u, f, c), function(p, m, g) { + p.querySelector("[name='repeat_interval_value']").value = (m ? m.interval : 1) || 1; + const y = p.querySelector('.dhx_form_repeat_custom_month [value="month_date"]'), x = p.querySelector('.dhx_form_repeat_custom_month [value="month_nth_weekday"]'); + y.innerText = e.templates.repeat_monthly_date(g.start_date, g), x.innerText = e.templates.repeat_monthly_weekday(g.start_date, g), m && (!m.bysetpos || m.byweekday && m.byweekday.length) ? p.querySelector('[name="dhx_custom_month_option"]').value = "month_nth_weekday" : p.querySelector('[name="dhx_custom_month_option"]').value = "month_date"; + }(u, f, c), function(p, m, g) { + const y = p.querySelector('.dhx_form_repeat_custom_year [value="month_date"]'), x = p.querySelector('.dhx_form_repeat_custom_year [value="month_nth_weekday"]'); + y.innerText = e.templates.repeat_yearly_month_date(g.start_date, g), x.innerText = e.templates.repeat_yearly_month_weekday(g.start_date, g), m && (!m.bysetpos || m.byweekday && m.byweekday.length) ? p.querySelector('[name="dhx_custom_year_option"]').value = "month_nth_weekday" : p.querySelector('[name="dhx_custom_year_option"]').value = "month_date"; + }(u, f, c), function(p, m, g) { + const y = p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_after"]'), x = p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_ondate"]'), b = p.querySelector("[name='dhx_custom_repeat_ends']"); + y.value = 1; + let k = e.date.date_to_str("%Y-%m-%d"); + e.config.repeat_date_of_end || (e.config.repeat_date_of_end = k(e.date.add(e._currentDate(), 30, "day"))), x.value = e.config.repeat_date_of_end, m && m.count ? (b.value = "AFTER", y.value = m.count) : g._end_date && g._end_date.getFullYear() !== 9999 ? (b.value = "ON", x.value = k(g._end_date)) : b.value = "NEVER", b.dispatchEvent(new Event("change")); + }(u, f, c); + } + function v(u) { + for (let f = 0; f < e.config.lightbox.sections.length; f++) { + let c = e.config.lightbox.sections[f]; + if (c.type === u) + return e.formSection(c.name); + } + return null; + } + e.form_blocks.recurring = { render: function(u) { + if (u.form) { + let c = e.form_blocks.recurring, p = c._get_node(u.form), m = c._outer_html(p); + return p.style.display = "none", m; + } + let f = e.locale.labels; + return `
+
+ +
+
+
+ + +
+ +
+
+ + + + + + + +
+ +
+ +
+ +
+ +
+
+ +
+
${f.repeat_ends}
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
`; + }, _init_set_value: function(u, f, c) { + function p(g) { + g.classList.add("dhx_hidden"); + } + function m(g) { + g.classList.remove("dhx_hidden"); + } + e.form_blocks.recurring._ds = { start: c.start_date, end: c.end_date }, u.querySelector(".dhx_form_repeat_pattern select").addEventListener("change", function() { + (function(g) { + const y = u.querySelector(".dhx_form_repeat_custom"); + g === "CUSTOM" ? m(y) : p(y); + })(this.value); + }), u.querySelector(".dhx_form_repeat_custom_interval [name='repeat_interval_unit']").addEventListener("change", function() { + (function(g) { + const y = { weekly: u.querySelector(".dhx_form_repeat_custom_week"), monthly: u.querySelector(".dhx_form_repeat_custom_month"), yearly: u.querySelector(".dhx_form_repeat_custom_year") }; + switch (g) { + case "DAILY": + p(y.weekly), p(y.monthly), p(y.yearly); + break; + case "WEEKLY": + m(y.weekly), p(y.monthly), p(y.yearly); + break; + case "MONTHLY": + p(y.weekly), m(y.monthly), p(y.yearly); + break; + case "YEARLY": + p(y.weekly), p(y.monthly), m(y.yearly); + } + })(this.value); + }), u.querySelector(".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']").addEventListener("change", function() { + (function(g) { + const y = { after: u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after"), on: u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on") }; + switch (g) { + case "NEVER": + p(y.after), p(y.on); + break; + case "AFTER": + m(y.after), p(y.on); + break; + case "ON": + p(y.after), m(y.on); + } + })(this.value); + }), e._lightbox._rec_init_done = !0; + }, button_click: function() { + }, set_value: function(u, f, c) { + let p = e.form_blocks.recurring; + e._lightbox._rec_init_done || p._init_set_value(u, f, c), u.open = !c.rrule, u.blocked = this._is_modified_occurence(c); + let m = p._ds; + if (m.start = c.start_date, m.end = c._end_date, c.rrule) { + const g = Se(c.rrule); + h(u, g.origOptions, c); + const y = function(x, b) { + const k = x.options, E = k.until || b; + return k.count || E && E.getFullYear() !== 9999 ? "CUSTOM" : k.freq !== C.DAILY || k.interval !== 1 || k.byweekday ? k.freq !== C.WEEKLY || k.interval !== 1 || k.byweekday ? k.freq !== C.MONTHLY || k.interval !== 1 || k.bysetpos ? k.freq !== C.YEARLY || k.interval !== 1 || k.bysetpos ? k.freq === C.DAILY && k.byweekday && k.byweekday.length === e.config.recurring_workdays.length && k.byweekday.includes(C.MO) && k.byweekday.includes(C.TU) && k.byweekday.includes(C.WE) && k.byweekday.includes(C.TH) && k.byweekday.includes(C.FR) ? "WORKDAYS" : "CUSTOM" : "YEARLY" : "MONTHLY" : "WEEKLY" : "DAILY"; + }(g, c._end_date); + if (u.querySelector(".dhx_form_repeat_pattern select").value = y, y === "CUSTOM") { + let x; + switch (g.origOptions.freq) { + case C.DAILY: + x = "DAILY"; + break; + case C.WEEKLY: + x = "WEEKLY"; + break; + case C.MONTHLY: + x = "MONTHLY"; + break; + case C.YEARLY: + x = "YEARLY"; + } + x && (u.querySelector('[name="repeat_interval_unit"]').value = x, u.querySelector('[name="repeat_interval_unit"]').dispatchEvent(new Event("change"))); + } + } else + h(u, null, c), u.querySelector(".dhx_form_repeat_pattern select").value = "NEVER"; + u.querySelector(".dhx_form_repeat_pattern select").dispatchEvent(new Event("change")); + }, get_value: function(u, f) { + if (u.blocked || u.querySelector(".dhx_form_repeat_pattern select").value === "NEVER") + f.rrule = f.rrule = "", f._end_date = f.end_date; + else { + let c = e.form_blocks.recurring._ds, p = {}; + (function() { + let y = e.formSection("time"); + if (y || (y = v("time")), y || (y = v("calendar_time")), !y) + throw new Error(["Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.", "You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. ", 'In the latter case, make sure the control is named "time":', "", "scheduler.config.lightbox.sections = [", '{name:"time", height:72, type:"YOU CONTROL", map_to:"auto" }];'].join(` +`)); + return y; + })().getValue(p), c.start = p.start_date; + const m = u.querySelector(".dhx_form_repeat_pattern select").value, g = l[m](c, u); + f.rrule = new C(g.rrule).toString().replace("RRULE:", ""), c.end = g.until, f.duration = Math.floor((p.end_date - p.start_date) / 1e3), c._start ? (f.start_date = new Date(c.start), f._start_date = new Date(c.start), c._start = !1) : f._start_date = null, f._end_date = c.end; + } + return f.rrule; + }, focus: function(u) { + } }; +}, recurring_legacy: function(e) { + function i() { + var n = e.formSection("recurring"); + if (n || (n = t("recurring")), !n) throw new Error(["Can't locate the Recurring form section.", "Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox ", 'and that the recurring control has name "recurring":', "", "scheduler.config.lightbox.sections = [", ' {name:"recurring", ... }', "];"].join(` `)); - return i; + return n; } - function a(i) { - for (var _ = 0; _ < e.config.lightbox.sections.length; _++) { - var o = e.config.lightbox.sections[_]; - if (o.type === i) - return e.formSection(o.name); + function t(n) { + for (var s = 0; s < e.config.lightbox.sections.length; s++) { + var _ = e.config.lightbox.sections[s]; + if (_.type === n) + return e.formSection(_.name); } return null; } - function r(i) { - return new Date(i.getFullYear(), i.getMonth(), i.getDate(), i.getHours(), i.getMinutes(), i.getSeconds(), 0); + function r(n) { + return new Date(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), 0); } var d; - e.config.occurrence_timestamp_in_utc = !1, e.config.recurring_workdays = [1, 2, 3, 4, 5], e.form_blocks.recurring = { _get_node: function(i) { - if (typeof i == "string") { - let _ = e._lightbox.querySelector(`#${i}`); - _ || (_ = document.getElementById(i)), i = _; - } - return i.style.display == "none" && (i.style.display = ""), i; - }, _outer_html: function(i) { - return i.outerHTML || (_ = i, (t = document.createElement("div")).appendChild(_.cloneNode(!0)), o = t.innerHTML, t = null, o); - var _, o, t; - }, render: function(i) { - if (i.form) { - var _ = e.form_blocks.recurring, o = _._get_node(i.form), t = _._outer_html(o); - return o.style.display = "none", t; - } - var n = e.locale.labels; - return '
' + n.repeat_text_occurences_count + '
'; - }, _ds: {}, _get_form_node: function(i, _, o) { - var t = i[_]; - if (!t) + e.config.occurrence_timestamp_in_utc = !1, e.config.recurring_workdays = [1, 2, 3, 4, 5], e.form_blocks.recurring = { _get_node: function(n) { + if (typeof n == "string") { + let s = e._lightbox.querySelector(`#${n}`); + s || (s = document.getElementById(n)), n = s; + } + return n.style.display == "none" && (n.style.display = ""), n; + }, _outer_html: function(n) { + return n.outerHTML || (s = n, (a = document.createElement("div")).appendChild(s.cloneNode(!0)), _ = a.innerHTML, a = null, _); + var s, _, a; + }, render: function(n) { + if (n.form) { + var s = e.form_blocks.recurring, _ = s._get_node(n.form), a = s._outer_html(_); + return _.style.display = "none", a; + } + var o = e.locale.labels; + return '
' + o.repeat_text_occurences_count + '
'; + }, _ds: {}, _get_form_node: function(n, s, _) { + var a = n[s]; + if (!a) return null; - if (t.nodeName) - return t; - if (t.length) { - for (var n = 0; n < t.length; n++) - if (t[n].value == o) - return t[n]; - } - }, _get_node_value: function(i, _, o) { - var t = i[_]; - if (!t) + if (a.nodeName) + return a; + if (a.length) { + for (var o = 0; o < a.length; o++) + if (a[o].value == _) + return a[o]; + } + }, _get_node_value: function(n, s, _) { + var a = n[s]; + if (!a) return ""; - if (t.length) { - if (o) { - for (var n = [], s = 0; s < t.length; s++) - t[s].checked && n.push(t[s].value); - return n; - } - for (s = 0; s < t.length; s++) - if (t[s].checked) - return t[s].value; - } - return t.value ? o ? [t.value] : t.value : void 0; - }, _get_node_numeric_value: function(i, _) { - return 1 * e.form_blocks.recurring._get_node_value(i, _) || 0; - }, _set_node_value: function(i, _, o) { - var t = i[_]; - if (t) { - if (t.name == _) - t.value = o; - else if (t.length) - for (var n = typeof o == "object", s = 0; s < t.length; s++) - (n || t[s].value == o) && (t[s].checked = n ? !!o[t[s].value] : !!o); - } - }, _init_set_value: function(i, _, o) { - var t = e.form_blocks.recurring, n = t._get_node_value, s = t._set_node_value; - e.form_blocks.recurring._ds = { start: o.start_date, end: o._end_date }; - var c = e.date.str_to_date(e.config.repeat_date, !1, !0), u = e.date.date_to_str(e.config.repeat_date), v = i.getElementsByTagName("FORM")[0], m = {}; - function l(D) { - for (var x = 0; x < D.length; x++) { - var S = D[x]; + if (a.length) { + if (_) { + for (var o = [], l = 0; l < a.length; l++) + a[l].checked && o.push(a[l].value); + return o; + } + for (l = 0; l < a.length; l++) + if (a[l].checked) + return a[l].value; + } + return a.value ? _ ? [a.value] : a.value : void 0; + }, _get_node_numeric_value: function(n, s) { + return 1 * e.form_blocks.recurring._get_node_value(n, s) || 0; + }, _set_node_value: function(n, s, _) { + var a = n[s]; + if (a) { + if (a.name == s) + a.value = _; + else if (a.length) + for (var o = typeof _ == "object", l = 0; l < a.length; l++) + (o || a[l].value == _) && (a[l].checked = o ? !!_[a[l].value] : !!_); + } + }, _init_set_value: function(n, s, _) { + var a = e.form_blocks.recurring, o = a._get_node_value, l = a._set_node_value; + e.form_blocks.recurring._ds = { start: _.start_date, end: _._end_date }; + var h = e.date.str_to_date(e.config.repeat_date, !1, !0), v = e.date.date_to_str(e.config.repeat_date), u = n.getElementsByTagName("FORM")[0], f = {}; + function c(D) { + for (var w = 0; w < D.length; w++) { + var S = D[w]; if (S.name) - if (m[S.name]) - if (m[S.name].nodeType) { - var N = m[S.name]; - m[S.name] = [N, S]; + if (f[S.name]) + if (f[S.name].nodeType) { + var N = f[S.name]; + f[S.name] = [N, S]; } else - m[S.name].push(S); + f[S.name].push(S); else - m[S.name] = S; + f[S.name] = S; } } - if (l(v.getElementsByTagName("INPUT")), l(v.getElementsByTagName("SELECT")), !e.config.repeat_date_of_end) { - var f = e.date.date_to_str(e.config.repeat_date); - e.config.repeat_date_of_end = f(e.date.add(e._currentDate(), 30, "day")); + if (c(u.getElementsByTagName("INPUT")), c(u.getElementsByTagName("SELECT")), !e.config.repeat_date_of_end) { + var p = e.date.date_to_str(e.config.repeat_date); + e.config.repeat_date_of_end = p(e.date.add(e._currentDate(), 30, "day")); } - s(m, "date_of_end", e.config.repeat_date_of_end); - var g = function(D) { + l(f, "date_of_end", e.config.repeat_date_of_end); + var m = function(D) { return e._lightbox.querySelector(`#${D}`) || { style: {} }; }; - function p() { - g("dhx_repeat_day").style.display = "none", g("dhx_repeat_week").style.display = "none", g("dhx_repeat_month").style.display = "none", g("dhx_repeat_year").style.display = "none", g("dhx_repeat_" + this.value).style.display = "", e.setLightboxSize(); + function g() { + m("dhx_repeat_day").style.display = "none", m("dhx_repeat_week").style.display = "none", m("dhx_repeat_month").style.display = "none", m("dhx_repeat_year").style.display = "none", m("dhx_repeat_" + this.value).style.display = "", e.setLightboxSize(); } - function y(D, x) { + function y(D, w) { var S = D.end; if (S.length) if (S[0].value && S[0].value != "on") for (var N = 0; N < S.length; N++) - S[N].value == x && (S[N].checked = !0); + S[N].value == w && (S[N].checked = !0); else { var M = 0; - switch (x) { + switch (w) { case "no": M = 0; break; @@ -7455,400 +9747,400 @@ const lt = { active_links: function(e) { S[M].checked = !0; } else - S.value = x; + S.value = w; } e.form_blocks.recurring._get_repeat_code = function(D) { - var x = [n(m, "repeat")]; - for (w[x[0]](x, D); x.length < 5; ) - x.push(""); + var w = [o(f, "repeat")]; + for (x[w[0]](w, D); w.length < 5; ) + w.push(""); var S = "", N = function(M) { - var A = M.end; - if (A.length) { - for (var C = 0; C < A.length; C++) - if (A[C].checked) - return A[C].value && A[C].value != "on" ? A[C].value : C ? C == 2 ? "date_of_end" : "occurences_count" : "no"; - } else if (A.value) - return A.value; + var T = M.end; + if (T.length) { + for (var A = 0; A < T.length; A++) + if (T[A].checked) + return T[A].value && T[A].value != "on" ? T[A].value : A ? A == 2 ? "date_of_end" : "occurences_count" : "no"; + } else if (T.value) + return T.value; return "no"; - }(m); + }(f); return N == "no" ? (D.end = new Date(9999, 1, 1), S = "no") : N == "date_of_end" ? D.end = function(M) { - var A = c(M); - return e.config.include_end_by && (A = e.date.add(A, 1, "day")), A; - }(n(m, "date_of_end")) : (e.transpose_type(x.join("_")), S = Math.max(1, n(m, "occurences_count")), D.end = e.date["add_" + x.join("_")](new Date(D.start), S + 0, { start_date: D.start }) || D.start), x.join("_") + "#" + S; + var T = h(M); + return e.config.include_end_by && (T = e.date.add(T, 1, "day")), T; + }(o(f, "date_of_end")) : (e.transpose_type(w.join("_")), S = Math.max(1, o(f, "occurences_count")), D.end = e.date["add_" + w.join("_")](new Date(D.start), S + 0, { start_date: D.start }) || D.start), w.join("_") + "#" + S; }; - var w = { month: function(D, x) { + var x = { month: function(D, w) { var S = e.form_blocks.recurring._get_node_value, N = e.form_blocks.recurring._get_node_numeric_value; - S(m, "month_type") == "d" ? (D.push(Math.max(1, N(m, "month_count"))), x.start.setDate(S(m, "month_day"))) : (D.push(Math.max(1, N(m, "month_count2"))), D.push(S(m, "month_day2")), D.push(Math.max(1, N(m, "month_week2"))), e.config.repeat_precise || x.start.setDate(1)), x._start = !0; - }, week: function(D, x) { + S(f, "month_type") == "d" ? (D.push(Math.max(1, N(f, "month_count"))), w.start.setDate(S(f, "month_day"))) : (D.push(Math.max(1, N(f, "month_count2"))), D.push(S(f, "month_day2")), D.push(Math.max(1, N(f, "month_week2"))), e.config.repeat_precise || w.start.setDate(1)), w._start = !0; + }, week: function(D, w) { var S = e.form_blocks.recurring._get_node_value, N = e.form_blocks.recurring._get_node_numeric_value; - D.push(Math.max(1, N(m, "week_count"))), D.push(""), D.push(""); - for (var M = [], A = S(m, "week_day", !0), C = x.start.getDay(), T = !1, O = 0; O < A.length; O++) - M.push(A[O]), T = T || A[O] == C; - M.length || (M.push(C), T = !0), M.sort(), e.config.repeat_precise ? T || (e.transpose_day_week(x.start, M, 1, 7), x._start = !0) : (x.start = e.date.week_start(x.start), x._start = !0), D.push(M.join(",")); + D.push(Math.max(1, N(f, "week_count"))), D.push(""), D.push(""); + for (var M = [], T = S(f, "week_day", !0), A = w.start.getDay(), H = !1, $ = 0; $ < T.length; $++) + M.push(T[$]), H = H || T[$] == A; + M.length || (M.push(A), H = !0), M.sort(), e.config.repeat_precise ? H || (e.transpose_day_week(w.start, M, 1, 7), w._start = !0) : (w.start = e.date.week_start(w.start), w._start = !0), D.push(M.join(",")); }, day: function(D) { - var x = e.form_blocks.recurring._get_node_value, S = e.form_blocks.recurring._get_node_numeric_value; - x(m, "day_type") == "d" ? D.push(Math.max(1, S(m, "day_count"))) : (D.push("week"), D.push(1), D.push(""), D.push(""), D.push(e.config.recurring_workdays.join(",")), D.splice(0, 1)); - }, year: function(D, x) { + var w = e.form_blocks.recurring._get_node_value, S = e.form_blocks.recurring._get_node_numeric_value; + w(f, "day_type") == "d" ? D.push(Math.max(1, S(f, "day_count"))) : (D.push("week"), D.push(1), D.push(""), D.push(""), D.push(e.config.recurring_workdays.join(",")), D.splice(0, 1)); + }, year: function(D, w) { var S = e.form_blocks.recurring._get_node_value; - S(m, "year_type") == "d" ? (D.push("1"), x.start.setMonth(0), x.start.setDate(S(m, "year_day")), x.start.setMonth(S(m, "year_month"))) : (D.push("1"), D.push(S(m, "year_day2")), D.push(S(m, "year_week2")), x.start.setDate(1), x.start.setMonth(S(m, "year_month2"))), x._start = !0; - } }, b = { week: function(D, x) { + S(f, "year_type") == "d" ? (D.push("1"), w.start.setMonth(0), w.start.setDate(S(f, "year_day")), w.start.setMonth(S(f, "year_month"))) : (D.push("1"), D.push(S(f, "year_day2")), D.push(S(f, "year_week2")), w.start.setDate(1), w.start.setMonth(S(f, "year_month2"))), w._start = !0; + } }, b = { week: function(D, w) { var S = e.form_blocks.recurring._set_node_value; - S(m, "week_count", D[1]); - for (var N = D[4].split(","), M = {}, A = 0; A < N.length; A++) - M[N[A]] = !0; - S(m, "week_day", M); - }, month: function(D, x) { + S(f, "week_count", D[1]); + for (var N = D[4].split(","), M = {}, T = 0; T < N.length; T++) + M[N[T]] = !0; + S(f, "week_day", M); + }, month: function(D, w) { var S = e.form_blocks.recurring._set_node_value; - D[2] === "" ? (S(m, "month_type", "d"), S(m, "month_count", D[1]), S(m, "month_day", x.start.getDate())) : (S(m, "month_type", "w"), S(m, "month_count2", D[1]), S(m, "month_week2", D[3]), S(m, "month_day2", D[2])); - }, day: function(D, x) { + D[2] === "" ? (S(f, "month_type", "d"), S(f, "month_count", D[1]), S(f, "month_day", w.start.getDate())) : (S(f, "month_type", "w"), S(f, "month_count2", D[1]), S(f, "month_week2", D[3]), S(f, "month_day2", D[2])); + }, day: function(D, w) { var S = e.form_blocks.recurring._set_node_value; - S(m, "day_type", "d"), S(m, "day_count", D[1]); - }, year: function(D, x) { + S(f, "day_type", "d"), S(f, "day_count", D[1]); + }, year: function(D, w) { var S = e.form_blocks.recurring._set_node_value; - D[2] === "" ? (S(m, "year_type", "d"), S(m, "year_day", x.start.getDate()), S(m, "year_month", x.start.getMonth())) : (S(m, "year_type", "w"), S(m, "year_week2", D[3]), S(m, "year_day2", D[2]), S(m, "year_month2", x.start.getMonth())); + D[2] === "" ? (S(f, "year_type", "d"), S(f, "year_day", w.start.getDate()), S(f, "year_month", w.start.getMonth())) : (S(f, "year_type", "w"), S(f, "year_week2", D[3]), S(f, "year_day2", D[2]), S(f, "year_month2", w.start.getMonth())); } }; - e.form_blocks.recurring._set_repeat_code = function(D, x) { + e.form_blocks.recurring._set_repeat_code = function(D, w) { var S = e.form_blocks.recurring._set_node_value, N = D.split("#"); - switch (D = N[0].split("_"), b[D[0]](D, x), N[1]) { + switch (D = N[0].split("_"), b[D[0]](D, w), N[1]) { case "no": - y(m, "no"); + y(f, "no"); break; case "": - y(m, "date_of_end"); - var M = x.end; - e.config.include_end_by && (M = e.date.add(M, -1, "day")), S(m, "date_of_end", u(M)); + y(f, "date_of_end"); + var M = w.end; + e.config.include_end_by && (M = e.date.add(M, -1, "day")), S(f, "date_of_end", v(M)); break; default: - y(m, "occurences_count"), S(m, "occurences_count", N[1]); + y(f, "occurences_count"), S(f, "occurences_count", N[1]); } - S(m, "repeat", D[0]); - var A = e.form_blocks.recurring._get_form_node(m, "repeat", D[0]); - A.nodeName == "SELECT" ? (A.dispatchEvent(new Event("change")), A.dispatchEvent(new MouseEvent("click"))) : A.dispatchEvent(new MouseEvent("click")); + S(f, "repeat", D[0]); + var T = e.form_blocks.recurring._get_form_node(f, "repeat", D[0]); + T.nodeName == "SELECT" ? (T.dispatchEvent(new Event("change")), T.dispatchEvent(new MouseEvent("click"))) : T.dispatchEvent(new MouseEvent("click")); }; - for (var k = 0; k < v.elements.length; k++) { - var E = v.elements[k]; - E.name === "repeat" && (E.nodeName != "SELECT" || E.$_eventAttached ? E.$_eventAttached || (E.$_eventAttached = !0, E.addEventListener("click", p)) : (E.$_eventAttached = !0, E.addEventListener("change", p))); + for (var k = 0; k < u.elements.length; k++) { + var E = u.elements[k]; + E.name === "repeat" && (E.nodeName != "SELECT" || E.$_eventAttached ? E.$_eventAttached || (E.$_eventAttached = !0, E.addEventListener("click", g)) : (E.$_eventAttached = !0, E.addEventListener("change", g))); } e._lightbox._rec_init_done = !0; - }, set_value: function(i, _, o) { - var t = e.form_blocks.recurring; - e._lightbox._rec_init_done || t._init_set_value(i, _, o), i.open = !o.rec_type, i.blocked = this._is_modified_occurence(o); - var n = t._ds; - n.start = o.start_date, n.end = o._end_date, t._toggle_block(), _ && t._set_repeat_code(_, n); - }, get_value: function(i, _) { - if (i.open) { - var o = e.form_blocks.recurring._ds, t = {}; + }, set_value: function(n, s, _) { + var a = e.form_blocks.recurring; + e._lightbox._rec_init_done || a._init_set_value(n, s, _), n.open = !_.rec_type, n.blocked = this._is_modified_occurence(_); + var o = a._ds; + o.start = _.start_date, o.end = _._end_date, a._toggle_block(), s && a._set_repeat_code(s, o); + }, get_value: function(n, s) { + if (n.open) { + var _ = e.form_blocks.recurring._ds, a = {}; (function() { - var n = e.formSection("time"); - if (n || (n = a("time")), n || (n = a("calendar_time")), !n) + var o = e.formSection("time"); + if (o || (o = t("time")), o || (o = t("calendar_time")), !o) throw new Error(["Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.", "You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. ", 'In the latter case, make sure the control is named "time":', "", "scheduler.config.lightbox.sections = [", '{name:"time", height:72, type:"YOU CONTROL", map_to:"auto" }];'].join(` `)); - return n; - })().getValue(t), o.start = t.start_date, _.rec_type = e.form_blocks.recurring._get_repeat_code(o), o._start ? (_.start_date = new Date(o.start), _._start_date = new Date(o.start), o._start = !1) : _._start_date = null, _._end_date = o.end, _.rec_pattern = _.rec_type.split("#")[0]; + return o; + })().getValue(a), _.start = a.start_date, s.rec_type = e.form_blocks.recurring._get_repeat_code(_), _._start ? (s.start_date = new Date(_.start), s._start_date = new Date(_.start), _._start = !1) : s._start_date = null, s._end_date = _.end, s.rec_pattern = s.rec_type.split("#")[0]; } else - _.rec_type = _.rec_pattern = "", _._end_date = _.end_date; - return _.rec_type; + s.rec_type = s.rec_pattern = "", s._end_date = s.end_date; + return s.rec_type; }, _get_button: function() { - return h().header.firstChild.firstChild; + return i().header.firstChild.firstChild; }, _get_form: function() { - return h().node; + return i().node; }, open: function() { - var i = e.form_blocks.recurring; - i._get_form().open || i._toggle_block(); + var n = e.form_blocks.recurring; + n._get_form().open || n._toggle_block(); }, close: function() { - var i = e.form_blocks.recurring; - i._get_form().open && i._toggle_block(); + var n = e.form_blocks.recurring; + n._get_form().open && n._toggle_block(); }, _toggle_block: function() { - var i = e.form_blocks.recurring, _ = i._get_form(), o = i._get_button(); - _.open || _.blocked ? (_.style.height = "0px", o && (o.style.backgroundPosition = "-5px 20px", o.nextSibling.innerHTML = e.locale.labels.button_recurring)) : (_.style.height = "auto", o && (o.style.backgroundPosition = "-5px 0px", o.nextSibling.innerHTML = e.locale.labels.button_recurring_open)), _.open = !_.open, e.setLightboxSize(); - }, focus: function(i) { - }, button_click: function(i, _, o) { + var n = e.form_blocks.recurring, s = n._get_form(), _ = n._get_button(); + s.open || s.blocked ? (s.style.height = "0px", _ && (_.style.backgroundPosition = "-5px 20px", _.nextSibling.innerHTML = e.locale.labels.button_recurring)) : (s.style.height = "auto", _ && (_.style.backgroundPosition = "-5px 0px", _.nextSibling.innerHTML = e.locale.labels.button_recurring_open)), s.open = !s.open, e.setLightboxSize(); + }, focus: function(n) { + }, button_click: function(n, s, _) { e.form_blocks.recurring._get_form().blocked || e.form_blocks.recurring._toggle_block(); - } }, e._rec_markers = {}, e._rec_markers_pull = {}, e._add_rec_marker = function(i, _) { - i._pid_time = _, this._rec_markers[i.id] = i, this._rec_markers_pull[i.event_pid] || (this._rec_markers_pull[i.event_pid] = {}), this._rec_markers_pull[i.event_pid][_] = i; - }, e._get_rec_marker = function(i, _) { - var o = this._rec_markers_pull[_]; - return o ? o[i] : null; - }, e._get_rec_markers = function(i) { - return this._rec_markers_pull[i] || []; - }, e._rec_temp = [], d = e.addEvent, e.addEvent = function(i, _, o, t, n) { - var s = d.apply(this, arguments); - if (s && e.getEvent(s)) { - var c = e.getEvent(s); - c.start_date && (c.start_date = r(c.start_date)), c.end_date && (c.end_date = r(c.end_date)), this._is_modified_occurence(c) && e._add_rec_marker(c, 1e3 * c.event_length), c.rec_type && (c.rec_pattern = c.rec_type.split("#")[0]); + } }, e._rec_markers = {}, e._rec_markers_pull = {}, e._add_rec_marker = function(n, s) { + n._pid_time = s, this._rec_markers[n.id] = n, this._rec_markers_pull[n.event_pid] || (this._rec_markers_pull[n.event_pid] = {}), this._rec_markers_pull[n.event_pid][s] = n; + }, e._get_rec_marker = function(n, s) { + var _ = this._rec_markers_pull[s]; + return _ ? _[n] : null; + }, e._get_rec_markers = function(n) { + return this._rec_markers_pull[n] || []; + }, e._rec_temp = [], d = e.addEvent, e.addEvent = function(n, s, _, a, o) { + var l = d.apply(this, arguments); + if (l && e.getEvent(l)) { + var h = e.getEvent(l); + h.start_date && (h.start_date = r(h.start_date)), h.end_date && (h.end_date = r(h.end_date)), this._is_modified_occurence(h) && e._add_rec_marker(h, 1e3 * h.event_length), h.rec_type && (h.rec_pattern = h.rec_type.split("#")[0]); } - return s; - }, e.attachEvent("onEventIdChange", function(i, _) { + return l; + }, e.attachEvent("onEventIdChange", function(n, s) { if (!this._ignore_call) { - this._ignore_call = !0, e._rec_markers[i] && (e._rec_markers[_] = e._rec_markers[i], delete e._rec_markers[i]), e._rec_markers_pull[i] && (e._rec_markers_pull[_] = e._rec_markers_pull[i], delete e._rec_markers_pull[i]); - for (var o = 0; o < this._rec_temp.length; o++) - (t = this._rec_temp[o]).event_pid == i && (t.event_pid = _, this.changeEventId(t.id, _ + "#" + t.id.split("#")[1])); - for (var o in this._rec_markers) { - var t; - (t = this._rec_markers[o]).event_pid == i && (t.event_pid = _, t._pid_changed = !0); - } - var n = e._rec_markers[_]; - n && n._pid_changed && (delete n._pid_changed, setTimeout(function() { + this._ignore_call = !0, e._rec_markers[n] && (e._rec_markers[s] = e._rec_markers[n], delete e._rec_markers[n]), e._rec_markers_pull[n] && (e._rec_markers_pull[s] = e._rec_markers_pull[n], delete e._rec_markers_pull[n]); + for (var _ = 0; _ < this._rec_temp.length; _++) + (a = this._rec_temp[_]).event_pid == n && (a.event_pid = s, this.changeEventId(a.id, s + "#" + a.id.split("#")[1])); + for (var _ in this._rec_markers) { + var a; + (a = this._rec_markers[_]).event_pid == n && (a.event_pid = s, a._pid_changed = !0); + } + var o = e._rec_markers[s]; + o && o._pid_changed && (delete o._pid_changed, setTimeout(function() { if (e.$destroyed) return !0; - e.callEvent("onEventChanged", [_, e.getEvent(_)]); + e.callEvent("onEventChanged", [s, e.getEvent(s)]); }, 1)), delete this._ignore_call; } - }), e.attachEvent("onConfirmedBeforeEventDelete", function(i) { - var _ = this.getEvent(i); - if (this._is_virtual_event(i) || this._is_modified_occurence(_) && _.rec_type && _.rec_type != "none") { - i = i.split("#"); - var o = this.uid(), t = i[1] ? i[1] : Math.round(_._pid_time / 1e3), n = this._copy_event(_); - n.id = o, n.event_pid = _.event_pid || i[0]; - var s = t; - n.event_length = s, n.rec_type = n.rec_pattern = "none", this.addEvent(n), this._add_rec_marker(n, 1e3 * s); + }), e.attachEvent("onConfirmedBeforeEventDelete", function(n) { + var s = this.getEvent(n); + if (this._is_virtual_event(n) || this._is_modified_occurence(s) && s.rec_type && s.rec_type != "none") { + n = n.split("#"); + var _ = this.uid(), a = n[1] ? n[1] : Math.round(s._pid_time / 1e3), o = this._copy_event(s); + o.id = _, o.event_pid = s.event_pid || n[0]; + var l = a; + o.event_length = l, o.rec_type = o.rec_pattern = "none", this.addEvent(o), this._add_rec_marker(o, 1e3 * l); } else { - _.rec_type && this._lightbox_id && this._roll_back_dates(_); - var c = this._get_rec_markers(i); - for (var u in c) - c.hasOwnProperty(u) && (i = c[u].id, this.getEvent(i) && this.deleteEvent(i, !0)); + s.rec_type && this._lightbox_id && this._roll_back_dates(s); + var h = this._get_rec_markers(n); + for (var v in h) + h.hasOwnProperty(v) && (n = h[v].id, this.getEvent(n) && this.deleteEvent(n, !0)); } return !0; - }), e.attachEvent("onEventDeleted", function(i, _) { - !this._is_virtual_event(i) && this._is_modified_occurence(_) && (e._events[i] || (_.rec_type = _.rec_pattern = "none", this.setEvent(i, _))); - }), e.attachEvent("onEventChanged", function(i, _) { + }), e.attachEvent("onEventDeleted", function(n, s) { + !this._is_virtual_event(n) && this._is_modified_occurence(s) && (e._events[n] || (s.rec_type = s.rec_pattern = "none", this.setEvent(n, s))); + }), e.attachEvent("onEventChanged", function(n, s) { if (this._loading) return !0; - var o = this.getEvent(i); - if (this._is_virtual_event(i)) { - i = i.split("#"); - var t = this.uid(); + var _ = this.getEvent(n); + if (this._is_virtual_event(n)) { + n = n.split("#"); + var a = this.uid(); this._not_render = !0; - var n = this._copy_event(_); - n.id = t, n.event_pid = i[0]; - var s = i[1]; - n.event_length = s, n.rec_type = n.rec_pattern = "", this._add_rec_marker(n, 1e3 * s), this.addEvent(n), this._not_render = !1; + var o = this._copy_event(s); + o.id = a, o.event_pid = n[0]; + var l = n[1]; + o.event_length = l, o.rec_type = o.rec_pattern = "", this._add_rec_marker(o, 1e3 * l), this.addEvent(o), this._not_render = !1; } else { - o.start_date && (o.start_date = r(o.start_date)), o.end_date && (o.end_date = r(o.end_date)), o.rec_type && this._lightbox_id && this._roll_back_dates(o); - var c = this._get_rec_markers(i); - for (var u in c) - c.hasOwnProperty(u) && (delete this._rec_markers[c[u].id], this.deleteEvent(c[u].id, !0)); - delete this._rec_markers_pull[i]; - for (var v = !1, m = 0; m < this._rendered.length; m++) - this._rendered[m].getAttribute(this.config.event_attribute) == i && (v = !0); - v || (this._select_id = null); + _.start_date && (_.start_date = r(_.start_date)), _.end_date && (_.end_date = r(_.end_date)), _.rec_type && this._lightbox_id && this._roll_back_dates(_); + var h = this._get_rec_markers(n); + for (var v in h) + h.hasOwnProperty(v) && (delete this._rec_markers[h[v].id], this.deleteEvent(h[v].id, !0)); + delete this._rec_markers_pull[n]; + for (var u = !1, f = 0; f < this._rendered.length; f++) + this._rendered[f].getAttribute(this.config.event_attribute) == n && (u = !0); + u || (this._select_id = null); } return !0; - }), e.attachEvent("onEventAdded", function(i) { + }), e.attachEvent("onEventAdded", function(n) { if (!this._loading) { - var _ = this.getEvent(i); - _.rec_type && !_.event_length && this._roll_back_dates(_); + var s = this.getEvent(n); + s.rec_type && !s.event_length && this._roll_back_dates(s); } return !0; - }), e.attachEvent("onEventSave", function(i, _, o) { - return this.getEvent(i).rec_type || !_.rec_type || this._is_virtual_event(i) || (this._select_id = null), !0; - }), e.attachEvent("onEventCreated", function(i) { - var _ = this.getEvent(i); - return _.rec_type || (_.rec_type = _.rec_pattern = _.event_length = _.event_pid = ""), !0; - }), e.attachEvent("onEventCancel", function(i) { - var _ = this.getEvent(i); - _.rec_type && (this._roll_back_dates(_), this.render_view_data()); - }), e._roll_back_dates = function(i) { - i.start_date && (i.start_date = r(i.start_date)), i.end_date && (i.end_date = r(i.end_date)), i.event_length = Math.round((i.end_date.valueOf() - i.start_date.valueOf()) / 1e3), i.end_date = i._end_date, i._start_date && (i.start_date.setMonth(0), i.start_date.setDate(i._start_date.getDate()), i.start_date.setMonth(i._start_date.getMonth()), i.start_date.setFullYear(i._start_date.getFullYear())); - }, e._is_virtual_event = function(i) { - return i.toString().indexOf("#") != -1; - }, e._is_modified_occurence = function(i) { - return i.event_pid && i.event_pid != "0"; - }, e.showLightbox_rec = e.showLightbox, e.showLightbox = function(i) { - var _ = this.locale, o = e.config.lightbox_recurring, t = this.getEvent(i), n = t.event_pid, s = this._is_virtual_event(i); - s && (n = i.split("#")[0]); - var c = function(v) { - var m = e.getEvent(v); - return m._end_date = m.end_date, m.end_date = new Date(m.start_date.valueOf() + 1e3 * m.event_length), e.showLightbox_rec(v); + }), e.attachEvent("onEventSave", function(n, s, _) { + return this.getEvent(n).rec_type || !s.rec_type || this._is_virtual_event(n) || (this._select_id = null), !0; + }), e.attachEvent("onEventCreated", function(n) { + var s = this.getEvent(n); + return s.rec_type || (s.rec_type = s.rec_pattern = s.event_length = s.event_pid = ""), !0; + }), e.attachEvent("onEventCancel", function(n) { + var s = this.getEvent(n); + s.rec_type && (this._roll_back_dates(s), this.render_view_data()); + }), e._roll_back_dates = function(n) { + n.start_date && (n.start_date = r(n.start_date)), n.end_date && (n.end_date = r(n.end_date)), n.event_length = Math.round((n.end_date.valueOf() - n.start_date.valueOf()) / 1e3), n.end_date = n._end_date, n._start_date && (n.start_date.setMonth(0), n.start_date.setDate(n._start_date.getDate()), n.start_date.setMonth(n._start_date.getMonth()), n.start_date.setFullYear(n._start_date.getFullYear())); + }, e._is_virtual_event = function(n) { + return n.toString().indexOf("#") != -1; + }, e._is_modified_occurence = function(n) { + return n.event_pid && n.event_pid != "0"; + }, e.showLightbox_rec = e.showLightbox, e.showLightbox = function(n) { + var s = this.locale, _ = e.config.lightbox_recurring, a = this.getEvent(n), o = a.event_pid, l = this._is_virtual_event(n); + l && (o = n.split("#")[0]); + var h = function(u) { + var f = e.getEvent(u); + return f._end_date = f.end_date, f.end_date = new Date(f.start_date.valueOf() + 1e3 * f.event_length), e.showLightbox_rec(u); }; - if ((n || 1 * n == 0) && t.rec_type) - return c(i); - if (!n || n === "0" || !_.labels.confirm_recurring || o == "instance" || o == "series" && !s) - return this.showLightbox_rec(i); - if (o == "ask") { - var u = this; - e.modalbox({ text: _.labels.confirm_recurring, title: _.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [_.labels.button_edit_series, _.labels.button_edit_occurrence, _.labels.icon_cancel], callback: function(v) { - switch (+v) { + if ((o || 1 * o == 0) && a.rec_type) + return h(n); + if (!o || o === "0" || !s.labels.confirm_recurring || _ == "instance" || _ == "series" && !l) + return this.showLightbox_rec(n); + if (_ == "ask") { + var v = this; + e.modalbox({ text: s.labels.confirm_recurring, title: s.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [s.labels.button_edit_series, s.labels.button_edit_occurrence, s.labels.icon_cancel], callback: function(u) { + switch (+u) { case 0: - return c(n); + return h(o); case 1: - return u.showLightbox_rec(i); + return v.showLightbox_rec(n); case 2: return; } } }); } else - c(n); - }, e.get_visible_events_rec = e.get_visible_events, e.get_visible_events = function(i) { - for (var _ = 0; _ < this._rec_temp.length; _++) - delete this._events[this._rec_temp[_].id]; + h(o); + }, e.get_visible_events_rec = e.get_visible_events, e.get_visible_events = function(n) { + for (var s = 0; s < this._rec_temp.length; s++) + delete this._events[this._rec_temp[s].id]; this._rec_temp = []; - var o = this.get_visible_events_rec(i), t = []; - for (_ = 0; _ < o.length; _++) - o[_].rec_type ? o[_].rec_pattern != "none" && this.repeat_date(o[_], t) : t.push(o[_]); - return t; + var _ = this.get_visible_events_rec(n), a = []; + for (s = 0; s < _.length; s++) + _[s].rec_type ? _[s].rec_pattern != "none" && this.repeat_date(_[s], a) : a.push(_[s]); + return a; }, function() { - var i = e.isOneDayEvent; - e.isOneDayEvent = function(o) { - return !!o.rec_type || i.call(this, o); + var n = e.isOneDayEvent; + e.isOneDayEvent = function(_) { + return !!_.rec_type || n.call(this, _); }; - var _ = e.updateEvent; - e.updateEvent = function(o) { - var t = e.getEvent(o); - t && t.rec_type && (t.rec_pattern = (t.rec_type || "").split("#")[0]), t && t.rec_type && !this._is_virtual_event(o) ? e.update_view() : _.call(this, o); + var s = e.updateEvent; + e.updateEvent = function(_) { + var a = e.getEvent(_); + a && a.rec_type && (a.rec_pattern = (a.rec_type || "").split("#")[0]), a && a.rec_type && !this._is_virtual_event(_) ? e.update_view() : s.call(this, _); }; - }(), e.transponse_size = { day: 1, week: 7, month: 1, year: 12 }, e.date.day_week = function(i, _, o) { - i.setDate(1); - var t = e.date.month_start(new Date(i)), n = 1 * _ + (o = 7 * (o - 1)) - i.getDay() + 1; - i.setDate(n <= o ? n + 7 : n); - var s = e.date.month_start(new Date(i)); - return t.valueOf() === s.valueOf(); - }, e.transpose_day_week = function(i, _, o, t, n) { - for (var s = (i.getDay() || (e.config.start_on_monday ? 7 : 0)) - o, c = 0; c < _.length; c++) - if (_[c] > s) - return i.setDate(i.getDate() + 1 * _[c] - s - (t ? o : n)); - this.transpose_day_week(i, _, o + t, null, o); - }, e.transpose_type = function(i) { - var _ = "transpose_" + i; - if (!this.date[_]) { - var o = i.split("_"), t = "add_" + i, n = this.transponse_size[o[0]] * o[1]; - if (o[0] == "day" || o[0] == "week") { - var s = null; - if (o[4] && (s = o[4].split(","), e.config.start_on_monday)) { - for (var c = 0; c < s.length; c++) - s[c] = 1 * s[c] || 7; - s.sort(); + }(), e.transponse_size = { day: 1, week: 7, month: 1, year: 12 }, e.date.day_week = function(n, s, _) { + n.setDate(1); + var a = e.date.month_start(new Date(n)), o = 1 * s + (_ = 7 * (_ - 1)) - n.getDay() + 1; + n.setDate(o <= _ ? o + 7 : o); + var l = e.date.month_start(new Date(n)); + return a.valueOf() === l.valueOf(); + }, e.transpose_day_week = function(n, s, _, a, o) { + for (var l = (n.getDay() || (e.config.start_on_monday ? 7 : 0)) - _, h = 0; h < s.length; h++) + if (s[h] > l) + return n.setDate(n.getDate() + 1 * s[h] - l - (a ? _ : o)); + this.transpose_day_week(n, s, _ + a, null, _); + }, e.transpose_type = function(n) { + var s = "transpose_" + n; + if (!this.date[s]) { + var _ = n.split("_"), a = "add_" + n, o = this.transponse_size[_[0]] * _[1]; + if (_[0] == "day" || _[0] == "week") { + var l = null; + if (_[4] && (l = _[4].split(","), e.config.start_on_monday)) { + for (var h = 0; h < l.length; h++) + l[h] = 1 * l[h] || 7; + l.sort(); } - this.date[_] = function(u, v) { - var m = Math.floor((v.valueOf() - u.valueOf()) / (864e5 * n)); - return m > 0 && u.setDate(u.getDate() + m * n), s && e.transpose_day_week(u, s, 1, n), u; - }, this.date[t] = function(u, v) { - var m = new Date(u.valueOf()); - if (s) - for (var l = 0; l < v; l++) - e.transpose_day_week(m, s, 0, n); + this.date[s] = function(v, u) { + var f = Math.floor((u.valueOf() - v.valueOf()) / (864e5 * o)); + return f > 0 && v.setDate(v.getDate() + f * o), l && e.transpose_day_week(v, l, 1, o), v; + }, this.date[a] = function(v, u) { + var f = new Date(v.valueOf()); + if (l) + for (var c = 0; c < u; c++) + e.transpose_day_week(f, l, 0, o); else - m.setDate(m.getDate() + v * n); - return m; + f.setDate(f.getDate() + u * o); + return f; }; } else - o[0] != "month" && o[0] != "year" || (this.date[_] = function(u, v, m) { - var l = Math.ceil((12 * v.getFullYear() + 1 * v.getMonth() + 1 - (12 * u.getFullYear() + 1 * u.getMonth() + 1)) / n - 1); - return l >= 0 && (u.setDate(1), u.setMonth(u.getMonth() + l * n)), e.date[t](u, 0, m); - }, this.date[t] = function(u, v, m, l) { - if (l ? l++ : l = 1, l > 12) + _[0] != "month" && _[0] != "year" || (this.date[s] = function(v, u, f) { + var c = Math.ceil((12 * u.getFullYear() + 1 * u.getMonth() + 1 - (12 * v.getFullYear() + 1 * v.getMonth() + 1)) / o - 1); + return c >= 0 && (v.setDate(1), v.setMonth(v.getMonth() + c * o)), e.date[a](v, 0, f); + }, this.date[a] = function(v, u, f, c) { + if (c ? c++ : c = 1, c > 12) return null; - var f = new Date(u.valueOf()); - f.setDate(1), f.setMonth(f.getMonth() + v * n); - var g = f.getMonth(), p = f.getFullYear(); - f.setDate(m.start_date.getDate()), o[3] && e.date.day_week(f, o[2], o[3]); + var p = new Date(v.valueOf()); + p.setDate(1), p.setMonth(p.getMonth() + u * o); + var m = p.getMonth(), g = p.getFullYear(); + p.setDate(f.start_date.getDate()), _[3] && e.date.day_week(p, _[2], _[3]); var y = e.config.recurring_overflow_instances; - return f.getMonth() != g && y != "none" && (f = y === "lastDay" ? new Date(p, g + 1, 0, f.getHours(), f.getMinutes(), f.getSeconds(), f.getMilliseconds()) : e.date[t](new Date(p, g + 1, 0), v || 1, m, l)), f; + return p.getMonth() != m && y != "none" && (p = y === "lastDay" ? new Date(g, m + 1, 0, p.getHours(), p.getMinutes(), p.getSeconds(), p.getMilliseconds()) : e.date[a](new Date(g, m + 1, 0), u || 1, f, c)), p; }); } - }, e.repeat_date = function(i, _, o, t, n, s) { - t = t || this._min_date, n = n || this._max_date; - var c = s || -1, u = new Date(i.start_date.valueOf()), v = u.getHours(), m = 0; - for (!i.rec_pattern && i.rec_type && (i.rec_pattern = i.rec_type.split("#")[0]), this.transpose_type(i.rec_pattern), u = e.date["transpose_" + i.rec_pattern](u, t, i); u && (u < i.start_date || e._fix_daylight_saving_date(u, t, i, u, new Date(u.valueOf() + 1e3 * i.event_length)).valueOf() <= t.valueOf() || u.valueOf() + 1e3 * i.event_length <= t.valueOf()); ) - u = this.date["add_" + i.rec_pattern](u, 1, i); - for (; u && u < n && u < i.end_date && (c < 0 || m < c); ) { - u.setHours(v); - var l = e.config.occurrence_timestamp_in_utc ? Date.UTC(u.getFullYear(), u.getMonth(), u.getDate(), u.getHours(), u.getMinutes(), u.getSeconds()) : u.valueOf(), f = this._get_rec_marker(l, i.id); - if (f) - o && (f.rec_type != "none" && m++, _.push(f)); + }, e.repeat_date = function(n, s, _, a, o, l) { + a = a || this._min_date, o = o || this._max_date; + var h = l || -1, v = new Date(n.start_date.valueOf()), u = v.getHours(), f = 0; + for (!n.rec_pattern && n.rec_type && (n.rec_pattern = n.rec_type.split("#")[0]), this.transpose_type(n.rec_pattern), v = e.date["transpose_" + n.rec_pattern](v, a, n); v && (v < n.start_date || e._fix_daylight_saving_date(v, a, n, v, new Date(v.valueOf() + 1e3 * n.event_length)).valueOf() <= a.valueOf() || v.valueOf() + 1e3 * n.event_length <= a.valueOf()); ) + v = this.date["add_" + n.rec_pattern](v, 1, n); + for (; v && v < o && v < n.end_date && (h < 0 || f < h); ) { + v.setHours(u); + var c = e.config.occurrence_timestamp_in_utc ? Date.UTC(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes(), v.getSeconds()) : v.valueOf(), p = this._get_rec_marker(c, n.id); + if (p) + _ && (p.rec_type != "none" && f++, s.push(p)); else { - var g = new Date(u.valueOf() + 1e3 * i.event_length), p = this._copy_event(i); - if (p.text = i.text, p.start_date = u, p.event_pid = i.id, p.id = i.id + "#" + Math.round(l / 1e3), p.end_date = g, p.end_date = e._fix_daylight_saving_date(p.start_date, p.end_date, i, u, p.end_date), p._timed = this.isOneDayEvent(p), !p._timed && !this._table_view && !this.config.multi_day) + var m = new Date(v.valueOf() + 1e3 * n.event_length), g = this._copy_event(n); + if (g.text = n.text, g.start_date = v, g.event_pid = n.id, g.id = n.id + "#" + Math.round(c / 1e3), g.end_date = m, g.end_date = e._fix_daylight_saving_date(g.start_date, g.end_date, n, v, g.end_date), g._timed = this.isOneDayEvent(g), !g._timed && !this._table_view && !this.config.multi_day) return; - _.push(p), o || (this._events[p.id] = p, this._rec_temp.push(p)), m++; - } - u = this.date["add_" + i.rec_pattern](u, 1, i); - } - }, e._fix_daylight_saving_date = function(i, _, o, t, n) { - var s = i.getTimezoneOffset() - _.getTimezoneOffset(); - return s ? s > 0 ? new Date(t.valueOf() + 1e3 * o.event_length - 60 * s * 1e3) : new Date(_.valueOf() - 60 * s * 1e3) : new Date(n.valueOf()); - }, e.getRecDates = function(i, _) { - var o = typeof i == "object" ? i : e.getEvent(i), t = []; - if (_ = _ || 100, !o.rec_type) - return [{ start_date: o.start_date, end_date: o.end_date }]; - if (o.rec_type == "none") + s.push(g), _ || (this._events[g.id] = g, this._rec_temp.push(g)), f++; + } + v = this.date["add_" + n.rec_pattern](v, 1, n); + } + }, e._fix_daylight_saving_date = function(n, s, _, a, o) { + var l = n.getTimezoneOffset() - s.getTimezoneOffset(); + return l ? l > 0 ? new Date(a.valueOf() + 1e3 * _.event_length - 60 * l * 1e3) : new Date(s.valueOf() - 60 * l * 1e3) : new Date(o.valueOf()); + }, e.getRecDates = function(n, s) { + var _ = typeof n == "object" ? n : e.getEvent(n), a = []; + if (s = s || 100, !_.rec_type) + return [{ start_date: _.start_date, end_date: _.end_date }]; + if (_.rec_type == "none") return []; - e.repeat_date(o, t, !0, o.start_date, o.end_date, _); - for (var n = [], s = 0; s < t.length; s++) - t[s].rec_type != "none" && n.push({ start_date: t[s].start_date, end_date: t[s].end_date }); - return n; - }, e.getEvents = function(i, _) { - var o = []; - for (var t in this._events) { - var n = this._events[t]; - if (n && n.start_date < _ && n.end_date > i) - if (n.rec_pattern) { - if (n.rec_pattern == "none") + e.repeat_date(_, a, !0, _.start_date, _.end_date, s); + for (var o = [], l = 0; l < a.length; l++) + a[l].rec_type != "none" && o.push({ start_date: a[l].start_date, end_date: a[l].end_date }); + return o; + }, e.getEvents = function(n, s) { + var _ = []; + for (var a in this._events) { + var o = this._events[a]; + if (o && o.start_date < s && o.end_date > n) + if (o.rec_pattern) { + if (o.rec_pattern == "none") continue; - var s = []; - this.repeat_date(n, s, !0, i, _); - for (var c = 0; c < s.length; c++) - !s[c].rec_pattern && s[c].start_date < _ && s[c].end_date > i && !this._rec_markers[s[c].id] && o.push(s[c]); + var l = []; + this.repeat_date(o, l, !0, n, s); + for (var h = 0; h < l.length; h++) + !l[h].rec_pattern && l[h].start_date < s && l[h].end_date > n && !this._rec_markers[l[h].id] && _.push(l[h]); } else - this._is_virtual_event(n.id) || o.push(n); + this._is_virtual_event(o.id) || _.push(o); } - return o; - }, e.config.repeat_date = "%m.%d.%Y", e.config.lightbox.sections = [{ name: "description", map_to: "text", type: "textarea", focus: !0 }, { name: "recurring", type: "recurring", map_to: "rec_type", button: "recurring" }, { name: "time", height: 72, type: "time", map_to: "auto" }], e._copy_dummy = function(i) { - var _ = new Date(this.start_date), o = new Date(this.end_date); - this.start_date = _, this.end_date = o, this.event_length = this.event_pid = this.rec_pattern = this.rec_type = null; + return _; + }, e.config.repeat_date = "%m.%d.%Y", e.config.lightbox.sections = [{ name: "description", map_to: "text", type: "textarea", focus: !0 }, { name: "recurring", type: "recurring", map_to: "rec_type", button: "recurring" }, { name: "time", height: 72, type: "time", map_to: "auto" }], e._copy_dummy = function(n) { + var s = new Date(this.start_date), _ = new Date(this.end_date); + this.start_date = s, this.end_date = _, this.event_length = this.event_pid = this.rec_pattern = this.rec_type = null; }, e.config.include_end_by = !1, e.config.lightbox_recurring = "ask", e.attachEvent("onClearAll", function() { e._rec_markers = {}, e._rec_markers_pull = {}, e._rec_temp = []; }); }, serialize: function(e) { - const h = oe(e); + const i = mt(e); e.data_attributes = function() { - var a = [], r = e._helpers.formatDate, d = h(); - for (var i in d) { - var _ = d[i]; - for (var o in _) - o.substr(0, 1) != "_" && a.push([o, o == "start_date" || o == "end_date" ? r : null]); + var t = [], r = e._helpers.formatDate, d = i(); + for (var n in d) { + var s = d[n]; + for (var _ in s) + _.substr(0, 1) != "_" && t.push([_, _ == "start_date" || _ == "end_date" ? r : null]); break; } - return a; - }, e.toXML = function(a) { - var r = [], d = this.data_attributes(), i = h(); - for (var _ in i) { - var o = i[_]; + return t; + }, e.toXML = function(t) { + var r = [], d = this.data_attributes(), n = i(); + for (var s in n) { + var _ = n[s]; r.push(""); - for (var t = 0; t < d.length; t++) - r.push("<" + d[t][0] + ">"); + for (var a = 0; a < d.length; a++) + r.push("<" + d[a][0] + ">"); r.push(""); } - return (a || "") + "" + r.join(` + return (t || "") + "" + r.join(` `) + ""; - }, e._serialize_json_value = function(a) { - return a === null || typeof a == "boolean" ? a = "" + a : (a || a === 0 || (a = ""), a = '"' + a.toString().replace(/\n/g, "").replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"'), a; + }, e._serialize_json_value = function(t) { + return t === null || typeof t == "boolean" ? t = "" + t : (t || t === 0 || (t = ""), t = '"' + t.toString().replace(/\n/g, "").replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"'), t; }, e.toJSON = function() { return JSON.stringify(this.serialize()); - }, e.toICal = function(a) { - var r = e.date.date_to_str("%Y%m%dT%H%i%s"), d = e.date.date_to_str("%Y%m%d"), i = [], _ = h(); - for (var o in _) { - var t = _[o]; - i.push("BEGIN:VEVENT"), t._timed && (t.start_date.getHours() || t.start_date.getMinutes()) ? i.push("DTSTART:" + r(t.start_date)) : i.push("DTSTART:" + d(t.start_date)), t._timed && (t.end_date.getHours() || t.end_date.getMinutes()) ? i.push("DTEND:" + r(t.end_date)) : i.push("DTEND:" + d(t.end_date)), i.push("SUMMARY:" + t.text), i.push("END:VEVENT"); + }, e.toICal = function(t) { + var r = e.date.date_to_str("%Y%m%dT%H%i%s"), d = e.date.date_to_str("%Y%m%d"), n = [], s = i(); + for (var _ in s) { + var a = s[_]; + n.push("BEGIN:VEVENT"), a._timed && (a.start_date.getHours() || a.start_date.getMinutes()) ? n.push("DTSTART:" + r(a.start_date)) : n.push("DTSTART:" + d(a.start_date)), a._timed && (a.end_date.getHours() || a.end_date.getMinutes()) ? n.push("DTEND:" + r(a.end_date)) : n.push("DTEND:" + d(a.end_date)), n.push("SUMMARY:" + a.text), n.push("END:VEVENT"); } return `BEGIN:VCALENDAR VERSION:2.0 PRODID:-//dhtmlXScheduler//NONSGML v2.2//EN -DESCRIPTION:` + (a || "") + ` -` + i.join(` +DESCRIPTION:` + (t || "") + ` +` + n.join(` `) + ` END:VCALENDAR`; }; }, timeline: function(e) { - R("Timeline", e.assert); + de("Timeline", e.assert); }, tooltip: function(e) { e.config.tooltip_timeout = 30, e.config.tooltip_offset_y = 20, e.config.tooltip_offset_x = 10, e.config.tooltip_hide_timeout = 30; - const h = new _t(e); - e.ext.tooltips = h, e.attachEvent("onSchedulerReady", function() { - h.tooltipFor({ selector: "[" + e.config.event_attribute + "]", html: (a) => { + const i = new vn(e); + e.ext.tooltips = i, e.attachEvent("onSchedulerReady", function() { + i.tooltipFor({ selector: "[" + e.config.event_attribute + "]", html: (t) => { if (e._mobile && !e.config.touch_tooltip) return; - const r = e._locate_event(a.target); + const r = e._locate_event(t.target); if (e.getEvent(r)) { const d = e.getEvent(r); return e.templates.tooltip_text(d.start_date, d.end_date, d); @@ -7856,68 +10148,68 @@ END:VCALENDAR`; return null; }, global: !1 }); }), e.attachEvent("onDestroy", function() { - h.destructor(); + i.destructor(); }), e.attachEvent("onLightbox", function() { - h.hideTooltip(); + i.hideTooltip(); }), e.attachEvent("onBeforeDrag", function() { - return h.hideTooltip(), !0; + return i.hideTooltip(), !0; }), e.attachEvent("onEventDeleted", function() { - return h.hideTooltip(), !0; + return i.hideTooltip(), !0; }); }, treetimeline: function(e) { - R("Tree Timeline", e.assert); + de("Tree Timeline", e.assert); }, units: function(e) { - R("Units", e.assert); + de("Units", e.assert); }, url: function(e) { e._get_url_nav = function() { - for (var h = {}, a = (document.location.hash || "").replace("#", "").split(","), r = 0; r < a.length; r++) { - var d = a[r].split("="); - d.length == 2 && (h[d[0]] = d[1]); + for (var i = {}, t = (document.location.hash || "").replace("#", "").split(","), r = 0; r < t.length; r++) { + var d = t[r].split("="); + d.length == 2 && (i[d[0]] = d[1]); } - return h; + return i; }, e.attachEvent("onTemplatesReady", function() { - var h = !0, a = e.date.str_to_date("%Y-%m-%d"), r = e.date.date_to_str("%Y-%m-%d"), d = e._get_url_nav().event || null; - function i(_) { + var i = !0, t = e.date.str_to_date("%Y-%m-%d"), r = e.date.date_to_str("%Y-%m-%d"), d = e._get_url_nav().event || null; + function n(s) { if (e.$destroyed) return !0; - d = _, e.getEvent(_) && e.showEvent(_); + d = s, e.getEvent(s) && e.showEvent(s); } - e.attachEvent("onAfterEventDisplay", function(_) { + e.attachEvent("onAfterEventDisplay", function(s) { return d = null, !0; - }), e.attachEvent("onBeforeViewChange", function(_, o, t, n) { - if (h) { - h = !1; - var s = e._get_url_nav(); - if (s.event) + }), e.attachEvent("onBeforeViewChange", function(s, _, a, o) { + if (i) { + i = !1; + var l = e._get_url_nav(); + if (l.event) try { - if (e.getEvent(s.event)) + if (e.getEvent(l.event)) return setTimeout(function() { - i(s.event); + n(l.event); }), !1; - var c = e.attachEvent("onXLE", function() { + var h = e.attachEvent("onXLE", function() { setTimeout(function() { - i(s.event); - }), e.detachEvent(c); + n(l.event); + }), e.detachEvent(h); }); } catch { } - if (s.date || s.mode) { + if (l.date || l.mode) { try { - this.setCurrentView(s.date ? a(s.date) : null, s.mode || null); + this.setCurrentView(l.date ? t(l.date) : null, l.mode || null); } catch { - this.setCurrentView(s.date ? a(s.date) : null, t); + this.setCurrentView(l.date ? t(l.date) : null, a); } return !1; } } - var u = ["date=" + r(n || o), "mode=" + (t || _)]; - d && u.push("event=" + d); - var v = "#" + u.join(","); - return document.location.hash = v, !0; + var v = ["date=" + r(o || _), "mode=" + (a || s)]; + d && v.push("event=" + d); + var u = "#" + v.join(","); + return document.location.hash = u, !0; }); }); }, week_agenda: function(e) { - R("Week Agenda", e.assert); + de("Week Agenda", e.assert); }, wp: function(e) { e.attachEvent("onLightBox", function() { if (this._cover) @@ -7925,103 +10217,103 @@ END:VCALENDAR`; this._cover.style.height = this.expanded ? "100%" : (document.body.parentNode || document.body).scrollHeight + "px"; } catch { } - }), e.form_blocks.select.set_value = function(h, a, r) { - a !== void 0 && a !== "" || (a = (h.firstChild.options[0] || {}).value), h.firstChild.value = a || ""; + }), e.form_blocks.select.set_value = function(i, t, r) { + t !== void 0 && t !== "" || (t = (i.firstChild.options[0] || {}).value), i.firstChild.value = t || ""; }; }, year_view: function(e) { - e.templates.year_date = function(o) { - return e.date.date_to_str(e.locale.labels.year_tab + " %Y")(o); - }, e.templates.year_month = e.date.date_to_str("%F"), e.templates.year_scale_date = e.date.date_to_str("%D"), e.templates.year_tooltip = function(o, t, n) { - return n.text; + e.templates.year_date = function(_) { + return e.date.date_to_str(e.locale.labels.year_tab + " %Y")(_); + }, e.templates.year_month = e.date.date_to_str("%F"), e.templates.year_scale_date = e.date.date_to_str("%D"), e.templates.year_tooltip = function(_, a, o) { + return o.text; }; - const h = function() { + const i = function() { return e._mode == "year"; - }, a = function(o) { - var t = e.$domHelpers.closest(o, "[data-cell-date]"); - return t && t.hasAttribute("data-cell-date") ? e.templates.parse_date(t.getAttribute("data-cell-date")) : null; + }, t = function(_) { + var a = e.$domHelpers.closest(_, "[data-cell-date]"); + return a && a.hasAttribute("data-cell-date") ? e.templates.parse_date(a.getAttribute("data-cell-date")) : null; }; - e.dblclick_dhx_month_head = function(o) { - if (h()) { - const t = o.target; - if (e.$domHelpers.closest(t, ".dhx_before") || e.$domHelpers.closest(t, ".dhx_after")) + e.dblclick_dhx_year_grid = function(_) { + if (i()) { + const a = _.target; + if (e.$domHelpers.closest(a, ".dhx_before") || e.$domHelpers.closest(a, ".dhx_after")) return !1; - const n = a(t); - if (n) { - const s = n, c = this.date.add(s, 1, "day"); - !this.config.readonly && this.config.dblclick_create && this.addEventNow(s.valueOf(), c.valueOf(), o); + const o = t(a); + if (o) { + const l = o, h = this.date.add(l, 1, "day"); + !this.config.readonly && this.config.dblclick_create && this.addEventNow(l.valueOf(), h.valueOf(), _); } } }, e.attachEvent("onEventIdChange", function() { - h() && this.year_view(!0); + i() && this.year_view(!0); }); var r = e.render_data; - e.render_data = function(o) { - if (!h()) + e.render_data = function(_) { + if (!i()) return r.apply(this, arguments); - for (var t = 0; t < o.length; t++) - this._year_render_event(o[t]); + for (var a = 0; a < _.length; a++) + this._year_render_event(_[a]); }; var d = e.clear_view; e.clear_view = function() { - if (!h()) + if (!i()) return d.apply(this, arguments); - var o = e._year_marked_cells; - for (var t in o) - o.hasOwnProperty(t) && o[t].classList.remove("dhx_year_event", "dhx_cal_datepicker_event"); + var _ = e._year_marked_cells; + for (var a in _) + _.hasOwnProperty(a) && _[a].classList.remove("dhx_year_event", "dhx_cal_datepicker_event"); e._year_marked_cells = {}; }, e._hideToolTip = function() { this._tooltip && (this._tooltip.style.display = "none", this._tooltip.date = new Date(9999, 1, 1)); - }, e._showToolTip = function(o, t, n, s) { + }, e._showToolTip = function(_, a, o, l) { if (this._tooltip) { - if (this._tooltip.date.valueOf() == o.valueOf()) + if (this._tooltip.date.valueOf() == _.valueOf()) return; this._tooltip.innerHTML = ""; } else { - var c = this._tooltip = document.createElement("div"); - c.className = "dhx_year_tooltip", this.config.rtl && (c.className += " dhx_tooltip_rtl"), document.body.appendChild(c), c.addEventListener("click", e._click.dhx_cal_data), c.addEventListener("click", function(p) { - if (p.target.closest(`[${e.config.event_attribute}]`)) { - const y = p.target.closest(`[${e.config.event_attribute}]`).getAttribute(e.config.event_attribute); + var h = this._tooltip = document.createElement("div"); + h.className = "dhx_year_tooltip", this.config.rtl && (h.className += " dhx_tooltip_rtl"), document.body.appendChild(h), h.addEventListener("click", e._click.dhx_cal_data), h.addEventListener("click", function(g) { + if (g.target.closest(`[${e.config.event_attribute}]`)) { + const y = g.target.closest(`[${e.config.event_attribute}]`).getAttribute(e.config.event_attribute); e.showLightbox(y); } }); } - for (var u = this.getEvents(o, this.date.add(o, 1, "day")), v = "", m = 0; m < u.length; m++) { - var l = u[m]; - if (this.filter_event(l.id, l)) { - var f = l.color ? "--dhx-scheduler-event-background:" + l.color + ";" : "", g = l.textColor ? "--dhx-scheduler-event-color:" + l.textColor + ";" : ""; - v += "
", v += "
" + (u[m]._timed ? this.templates.event_date(u[m].start_date) : "") + "
", v += "
 
", v += this.templates.year_tooltip(u[m].start_date, u[m].end_date, u[m]) + "
"; + for (var v = this.getEvents(_, this.date.add(_, 1, "day")), u = "", f = 0; f < v.length; f++) { + var c = v[f]; + if (this.filter_event(c.id, c)) { + var p = c.color ? "--dhx-scheduler-event-background:" + c.color + ";" : "", m = c.textColor ? "--dhx-scheduler-event-color:" + c.textColor + ";" : ""; + u += "
", u += "
" + (v[f]._timed ? this.templates.event_date(v[f].start_date) : "") + "
", u += "
 
", u += this.templates.year_tooltip(v[f].start_date, v[f].end_date, v[f]) + "
"; } } - this._tooltip.style.display = "", this._tooltip.style.top = "0px", document.body.offsetWidth - t.left - this._tooltip.offsetWidth < 0 ? this._tooltip.style.left = t.left - this._tooltip.offsetWidth + "px" : this._tooltip.style.left = t.left + s.offsetWidth + "px", this._tooltip.date = o, this._tooltip.innerHTML = v, document.body.offsetHeight - t.top - this._tooltip.offsetHeight < 0 ? this._tooltip.style.top = t.top - this._tooltip.offsetHeight + s.offsetHeight + "px" : this._tooltip.style.top = t.top + "px"; - }, e._year_view_tooltip_handler = function(o) { - if (h()) { - var t = o.target || o.srcElement; - t.tagName.toLowerCase() == "a" && (t = t.parentNode), e._getClassName(t).indexOf("dhx_year_event") != -1 ? e._showToolTip(e.templates.parse_date(t.getAttribute("data-year-date")), e.$domHelpers.getOffset(t), o, t) : e._hideToolTip(); + this._tooltip.style.display = "", this._tooltip.style.top = "0px", document.body.offsetWidth - a.left - this._tooltip.offsetWidth < 0 ? this._tooltip.style.left = a.left - this._tooltip.offsetWidth + "px" : this._tooltip.style.left = a.left + l.offsetWidth + "px", this._tooltip.date = _, this._tooltip.innerHTML = u, document.body.offsetHeight - a.top - this._tooltip.offsetHeight < 0 ? this._tooltip.style.top = a.top - this._tooltip.offsetHeight + l.offsetHeight + "px" : this._tooltip.style.top = a.top + "px"; + }, e._year_view_tooltip_handler = function(_) { + if (i()) { + var a = _.target || _.srcElement; + a.tagName.toLowerCase() == "a" && (a = a.parentNode), e._getClassName(a).indexOf("dhx_year_event") != -1 ? e._showToolTip(e.templates.parse_date(a.getAttribute("data-year-date")), e.$domHelpers.getOffset(a), _, a) : e._hideToolTip(); } }, e._init_year_tooltip = function() { e._detachDomEvent(e._els.dhx_cal_data[0], "mouseover", e._year_view_tooltip_handler), e.event(e._els.dhx_cal_data[0], "mouseover", e._year_view_tooltip_handler); - }, e._get_year_cell = function(o) { - for (var t = e.templates.format_date(o), n = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date="${t}"]`), s = 0; s < n.length; s++) - if (!e.$domHelpers.closest(n[s], ".dhx_after, .dhx_before")) - return n[s]; + }, e._get_year_cell = function(_) { + for (var a = e.templates.format_date(_), o = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date="${a}"]`), l = 0; l < o.length; l++) + if (!e.$domHelpers.closest(o[l], ".dhx_after, .dhx_before")) + return o[l]; return null; - }, e._year_marked_cells = {}, e._mark_year_date = function(o, t) { - var n = e.templates.format_date(o), s = this._get_year_cell(o); - if (s) { - var c = this.templates.event_class(t.start_date, t.end_date, t); - e._year_marked_cells[n] || (s.classList.add("dhx_year_event", "dhx_cal_datepicker_event"), s.setAttribute("data-year-date", n), s.setAttribute("date", n), e._year_marked_cells[n] = s), c && s.classList.add(c); - } - }, e._unmark_year_date = function(o) { - var t = this._get_year_cell(o); - t && t.classList.remove("dhx_year_event", "dhx_cal_datepicker_event"); - }, e._year_render_event = function(o) { - var t = o.start_date; - for (t = t.valueOf() < this._min_date.valueOf() ? this._min_date : this.date.date_part(new Date(t)); t < o.end_date; ) - if (this._mark_year_date(t, o), (t = this.date.add(t, 1, "day")).valueOf() >= this._max_date.valueOf()) + }, e._year_marked_cells = {}, e._mark_year_date = function(_, a) { + var o = e.templates.format_date(_), l = this._get_year_cell(_); + if (l) { + var h = this.templates.event_class(a.start_date, a.end_date, a); + e._year_marked_cells[o] || (l.classList.add("dhx_year_event", "dhx_cal_datepicker_event"), l.setAttribute("data-year-date", o), l.setAttribute("date", o), e._year_marked_cells[o] = l), h && l.classList.add(h); + } + }, e._unmark_year_date = function(_) { + var a = this._get_year_cell(_); + a && a.classList.remove("dhx_year_event", "dhx_cal_datepicker_event"); + }, e._year_render_event = function(_) { + var a = _.start_date; + for (a = a.valueOf() < this._min_date.valueOf() ? this._min_date : this.date.date_part(new Date(a)); a < _.end_date; ) + if (this._mark_year_date(a, _), (a = this.date.add(a, 1, "day")).valueOf() >= this._max_date.valueOf()) return; - }, e.year_view = function(o) { - if (e.set_sizes(), e._table_view = o, !this._load_mode || !this._load()) - if (o) { + }, e.year_view = function(_) { + if (e.set_sizes(), e._table_view = _, !this._load_mode || !this._load()) + if (_) { if (e._init_year_tooltip(), e._reset_year_scale(), e._load_mode && e._load()) return void (e._render_wait = !0); e.render_view_data(); @@ -8029,98 +10321,98 @@ END:VCALENDAR`; e._hideToolTip(); }, e._reset_year_scale = function() { this._cols = [], this._colsS = {}; - var o = [], t = this._els.dhx_cal_data[0], n = this.config; - t.scrollTop = 0, t.innerHTML = "", Math.floor((parseInt(t.style.height) - e.xy.year_top) / n.year_y); - var s = document.createElement("div"), c = this.date.week_start(e._currentDate()); - this._process_ignores(c, 7, "day", 1); - for (var u = 0; u < 7; u++) - this._ignores && this._ignores[u] || (this._cols[u] = "var(--dhx-scheduler-datepicker-cell-size)", this._render_x_header(u, 0, c, s)), c = this.date.add(c, 1, "day"); - for (s.lastChild.className += " dhx_scale_bar_last", u = 0; u < s.childNodes.length; u++) - this._waiAria.yearHeadCell(s.childNodes[u]); - var v = this.date[this._mode + "_start"](this.date.copy(this._date)), m = v, l = null; - const f = document.createElement("div"); - for (f.classList.add("dhx_year_wrapper"), u = 0; u < n.year_y; u++) - for (var g = 0; g < n.year_x; g++) { - (l = document.createElement("div")).className = "dhx_year_box", l.setAttribute("date", this._helpers.formatDate(v)), l.setAttribute("data-month-date", this._helpers.formatDate(v)), l.innerHTML = "
" + s.innerHTML + "
"; - var p = l.querySelector(".dhx_year_month"), y = l.querySelector(".dhx_year_grid"), w = l.querySelector(".dhx_year_body"), b = e.uid(); - this._waiAria.yearHeader(p, b), this._waiAria.yearGrid(y, b), p.innerHTML = this.templates.year_month(v); - var k = this.date.week_start(v); - this._reset_month_scale(w, v, k, 6); - for (var E = w.querySelectorAll("td"), D = 0; D < E.length; D++) + var _ = [], a = this._els.dhx_cal_data[0], o = this.config; + a.scrollTop = 0, a.innerHTML = "", Math.floor((parseInt(a.style.height) - e.xy.year_top) / o.year_y); + var l = document.createElement("div"), h = this.date.week_start(e._currentDate()); + this._process_ignores(h, 7, "day", 1); + for (var v = 0; v < 7; v++) + this._ignores && this._ignores[v] || (this._cols[v] = "var(--dhx-scheduler-datepicker-cell-size)", this._render_x_header(v, 0, h, l)), h = this.date.add(h, 1, "day"); + for (l.lastChild.className += " dhx_scale_bar_last", v = 0; v < l.childNodes.length; v++) + this._waiAria.yearHeadCell(l.childNodes[v]); + var u = this.date[this._mode + "_start"](this.date.copy(this._date)), f = u, c = null; + const p = document.createElement("div"); + for (p.classList.add("dhx_year_wrapper"), v = 0; v < o.year_y; v++) + for (var m = 0; m < o.year_x; m++) { + (c = document.createElement("div")).className = "dhx_year_box", c.setAttribute("date", this._helpers.formatDate(u)), c.setAttribute("data-month-date", this._helpers.formatDate(u)), c.innerHTML = "
" + l.innerHTML + "
"; + var g = c.querySelector(".dhx_year_month"), y = c.querySelector(".dhx_year_grid"), x = c.querySelector(".dhx_year_body"), b = e.uid(); + this._waiAria.yearHeader(g, b), this._waiAria.yearGrid(y, b), g.innerHTML = this.templates.year_month(u); + var k = this.date.week_start(u); + this._reset_month_scale(x, u, k, 6); + for (var E = x.querySelectorAll("td"), D = 0; D < E.length; D++) this._waiAria.yearDayCell(E[D]); - f.appendChild(l), o[u * n.year_x + g] = (v.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7, v = this.date.add(v, 1, "month"); + p.appendChild(c), _[v * o.year_x + m] = (u.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7, u = this.date.add(u, 1, "month"); } - t.appendChild(f); - var x = this._getNavDateElement(); - x && (x.innerHTML = this.templates[this._mode + "_date"](m, v, this._mode)), this.week_starts = o, o._month = m.getMonth(), this._min_date = m, this._max_date = v; + a.appendChild(p); + var w = this._getNavDateElement(); + w && (w.innerHTML = this.templates[this._mode + "_date"](f, u, this._mode)), this.week_starts = _, _._month = f.getMonth(), this._min_date = f, this._max_date = u; }, e._reset_year_scale = function() { - var o = this._els.dhx_cal_data[0]; - o.scrollTop = 0, o.innerHTML = ""; - let t = this.date.year_start(new Date(this._date)); - this._min_date = this.date.week_start(new Date(t)); - const n = document.createElement("div"); - n.classList.add("dhx_year_wrapper"); - let s = t; - for (let v = 0; v < 12; v++) { - let m = document.createElement("div"); - m.className = "dhx_year_box", m.setAttribute("date", this._helpers.formatDate(s)), m.setAttribute("data-month-date", this._helpers.formatDate(s)), m.innerHTML = `
${this.templates.year_month(s)}
+ var _ = this._els.dhx_cal_data[0]; + _.scrollTop = 0, _.innerHTML = ""; + let a = this.date.year_start(new Date(this._date)); + this._min_date = this.date.week_start(new Date(a)); + const o = document.createElement("div"); + o.classList.add("dhx_year_wrapper"); + let l = a; + for (let u = 0; u < 12; u++) { + let f = document.createElement("div"); + f.className = "dhx_year_box", f.setAttribute("date", this._helpers.formatDate(l)), f.setAttribute("data-month-date", this._helpers.formatDate(l)), f.innerHTML = `
${this.templates.year_month(l)}
`; - const l = m.querySelector(".dhx_year_grid"), f = e._createDatePicker(null, { date: s, minWeeks: 6 }); - f._renderDayGrid(l), f.destructor(), n.appendChild(m), s = this.date.add(s, 1, "month"); - } - o.appendChild(n); - let c = this.date.add(t, 1, "year"); - c.valueOf() != this.date.week_start(new Date(c)).valueOf() && (c = this.date.week_start(new Date(c)), c = this.date.add(c, 1, "week")), this._max_date = c; - var u = this._getNavDateElement(); - u && (u.innerHTML = this.templates[this._mode + "_date"](t, c, this._mode)); + const c = f.querySelector(".dhx_year_grid"), p = e._createDatePicker(null, { date: l, minWeeks: 6 }); + p._renderDayGrid(c), p.destructor(), o.appendChild(f), l = this.date.add(l, 1, "month"); + } + _.appendChild(o); + let h = this.date.add(a, 1, "year"); + h.valueOf() != this.date.week_start(new Date(h)).valueOf() && (h = this.date.week_start(new Date(h)), h = this.date.add(h, 1, "week")), this._max_date = h; + var v = this._getNavDateElement(); + v && (v.innerHTML = this.templates[this._mode + "_date"](a, h, this._mode)); }; - var i = e.getActionData; - e.getActionData = function(o) { - return h() ? { date: a(o.target), section: null } : i.apply(e, arguments); + var n = e.getActionData; + e.getActionData = function(_) { + return i() ? { date: t(_.target), section: null } : n.apply(e, arguments); }; - var _ = e._locate_event; - e._locate_event = function(o) { - var t = _.apply(e, arguments); - if (!t) { - var n = a(o); - if (!n) + var s = e._locate_event; + e._locate_event = function(_) { + var a = s.apply(e, arguments); + if (!a) { + var o = t(_); + if (!o) return null; - var s = e.getEvents(n, e.date.add(n, 1, "day")); - if (!s.length) + var l = e.getEvents(o, e.date.add(o, 1, "day")); + if (!l.length) return null; - t = s[0].id; + a = l[0].id; } - return t; + return a; }, e.attachEvent("onDestroy", function() { e._hideToolTip(); }); -} }, X = new class { +} }, Re = new class { constructor(e) { - this._seed = 0, this._schedulerPlugins = [], this._bundledExtensions = e, this._extensionsManager = new it(e); + this._seed = 0, this._schedulerPlugins = [], this._bundledExtensions = e, this._extensionsManager = new Na(e); } plugin(e) { - this._schedulerPlugins.push(e), I.scheduler && e(I.scheduler); + this._schedulerPlugins.push(e), oe.scheduler && e(oe.scheduler); } getSchedulerInstance(e) { - for (var h = nt(this._extensionsManager), a = 0; a < this._schedulerPlugins.length; a++) - this._schedulerPlugins[a](h); - return h._internal_id = this._seed++, this.$syncFactory && this.$syncFactory(h), e && this._initFromConfig(h, e), h; - } - _initFromConfig(e, h) { - if (h.plugins && e.plugins(h.plugins), h.config && e.mixin(e.config, h.config, !0), h.templates && e.attachEvent("onTemplatesReady", function() { - e.mixin(e.templates, h.templates, !0); - }, { once: !0 }), h.events) - for (const a in h.events) - e.attachEvent(a, h.events[a]); - h.locale && e.i18n.setLocale(h.locale), Array.isArray(h.calendars) && h.calendars.forEach(function(a) { - e.addCalendar(a); - }), h.container ? e.init(h.container) : e.init(), h.data && (typeof h.data == "string" ? e.load(h.data) : e.parse(h.data)); - } -}(lt), Z = X.getSchedulerInstance(), ae = { plugin: Z.bind(X.plugin, X) }; -window.scheduler = Z, window.Scheduler = ae, window.$dhx || (window.$dhx = {}), window.$dhx.scheduler = Z, window.$dhx.Scheduler = ae; + for (var i = Sa(this._extensionsManager), t = 0; t < this._schedulerPlugins.length; t++) + this._schedulerPlugins[t](i); + return i._internal_id = this._seed++, this.$syncFactory && this.$syncFactory(i), e && this._initFromConfig(i, e), i; + } + _initFromConfig(e, i) { + if (i.plugins && e.plugins(i.plugins), i.config && e.mixin(e.config, i.config, !0), i.templates && e.attachEvent("onTemplatesReady", function() { + e.mixin(e.templates, i.templates, !0); + }, { once: !0 }), i.events) + for (const t in i.events) + e.attachEvent(t, i.events[t]); + i.locale && e.i18n.setLocale(i.locale), Array.isArray(i.calendars) && i.calendars.forEach(function(t) { + e.addCalendar(t); + }), i.container ? e.init(i.container) : e.init(), i.data && (typeof i.data == "string" ? e.load(i.data) : e.parse(i.data)); + } +}(gn), Ye = Re.getSchedulerInstance(), ht = { plugin: Ye.bind(Re.plugin, Re) }; +window.scheduler = Ye, window.Scheduler = ht, window.$dhx || (window.$dhx = {}), window.$dhx.scheduler = Ye, window.$dhx.Scheduler = ht; export { - ae as Scheduler, - Z as default, - Z as scheduler + ht as Scheduler, + Ye as default, + Ye as scheduler }; //# sourceMappingURL=dhtmlxscheduler.es.js.map diff --git a/codebase/dhtmlxscheduler.es.js.map b/codebase/dhtmlxscheduler.es.js.map index af219e2..97555b6 100644 --- a/codebase/dhtmlxscheduler.es.js.map +++ b/codebase/dhtmlxscheduler.es.js.map @@ -1 +1 @@ -{"version":3,"file":"dhtmlxscheduler.es.js","sources":["../sources/global.js","../sources/core/nav_bar.js","../sources/core/scheduler_resize_listener.js","../sources/utils/eventable.js","../sources/core/utils/event.js","../sources/core/common.js","../sources/core/utils/scoped_event.js","../sources/core/utils/utils.js","../sources/core/utils/dom_helpers.js","../sources/utils/env.js","../sources/core/common/url_serialize.js","../sources/core/base.js","../sources/core/common/get_serializable_events.js","../sources/core/load.js","../sources/core/loaders/xml.js","../sources/core/loaders/json.js","../sources/core/loaders/ical.js","../sources/core/touch.js","../sources/core/skins.js","../sources/core/dataprocessor/dataprocessor_hooks.js","../sources/core/dataprocessor/dataprocessor.js","../sources/core/message.js","../sources/locale/locale_ar.js","../sources/locale/locale_be.js","../sources/locale/locale_ca.js","../sources/locale/locale_cn.js","../sources/locale/locale_cs.js","../sources/locale/locale_da.js","../sources/locale/locale_de.js","../sources/locale/locale_el.js","../sources/locale/locale_en.js","../sources/locale/locale_es.js","../sources/locale/locale_fi.js","../sources/locale/locale_fr.js","../sources/locale/locale_he.js","../sources/locale/locale_hu.js","../sources/locale/locale_id.js","../sources/locale/locale_it.js","../sources/locale/locale_jp.js","../sources/locale/locale_manager.js","../sources/locale/locale_nb.js","../sources/locale/locale_nl.js","../sources/locale/locale_no.js","../sources/locale/locale_pl.js","../sources/locale/locale_pt.js","../sources/locale/locale_ro.js","../sources/locale/locale_ru.js","../sources/locale/locale_si.js","../sources/locale/locale_sk.js","../sources/locale/locale_sv.js","../sources/locale/locale_tr.js","../sources/locale/locale_ua.js","../sources/core/datepicker.js","../sources/scheduler_factory_method.js","../sources/core/common_errors.js","../sources/core/scheduler.js","../sources/core/wai_aria.js","../sources/core/common/assert.js","../sources/core/jquery.js","../sources/core/destructor.js","../sources/core/utils/ajax.js","../sources/core/config.js","../sources/core/event.js","../sources/core/event_highlight.js","../sources/core/lightbox.js","../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../sources/core/delay_render.js","../sources/core/connector.js","../sources/locale/index.js","../sources/ext/extension_manager.js","../sources/dhtmlx_hook.js","../sources/ext/restricted_extensions/not_implemented_extension.js","../sources/ext/keyboard_navigation/modals.js","../sources/ext/keyboard_navigation/key_nav_legacy.js","../sources/ext/keyboard_navigation/scheduler_handlers.js","../sources/ext/tooltip/tooltip.ts","../sources/ext/tooltip/tooltipManager.ts","../sources/ext/extensions_gpl.js","../sources/ext/active_links.js","../sources/ext/agenda_legacy_view.js","../sources/ext/agenda.js","../sources/ext/all_timed.js","../sources/ext/collision.js","../sources/ext/container_autoresize.js","../sources/ext/cookie.js","../sources/ext/restricted_extensions/daytimeline.js","../sources/ext/restricted_extensions/drag_between.js","../sources/ext/editors.js","../sources/ext/expand.js","../sources/ext/export_api/index.js","../sources/ext/restricted_extensions/grid_view.js","../sources/ext/html_templates.js","../sources/ext/key_nav.js","../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../sources/ext/keyboard_navigation/common/eventhandler.js","../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../sources/ext/keyboard_navigation/marker.js","../sources/ext/keyboard_navigation/elements/scheduler_node.js","../sources/ext/keyboard_navigation/elements/nav_node.js","../sources/ext/keyboard_navigation/elements/header_cell.js","../sources/ext/keyboard_navigation/elements/event.js","../sources/ext/keyboard_navigation/elements/time_slot.js","../sources/ext/keyboard_navigation/elements/minical_button.js","../sources/ext/keyboard_navigation/elements/minical_cell.js","../sources/ext/keyboard_navigation/elements/data_area.js","../sources/ext/keyboard_navigation/core.js","../sources/ext/keyboard_navigation/minical_handlers.js","../sources/ext/layer.js","../sources/ext/limit.js","../sources/ext/map_view.js","../sources/ext/minical.js","../sources/ext/monthheight.js","../sources/ext/restricted_extensions/multisection.js","../sources/ext/multiselect.js","../sources/ext/multisource.js","../sources/ext/mvc.js","../sources/ext/outerdrag.js","../sources/ext/pdf.js","../sources/ext/quick_info.js","../sources/ext/readonly.js","../sources/ext/recurring.js","../sources/ext/serialize.js","../sources/ext/restricted_extensions/timeline.js","../sources/ext/tooltip/index.ts","../sources/ext/restricted_extensions/treetimeline.js","../sources/ext/restricted_extensions/units.js","../sources/ext/url.js","../sources/ext/restricted_extensions/week_agenda.js","../sources/ext/wp.js","../sources/ext/year_view.js","../sources/dhtmlxscheduler.gpl.js","../sources/scheduler_factory.js"],"sourcesContent":["\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX + d.scrollLeft - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY + d.scrollTop - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function () {\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\n\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.getState=function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n};\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\t\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\r\n\tvar html = '
';\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\t\thtml+=\"
\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\nscheduler.config.mark_now = true;\r\nscheduler.config.display_marked_timespans = true;\r\nscheduler.config.overwrite_marked_timespans = true;\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tvar blocker = scheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif (event.rec_type) {\r\n\t\t\tvar dates = scheduler.getRecDates(event);\r\n\t\t\tfor(var i=0; i < dates.length; i++){\r\n\t\t\t\tvar ev = scheduler._copy_event(event);\r\n\t\t\t\tscheduler._lame_copy(ev, dates[i]);\r\n\t\t\t\tevs.push(ev);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!blocker(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn blocker(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn blocker(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\tscheduler._mark_now = function(hide) {\r\n\t\t// day, week, units views\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tif (!this._els[dhx_now_time]) {\r\n\t\t\tthis._els[dhx_now_time] = [];\r\n\t\t}\r\n\t\tvar now = scheduler._currentDate();\r\n\t\tvar cfg = this.config;\r\n\t\tscheduler._remove_mark_now(); // delete previous marks if they exist\r\n\t\tif (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i\" + ev.text + \"

\" + (ev.event_location || '') + \"

\" + scheduler.templates.marker_date(start) + \" - \" + scheduler.templates.marker_date(end) + \"
\";\r\n};\r\nscheduler.dblclick_dhx_map_area = function() {\r\n\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler._date,\r\n\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t});\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\n\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\n\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\n\r\nscheduler._latLngUpdate = false; // flag for not displaying event second time in case of coordinates update\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\tscheduler._isMapPositionSet = false; // if user actual (geolocation) position was set on the map\r\n\r\n\tconst gmap = document.createElement('div');\r\n\tgmap.className = 'dhx_map';\r\n\tgmap.id = 'dhx_gmap';\r\n\tgmap.style.display = \"none\";\r\n\r\n\tscheduler._obj.appendChild(gmap);\r\n\r\n\tscheduler._els.dhx_gmap = [];\r\n\tscheduler._els.dhx_gmap.push(gmap);\r\n\r\n\t_setMapSize('dhx_gmap');\r\n\r\n\tconst mapOptions = {\r\n\t\tzoom: scheduler.config.map_initial_zoom || 10,\r\n\t\tcenter: scheduler.config.map_initial_position,\r\n\t\tmapTypeId: scheduler.config.map_type || google.maps.MapTypeId.ROADMAP\r\n\t};\r\n\tconst map = new google.maps.Map(document.getElementById('dhx_gmap'), mapOptions);\r\n\tmap.disableDefaultUI = false;\r\n\tmap.disableDoubleClickZoom = !scheduler.config.readonly;\r\n\r\n\tgoogle.maps.event.addListener(map, \"dblclick\", function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\r\n\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\tvar point = event.latLng;\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'latLng': point },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\tstart_date: scheduler._date,\r\n\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n\r\n\tvar infoWindowOptions = {\r\n\t\tcontent: ''\r\n\t};\r\n\r\n\tif (scheduler.config.map_infowindow_max_width) {\r\n\t\tinfoWindowOptions.maxWidth = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\r\n\tscheduler.map = {\r\n\t\t_points: [],\r\n\t\t_markers: [],\r\n\t\t_infowindow: new google.maps.InfoWindow(infoWindowOptions),\r\n\t\t_infowindows_content: [],\r\n\t\t_initialization_count: -1,\r\n\t\t_obj: map\r\n\t};\r\n\r\n\tscheduler.ext.mapView.geocoder = new google.maps.Geocoder();\r\n\tscheduler.ext.mapView.map = map;\r\n\tscheduler.ext.mapView.points = scheduler.map._points;\r\n\tscheduler.ext.mapView.markers = scheduler.map._markers;\r\n\tscheduler.ext.mapView.infoWindow = scheduler.map._infowindow;\r\n\r\n\tif (scheduler.config.map_resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tif (!scheduler._isMapPositionSet) {\r\n\t\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\t\tvar _userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\r\n\t\t\t\t\tmap.setCenter(_userLocation);\r\n\t\t\t\t\tmap.setZoom(scheduler.config.map_zoom_after_resolve || 10);\r\n\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);\r\n\t\t\t\t\tscheduler.map._infowindow.position = map.getCenter();\r\n\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\r\n\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t},\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setPosition(map.getCenter());\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\t\t\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tgoogle.maps.event.addListener(map, \"resize\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t\tmap.setZoom(map.getZoom());\r\n\r\n\t});\r\n\tgoogle.maps.event.addListener(map, \"tilesloaded\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t});\r\n\r\n\tgmap.style.display = 'none'; // property was changed after attaching map\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i], false, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clear_map_tab() {\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\tvar markers = scheduler.map._markers;\r\n\t\tfor (var key in markers) {\r\n\t\t\tif (markers.hasOwnProperty(key)) {\r\n\t\t\t\tmarkers[key].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[key];\r\n\t\t\t\tif (scheduler.map._infowindows_content[key])\r\n\t\t\t\t\tdelete scheduler.map._infowindows_content[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tvar ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tvar html = \"
\";\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar ev = events[i];\r\n\t\t\tvar event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tvar ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tvar ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tvar t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (var i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tvar map = document.getElementById(elem_id);\r\n\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\tvar height = scheduler._y - nav_height;\r\n\t\tif (height < 0)\r\n\t\t\theight = 0;\r\n\t\tvar width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\tif (width < 0)\r\n\t\t\twidth = 0;\r\n\t\tmap.style.height = height + 'px';\r\n\t\tmap.style.width = width + 'px';\r\n\t\tmap.style.position = \"absolute\";\r\n\t\tmap.style.top = nav_height + \"px\";\r\n\t\tif (scheduler.config.rtl) {\r\n\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t} else {\r\n\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t}\r\n\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t}\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler.map._initialization_count++;\r\n\t\tvar gmap = scheduler._els.dhx_gmap[0];\r\n\t\tvar temp_center;\r\n\t\t//scheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\r\n\t\tif (mode) { //map tab activated\r\n\t\t\tclear_map_tab();\r\n\t\t\tfill_map_tab();\r\n\t\t\tgmap.style.display = 'block';\r\n\r\n\t\t\t// need to resize block every time window is resized\r\n\t\t\t_setMapSize('dhx_gmap');\r\n\t\t\ttemp_center = scheduler.map._obj.getCenter();\r\n\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else { //map tab de-activated\r\n\t\t\tgmap.style.display = 'none';\r\n\t\t}\r\n\t\tgoogle.maps.event.trigger(scheduler.map._obj, 'resize');\r\n\r\n\t\tif (scheduler.map._initialization_count === 0 && temp_center) { // if tab is activated for the first time need to fix position\r\n\t\t\tscheduler.map._obj.setCenter(temp_center);\r\n\t\t}\r\n\r\n\t\tif (scheduler._selected_event_id) {\r\n\t\t\tselectEvent(scheduler._selected_event_id);\r\n\t\t}\r\n\t};\r\n\r\n\tvar selectEvent = function(event_id) {\r\n\t\tscheduler.map._obj.setCenter(scheduler.map._points[event_id]);\r\n\t\tscheduler.callEvent(\"onClick\", [event_id]);\r\n\t};\r\n\r\n\tvar showAddress = function(event, setCenter, performClick) { // what if event have incorrect position from the start?\r\n\t\tvar point = scheduler.config.map_error_position;\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tpoint = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t}\r\n\t\tvar message = scheduler.templates.marker_text(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._new_event) {\r\n\r\n\t\t\tscheduler.map._infowindows_content[event.id] = message;\r\n\r\n\t\t\tif (scheduler.map._markers[event.id])\r\n\t\t\t\tscheduler.map._markers[event.id].setMap(null);\r\n\r\n\t\t\tscheduler.map._markers[event.id] = scheduler.ext.mapView.createMarker({\r\n\t\t\t\tposition: point,\r\n\t\t\t\tmap: scheduler.map._obj\r\n\t\t\t});\r\n\r\n\t\t\tgoogle.maps.event.addListener(scheduler.map._markers[event.id], 'click', function() {\r\n\t\t\t\tscheduler.map._infowindow.setContent(scheduler.map._infowindows_content[event.id]);\r\n\t\t\t\tscheduler.map._infowindow.open(scheduler.map._obj, scheduler.map._markers[event.id]);\r\n\t\t\t\tscheduler._selected_event_id = event.id;\r\n\t\t\t\tscheduler.render_data();\r\n\t\t\t});\r\n\t\t\tscheduler.map._points[event.id] = point;\r\n\r\n\t\t\tif (setCenter) scheduler.map._obj.setCenter(scheduler.map._points[event.id]);\r\n\t\t\tif (performClick) scheduler.callEvent(\"onClick\", [event.id]);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onClick\", function(id, domEvent) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tscheduler._selected_event_id = id;\r\n\t\t\tfor (var i = 0; i < scheduler._rendered.length; i++) {\r\n\t\t\t\tscheduler._rendered[i].className = 'dhx_map_line';\r\n\t\t\t\tif (scheduler._rendered[i].getAttribute(scheduler.config.event_attribute) == id) {\r\n\t\t\t\t\tscheduler._rendered[i].className += \" highlight\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._points[id] && scheduler.map._markers[id]) {\r\n\t\t\t\tscheduler.map._obj.setCenter(scheduler.map._points[id]); // was panTo\r\n\t\t\t\tgoogle.maps.event.trigger(scheduler.map._markers[id], 'click');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tvar _displayEventOnMap = function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\r\n\t\t\t\t\tscheduler._selected_event_id = event.id;\r\n\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t\tshowAddress(event, true, true);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tshowAddress(event, true, true);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _updateEventLocation = function(event) { // update lat and lng in database\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tvar ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\t\tif (!this._latLngUpdate) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t} else { // event no longer should be displayed on the map view\r\n\t\t\t\tscheduler._selected_event_id = null;\r\n\t\t\t\tscheduler.map._infowindow.close();\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis._latLngUpdate = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_event_id, new_event_id) {\r\n\t\tvar event = scheduler.getEvent(new_event_id);\r\n\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\tif (scheduler.map._markers[old_event_id]) {\r\n\t\t\t\tscheduler.map._markers[old_event_id].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[old_event_id];\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._infowindows_content[old_event_id])\r\n\t\t\t\tdelete scheduler.map._infowindows_content[old_event_id];\r\n\t\t\t_displayEventOnMap(event);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id, event) {\r\n\t\tif (!scheduler._dataprocessor) {\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\t/* Test/example\r\n\t scheduler.attachEvent(\"onLocationError\", function(event_id,event_object){\r\n\t return new google.maps.LatLng(8, 8);\r\n\t });\r\n\t */\r\n\r\n\tscheduler.attachEvent(\"onBeforeEventDelete\", function(id, event) {\r\n\t\tif (scheduler.map._markers[id]) {\r\n\t\t\tscheduler.map._markers[id].setMap(null); // if new event is deleted tab != map then it doesn't have marker yet\r\n\t\t}\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (scheduler.config.map_resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventCancel\", function(id, is_new) {\r\n\t\tif (is_new) {\r\n\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\tscheduler.map._infowindow.close();\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\r\n\tvar node = domEv;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tvar dx = (left + domEv.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tvar dy = (top + domEv.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:domEv.offsetWidth, height:domEv.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
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\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t''+loc.repeat_text_occurences_count+'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'
';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_month_head = function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;"],"names":["global$1","window","global","extend","scheduler","div","className","element","document","createElement","split","forEach","cssClass","classList","add","itemTypes","rows_container","row","view","config","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","date","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","event","isCalendarVisible","destroyCalendar","renderCalendar","position","this","getState","navigation","handler","calendar","setCurrentView","html_element","renderElement","renderer","rows","cols","css","width","value","style","height","html","innerHTML","align","justifyContent","prepareConfig","renderLayout","items","fragment","createDocumentFragment","Array","isArray","i","length","next","appendChild","_init_nav_bar","navBar","$container","querySelector","_update_nav_bar","previousHeight","container","heightChanged","newHeight","xy","nav_height","unset_actions","_els","get_elements","set_actions","display","isAttachedNode","root","body","parentNode","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","listenWindowResize","resizeDelay","oldSize","clearTimeout","setTimeout","$destroyed","a","b","newSize","triggerSchedulerResize","$root","callEvent","updateView","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","contentWindow","removeChild","EventHost","constructor","_silent_mode","listeners","_silentStart","_silentEnd","createEventStorage","obj","handlers","index","eventStorage","combinedResult","handlerResult","apply","arguments","addEvent","settings","e","handlerId","id","once","originalHandler","removeEvent","clear","makeEventable","eventHost","attachEvent","eventName","toLowerCase","thisObject","bind","attachAll","callback","name","eventArguments","handlerName","concat","checkEvent","detachEvent","list","eventId","detachAllEvents","defaultDomEvents","el","addEventListener","eventRemove","removeEventListener","domEvents","eventScope","attach","capture","push","detach","splice","detachAll","staticArray","slice","undefined","createEventScope","_eventRemoveAll","_createDomEventScope","_trim","str","String","prototype","trim","replace","_isDate","getFullYear","getMonth","getDate","_isObject","uidSeed","Date","now","isDate","utils","uid","mixin","target","source","force","f","copy","object","result","pop","Function","toString","call","Number","Boolean","varType","Object","hasOwnProperty","defined","delay","timeout","timer","$cancelTimeout","$pending","args","$execute","getClassName","node","baseVal","indexOf","locateCss","classname","strict","trg","srcElement","ind","left","charAt","right","isVisible","visibility","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","isNaN","getAttribute","hasHref","area","nodeName","loLowerCase","isEnabled","input","select","textarea","hasAttribute","isShadowDomSupported","head","createShadowRoot","attachShadow","getRootNode","ShadowRoot","host","dom_helpers","getAbsoluteLeft","htmlObject","getOffset","getAbsoluteTop","top","getOffsetSum","elem","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetRect","box","getBoundingClientRect","test","navigator","userAgent","dummy","dummyBox","docElem","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","Math","round","closest","selector","insertAfter","newNode","referenceNode","nextSibling","insertBefore","remove","isChildOf","child","parent","contains","getFocusableNodes","nodes","querySelectorAll","join","nodesArray","$position","sort","hasShadowParent","getActiveElement","activeElement","shadowRoot","getSelection","focusNode","getRelativeEventPosition","ev","d","bottom","y","x","clientX","clientY","getTargetNode","tagName","composedPath","getNodePosition","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isIE","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialize$1","data","key","serialized","encodeURIComponent","JSON","stringify","generateStringToDate","format","utc","splt","mask","match","code","csp_str_to_date","set","temp","locale","month_short_hash","month_full_hash","UTC","cspEnabled","useCsp","csp","checkIfCSPEnabled","init","s","month_short","t","month_full","date_part","old","setHours","setMinutes","setSeconds","setMilliseconds","getHours","setTime","getTime","time_part","valueOf","getTimezoneOffset","week_start","shift","getDay","start_on_monday","month_start","setDate","year_start","setMonth","day_start","_add_days","inc","ndate","rest","hours","mode","setYear","to_fixed","num","date_to_str","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","getUTCHours","getUTCMinutes","getMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","parseYMD","parseMDY","parseDMY","dateString","parse_exact_format","datestr","nday","first_thursday","year_number","ordinal_date","floor","convert_to_utc","getSerializator","res","_events","_loaded","_load","url","from","_load_url","to","prevent_cache","_date","_load_mode","lf","templates","load_format","_min_date","cache_line","_max_date","temp_to","ajax","get","ajaxCallback","response","on_load","_parsers","xml","canParse","xhr","responseXML","firstChild","xmlDoc","parse","responseText","topElement","xmltop","loader","csrfToken","dhtmlx","security_key","opts","xpath","arr","serverList","itms","j","attrs","attributes","label","k","attr","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","text","evs","_init_event","json","err","events","dhx_security","collections","collections_loaded","collection","option","option_key","ical","RegExp","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","parse_date","dh","dm","utcMark","dy","dn","dd","server_utc","error","foundParser","parser","_process","status","_process_loading","_loading","_not_render","_render_wait","render_view_data","_after_call","_tagvalue","start_date","_init_date","end_date","_helpers","parseDate","getSerializableData","createSerializator","serialize","dataset","allEvents","exportedEvent","exportValue","rawValue","xml_format","format_date","type","load","setLoadMode","array","childNodes","show_loading","_x","_y","_obj","_init_touch_events","touch","MSStream","platform","maxTouchPoints","scroll_width","_mobile","touchEventsSupported","createEvent","_touch_events","touches","pageX","pageY","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","names","accessor","ignore","tracker","drag_mode","scroll_mode","action_mode","dblclicktime","attachTouchEvent","_is_lightbox_open","passive","drag_cancel","_hide_global_tip","_on_mouse_up","_temp_touch_block","_drag_id","_drag_mode","_drag_pos","_pointerDragId","acc","dnd","timeline","matrix","_mode","original_render","drag_id","getEvent","property","y_property","getEvents","_sorder","_count","render_data","_on_mouse_move","preventDefault","cancelBubble","_update_global_tip","abs","fake_event","pointerId","_click","dhx_cal_data","_on_dbl_click","_block_next_stop","touch_drag","actTask","_locate_event","fakeTask","sourceTask","_ignore_next_click","_getClassName","previousSibling","_on_mouse_down","for_rendered","_rendered","touch_tip","_show_global_tip","updateEvent","touch_swipe_dates","s_ev","e_ev","step","max_dy","scrollable","dx","dhx_cal_next_button","dhx_cal_prev_button","toptip","_global_tip","time","_timed","event_header","day_date","labels","drag_to_create","drag_to_move","calculatedMaterial","cachedBorderBoxValue","checkIfBorderBoxStyling","_is_material_skin","probe","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","flatSkinHourScale","min","_addThemeClass","skin","_skin_settings","use_select_menu_space","wide_form","hour_size_px","displayed_event_color","displayed_event_text_color","_skin_xy","lightbox_additional_height","bar_height","_build_skin_info","clearInterval","monitorIntervalId","setInterval","csstheme","setSkin","monitorThemeChange","styles","themeVar","themeName","isCssVarTheme","cssValues","oldMaterialTheme","links","getElementsByTagName","href","themeNameFromFile","_theme_info","theme","cssVarTheme","values","themeVariables","_configure","col","_skin_init","render","hour_scale","hour_date","_old_month_day","month_day","old_month_day","_currentDate","dhx_cal_today_button","tab","header","tabs","specialTabs","map","tabName","find","filter","firstTab","reverse","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_new_event","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","deleteEvent","_add_rec_marker","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","updateMode","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","message","boxAttribute","_dhx_msg_cfg","usercall","modalBox","hide","modal_key","which","keyCode","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","_waiAria","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","title","content","message_ok","message_cancel","buttons","btn","getElementById","hidden","focus","alertPopup","confirmPopup","boxPopup","box_params","params","expire","focusable","messageInfoAttr","timers","pull","seed","hideAll","popups","alert","confirm","modalbox","setTransactionMode","total","headers","payload","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","val","_columns","getSyncState","enableDataNames","enablePartialDataSend","_changed","setUpdateMode","master","rowId","state","findRow","existing","getUserData","set_invalid","is_invalid","markRow","sendData","_methods","details","getActionByState","checkBeforeUpdate","editStop","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","stack","keys","pref","_applyPayload","urlSeparator","dataToSend","self","queryParams","ids","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","method","preprocessedData","_cleanupItemBeforeSend","action","query","_onResolvedCreateUpdate","tag","resultState","setRequestHeader","sid","tid","afterUpdateCallback","routerMode","actionPromise","create","delete","update","then","Error","catch","valid","_forEachUpdatedRow","_getAllData","out","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","_is_virtual_event","_set_event_text_style","r","cssText","event_updated","rec_type","rec_pattern","_dp_change_event_id","new_id","changeEventId","_dp_hook_delete","setDp","_dp","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","func","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","destructor","processedData","updatedItem","output","_prepareDataItem","item","processedItem","formatDate","dataItem","ar","day_tab","week_tab","month_tab","new_event","icon_save","icon_cancel","icon_details","icon_edit","icon_delete","confirm_closing","confirm_deleting","section_description","section_time","full_day","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","prev","year","month","day","hour","minute","be","agenda_tab","description","year_tab","week_agenda_tab","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","month_for_recurring","day_for_recurring","ca","cn","cs","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","direction","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","maxDate","labelFormat","dayElement","max","weeks","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","currDate","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","commonViews","agenda","grid","unit","week_agenda","anythingElse","requiredExtensions","limit","_commonErrorMessages","unknownView","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","addMarkedTimespan","exportToPNG","exportToPDF","common","nav_bar","_detachDomEvent","_init_once","scheduler_resize_listener","layout","hasSchedulerMarkup","console","wai_aria_application_role","views","_props","_grid","viewName","log","rtl","_scroll","init_templates","set_sizes","$initialized","min_event_height","scale_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","edit_save","edit_cancel","functor","scale_x","_table_view","materialScalePlaceholder","set_xy","_lightbox","_setLbPosition","_data_width","prepareValue","prepared","els","class_name","attr_value","labelAttr","domEventsScope","getDaysDifference","startDate","endDate","start","differenceInDays","_select_id","_close_not_saved","unselect","previousSelection","min_date","max_date","editor_id","_edit_id","lightbox_id","_lightbox_id","select_id","expanded","readonly","getActionData","icon","def_step","dhx_cal_tab","deprecated_name","substring","c","_dhtmlx_confirm","title_confirm_deleting","edit","save","showLightbox","form","addEventNow","end","base","duration","event_duration","time_step","start_hour","first_hour","_drag_event","src","dblclick_create","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_cols","_ignores","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","_colsS","$domHelpers","dataArea","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","title_confirm_closing","positive_closing","_correct_shift","back","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","has_moved","_correct_drag_start_date","len","_start_correction","_end_correction","last_hour","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","maxY","precisePos","minDate","preciseDate","cursor","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","getView","_allow_dnd","update_render","sx","update_view","drag_event_body","_lame_clone","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","moved","_dhx_changed","is_new","edit_on_create","details_on_create","isOneDayEvent","_lame_copy","_trigger_dyn_loading","_reset_ignores","_reset_scale","isViewExists","_set_aria_buttons_attrs","buttonGroups","group","headerButtonsAttributes","icon_form","oldClass","newClass","multidayScroll","dhx_multi_day","prev_scroll","preserve_scroll","_dy_shift","headerToggleState","_render_x_header","offset_top","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","count","count_n","_get_timeunit_start","_get_view_end","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","scales","cls","firstHalf","slotDate","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","_getNavDateElement","drag_resize","drag_move","_scales","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","totalWidth","col_length","offset","hiddenWidth","c2","cloneNode","cc","hourScaleAttr","scroll_hour","now_date","n","preserve","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","cellBody","bf1","getLabel","sections","lightbox","map_to","options","updateCollection","list_name","resetLightbox","hideCover","cache","n_ev","section","_focus","endColumnIndex","eventLength","startColumnIndex","_get_date_index","last_column","check","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","days","end_slot","fd","start_slot","_get_section_property","_is_initialized","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","setAttributes","role","isActive","getHeaderCellAttr","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","agendaDetailsBtnString","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","buttonLabel","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","dom","assert","show_errors","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","$","counter","methods","Promise","clearAll","createConfig","async","serializeRequestParams","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","xpathExp","docObj","selectNodes","first","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","readyState","filePath","open","toUpperCase","send","$ajax","default_date","month_date","load_date","week_date","date_format","api_date","day_column_padding","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_display","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","quick_info_detached","drag_highlight","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","ajax_error","delay_render","timeline_swap_resize","event_attribute","$initial","xml_date","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","clear_view","extra_data","silent","setEvent","hash","create_getter","create_setter","is_visible_events","clear_event","evFirstHour","evLastHour","lastHour","checkEndDate","get_visible_events","only_timed","filter_event","_is_main_area_event","hold","full","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","_get_event_bar_pos","widt","x2","_pre_render_events","containers","render_event_bar","max_evs","max_month_events","locate_holder","real","render_event","_get_first_visible_cell","cells","hb","h_old","_pre_render_events_table","_pre_render_events_line","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","weekCellIndex","locate_holder_day","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","zIndex","color","setProperty","tplClass","_editor","shiftKey","ariaAttr","icons","icons_str","currentIcon","textColor","highlightEventPosition","contentA","contentB","_","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","section_delimiter","getSectionTop","posFromDate","_smartRenderingEnabled","restoreOriginalColors","scrollTo","_append_drag_marker","m","scale","lastChild","_update_marker_position","size","getLightboxRoot","cspEnvironment","salesforceEnvironment","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","cfg","dt","last","limit_time_select","p","selectBoxClass","range","start_year","end_year","year_range","g","tdate","_time_values","ariaAttrs","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","block","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","inputBlock","fallback","inputId","old_id","getRootView","hooks","didInsert","cmp","skins","jQuery","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","oldDate","oldMode","updateFlags","lazy_updateView","ars","createDataProcessor","tMode","batchUpdate","dhtmlxError","catchError","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","ext","activePlugins","plugins","extensionList","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","ExtensionsManager","_extensions","attaches","attachScheduler","_genStr","attachObject","vs","av","sched","schedId","setSizes","_viewRestore","notImplemented","modals","modalsStack","isModal","afterPopup","trapFocus","currentTarget","$keyboardNavigation","_keyNavMessagePopup","focusElement","backupFocus","key_nav_legacy","_temp_key_scope","key_nav","_pasteDate","_pasteSection","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","dispatcher","copyEvent","_make_pasted_event","event_pid","event_length","multisection","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","ctrlKey","metaKey","_buffer_event","_key_nav_copy_paste","getActiveNode","new_ev","scheduler_handlers","attachSchedulerHandlers","waitCall","keyDownHandler","focusHandler","keepScrollPosition","focusGlobalNode","enable","reFocusActiveNode","activeNode","isValid","MinicalButton","MinicalCell","mousedownHandler","dataAreaClick","listOfScales","some","Event","TimeSlot","nextSlot","setActiveNode","removeAttribute","evNode","prevState","lastStart","lastEnd","lastSection","getNode","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","_getViewPort","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","hideTooltip","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","clone","delayShow","utils.default","setContent","show","tooltip_timeout","tooltip_hide_timeout","gplExtensions","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","_agendaScrollTop","agenda_area","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","l","rowAttr","dateHeader","descriptionHeader","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","eventStart","renderDay","calendarEvent","dates","selectedId","all_timed_month","is_event_short","_safe_copy","proto","isPrototypeOf","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","before","_setTempSection","event_id","collision_limit","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","second","evs_dates","getRecDates","tevs","concurrent","checked_mode","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","year_y","cur_height","week_agenda_scale_height","eventsContainer","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","cookie_param","old_load","drag_between","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","selected_id","addOption","disable","selectOption","setComboValue","all_options","single_option","getIndexByValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","o","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","getTimeline","orientation","dpi","zoom","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","info","_plain_export_copy","$text","_create_hidden_form","submit","_hidden_export_form","_get_export_size","footer","A5","A4","A3","A2","A1","A0","dataX","cSize","parseFloat","smartRendering","initialSizes","smart_rendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","grid_view","html_templates","all","getScope","scopes","minicalButton","minicalDate","SchedulerNode","DataArea","timeSlot","searchMap","key_nav_step","addShortcut","shortcut","scope","scopeObject","getShortcutHandler","commands","shortcuts","findHandler","removeShortcut","unbind","disp","setDefaultNode","_compose","parts","createCommand","modifiers","alt","ctrl","meta","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","doAction","returnValue","bindAll","initKeys","nextItem","currentFocus","currentIndex","divs","renderMultiple","currentStart","currentEnd","_modes","_getMode","units","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","areas","round_position","blocks","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","tempStart","tempEnd","_timeline_getX","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","inner_index","all_hours_height","hour_ms","lineHeight","getDefaultNode","getMode","blur","_compareEvents","_pickEvent","startId","nextEventHandler","nextEvent","currEvent","visibleDates","nextEv","prevEventHandler","HeaderCell","getNodes","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","defaultCell","_getSection","_getNodes","eventNode","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","_moveToSlot","slot","movingDate","getDefaultDate","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","timeslot","_getMultisectionView","_getNextSection","sectionId","nextIndex","defaultSlot","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","minutes","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","globalNode","_getGrid","_getNode","enabled","newRow","newCol","blurNode","editor","defaultPrevented","schedulerNode","_timeout","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","cellIndex","td","renderMinical","cal","added","destroyMinical","_def_count","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_start","limit_end","limit_view","check_limits","mark_now","display_marked_timespans","overwrite_marked_timespans","_temp_limit_scope","dhx_time_block","default_timespan_type","get_resulting_options","zones","blockTime","unblockTime","deleteMarkedTimespan","om","od","nm","nd","isBlocked","date_end","resetDate","checkInMarkedTimespan","timespan_type","on_overlap","temp_start_date","temp_end_date","timespans","_marked_timespans","day_value","getZones","_get_zone_minutes","eventEnd","markerStart","markerEnd","blocker","checkLimitViolation","complete_res","allow","day_index","linker","_add_timespan_zones","_get_blocked_zones","timeline_zones","blocked_timeline_zones","_get_relevant_blocked_zones","resultZones","is_new_event","data_copy","native_object","_mark_now","_mark_now_timer","dhx_now_time","_remove_mark_now","_append_mark_now","zone_start","start_index","end_index","units_l","r_divs","t_day","t_div","_render_marked_timespan","_prepare_timespan_options","r_configs","temp_configs","t_days","cloned_config","invert_zones","invertZones","view_key","t_config","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","start_day","delta","t_date","_get_css_classes_by_config","css_classes","_get_block_by_config","date_to_display","min_day","sday","block_proto","_mark_timespans","_on_scale_add_marker","markTimespan","configuration","rebuild_els","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","unmarkTimespan","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","_subtract_timespan_zones","is_modified","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","types","typedConfig","_get_types_to_render","specific","types_to_render","_get_configs_to_render","_get_unit_index","day_ind","unitsPerDay","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","map_view","mapView","geocoder","points","markers","infoWindow","createMarker","google","maps","Marker","map_date_width","map_icon_width","map_description_width","map_resolve_event_location","map_resolve_user_location","map_initial_position","LatLng","map_error_position","map_infowindow_max_width","map_type","MapTypeId","ROADMAP","map_zoom_after_resolve","marker_geo_success","marker_geo_fail","marker_date","marker_text","event_location","dblclick_dhx_map_area","map_time","map_text","map_start","add_map","map_date","_latLngUpdate","_isMapPositionSet","gmap","dhx_gmap","_setMapSize","mapOptions","map_initial_zoom","center","mapTypeId","Map","disableDefaultUI","disableDoubleClickZoom","addListener","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","lat","lng","formatted_address","infoWindowOptions","maxWidth","_points","_markers","_infowindow","InfoWindow","_infowindows_content","_initialization_count","Geocoder","geolocation","getCurrentPosition","_userLocation","coords","latitude","longitude","setCenter","setZoom","getCenter","setPosition","getZoom","fill_map_tab","_selected_event_id","ariaButtonAttr","elem_id","marginRight","marginLeft","marginTop","showAddress","temp_center","map_end","close","setMap","clear_map_tab","trigger","selectEvent","performClick","_displayEventOnMap","address","language","_updateEventLocation","old_event_id","new_event_id","_event_resolve_delay","ret","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","_render_calendar","unmarkCalendar","cont","tpos","_get_def_cont","$dom","dateAttribute","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","calendars","arrow","dayHeaders","dayCells","inputs","selects","inp","number","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","monthheight","old_s","multiselect","_result","_children","_mark_inputs","_ids","delimiter","script_url","divLoading","multisource","mvc","update_timer","use_id","sanitize","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","last_event","dragger","dhtmlDragAndDropObject","stopDrag","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_end","xml_top","profile","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","to_pdf","objects","getPDFData","toPDF","toPDFRange","quick_info","show_quick_info","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","_quick_info_onscroll_handler","$testmode","_qi_button_click","domEv","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","txt_replace","txts","txtt","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","originalForm","readonlyForm","_lightbox_r","getRecurringSection","getFirstSectionOfType","clearMilliseconds","old_add_event","occurrence_timestamp_in_utc","recurring_workdays","_get_node","_outer_html","outerHTML","rec","loc","repeat_date_of_end","_ds","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","_init_set_value","_end_date","str_date_format","repeat_date","date_str","register_els","inps","formatter","change_current_view","set_end_rule","_get_repeat_code","get_rcode","repeat","str_date","include_end_by","transpose_type","get_numeric_value","repeat_precise","_start","start_exists","transpose_day_week","set_rcode","_set_repeat_code","dispatchEvent","MouseEvent","elements","_rec_init_done","rf","blocked","_is_modified_occurence","_toggle_block","actual_dates","timeControl","getTimeSection","_start_date","_get_button","_get_form","backgroundPosition","_rec_markers","_rec_markers_pull","_pid_time","_get_rec_marker","ch","_get_rec_markers","_rec_temp","ev_id","_ignore_call","tev","_pid_changed","nid","nev","sub","isEventFound","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","old_update_event","transponse_size","day_week","originalMonth","newMonth","cor","cor2","cday","transposeRecurring","recurringParts","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","getMilliseconds","non_render","maxCount","startHour","visibleCount","_fix_daylight_saving_date","ted","recurrings","sev","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","s2d","d2s","select_event","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_month_head","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","yearStart","datepicker","locateEvent","factory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","addCalendar","$dhx"],"mappings":"AAUA,MAAAA,IAPUC,OAAAA,SAAW,MACNA,SAEAC;ACNA,SAASC,GAAOC,GAE/B;AAAA,WAASC,EAAIC,GAAAA;AACZ,QAAIC,IAAUC,SAASC,cAAc,KAKrC;AAAA,YAJeH,KAAa,IAAII,MAAM,GAAA,EAC9BC,QAAQ,SAASC,GACxBL;AAAAA,QAAQM,UAAUC,IAAIF,CACxB;AAAA,IAAA,CAAA,GACQL;AAAAA,EACR;AACA,MAAIQ,IAAY,EACfC,gBAAgB,WACf;AAAA,WAAOX,EAAI,+BAAA;AAAA,EACX,GACDY,KAAK,WACJ;AAAA,WAAOZ,EAAI,oBAAA;AAAA,EACX,GACDa,MAAM,SAAUC,GAAAA;AACf,QAAIZ,IAAUF,EAAI,aAAA;AAiBlB,WAhBAE,EAAQa,aAAa,QAAQD,EAAOD,OAAO,MAC3CX,GAAAA,EAAQa,aAAa,YAAYD,EAAOD,IAErCd,GAAAA,EAAUe,OAAOE,qBAChBF,EAAOG,YACTf,EAAQM,UAAUC,IAAI,mBAAA,IACdK,EAAOI,WACfhB,EAAQM,UAAUC,IAAI,kBAAA,IACbK,EAAOD,SAAS,UACzBX,EAAQM,UAAUC,IAAI,wBAGpBK,GAAAA,EAAOK,iBACTjB,EAAQM,UAAUC,IAAI,uBAGjBP,IAAAA;AAAAA,EACP,GACDkB,MAAM,WACL;AAAA,WAAOpB,EAAI,cAAA;AAAA,EACX,GACDqB,QAAQ,SAAUP,GAAAA;AACjB,WAAOd,EA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OAAOjd,CAI9Cw+F,CAAAA;AAAAA,IAAAA,EAAWhqF,UACbrW,EAAUi0D,KAAKE,UAAUksC,EAAWhqF,MAAAA,GAGlC1S,MAAMC,QAAQy8F,EAAWnT,SAAAA,KAC3BmT,EAAWnT,UAAU3sF,QAAQ,SAAS+B,GACrCtC;AAAAA,QAAUygG,YAAYn+F,CAAAA;AAAAA,IAC1B,CAGK+9F,GAAAA,EAAW97F,YACbvE,EAAU6W,KAAKwpF,EAAW97F,SAE1BvE,IAAAA,EAAU6W,KAGRwpF,GAAAA,EAAWhrF,SACiB,OAApBgrF,EAAWhrF,QAAS,WAC7BrV,EAAUsiB,KAAK+9E,EAAWhrF,IAAAA,IAE1BrV,EAAUid,MAAMojF,EAAWhrF,IAAAA;AAAAA,EAG7B;ADxFmC6nD,EAAAA,EAAAA,GAE/Bl9D,IAAY+/F,EAAQ7sC,qBACpBD,GAAAA,KAAY,EACjBuC,QAAQx1D,EAAUmJ,KAAK42F,EAAQvqC,QAAQuqC,CAGxClgG,EAAAA;AAAAA,OAAOG,YAAYA,GACnBH,OAAOozD,YAAYA,IAEfpzD,OAAO6gG,SACV7gG,OAAO6gG,OAAO,KAGf7gG,OAAO6gG,KAAK1gG,YAAYA,GACxBH,OAAO6gG,KAAKztC,YAAYA;"} \ No newline at end of file +{"version":3,"file":"dhtmlxscheduler.es.js","sources":["../sources/global.js","../sources/plugins/drag_highlight_pos.js","../sources/plugins/limit.js","../sources/plugins/batch_update.js","../sources/plugins/index.js","../sources/plugins/undo_delete.js","../sources/core/utils/utils.js","../sources/core/nav_bar.js","../sources/core/scheduler_resize_listener.js","../sources/utils/eventable.js","../sources/core/utils/event.js","../sources/core/common.js","../sources/core/utils/scoped_event.js","../sources/core/utils/dom_helpers.js","../sources/utils/env.js","../sources/core/common/url_serialize.js","../sources/core/base.js","../sources/core/common/get_serializable_events.js","../sources/core/load.js","../sources/core/loaders/xml.js","../sources/core/loaders/json.js","../sources/core/loaders/ical.js","../sources/core/touch.js","../sources/core/skins.js","../sources/core/dataprocessor/dataprocessor_hooks.js","../sources/core/dataprocessor/dataprocessor.js","../sources/core/message.js","../sources/locale/locale_ar.js","../sources/locale/locale_be.js","../sources/locale/locale_ca.js","../sources/locale/locale_cn.js","../sources/locale/locale_cs.js","../sources/locale/locale_da.js","../sources/locale/locale_de.js","../sources/locale/locale_el.js","../sources/locale/locale_en.js","../sources/locale/locale_es.js","../sources/locale/locale_fi.js","../sources/locale/locale_fr.js","../sources/locale/locale_he.js","../sources/locale/locale_hu.js","../sources/locale/locale_id.js","../sources/locale/locale_it.js","../sources/locale/locale_jp.js","../sources/locale/locale_manager.js","../sources/locale/locale_nb.js","../sources/locale/locale_nl.js","../sources/locale/locale_no.js","../sources/locale/locale_pl.js","../sources/locale/locale_pt.js","../sources/locale/locale_ro.js","../sources/locale/locale_ru.js","../sources/locale/locale_si.js","../sources/locale/locale_sk.js","../sources/locale/locale_sv.js","../sources/locale/locale_tr.js","../sources/locale/locale_ua.js","../sources/core/datepicker.js","../sources/scheduler_factory_method.js","../sources/core/state.js","../sources/core/common_errors.js","../sources/core/scheduler.js","../sources/core/wai_aria.js","../sources/core/common/assert.js","../sources/core/jquery.js","../sources/core/destructor.js","../sources/core/utils/ajax.js","../sources/core/config.js","../sources/core/event.js","../sources/core/event_highlight.js","../sources/core/lightbox.js","../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../sources/core/delay_render.js","../sources/core/connector.js","../sources/locale/index.js","../sources/ext/extension_manager.js","../sources/dhtmlx_hook.js","../sources/ext/restricted_extensions/not_implemented_extension.js","../sources/ext/keyboard_navigation/modals.js","../sources/ext/keyboard_navigation/key_nav_legacy.js","../sources/ext/keyboard_navigation/scheduler_handlers.js","../sources/ext/map_view/gMapAdapter.ts","../sources/ext/map_view/osmMapAdapter.ts","../sources/ext/map_view/mapboxAdapter.ts","../node_modules/rrule/dist/esm/weekday.js","../node_modules/rrule/dist/esm/helpers.js","../node_modules/rrule/dist/esm/dateutil.js","../node_modules/rrule/dist/esm/iterresult.js","../node_modules/rrule/node_modules/tslib/tslib.es6.mjs","../node_modules/rrule/dist/esm/callbackiterresult.js","../node_modules/rrule/dist/esm/types.js","../node_modules/rrule/dist/esm/nlp/i18n.js","../node_modules/rrule/dist/esm/nlp/totext.js","../node_modules/rrule/dist/esm/nlp/parsetext.js","../node_modules/rrule/dist/esm/nlp/index.js","../node_modules/rrule/dist/esm/datetime.js","../node_modules/rrule/dist/esm/parseoptions.js","../node_modules/rrule/dist/esm/parsestring.js","../node_modules/rrule/dist/esm/datewithzone.js","../node_modules/rrule/dist/esm/optionstostring.js","../node_modules/rrule/dist/esm/cache.js","../node_modules/rrule/dist/esm/masks.js","../node_modules/rrule/dist/esm/iterinfo/yearinfo.js","../node_modules/rrule/dist/esm/iterinfo/index.js","../node_modules/rrule/dist/esm/iterinfo/monthinfo.js","../node_modules/rrule/dist/esm/iterinfo/easter.js","../node_modules/rrule/dist/esm/iter/poslist.js","../node_modules/rrule/dist/esm/iter/index.js","../node_modules/rrule/dist/esm/rrule.js","../node_modules/rrule/dist/esm/rrulestr.js","../node_modules/rrule/dist/esm/rruleset.js","../node_modules/rrule/dist/esm/iterset.js","../sources/ext/tooltip/tooltip.ts","../sources/ext/tooltip/tooltipManager.ts","../sources/ext/extensions_gpl.js","../sources/ext/active_links.js","../sources/ext/agenda_legacy_view.js","../sources/ext/agenda.js","../sources/ext/all_timed.js","../sources/ext/collision.js","../sources/ext/container_autoresize.js","../sources/ext/cookie.js","../sources/ext/restricted_extensions/daytimeline.js","../sources/ext/restricted_extensions/drag_between.js","../sources/ext/editors.js","../sources/ext/expand.js","../sources/ext/export_api/index.js","../sources/ext/restricted_extensions/grid_view.js","../sources/ext/html_templates.js","../sources/ext/key_nav.js","../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../sources/ext/keyboard_navigation/common/eventhandler.js","../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../sources/ext/keyboard_navigation/marker.js","../sources/ext/keyboard_navigation/elements/scheduler_node.js","../sources/ext/keyboard_navigation/elements/nav_node.js","../sources/ext/keyboard_navigation/elements/header_cell.js","../sources/ext/keyboard_navigation/elements/event.js","../sources/ext/keyboard_navigation/elements/time_slot.js","../sources/ext/keyboard_navigation/elements/minical_button.js","../sources/ext/keyboard_navigation/elements/minical_cell.js","../sources/ext/keyboard_navigation/elements/data_area.js","../sources/ext/keyboard_navigation/core.js","../sources/ext/keyboard_navigation/minical_handlers.js","../sources/ext/layer.js","../sources/ext/limit.js","../sources/ext/map_view/index.ts","../sources/ext/minical.js","../sources/ext/monthheight.js","../sources/ext/restricted_extensions/multisection.js","../sources/ext/multiselect.js","../sources/ext/multisource.js","../sources/ext/mvc.js","../sources/ext/outerdrag.js","../sources/ext/pdf.js","../sources/ext/quick_info.js","../sources/ext/readonly.js","../sources/ext/recurring.js","../sources/ext/recurring_legacy.js","../sources/ext/serialize.js","../sources/ext/restricted_extensions/timeline.js","../sources/ext/tooltip/index.ts","../sources/ext/restricted_extensions/treetimeline.js","../sources/ext/restricted_extensions/units.js","../sources/ext/url.js","../sources/ext/restricted_extensions/week_agenda.js","../sources/ext/wp.js","../sources/ext/year_view.js","../sources/dhtmlxscheduler.gpl.js","../sources/scheduler_factory.js"],"sourcesContent":["\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function dragHighlightPos(scheduler){\r\n let dndMarkers = [];\r\n let dragStarted = false;\r\n let eventNode = null;\r\n let event = null;\r\n\r\n function isEnabled() { \r\n return scheduler.config.drag_highlight && scheduler.markTimespan;\r\n }\r\n\r\n function checkViewName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj){\r\n return viewObj.layout;\r\n }\r\n return viewName;\r\n }\r\n\r\n function checkSectionPropertyName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj.y_property){\r\n return viewObj.y_property;\r\n }\r\n if(viewObj.map_to){\r\n return viewObj.map_to;\r\n }\r\n }\r\n\r\n function setRequiredStylesToMarker(eventNode, layout){\r\n switch (layout) {\r\n case \"month\":\r\n eventNode.style.top = \"\";\r\n eventNode.style.left = \"\";\r\n break;\r\n case \"timeline\":\r\n eventNode.style.left = \"\";\r\n eventNode.style.marginLeft = \"1px\";\r\n break;\r\n default:\r\n eventNode.style.top = \"\";\r\n break;\r\n }\r\n }\r\n \r\n function createMarkerConfig(configSettings){\r\n const { event, layout, viewName, sectionId, eventNode } = configSettings;\r\n setRequiredStylesToMarker(eventNode, layout);\r\n const sections = {};\r\n let markerObject = {\r\n start_date: event.start_date,\r\n end_date: event.end_date,\r\n css: \"dhx_scheduler_dnd_marker\",\r\n html: eventNode\r\n };\r\n if (layout == \"timeline\" || layout == \"month\" ){\r\n // we need to set end date less than 24 hours of the views to avoid receiving multiple marktimespans\r\n markerObject = {...markerObject, end_date: scheduler.date.add(event.start_date, 1, 'minute')};\r\n }\r\n if (sectionId){\r\n sections[viewName] = sectionId;\r\n markerObject.sections = sections;\r\n }\r\n return markerObject;\r\n }\r\n\r\n function createViewMarker(settings){\r\n const { layout } = settings;\r\n let markerConfigs;\r\n switch (layout) {\r\n case \"month\": \r\n markerConfigs = getMonthViewMarkers(settings);\r\n break;\r\n case 'timeline':\r\n case 'units':\r\n markerConfigs = getTimelineAndUnitsViewMarkers(settings);\r\n break;\r\n default: \r\n markerConfigs = getColumnViewMarkers(settings);\r\n break;\r\n }\r\n markerConfigs.forEach((cfg) => {\r\n dndMarkers.push(scheduler.markTimespan(cfg));\r\n });\r\n }\r\n\r\n function getColumnViewMarkers(settings){\r\n const {event, layout, viewName, sectionId} = settings;\r\n let columnViewMarkersArray = [];\r\n let eventNodes = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);\r\n if(eventNodes){\r\n for (let i = 0; i < eventNodes.length; i++) {\r\n let eventNodeClone = eventNodes[i].cloneNode(true);\r\n let startDate = new Date(+eventNodeClone.getAttribute(\"data-bar-start\"));\r\n let endDate = new Date(+eventNodeClone.getAttribute(\"data-bar-end\"));\r\n let dates = {start_date: startDate, end_date: endDate};\r\n const configSettings = {\r\n event: dates, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode:eventNodeClone\r\n };\r\n columnViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\t\r\n }\r\n return columnViewMarkersArray;\r\n }\r\n\r\n function getMonthViewMarkers(settings){\r\n let monthViewMarkersArray = [];\r\n const {event, layout, viewName, sectionId} = settings;\r\n const weekDates = [];\r\n let currDate = new Date(event.start_date);\r\n while(currDate.valueOf() < event.end_date.valueOf()){\r\n let obj = {start_date: currDate};\r\n weekDates.push(obj);\r\n currDate = scheduler.date.week_start(scheduler.date.add(currDate, 1, \"week\"));\r\n }\r\n let cells = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']`);\r\n for (let i = 0; i < cells.length; i++) {\r\n const configSettings = {\r\n event: weekDates[i], \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode: cells[i].cloneNode(true)\r\n };\r\n monthViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n return monthViewMarkersArray;\r\n }\r\n\r\n function getTimelineAndUnitsViewMarkers(settings){\r\n let unitMarkersArray = [];\r\n const {event, layout, viewName, eventNode} = settings;\r\n let sectionPropertyName = checkSectionPropertyName(viewName);\r\n if (scheduler.config.multisection && sectionPropertyName){\r\n const sections = String(event[sectionPropertyName]).split(scheduler.config.section_delimiter);\r\n const formatedSections = sections.map(element => String(element));\r\n const elems = [];\r\n for (let i = 0; i < formatedSections.length; i++) {\r\n elems[i] = eventNode.cloneNode(true);\r\n const configSettings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId: formatedSections[i],\r\n eventNode: elems[i]\r\n };\r\n unitMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n }\r\n return unitMarkersArray;\r\n }\r\n \r\n scheduler.attachEvent(\"onBeforeDrag\", function (id, mode, e){\r\n if (isEnabled()) {\r\n dragStarted = true;\r\n event = scheduler.getEvent(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n // to avoid incorrect eventNode and marker creation when scheduler.config.cascade_event_display included\r\n if (layout == \"units\" && scheduler.config.cascade_event_display ) {\r\n scheduler.unselect(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n scheduler.attachEvent(\"onEventDrag\", function (id, mode, e){\r\n if(dragStarted && isEnabled()){\r\n dragStarted = false;// insert element only once after dnd start\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n const sectionId = scheduler.getActionData(e).section;\r\n if (event) {\r\n const settings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode\r\n };\r\n createViewMarker(settings);\r\n }\r\n }\r\n });\r\n\r\n scheduler.attachEvent(\"onDragEnd\", function(id, mode, e){\r\n for (let i = 0; i < dndMarkers.length; i++) {\r\n scheduler.unmarkTimespan(dndMarkers[i]);\r\n }\r\n dndMarkers = [];\r\n eventNode = null;\r\n event = null;\r\n });\r\n}","export default function limitPlugin(scheduler){\r\n\r\n\r\n\tscheduler.config.mark_now = true;\r\n\tscheduler.config.display_marked_timespans = true;\r\n\tscheduler.config.overwrite_marked_timespans = true;\r\n\r\n\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tscheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif ((event.rec_type && event._end_date) || (event.rrule)) {\r\n\t\t\tconst seriesEnd = event._end_date || event.end_date;\r\n\t\t\t// GS-2482 need to take into account that a part of recurring events might be outside the limits\r\n\t\t\tif ((c.limit_start && c.limit_end)) {\r\n\t\t\t\tvar recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event.start_date.valueOf() <= c.limit_end.valueOf();\r\n\t\t\t\treturn recEventInLimits;\r\n\t\t\t} else return true;\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i {\r\n\t\t\tif(date){\r\n\t\t\t\tcalls.setModeDate.date = date;\r\n\t\t\t}\r\n\t\t\tif(mode){\r\n\t\t\t\tcalls.setModeDate.mode = mode;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar methods = {\r\n\t\t\trender:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tsetCurrentView:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tupdateView:(date, mode) => {calls.needUpdateView = true; rememberModeDate(date, mode);},\r\n\t\t\trender_data:() => calls.needRender = true,\r\n\t\t\trender_view_data:(evs) => { \r\n\t\t\t\tif(evs && evs.length){\r\n\t\t\t\t\tevs.forEach((e) => calls.repaintEvents[e.id] = true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcalls.needRender = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\tisActive = false;\r\n\t\tif(!noRedraw){\r\n\t\t\tif(calls.needRender){\r\n\t\t\t\tscheduler.render(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else if(calls.needUpdateView){\r\n\t\t\t\tscheduler.updateView(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else{\r\n\t\t\t\tfor(const i in calls.repaintEvents){\r\n\t\t\t\t\tscheduler.updateEvent(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default function(scheduler){\r\n\tscheduler.batchUpdate = createMethod(scheduler);\r\n}","import dragHighlightPos from \"./drag_highlight_pos\";\r\nimport undoDelete from \"./undo_delete\";\r\nimport limit from \"./limit\";\r\nimport batchUpdate from \"./batch_update\";\r\n\r\nexport default function initPlugins(scheduler){\r\n undoDelete(scheduler);\r\n dragHighlightPos(scheduler);\r\n limit(scheduler);\r\n batchUpdate(scheduler);\r\n}","export default function undoDelete(scheduler) {\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tlet deletedEvent = scheduler.copy(ev);\r\n\t\tif (scheduler.config.undo_deleted && !scheduler.getState().new_event) {\r\n\t\t\tscheduler.message({\r\n\t\t\t\ttext: `
\r\n Event deleted\r\n \r\n
`,\r\n\t\t\t\texpire: 10000,\r\n\t\t\t\ttype: \"popup_after_delete\",\r\n\t\t\t\tcallback: function (e) {\r\n\t\t\t\t\tlet undoBtn = e.target.closest(\r\n\t\t\t\t\t\t`[data-deleted-event-id=\"${ev.id}\"]`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (undoBtn) {\r\n\t\t\t\t\t\tscheduler.addEvent(deletedEvent);\r\n\t\t\t\t\t\tscheduler.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function (e) {\r\n if(text.callback) {\r\n text.callback.call(this, e);\r\n }\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id, callback) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id, callback: callback};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"يومي\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"أسبوعي\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"شهري\",\r\n\t\trepeat_radio_year: \"سنوي\",\r\n\t\trepeat_radio_day_type: \"كل\",\r\n\t\trepeat_text_day_count: \"يوم\",\r\n\t\trepeat_radio_day_type2: \"كل يوم عمل\",\r\n\t\trepeat_week: \" تكرار كل\",\r\n\t\trepeat_text_week_count: \"أسبوع في الأيام التالية:\",\r\n\t\trepeat_radio_month_type: \"تكرار\",\r\n\t\trepeat_radio_month_start: \"في\",\r\n\t\trepeat_text_month_day: \"يوم كل\",\r\n\t\trepeat_text_month_count: \"شهر\",\r\n\t\trepeat_text_month_count2_before: \"كل\",\r\n\t\trepeat_text_month_count2_after: \"شهر\",\r\n\t\trepeat_year_label: \"في\",\r\n\t\tselect_year_day2: \"من\",\r\n\t\trepeat_text_year_day: \"يوم\",\r\n\t\tselect_year_month: \"شهر\",\r\n\t\trepeat_radio_end: \"بدون تاريخ انتهاء\",\r\n\t\trepeat_text_occurences_count: \"تكرارات\",\r\n\t\trepeat_radio_end2: \"بعد\",\r\n\t\trepeat_radio_end3: \"ينتهي في\",\r\n\r\n\t\trepeat_never: \"أبداً\",\r\n\t\trepeat_daily: \"كل يوم\",\r\n\t\trepeat_workdays: \"كل يوم عمل\",\r\n\t\trepeat_weekly: \"كل أسبوع\",\r\n\t\trepeat_monthly: \"كل شهر\",\r\n\t\trepeat_yearly: \"كل سنة\",\r\n\t\trepeat_custom: \"تخصيص\",\r\n\t\trepeat_freq_day: \"يوم\",\r\n\t\trepeat_freq_week: \"أسبوع\",\r\n\t\trepeat_freq_month: \"شهر\",\r\n\t\trepeat_freq_year: \"سنة\",\r\n\t\trepeat_on_date: \"في التاريخ\",\r\n\t\trepeat_ends: \"ينتهي\",\r\n\r\n\t\tmonth_for_recurring: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_for_recurring: [\"الأحد\", \"الإثنين\", \"الثلاثاء\", \"الأربعاء\", \"الخميس\", \"الجمعة\", \"السبت\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\r\n\t\trepeat_never: \"Ніколі\",\r\n\t\trepeat_daily: \"Кожны дзень\",\r\n\t\trepeat_workdays: \"Кожны працоўны дзень\",\r\n\t\trepeat_weekly: \"Кожны тыдзень\",\r\n\t\trepeat_monthly: \"Кожны месяц\",\r\n\t\trepeat_yearly: \"Кожны год\",\r\n\t\trepeat_custom: \"Наладжвальны\",\r\n\t\trepeat_freq_day: \"Дзень\",\r\n\t\trepeat_freq_week: \"Тыдзень\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Заканчваецца\",\r\n\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diari\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Setmanal\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mensual\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada dia laborable\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"setmana els dies següents:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada\",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"de\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sense data de finalització\",\r\n\t\trepeat_text_occurences_count: \"ocurrències\",\r\n\t\trepeat_radio_end2: \"Després\",\r\n\t\trepeat_radio_end3: \"Finalitzar el\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Cada dia\",\r\n\t\trepeat_workdays: \"Cada dia laborable\",\r\n\t\trepeat_weekly: \"Cada setmana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada any\",\r\n\t\trepeat_custom: \"Personalitzat\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Setmana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Any\",\r\n\t\trepeat_on_date: \"En la data\",\r\n\t\trepeat_ends: \"Finalitza\",\r\n\r\n\t\tmonth_for_recurring: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tday_for_recurring: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"]\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\t\r\n\t\trepeat_never: \"从不\",\r\n\t\trepeat_daily: \"每天\",\r\n\t\trepeat_workdays: \"每个工作日\",\r\n\t\trepeat_weekly: \"每周\",\r\n\t\trepeat_monthly: \"每月\",\r\n\t\trepeat_yearly: \"每年\",\r\n\t\trepeat_custom: \"自定义\",\r\n\t\trepeat_freq_day: \"天\",\r\n\t\trepeat_freq_week: \"周\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"在日期\",\r\n\t\trepeat_ends: \"结束\",\r\n\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý den\",\r\n\t\trepeat_workdays: \"Každý pracovní den\",\r\n\t\trepeat_weekly: \"Každý týden\",\r\n\t\trepeat_monthly: \"Každý měsíc\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastní\",\r\n\t\trepeat_freq_day: \"Den\",\r\n\t\trepeat_freq_week: \"Týden\",\r\n\t\trepeat_freq_month: \"Měsíc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Končí\",\r\n\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver hverdag\",\r\n\t\trepeat_weekly: \"Hver uge\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Brugerdefineret\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uge\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\r\n\t\trepeat_never: \"Nie\",\r\n\t\trepeat_daily: \"Jeden Tag\",\r\n\t\trepeat_workdays: \"Jeden Werktag\",\r\n\t\trepeat_weekly: \"Jede Woche\",\r\n\t\trepeat_monthly: \"Jeden Monat\",\r\n\t\trepeat_yearly: \"Jedes Jahr\",\r\n\t\trepeat_custom: \"Benutzerdefiniert\",\r\n\t\trepeat_freq_day: \"Tag\",\r\n\t\trepeat_freq_week: \"Woche\",\r\n\t\trepeat_freq_month: \"Monat\",\r\n\t\trepeat_freq_year: \"Jahr\",\r\n\t\trepeat_on_date: \"Am Datum\",\r\n\t\trepeat_ends: \"Endet\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\r\n\t\trepeat_never: \"Ποτέ\",\r\n\t\trepeat_daily: \"Κάθε μέρα\",\r\n\t\trepeat_workdays: \"Κάθε εργάσιμη μέρα\",\r\n\t\trepeat_weekly: \"Κάθε εβδομάδα\",\r\n\t\trepeat_monthly: \"Κάθε μήνα\",\r\n\t\trepeat_yearly: \"Κάθε χρόνο\",\r\n\t\trepeat_custom: \"Προσαρμοσμένο\",\r\n\t\trepeat_freq_day: \"Ημέρα\",\r\n\t\trepeat_freq_week: \"Εβδομάδα\",\r\n\t\trepeat_freq_month: \"Μήνας\",\r\n\t\trepeat_freq_year: \"Χρόνος\",\r\n\t\trepeat_on_date: \"Σε ημερομηνία\",\r\n\t\trepeat_ends: \"Λήγει\",\r\n\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\r\n\t\trepeat_never: \"Never\",\r\n\t\trepeat_daily: \"Every day\",\r\n\t\trepeat_workdays: \"Every weekday\",\r\n\t\trepeat_weekly: \"Every week\",\r\n\t\trepeat_monthly: \"Every month\",\r\n\t\trepeat_yearly: \"Every year\",\r\n\t\trepeat_custom: \"Custom\",\r\n\t\trepeat_freq_day: \"Day\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Month\",\r\n\t\trepeat_freq_year: \"Year\",\r\n\t\trepeat_on_date: \"On date\",\r\n\t\trepeat_ends: \"Ends\",\r\n\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Cada día\",\r\n\t\trepeat_workdays: \"Cada día laborable\",\r\n\t\trepeat_weekly: \"Cada semana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada año\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Día\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Año\",\r\n\t\trepeat_on_date: \"En la fecha\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ei koskaan\",\r\n\t\trepeat_daily: \"Joka päivä\",\r\n\t\trepeat_workdays: \"Joka arkipäivä\",\r\n\t\trepeat_weekly: \"Joka viikko\",\r\n\t\trepeat_monthly: \"Joka kuukausi\",\r\n\t\trepeat_yearly: \"Joka vuosi\",\r\n\t\trepeat_custom: \"Mukautettu\",\r\n\t\trepeat_freq_day: \"Päivä\",\r\n\t\trepeat_freq_week: \"Viikko\",\r\n\t\trepeat_freq_month: \"Kuukausi\",\r\n\t\trepeat_freq_year: \"Vuosi\",\r\n\t\trepeat_on_date: \"Tiettynä päivänä\",\r\n\t\trepeat_ends: \"Päättyy\",\r\n\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\r\n\t\trepeat_never: \"Jamais\",\r\n\t\trepeat_daily: \"Chaque jour\",\r\n\t\trepeat_workdays: \"Chaque jour ouvrable\",\r\n\t\trepeat_weekly: \"Chaque semaine\",\r\n\t\trepeat_monthly: \"Chaque mois\",\r\n\t\trepeat_yearly: \"Chaque année\",\r\n\t\trepeat_custom: \"Personnalisé\",\r\n\t\trepeat_freq_day: \"Jour\",\r\n\t\trepeat_freq_week: \"Semaine\",\r\n\t\trepeat_freq_month: \"Mois\",\r\n\t\trepeat_freq_year: \"Année\",\r\n\t\trepeat_on_date: \"À la date\",\r\n\t\trepeat_ends: \"Se termine\",\r\n\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\r\n\t\trepeat_never: \"אף פעם\",\r\n\t\trepeat_daily: \"כל יום\",\r\n\t\trepeat_workdays: \"כל יום עבודה\",\r\n\t\trepeat_weekly: \"כל שבוע\",\r\n\t\trepeat_monthly: \"כל חודש\",\r\n\t\trepeat_yearly: \"כל שנה\",\r\n\t\trepeat_custom: \"מותאם אישית\",\r\n\t\trepeat_freq_day: \"יום\",\r\n\t\trepeat_freq_week: \"שבוע\",\r\n\t\trepeat_freq_month: \"חודש\",\r\n\t\trepeat_freq_year: \"שנה\",\r\n\t\trepeat_on_date: \"בתאריך\",\r\n\t\trepeat_ends: \"מסתיים\",\r\n\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Napi\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Heti\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Havi\",\r\n\t\trepeat_radio_year: \"Éves\",\r\n\t\trepeat_radio_day_type: \"Minden\",\r\n\t\trepeat_text_day_count: \"nap\",\r\n\t\trepeat_radio_day_type2: \"Minden munkanap\",\r\n\t\trepeat_week: \" Ismételje meg minden\",\r\n\t\trepeat_text_week_count: \"héten a következő napokon:\",\r\n\t\trepeat_radio_month_type: \"Ismétlés\",\r\n\t\trepeat_radio_month_start: \"Ekkor\",\r\n\t\trepeat_text_month_day: \"nap minden\",\r\n\t\trepeat_text_month_count: \"hónapban\",\r\n\t\trepeat_text_month_count2_before: \"minden\",\r\n\t\trepeat_text_month_count2_after: \"hónapban\",\r\n\t\trepeat_year_label: \"Ekkor\",\r\n\t\tselect_year_day2: \"-án/-én\",\r\n\t\trepeat_text_year_day: \"nap\",\r\n\t\tselect_year_month: \"hónap\",\r\n\t\trepeat_radio_end: \"Nincs befejezési dátum\",\r\n\t\trepeat_text_occurences_count: \"esemény\",\r\n\t\trepeat_radio_end2: \"Után\",\r\n\t\trepeat_radio_end3: \"Befejező dátum\",\r\n\r\n\t\trepeat_never: \"Soha\",\r\n\t\trepeat_daily: \"Minden nap\",\r\n\t\trepeat_workdays: \"Minden munkanap\",\r\n\t\trepeat_weekly: \"Minden héten\",\r\n\t\trepeat_monthly: \"Minden hónapban\",\r\n\t\trepeat_yearly: \"Minden évben\",\r\n\t\trepeat_custom: \"Egyedi\",\r\n\t\trepeat_freq_day: \"Nap\",\r\n\t\trepeat_freq_week: \"Hét\",\r\n\t\trepeat_freq_month: \"Hónap\",\r\n\t\trepeat_freq_year: \"Év\",\r\n\t\trepeat_on_date: \"Dátum szerint\",\r\n\t\trepeat_ends: \"Befejeződik\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Harian\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Mingguan\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Bulanan\",\r\n\t\trepeat_radio_year: \"Tahunan\",\r\n\t\trepeat_radio_day_type: \"Setiap\",\r\n\t\trepeat_text_day_count: \"hari\",\r\n\t\trepeat_radio_day_type2: \"Setiap hari kerja\",\r\n\t\trepeat_week: \" Ulangi setiap\",\r\n\t\trepeat_text_week_count: \"minggu pada hari berikut:\",\r\n\t\trepeat_radio_month_type: \"Ulangi\",\r\n\t\trepeat_radio_month_start: \"Pada\",\r\n\t\trepeat_text_month_day: \"hari setiap\",\r\n\t\trepeat_text_month_count: \"bulan\",\r\n\t\trepeat_text_month_count2_before: \"setiap\",\r\n\t\trepeat_text_month_count2_after: \"bulan\",\r\n\t\trepeat_year_label: \"Pada\",\r\n\t\tselect_year_day2: \"dari\",\r\n\t\trepeat_text_year_day: \"hari\",\r\n\t\tselect_year_month: \"bulan\",\r\n\t\trepeat_radio_end: \"Tanpa tanggal akhir\",\r\n\t\trepeat_text_occurences_count: \"kejadian\",\r\n\t\trepeat_radio_end2: \"Setelah\",\r\n\t\trepeat_radio_end3: \"Berakhir pada\",\r\n\r\n\t\trepeat_never: \"Tidak pernah\",\r\n\t\trepeat_daily: \"Setiap hari\",\r\n\t\trepeat_workdays: \"Setiap hari kerja\",\r\n\t\trepeat_weekly: \"Setiap minggu\",\r\n\t\trepeat_monthly: \"Setiap bulan\",\r\n\t\trepeat_yearly: \"Setiap tahun\",\r\n\t\trepeat_custom: \"Kustom\",\r\n\t\trepeat_freq_day: \"Hari\",\r\n\t\trepeat_freq_week: \"Minggu\",\r\n\t\trepeat_freq_month: \"Bulan\",\r\n\t\trepeat_freq_year: \"Tahun\",\r\n\t\trepeat_on_date: \"Pada tanggal\",\r\n\t\trepeat_ends: \"Berakhir\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Ogni giorno\",\r\n\t\trepeat_workdays: \"Ogni giorno feriale\",\r\n\t\trepeat_weekly: \"Ogni settimana\",\r\n\t\trepeat_monthly: \"Ogni mese\",\r\n\t\trepeat_yearly: \"Ogni anno\",\r\n\t\trepeat_custom: \"Personalizzato\",\r\n\t\trepeat_freq_day: \"Giorno\",\r\n\t\trepeat_freq_week: \"Settimana\",\r\n\t\trepeat_freq_month: \"Mese\",\r\n\t\trepeat_freq_year: \"Anno\",\r\n\t\trepeat_on_date: \"Alla data\",\r\n\t\trepeat_ends: \"Finisce\",\r\n\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"毎日\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"毎週\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"毎月\",\r\n\t\trepeat_radio_year: \"毎年\",\r\n\t\trepeat_radio_day_type: \"毎\",\r\n\t\trepeat_text_day_count: \"日\",\r\n\t\trepeat_radio_day_type2: \"毎営業日\",\r\n\t\trepeat_week: \" 繰り返し毎\",\r\n\t\trepeat_text_week_count: \"週 次の日:\",\r\n\t\trepeat_radio_month_type: \"繰り返し\",\r\n\t\trepeat_radio_month_start: \"オン\",\r\n\t\trepeat_text_month_day: \"日毎\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"毎\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"オン\",\r\n\t\tselect_year_day2: \"の\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"終了日なし\",\r\n\t\trepeat_text_occurences_count: \"回数\",\r\n\t\trepeat_radio_end2: \"後\",\r\n\t\trepeat_radio_end3: \"終了日まで\",\r\n\r\n\t\trepeat_never: \"決して\",\r\n\t\trepeat_daily: \"毎日\",\r\n\t\trepeat_workdays: \"毎営業日\",\r\n\t\trepeat_weekly: \"毎週\",\r\n\t\trepeat_monthly: \"毎月\",\r\n\t\trepeat_yearly: \"毎年\",\r\n\t\trepeat_custom: \"カスタム\",\r\n\t\trepeat_freq_day: \"日\",\r\n\t\trepeat_freq_week: \"週\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"日にち\",\r\n\t\trepeat_ends: \"終了\",\r\n\r\n\t\tmonth_for_recurring: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_for_recurring: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\r\n\t\trepeat_never: \"Nooit\",\r\n\t\trepeat_daily: \"Elke dag\",\r\n\t\trepeat_workdays: \"Elke werkdag\",\r\n\t\trepeat_weekly: \"Elke week\",\r\n\t\trepeat_monthly: \"Elke maand\",\r\n\t\trepeat_yearly: \"Elk jaar\",\r\n\t\trepeat_custom: \"Aangepast\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Maand\",\r\n\t\trepeat_freq_year: \"Jaar\",\r\n\t\trepeat_on_date: \"Op datum\",\r\n\t\trepeat_ends: \"Eindigt\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Ukentlig\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Hver arbeidsdag\",\r\n\t\trepeat_week: \" Gjenta hver\",\r\n\t\trepeat_text_week_count: \"uke neste dager:\",\r\n\t\trepeat_radio_month_type: \"Gjenta\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"På\",\r\n\t\tselect_year_day2: \"av\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"måned\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomster\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\trepeat_radio_end3: \"Slutt innen\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nigdy\",\r\n\t\trepeat_daily: \"Codziennie\",\r\n\t\trepeat_workdays: \"Każdy dzień roboczy\",\r\n\t\trepeat_weekly: \"Co tydzień\",\r\n\t\trepeat_monthly: \"Co miesiąc\",\r\n\t\trepeat_yearly: \"Co rok\",\r\n\t\trepeat_custom: \"Niestandardowy\",\r\n\t\trepeat_freq_day: \"Dzień\",\r\n\t\trepeat_freq_week: \"Tydzień\",\r\n\t\trepeat_freq_month: \"Miesiąc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"W dniu\",\r\n\t\trepeat_ends: \"Kończy się\",\r\n\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Todos os dias\",\r\n\t\trepeat_workdays: \"Todos os dias úteis\",\r\n\t\trepeat_weekly: \"Toda semana\",\r\n\t\trepeat_monthly: \"Todo mês\",\r\n\t\trepeat_yearly: \"Todo ano\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mês\",\r\n\t\trepeat_freq_year: \"Ano\",\r\n\t\trepeat_on_date: \"Na data\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\r\n\t\trepeat_never: \"Niciodată\",\r\n\t\trepeat_daily: \"În fiecare zi\",\r\n\t\trepeat_workdays: \"În fiecare zi lucrătoare\",\r\n\t\trepeat_weekly: \"În fiecare săptămână\",\r\n\t\trepeat_monthly: \"În fiecare lună\",\r\n\t\trepeat_yearly: \"În fiecare an\",\r\n\t\trepeat_custom: \"Personalizat\",\r\n\t\trepeat_freq_day: \"Zi\",\r\n\t\trepeat_freq_week: \"Săptămână\",\r\n\t\trepeat_freq_month: \"Lună\",\r\n\t\trepeat_freq_year: \"An\",\r\n\t\trepeat_on_date: \"La data\",\r\n\t\trepeat_ends: \"Se termină\",\r\n\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Никогда\",\r\n\t\trepeat_daily: \"Каждый день\",\r\n\t\trepeat_workdays: \"Каждый будний день\",\r\n\t\trepeat_weekly: \"Каждую неделю\",\r\n\t\trepeat_monthly: \"Каждый месяц\",\r\n\t\trepeat_yearly: \"Каждый год\",\r\n\t\trepeat_custom: \"Настроить\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Неделя\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"В дату\",\r\n\t\trepeat_ends: \"Заканчивается\",\r\n\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dnevno\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Tedensko\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mesečno\",\r\n\t\trepeat_radio_year: \"Letno\",\r\n\t\trepeat_radio_day_type: \"Vsak\",\r\n\t\trepeat_text_day_count: \"dan\",\r\n\t\trepeat_radio_day_type2: \"Vsak delovni dan\",\r\n\t\trepeat_week: \" Ponavljaj vsak\",\r\n\t\trepeat_text_week_count: \"teden na naslednje dni:\",\r\n\t\trepeat_radio_month_type: \"Ponavljaj\",\r\n\t\trepeat_radio_month_start: \"Na\",\r\n\t\trepeat_text_month_day: \"dan vsak\",\r\n\t\trepeat_text_month_count: \"mesec\",\r\n\t\trepeat_text_month_count2_before: \"vsak\",\r\n\t\trepeat_text_month_count2_after: \"mesec\",\r\n\t\trepeat_year_label: \"Na\",\r\n\t\tselect_year_day2: \"od\",\r\n\t\trepeat_text_year_day: \"dan\",\r\n\t\tselect_year_month: \"mesec\",\r\n\t\trepeat_radio_end: \"Brez končnega datuma\",\r\n\t\trepeat_text_occurences_count: \"pojavitve\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\trepeat_radio_end3: \"Končaj do\",\r\n\r\n\t\trepeat_never: \"Nikoli\",\r\n\t\trepeat_daily: \"Vsak dan\",\r\n\t\trepeat_workdays: \"Vsak delovni dan\",\r\n\t\trepeat_weekly: \"Vsak teden\",\r\n\t\trepeat_monthly: \"Vsak mesec\",\r\n\t\trepeat_yearly: \"Vsako leto\",\r\n\t\trepeat_custom: \"Po meri\",\r\n\t\trepeat_freq_day: \"Dan\",\r\n\t\trepeat_freq_week: \"Teden\",\r\n\t\trepeat_freq_month: \"Mesec\",\r\n\t\trepeat_freq_year: \"Leto\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Konča se\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý deň\",\r\n\t\trepeat_workdays: \"Každý pracovný deň\",\r\n\t\trepeat_weekly: \"Každý týždeň\",\r\n\t\trepeat_monthly: \"Každý mesiac\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastné\",\r\n\t\trepeat_freq_day: \"Deň\",\r\n\t\trepeat_freq_week: \"Týždeň\",\r\n\t\trepeat_freq_month: \"Mesiac\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na dátum\",\r\n\t\trepeat_ends: \"Koniec\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Varje dag\",\r\n\t\trepeat_workdays: \"Varje vardag\",\r\n\t\trepeat_weekly: \"Varje vecka\",\r\n\t\trepeat_monthly: \"Varje månad\",\r\n\t\trepeat_yearly: \"Varje år\",\r\n\t\trepeat_custom: \"Anpassad\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Vecka\",\r\n\t\trepeat_freq_month: \"Månad\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På datum\",\r\n\t\trepeat_ends: \"Slutar\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Günlük\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Haftalık\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Aylık\",\r\n\t\trepeat_radio_year: \"Yıllık\",\r\n\t\trepeat_radio_day_type: \"Her\",\r\n\t\trepeat_text_day_count: \"gün\",\r\n\t\trepeat_radio_day_type2: \"Her iş günü\",\r\n\t\trepeat_week: \" Tekrar her\",\r\n\t\trepeat_text_week_count: \"hafta şu günlerde:\",\r\n\t\trepeat_radio_month_type: \"Tekrar et\",\r\n\t\trepeat_radio_month_start: \"Tarihinde\",\r\n\t\trepeat_text_month_day: \"gün her\",\r\n\t\trepeat_text_month_count: \"ay\",\r\n\t\trepeat_text_month_count2_before: \"her\",\r\n\t\trepeat_text_month_count2_after: \"ay\",\r\n\t\trepeat_year_label: \"Tarihinde\",\r\n\t\tselect_year_day2: \"ayın\",\r\n\t\trepeat_text_year_day: \"günü\",\r\n\t\tselect_year_month: \"ay\",\r\n\t\trepeat_radio_end: \"Bitiş tarihi yok\",\r\n\t\trepeat_text_occurences_count: \"olay\",\r\n\t\trepeat_radio_end2: \"Sonra\",\r\n\t\trepeat_radio_end3: \"Tarihinde bitir\",\r\n\r\n\t\trepeat_never: \"Asla\",\r\n\t\trepeat_daily: \"Her gün\",\r\n\t\trepeat_workdays: \"Her iş günü\",\r\n\t\trepeat_weekly: \"Her hafta\",\r\n\t\trepeat_monthly: \"Her ay\",\r\n\t\trepeat_yearly: \"Her yıl\",\r\n\t\trepeat_custom: \"Özel\",\r\n\t\trepeat_freq_day: \"Gün\",\r\n\t\trepeat_freq_week: \"Hafta\",\r\n\t\trepeat_freq_month: \"Ay\",\r\n\t\trepeat_freq_year: \"Yıl\",\r\n\t\trepeat_on_date: \"Tarihinde\",\r\n\t\trepeat_ends: \"Biter\",\r\n\r\n\t\tmonth_for_recurring: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tday_for_recurring: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ніколи\",\r\n\t\trepeat_daily: \"Щодня\",\r\n\t\trepeat_workdays: \"Щодня в робочі дні\",\r\n\t\trepeat_weekly: \"Щотижня\",\r\n\t\trepeat_monthly: \"Щомісяця\",\r\n\t\trepeat_yearly: \"Щороку\",\r\n\t\trepeat_custom: \"Налаштоване\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Тиждень\",\r\n\t\trepeat_freq_month: \"Місяць\",\r\n\t\trepeat_freq_year: \"Рік\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Закінчується\",\r\n\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\nimport addPlugins from \"./plugins\";\r\nimport stateProvider from \"./core/state\";\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tscheduler.$stateProvider = stateProvider();\r\n\r\n\tscheduler.getState = scheduler.$stateProvider.getState;\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\taddPlugins(scheduler);\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","import utils from \"./utils/utils\";\r\n\r\nconst StateService = (function(){\r\n\tconst stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tconst provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tconst res = {};\r\n\t\t\tfor(const i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.$stateProvider.registerProvider(\"global\", (function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n}).bind(scheduler));\r\n\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\tundo_deleted: true,\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\tvar html = `
\r\n\t\t\t\t
`;\r\n\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\t\thtml+=\"
\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\ndeclare let google: any;\r\n\r\nexport class GoogleMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tprivate infoWindow: any;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tlet zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom;\r\n\t\t\t\t\tif (event.lat && event.lng){\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: event.lat, \r\n\t\t\t\t\t\t\tlng: event.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: this.settings.error_position.lat, \r\n\t\t\t\t\t\t\tlng: this.settings.error_position.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoogle.maps.event.trigger(this._markers[i].marker, 'click');\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tthis.settings = options;\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapOptions = {\r\n\t\t\tcenter: { lat: options.initial_position.lat, lng: options.initial_position.lng },\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tmapId: container.id,\r\n\t\t\tscrollwheel: true,\r\n\t\t\tmapTypeId: options.type\r\n\t\t}\r\n\t\t// we need to reuse the google map to avoid leak memory\r\n\t\tif (this.map === null) {\r\n\t\t\tthis.map = new google.maps.Map(container, mapOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet map = this.map;\r\n\t\t\tcontainer.appendChild(this.map.__gm.messageOverlay);\r\n\t\t\tcontainer.appendChild(this.map.__gm.outerContainer);\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tmap.setOptions({container: container.id});\r\n\t\t\t}, 500);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(this.map, \"dblclick\", function(event) {\r\n\t\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\r\n\t\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\t\tlet point = event.latLng;\r\n\t\t\t\tgeocoder.geocode(\r\n\t\t\t\t\t{ 'latLng': point },\r\n\t\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tgoogle.maps.event.clearInstanceListeners(window);\r\n\t\tgoogle.maps.event.clearInstanceListeners(document);\r\n\t\tgoogle.maps.event.clearInstanceListeners(container);\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\tasync addEventMarker(event: ICalendarEvent): Promise {\r\n\t\tlet config = {\r\n\t\t\ttitle: event.text,\r\n\t\t\tposition: {},\r\n\t\t\tmap: {}\r\n\t\t}\r\n\t\t\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tconfig.position = { lat: event.lat, lng: event.lng };\r\n\t\t} else {\r\n\t\t\tconfig.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }\r\n\t\t}\r\n\t\tconst { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\t\tlet marker;\r\n\t\tif (this.scheduler.ext.mapView.createMarker) {\r\n\t\t\tconfig.map = this.map;\r\n\t\t\tmarker = this.scheduler.ext.mapView.createMarker(config);\r\n\t\t} else {\r\n\t\t\tmarker = new AdvancedMarkerElement(config);\r\n\t\t\tmarker.map = this.map;\r\n\t\t}\r\n\t\tmarker.setMap(this.map);\r\n\t\t//case for markeks which were deleted with DataProcessor\r\n\t\tif (event[\"!nativeeditor_status\"] == \"true_deleted\"){\r\n\t\t\tmarker.setMap(null);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(marker, \"click\", () => {\r\n\t\t\tif (this.infoWindow) {\r\n\t\t\t\tthis.infoWindow.close();\r\n\t\t\t}\r\n\t\t\tthis.infoWindow = new google.maps.InfoWindow({maxWidth: this.settings.info_window_max_width});\r\n\t\t\tthis.infoWindow.setContent(this.scheduler.templates.map_info_content(event));\r\n\t\t\tthis.infoWindow.open({\r\n\t\t\t\tanchor: marker,\r\n\t\t\t\tmap: this.map,\r\n\t\t\t});\r\n\t\t});\r\n\t\tlet markerInfo = {event, ...config, marker};\r\n\t\tthis._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.setVisible(false);\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t\tthis._markers[i].marker.setPosition(null);\r\n\t\t\t\tthis._markers[i].marker = null;\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tthis._markers[i].position.lat = event.lat;\r\n\t\t\t\tthis._markers[i].position.lng = event.lng;\r\n\t\t\t\tthis._markers[i].text = event.text;\r\n\t\t\t\tlet latlng = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t\t\tthis._markers[i].marker.setPosition(latlng);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif (this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setCenter({\r\n\t\t\tlat: latitude, \r\n\t\t\tlng: longitude,\r\n\t\t});\r\n\t\tthis.map.setZoom(zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\tlet position: any = await new Promise((resolve) => {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'address': string },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tresolve({\r\n\t\t\t\t\t\t lat: results[0].geometry.location.lat(),\r\n\t\t\t\t\t\t lng: results[0].geometry.location.lng()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\tresolve({});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\t\treturn position;\r\n\t}\r\n\t\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let L: any\r\n\r\nexport class OpenStreetMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate _markers: any[];\r\n\tprivate settings: IMapSettings;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.openPopup();\r\n\t\t\t\t\tthis._markers[i].marker.closeTooltip();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapWrapper = document.createElement('div');\r\n\t\tmapWrapper.className = 'mapWrapper';\r\n\t\tmapWrapper.id = 'mapWrapper';\r\n\t\tmapWrapper.style.width = container.style.width;\r\n\t\tmapWrapper.style.height = container.style.height;\r\n\t\tcontainer.appendChild(mapWrapper);\r\n\r\n\t\tlet map = L.map(mapWrapper, {\r\n\t\t\tcenter: L.latLng(options.initial_position.lat, options.initial_position.lng),\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tkeyboard: false // need to set false, due to bug with moving window\r\n\t\t});\r\n\t\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);\r\n\t\tmap.on(\"dblclick\", async function(e){\r\n\t\t\tconst settings = {\r\n\t\t\t\t\"method\": \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then(response => response.json());\r\n\t\t\tif (response.address) {\r\n\t\t\t\tlet address = response.address.country;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.latlng.lat,\r\n\t\t\t\t\tlng: e.latlng.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\", response.error);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.map = map;\r\n\t\tthis.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n\t\tconst myIcon = L.icon({\r\n\t\t\ticonUrl: 'https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png',\r\n\t\t\ticonSize: [25, 41],\r\n\t\t\tshadowSize: [30, 65],\r\n\t\t\ticonAnchor: [12, 41],\r\n\t\t\tshadowAnchor: [7, 65]\r\n\t\t});\r\n\t\tlet popupConfig = {\r\n\t\t\tminWidth: 180,\r\n\t\t\tmaxWidth: this.settings.info_window_max_width,\r\n\t\t}\r\n\t\tconst markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event));\r\n\t\tconst tooltip = L.tooltip().setContent(event.text);\r\n\r\n\t\tlet markerConfig = [\r\n\t\t\tevent.lat,\r\n\t\t\tevent.lng\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tmarkerConfig = [this.settings.error_position.lat, this.settings.error_position.lng];\r\n\t\t}\r\n\t\tconst marker = L.marker(markerConfig, {\r\n\t\t\ticon: myIcon\r\n\t\t}).bindPopup(markerPopup).bindTooltip(tooltip).addTo(this.map);\r\n\t\tconst markerInfo = {event, marker};\r\n\t\tthis._markers.push(markerInfo);\t\t\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker);\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([event.lat, event.lng]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif(this._markers) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker); \r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setView([latitude, longitude], zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst settings = {\r\n\t\t\t\"method\": \"GET\",\r\n\t\t\theaders: {\r\n\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t},\r\n\t\t};\r\n\t\tlet position:any = {};\r\n\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then(response => response.json());\r\n\t\tif (response && response.length) {\r\n\t\t\tposition.lat = +response[0].lat;\r\n\t\t\tposition.lng = +response[0].lon;\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let mapboxgl: any;\r\ndeclare let MapboxGeocoder: any;\r\n\r\nexport class MapboxAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n const popup = this._markers[i].marker.getPopup();\r\n if (popup.isOpen()){\r\n popup.remove();\r\n }\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.togglePopup();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n let scheduler = this.scheduler;\r\n\r\n\t\tmapboxgl.accessToken = options.accessToken;\r\n const map = new mapboxgl.Map({\r\n container: container, \r\n center: [options.initial_position.lng, options.initial_position.lat], \r\n zoom: options.initial_zoom + 1, // problems with coordinates if zoom = 1\r\n });\r\n map.on(\"dblclick\",async function(e){\r\n\t\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${ e.lngLat.lat}.json?access_token=${options.accessToken}`).then(response => response.json());\r\n\t\t\tif (response.features){\r\n\t\t\t\tlet address = response.features[0].place_name;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.lngLat.lat,\r\n\t\t\t\t\tlng: e.lngLat.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\");\r\n\t\t\t}\r\n\t\t});\r\n this.map = map;\r\n this.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n while (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n container.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n let config = [\r\n\t\t\tevent.lng,\r\n\t\t\tevent.lat\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tconfig = [this.settings.error_position.lng, this.settings.error_position.lat];\r\n\t\t} \r\n\r\n\t\tconst popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false})\r\n .setMaxWidth(`${this.settings.info_window_max_width}px`) \r\n .setHTML(this.scheduler.templates.map_info_content(event));\r\n const marker = new mapboxgl.Marker()\r\n .setLngLat(config)\r\n .setPopup(popup)\r\n .addTo(this.map);\r\n const markerInfo = {event, marker}; \r\n this._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.remove();\r\n this._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([event.lng, event.lat]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tfor (let i = 0; i {\r\n\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then(response => response.json());\r\n\t\tlet position:any = {};\r\n\t\tif (response && response.features.length) {\r\n\t\t\tposition.lng = response.features[0].center[0];\r\n\t\t\tposition.lat = response.features[0].center[1];\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","// =============================================================================\n// Weekday\n// =============================================================================\nexport var ALL_WEEKDAYS = [\n 'MO',\n 'TU',\n 'WE',\n 'TH',\n 'FR',\n 'SA',\n 'SU',\n];\nvar Weekday = /** @class */ (function () {\n function Weekday(weekday, n) {\n if (n === 0)\n throw new Error(\"Can't create weekday with n == 0\");\n this.weekday = weekday;\n this.n = n;\n }\n Weekday.fromStr = function (str) {\n return new Weekday(ALL_WEEKDAYS.indexOf(str));\n };\n // __call__ - Cannot call the object directly, do it through\n // e.g. RRule.TH.nth(-1) instead,\n Weekday.prototype.nth = function (n) {\n return this.n === n ? this : new Weekday(this.weekday, n);\n };\n // __eq__\n Weekday.prototype.equals = function (other) {\n return this.weekday === other.weekday && this.n === other.n;\n };\n // __repr__\n Weekday.prototype.toString = function () {\n var s = ALL_WEEKDAYS[this.weekday];\n if (this.n)\n s = (this.n > 0 ? '+' : '') + String(this.n) + s;\n return s;\n };\n Weekday.prototype.getJsWeekday = function () {\n return this.weekday === 6 ? 0 : this.weekday + 1;\n };\n return Weekday;\n}());\nexport { Weekday };\n//# sourceMappingURL=weekday.js.map","// =============================================================================\n// Helper functions\n// =============================================================================\nimport { ALL_WEEKDAYS } from './weekday';\nexport var isPresent = function (value) {\n return value !== null && value !== undefined;\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isWeekdayStr = function (value) {\n return typeof value === 'string' && ALL_WEEKDAYS.includes(value);\n};\nexport var isArray = Array.isArray;\n/**\n * Simplified version of python's range()\n */\nexport var range = function (start, end) {\n if (end === void 0) { end = start; }\n if (arguments.length === 1) {\n end = start;\n start = 0;\n }\n var rang = [];\n for (var i = start; i < end; i++)\n rang.push(i);\n return rang;\n};\nexport var clone = function (array) {\n return [].concat(array);\n};\nexport var repeat = function (value, times) {\n var i = 0;\n var array = [];\n if (isArray(value)) {\n for (; i < times; i++)\n array[i] = [].concat(value);\n }\n else {\n for (; i < times; i++)\n array[i] = value;\n }\n return array;\n};\nexport var toArray = function (item) {\n if (isArray(item)) {\n return item;\n }\n return [item];\n};\nexport function padStart(item, targetLength, padString) {\n if (padString === void 0) { padString = ' '; }\n var str = String(item);\n targetLength = targetLength >> 0;\n if (str.length > targetLength) {\n return String(str);\n }\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += repeat(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(str);\n}\n/**\n * Python like split\n */\nexport var split = function (str, sep, num) {\n var splits = str.split(sep);\n return num\n ? splits.slice(0, num).concat([splits.slice(num).join(sep)])\n : splits;\n};\n/**\n * closure/goog/math/math.js:modulo\n * Copyright 2006 The Closure Library Authors.\n * The % operator in JavaScript returns the remainder of a / b, but differs from\n * some other languages in that the result will have the same sign as the\n * dividend. For example, -1 % 8 == -1, whereas in some other languages\n * (such as Python) the result would be 7. This function emulates the more\n * correct modulo behavior, which is useful for certain applications such as\n * calculating an offset index in a circular list.\n *\n * @param {number} a The dividend.\n * @param {number} b The divisor.\n * @return {number} a % b where the result is between 0 and b (either 0 <= x < b\n * or b < x <= 0, depending on the sign of b).\n */\nexport var pymod = function (a, b) {\n var r = a % b;\n // If r and b differ in sign, add b to wrap the result to the correct sign.\n return r * b < 0 ? r + b : r;\n};\n/**\n * @see: \n */\nexport var divmod = function (a, b) {\n return { div: Math.floor(a / b), mod: pymod(a, b) };\n};\nexport var empty = function (obj) {\n return !isPresent(obj) || obj.length === 0;\n};\n/**\n * Python-like boolean\n *\n * @return {Boolean} value of an object/primitive, taking into account\n * the fact that in Python an empty list's/tuple's\n * boolean value is False, whereas in JS it's true\n */\nexport var notEmpty = function (obj) {\n return !empty(obj);\n};\n/**\n * Return true if a value is in an array\n */\nexport var includes = function (arr, val) {\n return notEmpty(arr) && arr.indexOf(val) !== -1;\n};\n//# sourceMappingURL=helpers.js.map","import { padStart } from './helpers';\nexport var datetime = function (y, m, d, h, i, s) {\n if (h === void 0) { h = 0; }\n if (i === void 0) { i = 0; }\n if (s === void 0) { s = 0; }\n return new Date(Date.UTC(y, m - 1, d, h, i, s));\n};\n/**\n * General date-related utilities.\n * Also handles several incompatibilities between JavaScript and Python\n *\n */\nexport var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/**\n * Number of milliseconds of one day\n */\nexport var ONE_DAY = 1000 * 60 * 60 * 24;\n/**\n * @see: \n */\nexport var MAXYEAR = 9999;\n/**\n * Python uses 1-Jan-1 as the base for calculating ordinals but we don't\n * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,\n * therefore we use 1-Jan-1970 instead\n */\nexport var ORDINAL_BASE = datetime(1970, 1, 1);\n/**\n * Python: MO-SU: 0 - 6\n * JS: SU-SAT 0 - 6\n */\nexport var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];\n/**\n * py_date.timetuple()[7]\n */\nexport var getYearDay = function (date) {\n var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /\n ONE_DAY) + 1);\n};\nexport var isLeapYear = function (year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n};\nexport var isDate = function (value) {\n return value instanceof Date;\n};\nexport var isValidDate = function (value) {\n return isDate(value) && !isNaN(value.getTime());\n};\n/**\n * @return {Number} the date's timezone offset in ms\n */\nexport var tzOffset = function (date) {\n return date.getTimezoneOffset() * 60 * 1000;\n};\n/**\n * @see: \n */\nexport var daysBetween = function (date1, date2) {\n // The number of milliseconds in one day\n // Convert both dates to milliseconds\n var date1ms = date1.getTime();\n var date2ms = date2.getTime();\n // Calculate the difference in milliseconds\n var differencems = date1ms - date2ms;\n // Convert back to days and return\n return Math.round(differencems / ONE_DAY);\n};\n/**\n * @see: \n */\nexport var toOrdinal = function (date) {\n return daysBetween(date, ORDINAL_BASE);\n};\n/**\n * @see - \n */\nexport var fromOrdinal = function (ordinal) {\n return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);\n};\nexport var getMonthDays = function (date) {\n var month = date.getUTCMonth();\n return month === 1 && isLeapYear(date.getUTCFullYear())\n ? 29\n : MONTH_DAYS[month];\n};\n/**\n * @return {Number} python-like weekday\n */\nexport var getWeekday = function (date) {\n return PY_WEEKDAYS[date.getUTCDay()];\n};\n/**\n * @see: \n */\nexport var monthRange = function (year, month) {\n var date = datetime(year, month + 1, 1);\n return [getWeekday(date), getMonthDays(date)];\n};\n/**\n * @see: \n */\nexport var combine = function (date, time) {\n time = time || date;\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));\n};\nexport var clone = function (date) {\n var dolly = new Date(date.getTime());\n return dolly;\n};\nexport var cloneDates = function (dates) {\n var clones = [];\n for (var i = 0; i < dates.length; i++) {\n clones.push(clone(dates[i]));\n }\n return clones;\n};\n/**\n * Sorts an array of Date or Time objects\n */\nexport var sort = function (dates) {\n dates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n};\nexport var timeToUntilString = function (time, utc) {\n if (utc === void 0) { utc = true; }\n var date = new Date(time);\n return [\n padStart(date.getUTCFullYear().toString(), 4, '0'),\n padStart(date.getUTCMonth() + 1, 2, '0'),\n padStart(date.getUTCDate(), 2, '0'),\n 'T',\n padStart(date.getUTCHours(), 2, '0'),\n padStart(date.getUTCMinutes(), 2, '0'),\n padStart(date.getUTCSeconds(), 2, '0'),\n utc ? 'Z' : '',\n ].join('');\n};\nexport var untilStringToDate = function (until) {\n var re = /^(\\d{4})(\\d{2})(\\d{2})(T(\\d{2})(\\d{2})(\\d{2})Z?)?$/;\n var bits = re.exec(until);\n if (!bits)\n throw new Error(\"Invalid UNTIL value: \".concat(until));\n return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));\n};\nvar dateTZtoISO8601 = function (date, timeZone) {\n // date format for sv-SE is almost ISO8601\n var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });\n // '2023-02-07 10:41:36'\n return dateStr.replace(' ', 'T') + 'Z';\n};\nexport var dateInTimeZone = function (date, timeZone) {\n var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // Date constructor can only reliably parse dates in ISO8601 format\n var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));\n var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));\n var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();\n return new Date(date.getTime() - tzOffset);\n};\n//# sourceMappingURL=dateutil.js.map","/**\n * This class helps us to emulate python's generators, sorta.\n */\nvar IterResult = /** @class */ (function () {\n function IterResult(method, args) {\n this.minDate = null;\n this.maxDate = null;\n this._result = [];\n this.total = 0;\n this.method = method;\n this.args = args;\n if (method === 'between') {\n this.maxDate = args.inc\n ? args.before\n : new Date(args.before.getTime() - 1);\n this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1);\n }\n else if (method === 'before') {\n this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1);\n }\n else if (method === 'after') {\n this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1);\n }\n }\n /**\n * Possibly adds a date into the result.\n *\n * @param {Date} date - the date isn't necessarly added to the result\n * list (if it is too late/too early)\n * @return {Boolean} true if it makes sense to continue the iteration\n * false if we're done.\n */\n IterResult.prototype.accept = function (date) {\n ++this.total;\n var tooEarly = this.minDate && date < this.minDate;\n var tooLate = this.maxDate && date > this.maxDate;\n if (this.method === 'between') {\n if (tooEarly)\n return true;\n if (tooLate)\n return false;\n }\n else if (this.method === 'before') {\n if (tooLate)\n return false;\n }\n else if (this.method === 'after') {\n if (tooEarly)\n return true;\n this.add(date);\n return false;\n }\n return this.add(date);\n };\n /**\n *\n * @param {Date} date that is part of the result.\n * @return {Boolean} whether we are interested in more values.\n */\n IterResult.prototype.add = function (date) {\n this._result.push(date);\n return true;\n };\n /**\n * 'before' and 'after' return only one date, whereas 'all'\n * and 'between' an array.\n *\n * @return {Date,Array?}\n */\n IterResult.prototype.getValue = function () {\n var res = this._result;\n switch (this.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n case 'after':\n default:\n return (res.length ? res[res.length - 1] : null);\n }\n };\n IterResult.prototype.clone = function () {\n return new IterResult(this.method, this.args);\n };\n return IterResult;\n}());\nexport default IterResult;\n//# sourceMappingURL=iterresult.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nimport IterResult from './iterresult';\n/**\n * IterResult subclass that calls a callback function on each add,\n * and stops iterating when the callback returns false.\n */\nvar CallbackIterResult = /** @class */ (function (_super) {\n __extends(CallbackIterResult, _super);\n function CallbackIterResult(method, args, iterator) {\n var _this = _super.call(this, method, args) || this;\n _this.iterator = iterator;\n return _this;\n }\n CallbackIterResult.prototype.add = function (date) {\n if (this.iterator(date, this._result.length)) {\n this._result.push(date);\n return true;\n }\n return false;\n };\n return CallbackIterResult;\n}(IterResult));\nexport default CallbackIterResult;\n//# sourceMappingURL=callbackiterresult.js.map","export var Frequency;\n(function (Frequency) {\n Frequency[Frequency[\"YEARLY\"] = 0] = \"YEARLY\";\n Frequency[Frequency[\"MONTHLY\"] = 1] = \"MONTHLY\";\n Frequency[Frequency[\"WEEKLY\"] = 2] = \"WEEKLY\";\n Frequency[Frequency[\"DAILY\"] = 3] = \"DAILY\";\n Frequency[Frequency[\"HOURLY\"] = 4] = \"HOURLY\";\n Frequency[Frequency[\"MINUTELY\"] = 5] = \"MINUTELY\";\n Frequency[Frequency[\"SECONDLY\"] = 6] = \"SECONDLY\";\n})(Frequency || (Frequency = {}));\nexport function freqIsDailyOrGreater(freq) {\n return freq < Frequency.HOURLY;\n}\n//# sourceMappingURL=types.js.map","// =============================================================================\n// i18n\n// =============================================================================\nvar ENGLISH = {\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ],\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n tokens: {\n SKIP: /^[ \\r\\n\\t]+|^\\.$/,\n number: /^[1-9][0-9]*/,\n numberAsText: /^(one|two|three)/i,\n every: /^every/i,\n 'day(s)': /^days?/i,\n 'weekday(s)': /^weekdays?/i,\n 'week(s)': /^weeks?/i,\n 'hour(s)': /^hours?/i,\n 'minute(s)': /^minutes?/i,\n 'month(s)': /^months?/i,\n 'year(s)': /^years?/i,\n on: /^(on|in)/i,\n at: /^(at)/i,\n the: /^the/i,\n first: /^first/i,\n second: /^second/i,\n third: /^third/i,\n nth: /^([1-9][0-9]*)(\\.|th|nd|rd|st)/i,\n last: /^last/i,\n for: /^for/i,\n 'time(s)': /^times?/i,\n until: /^(un)?til/i,\n monday: /^mo(n(day)?)?/i,\n tuesday: /^tu(e(s(day)?)?)?/i,\n wednesday: /^we(d(n(esday)?)?)?/i,\n thursday: /^th(u(r(sday)?)?)?/i,\n friday: /^fr(i(day)?)?/i,\n saturday: /^sa(t(urday)?)?/i,\n sunday: /^su(n(day)?)?/i,\n january: /^jan(uary)?/i,\n february: /^feb(ruary)?/i,\n march: /^mar(ch)?/i,\n april: /^apr(il)?/i,\n may: /^may/i,\n june: /^june?/i,\n july: /^july?/i,\n august: /^aug(ust)?/i,\n september: /^sep(t(ember)?)?/i,\n october: /^oct(ober)?/i,\n november: /^nov(ember)?/i,\n december: /^dec(ember)?/i,\n comma: /^(,\\s*|(and|or)\\s*)+/i,\n },\n};\nexport default ENGLISH;\n//# sourceMappingURL=i18n.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\nimport { isArray, isNumber, isPresent } from '../helpers';\n// =============================================================================\n// Helper functions\n// =============================================================================\n/**\n * Return true if a value is in an array\n */\nvar contains = function (arr, val) {\n return arr.indexOf(val) !== -1;\n};\nvar defaultGetText = function (id) { return id.toString(); };\nvar defaultDateFormatter = function (year, month, day) { return \"\".concat(month, \" \").concat(day, \", \").concat(year); };\n/**\n *\n * @param {RRule} rrule\n * Optional:\n * @param {Function} gettext function\n * @param {Object} language definition\n * @constructor\n */\nvar ToText = /** @class */ (function () {\n function ToText(rrule, gettext, language, dateFormatter) {\n if (gettext === void 0) { gettext = defaultGetText; }\n if (language === void 0) { language = ENGLISH; }\n if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; }\n this.text = [];\n this.language = language || ENGLISH;\n this.gettext = gettext;\n this.dateFormatter = dateFormatter;\n this.rrule = rrule;\n this.options = rrule.options;\n this.origOptions = rrule.origOptions;\n if (this.origOptions.bymonthday) {\n var bymonthday = [].concat(this.options.bymonthday);\n var bynmonthday = [].concat(this.options.bynmonthday);\n bymonthday.sort(function (a, b) { return a - b; });\n bynmonthday.sort(function (a, b) { return b - a; });\n // 1, 2, 3, .., -5, -4, -3, ..\n this.bymonthday = bymonthday.concat(bynmonthday);\n if (!this.bymonthday.length)\n this.bymonthday = null;\n }\n if (isPresent(this.origOptions.byweekday)) {\n var byweekday = !isArray(this.origOptions.byweekday)\n ? [this.origOptions.byweekday]\n : this.origOptions.byweekday;\n var days = String(byweekday);\n this.byweekday = {\n allWeeks: byweekday.filter(function (weekday) {\n return !weekday.n;\n }),\n someWeeks: byweekday.filter(function (weekday) {\n return Boolean(weekday.n);\n }),\n isWeekdays: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') === -1 &&\n days.indexOf('SU') === -1,\n isEveryDay: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') !== -1 &&\n days.indexOf('SU') !== -1,\n };\n var sortWeekDays = function (a, b) {\n return a.weekday - b.weekday;\n };\n this.byweekday.allWeeks.sort(sortWeekDays);\n this.byweekday.someWeeks.sort(sortWeekDays);\n if (!this.byweekday.allWeeks.length)\n this.byweekday.allWeeks = null;\n if (!this.byweekday.someWeeks.length)\n this.byweekday.someWeeks = null;\n }\n else {\n this.byweekday = null;\n }\n }\n /**\n * Test whether the rrule can be fully converted to text.\n *\n * @param {RRule} rrule\n * @return {Boolean}\n */\n ToText.isFullyConvertible = function (rrule) {\n var canConvert = true;\n if (!(rrule.options.freq in ToText.IMPLEMENTED))\n return false;\n if (rrule.origOptions.until && rrule.origOptions.count)\n return false;\n for (var key in rrule.origOptions) {\n if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))\n return true;\n if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))\n return false;\n }\n return canConvert;\n };\n ToText.prototype.isFullyConvertible = function () {\n return ToText.isFullyConvertible(this.rrule);\n };\n /**\n * Perform the conversion. Only some of the frequencies are supported.\n * If some of the rrule's options aren't supported, they'll\n * be omitted from the output an \"(~ approximate)\" will be appended.\n *\n * @return {*}\n */\n ToText.prototype.toString = function () {\n var gettext = this.gettext;\n if (!(this.options.freq in ToText.IMPLEMENTED)) {\n return gettext('RRule error: Unable to fully convert this rrule to text');\n }\n this.text = [gettext('every')];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[RRule.FREQUENCIES[this.options.freq]]();\n if (this.options.until) {\n this.add(gettext('until'));\n var until = this.options.until;\n this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate()));\n }\n else if (this.options.count) {\n this.add(gettext('for'))\n .add(this.options.count.toString())\n .add(this.plural(this.options.count) ? gettext('times') : gettext('time'));\n }\n if (!this.isFullyConvertible())\n this.add(gettext('(~ approximate)'));\n return this.text.join('');\n };\n ToText.prototype.HOURLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour'));\n };\n ToText.prototype.MINUTELY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval)\n ? gettext('minutes')\n : gettext('minute'));\n };\n ToText.prototype.DAILY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n else if (this.origOptions.byhour) {\n this._byhour();\n }\n };\n ToText.prototype.WEEKLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week'));\n }\n if (this.byweekday && this.byweekday.isWeekdays) {\n if (this.options.interval === 1) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n }\n else if (this.byweekday && this.byweekday.isEveryDay) {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n else {\n if (this.options.interval === 1)\n this.add(gettext('week'));\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.origOptions.byhour) {\n this._byhour();\n }\n }\n };\n ToText.prototype.MONTHLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(gettext('months'));\n if (this.plural(this.options.interval))\n this.add(gettext('in'));\n }\n else {\n // this.add(gettext('MONTH'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval)\n ? gettext('months')\n : gettext('month'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n };\n ToText.prototype.YEARLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n this.add(gettext('years'));\n }\n else {\n // this.add(gettext('YEAR'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.options.byyearday) {\n this.add(gettext('on the'))\n .add(this.list(this.options.byyearday, this.nth, gettext('and')))\n .add(gettext('day'));\n }\n if (this.options.byweekno) {\n this.add(gettext('in'))\n .add(this.plural(this.options.byweekno.length)\n ? gettext('weeks')\n : gettext('week'))\n .add(this.list(this.options.byweekno, undefined, gettext('and')));\n }\n };\n ToText.prototype._bymonthday = function () {\n var gettext = this.gettext;\n if (this.byweekday && this.byweekday.allWeeks) {\n this.add(gettext('on'))\n .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')))\n .add(gettext('the'))\n .add(this.list(this.bymonthday, this.nth, gettext('or')));\n }\n else {\n this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and')));\n }\n // this.add(gettext('DAY'))\n };\n ToText.prototype._byweekday = function () {\n var gettext = this.gettext;\n if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext));\n }\n if (this.byweekday.someWeeks) {\n if (this.byweekday.allWeeks)\n this.add(gettext('and'));\n this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and')));\n }\n };\n ToText.prototype._byhour = function () {\n var gettext = this.gettext;\n this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and')));\n };\n ToText.prototype._bymonth = function () {\n this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and')));\n };\n ToText.prototype.nth = function (n) {\n n = parseInt(n.toString(), 10);\n var nth;\n var gettext = this.gettext;\n if (n === -1)\n return gettext('last');\n var npos = Math.abs(n);\n switch (npos) {\n case 1:\n case 21:\n case 31:\n nth = npos + gettext('st');\n break;\n case 2:\n case 22:\n nth = npos + gettext('nd');\n break;\n case 3:\n case 23:\n nth = npos + gettext('rd');\n break;\n default:\n nth = npos + gettext('th');\n }\n return n < 0 ? nth + ' ' + gettext('last') : nth;\n };\n ToText.prototype.monthtext = function (m) {\n return this.language.monthNames[m - 1];\n };\n ToText.prototype.weekdaytext = function (wday) {\n var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday();\n return ((wday.n ? this.nth(wday.n) + ' ' : '') +\n this.language.dayNames[weekday]);\n };\n ToText.prototype.plural = function (n) {\n return n % 100 !== 1;\n };\n ToText.prototype.add = function (s) {\n this.text.push(' ');\n this.text.push(s);\n return this;\n };\n ToText.prototype.list = function (arr, callback, finalDelim, delim) {\n var _this = this;\n if (delim === void 0) { delim = ','; }\n if (!isArray(arr)) {\n arr = [arr];\n }\n var delimJoin = function (array, delimiter, finalDelimiter) {\n var list = '';\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n if (i === array.length - 1) {\n list += ' ' + finalDelimiter + ' ';\n }\n else {\n list += delimiter + ' ';\n }\n }\n list += array[i];\n }\n return list;\n };\n callback =\n callback ||\n function (o) {\n return o.toString();\n };\n var realCallback = function (arg) {\n return callback && callback.call(_this, arg);\n };\n if (finalDelim) {\n return delimJoin(arr.map(realCallback), delim, finalDelim);\n }\n else {\n return arr.map(realCallback).join(delim + ' ');\n }\n };\n return ToText;\n}());\nexport default ToText;\n//# sourceMappingURL=totext.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\n// =============================================================================\n// Parser\n// =============================================================================\nvar Parser = /** @class */ (function () {\n function Parser(rules) {\n this.done = true;\n this.rules = rules;\n }\n Parser.prototype.start = function (text) {\n this.text = text;\n this.done = false;\n return this.nextSymbol();\n };\n Parser.prototype.isDone = function () {\n return this.done && this.symbol === null;\n };\n Parser.prototype.nextSymbol = function () {\n var best;\n var bestSymbol;\n this.symbol = null;\n this.value = null;\n do {\n if (this.done)\n return false;\n var rule = void 0;\n best = null;\n for (var name_1 in this.rules) {\n rule = this.rules[name_1];\n var match = rule.exec(this.text);\n if (match) {\n if (best === null || match[0].length > best[0].length) {\n best = match;\n bestSymbol = name_1;\n }\n }\n }\n if (best != null) {\n this.text = this.text.substr(best[0].length);\n if (this.text === '')\n this.done = true;\n }\n if (best == null) {\n this.done = true;\n this.symbol = null;\n this.value = null;\n return;\n }\n } while (bestSymbol === 'SKIP');\n this.symbol = bestSymbol;\n this.value = best;\n return true;\n };\n Parser.prototype.accept = function (name) {\n if (this.symbol === name) {\n if (this.value) {\n var v = this.value;\n this.nextSymbol();\n return v;\n }\n this.nextSymbol();\n return true;\n }\n return false;\n };\n Parser.prototype.acceptNumber = function () {\n return this.accept('number');\n };\n Parser.prototype.expect = function (name) {\n if (this.accept(name))\n return true;\n throw new Error('expected ' + name + ' but found ' + this.symbol);\n };\n return Parser;\n}());\nexport default function parseText(text, language) {\n if (language === void 0) { language = ENGLISH; }\n var options = {};\n var ttr = new Parser(language.tokens);\n if (!ttr.start(text))\n return null;\n S();\n return options;\n function S() {\n // every [n]\n ttr.expect('every');\n var n = ttr.acceptNumber();\n if (n)\n options.interval = parseInt(n[0], 10);\n if (ttr.isDone())\n throw new Error('Unexpected end');\n switch (ttr.symbol) {\n case 'day(s)':\n options.freq = RRule.DAILY;\n if (ttr.nextSymbol()) {\n AT();\n F();\n }\n break;\n // FIXME Note: every 2 weekdays != every two weeks on weekdays.\n // DAILY on weekdays is not a valid rule\n case 'weekday(s)':\n options.freq = RRule.WEEKLY;\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n ttr.nextSymbol();\n AT();\n F();\n break;\n case 'week(s)':\n options.freq = RRule.WEEKLY;\n if (ttr.nextSymbol()) {\n ON();\n AT();\n F();\n }\n break;\n case 'hour(s)':\n options.freq = RRule.HOURLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'minute(s)':\n options.freq = RRule.MINUTELY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'month(s)':\n options.freq = RRule.MONTHLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'year(s)':\n options.freq = RRule.YEARLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n options.freq = RRule.WEEKLY;\n var key = ttr.symbol\n .substr(0, 2)\n .toUpperCase();\n options.byweekday = [RRule[key]];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var wkd = decodeWKD();\n if (!wkd) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday');\n }\n options.byweekday.push(RRule[wkd]);\n ttr.nextSymbol();\n }\n AT();\n MDAYs();\n F();\n break;\n case 'january':\n case 'february':\n case 'march':\n case 'april':\n case 'may':\n case 'june':\n case 'july':\n case 'august':\n case 'september':\n case 'october':\n case 'november':\n case 'december':\n options.freq = RRule.YEARLY;\n options.bymonth = [decodeM()];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var m = decodeM();\n if (!m) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month');\n }\n options.bymonth.push(m);\n ttr.nextSymbol();\n }\n ON();\n F();\n break;\n default:\n throw new Error('Unknown symbol');\n }\n }\n function ON() {\n var on = ttr.accept('on');\n var the = ttr.accept('the');\n if (!(on || the))\n return;\n do {\n var nth = decodeNTH();\n var wkd = decodeWKD();\n var m = decodeM();\n // nth | \n if (nth) {\n // ttr.nextSymbol()\n if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd].nth(nth));\n }\n else {\n if (!options.bymonthday)\n options.bymonthday = [];\n options.bymonthday.push(nth);\n ttr.accept('day(s)');\n }\n // \n }\n else if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd]);\n }\n else if (ttr.symbol === 'weekday(s)') {\n ttr.nextSymbol();\n if (!options.byweekday) {\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n }\n }\n else if (ttr.symbol === 'week(s)') {\n ttr.nextSymbol();\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number');\n }\n options.byweekno = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.byweekno.push(parseInt(n[0], 10));\n }\n }\n else if (m) {\n ttr.nextSymbol();\n if (!options.bymonth)\n options.bymonth = [];\n options.bymonth.push(m);\n }\n else {\n return;\n }\n } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on'));\n }\n function AT() {\n var at = ttr.accept('at');\n if (!at)\n return;\n do {\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour');\n }\n options.byhour = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour');\n }\n options.byhour.push(parseInt(n[0], 10));\n }\n } while (ttr.accept('comma') || ttr.accept('at'));\n }\n function decodeM() {\n switch (ttr.symbol) {\n case 'january':\n return 1;\n case 'february':\n return 2;\n case 'march':\n return 3;\n case 'april':\n return 4;\n case 'may':\n return 5;\n case 'june':\n return 6;\n case 'july':\n return 7;\n case 'august':\n return 8;\n case 'september':\n return 9;\n case 'october':\n return 10;\n case 'november':\n return 11;\n case 'december':\n return 12;\n default:\n return false;\n }\n }\n function decodeWKD() {\n switch (ttr.symbol) {\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n return ttr.symbol.substr(0, 2).toUpperCase();\n default:\n return false;\n }\n }\n function decodeNTH() {\n switch (ttr.symbol) {\n case 'last':\n ttr.nextSymbol();\n return -1;\n case 'first':\n ttr.nextSymbol();\n return 1;\n case 'second':\n ttr.nextSymbol();\n return ttr.accept('last') ? -2 : 2;\n case 'third':\n ttr.nextSymbol();\n return ttr.accept('last') ? -3 : 3;\n case 'nth':\n var v = parseInt(ttr.value[1], 10);\n if (v < -366 || v > 366)\n throw new Error('Nth out of range: ' + v);\n ttr.nextSymbol();\n return ttr.accept('last') ? -v : v;\n default:\n return false;\n }\n }\n function MDAYs() {\n ttr.accept('on');\n ttr.accept('the');\n var nth = decodeNTH();\n if (!nth)\n return;\n options.bymonthday = [nth];\n ttr.nextSymbol();\n while (ttr.accept('comma')) {\n nth = decodeNTH();\n if (!nth) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.bymonthday.push(nth);\n ttr.nextSymbol();\n }\n }\n function F() {\n if (ttr.symbol === 'until') {\n var date = Date.parse(ttr.text);\n if (!date)\n throw new Error('Cannot parse until date:' + ttr.text);\n options.until = new Date(date);\n }\n else if (ttr.accept('for')) {\n options.count = parseInt(ttr.value[0], 10);\n ttr.expect('number');\n // ttr.expect('times')\n }\n }\n}\n//# sourceMappingURL=parsetext.js.map","import ToText from './totext';\nimport parseText from './parsetext';\nimport { RRule } from '../rrule';\nimport { Frequency } from '../types';\nimport ENGLISH from './i18n';\n/* !\n * rrule.js - Library for working with recurrence rules for calendar dates.\n * https://github.com/jakubroztocil/rrule\n *\n * Copyright 2010, Jakub Roztocil and Lars Schoning\n * Licenced under the BSD licence.\n * https://github.com/jakubroztocil/rrule/blob/master/LICENCE\n *\n */\n/**\n *\n * Implementation of RRule.fromText() and RRule::toText().\n *\n *\n * On the client side, this file needs to be included\n * when those functions are used.\n *\n */\n// =============================================================================\n// fromText\n// =============================================================================\n/**\n * Will be able to convert some of the below described rules from\n * text format to a rule object.\n *\n *\n * RULES\n *\n * Every ([n])\n * day(s)\n * | [weekday], ..., (and) [weekday]\n * | weekday(s)\n * | week(s)\n * | month(s)\n * | [month], ..., (and) [month]\n * | year(s)\n *\n *\n * Plus 0, 1, or multiple of these:\n *\n * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday]\n *\n * on [weekday], ..., (and) [weekday]\n *\n * on the [monthday], [monthday], ... (and) [monthday] (day of the month)\n *\n * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year)\n *\n *\n * Plus 0 or 1 of these:\n *\n * for [n] time(s)\n *\n * until [date]\n *\n * Plus (.)\n *\n *\n * Definitely no supported for parsing:\n *\n * (for year):\n * in week(s) [n], ..., (and) [n]\n *\n * on the [yearday], ..., (and) [n] day of the year\n * on day [yearday], ..., (and) [n]\n *\n *\n * NON-TERMINALS\n *\n * [n]: 1, 2 ..., one, two, three ..\n * [month]: January, February, March, April, May, ... December\n * [weekday]: Monday, ... Sunday\n * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ...\n * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, ..\n * [date]:\n * - [month] (0-31(,) ([year])),\n * - (the) 0-31.(1-12.([year])),\n * - (the) 0-31/(1-12/([year])),\n * - [weekday]\n *\n * [year]: 0000, 0001, ... 01, 02, ..\n *\n * Definitely not supported for parsing:\n *\n * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, ..\n *\n * @param {String} text\n * @return {Object, Boolean} the rule, or null.\n */\nvar fromText = function (text, language) {\n if (language === void 0) { language = ENGLISH; }\n return new RRule(parseText(text, language) || undefined);\n};\nvar common = [\n 'count',\n 'until',\n 'interval',\n 'byweekday',\n 'bymonthday',\n 'bymonth',\n];\nToText.IMPLEMENTED = [];\nToText.IMPLEMENTED[Frequency.HOURLY] = common;\nToText.IMPLEMENTED[Frequency.MINUTELY] = common;\nToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common);\nToText.IMPLEMENTED[Frequency.WEEKLY] = common;\nToText.IMPLEMENTED[Frequency.MONTHLY] = common;\nToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common);\n// =============================================================================\n// Export\n// =============================================================================\nvar toText = function (rrule, gettext, language, dateFormatter) {\n return new ToText(rrule, gettext, language, dateFormatter).toString();\n};\nvar isFullyConvertible = ToText.isFullyConvertible;\nexport { fromText, parseText, isFullyConvertible, toText };\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { Frequency } from './types';\nimport { pymod, divmod, empty, includes } from './helpers';\nimport { getWeekday, MAXYEAR, monthRange } from './dateutil';\nvar Time = /** @class */ (function () {\n function Time(hour, minute, second, millisecond) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond || 0;\n }\n Time.prototype.getHours = function () {\n return this.hour;\n };\n Time.prototype.getMinutes = function () {\n return this.minute;\n };\n Time.prototype.getSeconds = function () {\n return this.second;\n };\n Time.prototype.getMilliseconds = function () {\n return this.millisecond;\n };\n Time.prototype.getTime = function () {\n return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 +\n this.millisecond);\n };\n return Time;\n}());\nexport { Time };\nvar DateTime = /** @class */ (function (_super) {\n __extends(DateTime, _super);\n function DateTime(year, month, day, hour, minute, second, millisecond) {\n var _this = _super.call(this, hour, minute, second, millisecond) || this;\n _this.year = year;\n _this.month = month;\n _this.day = day;\n return _this;\n }\n DateTime.fromDate = function (date) {\n return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000);\n };\n DateTime.prototype.getWeekday = function () {\n return getWeekday(new Date(this.getTime()));\n };\n DateTime.prototype.getTime = function () {\n return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();\n };\n DateTime.prototype.getDay = function () {\n return this.day;\n };\n DateTime.prototype.getMonth = function () {\n return this.month;\n };\n DateTime.prototype.getYear = function () {\n return this.year;\n };\n DateTime.prototype.addYears = function (years) {\n this.year += years;\n };\n DateTime.prototype.addMonths = function (months) {\n this.month += months;\n if (this.month > 12) {\n var yearDiv = Math.floor(this.month / 12);\n var monthMod = pymod(this.month, 12);\n this.month = monthMod;\n this.year += yearDiv;\n if (this.month === 0) {\n this.month = 12;\n --this.year;\n }\n }\n };\n DateTime.prototype.addWeekly = function (days, wkst) {\n if (wkst > this.getWeekday()) {\n this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7;\n }\n else {\n this.day += -(this.getWeekday() - wkst) + days * 7;\n }\n this.fixDay();\n };\n DateTime.prototype.addDaily = function (days) {\n this.day += days;\n this.fixDay();\n };\n DateTime.prototype.addHours = function (hours, filtered, byhour) {\n if (filtered) {\n // Jump to one iteration before next day\n this.hour += Math.floor((23 - this.hour) / hours) * hours;\n }\n for (;;) {\n this.hour += hours;\n var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod;\n if (dayDiv) {\n this.hour = hourMod;\n this.addDaily(dayDiv);\n }\n if (empty(byhour) || includes(byhour, this.hour))\n break;\n }\n };\n DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) {\n if (filtered) {\n // Jump to one iteration before next day\n this.minute +=\n Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes;\n }\n for (;;) {\n this.minute += minutes;\n var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod;\n if (hourDiv) {\n this.minute = minuteMod;\n this.addHours(hourDiv, false, byhour);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute))) {\n break;\n }\n }\n };\n DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) {\n if (filtered) {\n // Jump to one iteration before next day\n this.second +=\n Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) /\n seconds) * seconds;\n }\n for (;;) {\n this.second += seconds;\n var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod;\n if (minuteDiv) {\n this.second = secondMod;\n this.addMinutes(minuteDiv, false, byhour, byminute);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute)) &&\n (empty(bysecond) || includes(bysecond, this.second))) {\n break;\n }\n }\n };\n DateTime.prototype.fixDay = function () {\n if (this.day <= 28) {\n return;\n }\n var daysinmonth = monthRange(this.year, this.month - 1)[1];\n if (this.day <= daysinmonth) {\n return;\n }\n while (this.day > daysinmonth) {\n this.day -= daysinmonth;\n ++this.month;\n if (this.month === 13) {\n this.month = 1;\n ++this.year;\n if (this.year > MAXYEAR) {\n return;\n }\n }\n daysinmonth = monthRange(this.year, this.month - 1)[1];\n }\n };\n DateTime.prototype.add = function (options, filtered) {\n var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n switch (freq) {\n case Frequency.YEARLY:\n return this.addYears(interval);\n case Frequency.MONTHLY:\n return this.addMonths(interval);\n case Frequency.WEEKLY:\n return this.addWeekly(interval, wkst);\n case Frequency.DAILY:\n return this.addDaily(interval);\n case Frequency.HOURLY:\n return this.addHours(interval, filtered, byhour);\n case Frequency.MINUTELY:\n return this.addMinutes(interval, filtered, byhour, byminute);\n case Frequency.SECONDLY:\n return this.addSeconds(interval, filtered, byhour, byminute, bysecond);\n }\n };\n return DateTime;\n}(Time));\nexport { DateTime };\n//# sourceMappingURL=datetime.js.map","import { __assign } from \"tslib\";\nimport { freqIsDailyOrGreater } from './types';\nimport { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr, } from './helpers';\nimport { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';\nimport { getWeekday, isDate, isValidDate } from './dateutil';\nimport { Weekday } from './weekday';\nimport { Time } from './datetime';\nexport function initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n // Shallow copy for options and origOptions and check for invalid\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!includes(defaultKeys, key))\n invalid.push(key);\n if (isDate(options[key]) && !isValidDate(options[key])) {\n invalid.push(key);\n }\n }\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign({}, options);\n}\nexport function parseOptions(options) {\n var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options));\n if (isPresent(opts.byeaster))\n opts.freq = RRule.YEARLY;\n if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) {\n throw new Error(\"Invalid frequency: \".concat(opts.freq, \" \").concat(options.freq));\n }\n if (!opts.dtstart)\n opts.dtstart = new Date(new Date().setMilliseconds(0));\n if (!isPresent(opts.wkst)) {\n opts.wkst = RRule.MO.weekday;\n }\n else if (isNumber(opts.wkst)) {\n // cool, just keep it like that\n }\n else {\n opts.wkst = opts.wkst.weekday;\n }\n if (isPresent(opts.bysetpos)) {\n if (isNumber(opts.bysetpos))\n opts.bysetpos = [opts.bysetpos];\n for (var i = 0; i < opts.bysetpos.length; i++) {\n var v = opts.bysetpos[i];\n if (v === 0 || !(v >= -366 && v <= 366)) {\n throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1');\n }\n }\n }\n if (!(Boolean(opts.byweekno) ||\n notEmpty(opts.byweekno) ||\n notEmpty(opts.byyearday) ||\n Boolean(opts.bymonthday) ||\n notEmpty(opts.bymonthday) ||\n isPresent(opts.byweekday) ||\n isPresent(opts.byeaster))) {\n switch (opts.freq) {\n case RRule.YEARLY:\n if (!opts.bymonth)\n opts.bymonth = opts.dtstart.getUTCMonth() + 1;\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.MONTHLY:\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.WEEKLY:\n opts.byweekday = [getWeekday(opts.dtstart)];\n break;\n }\n }\n // bymonth\n if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) {\n opts.bymonth = [opts.bymonth];\n }\n // byyearday\n if (isPresent(opts.byyearday) &&\n !isArray(opts.byyearday) &&\n isNumber(opts.byyearday)) {\n opts.byyearday = [opts.byyearday];\n }\n // bymonthday\n if (!isPresent(opts.bymonthday)) {\n opts.bymonthday = [];\n opts.bynmonthday = [];\n }\n else if (isArray(opts.bymonthday)) {\n var bymonthday = [];\n var bynmonthday = [];\n for (var i = 0; i < opts.bymonthday.length; i++) {\n var v = opts.bymonthday[i];\n if (v > 0) {\n bymonthday.push(v);\n }\n else if (v < 0) {\n bynmonthday.push(v);\n }\n }\n opts.bymonthday = bymonthday;\n opts.bynmonthday = bynmonthday;\n }\n else if (opts.bymonthday < 0) {\n opts.bynmonthday = [opts.bymonthday];\n opts.bymonthday = [];\n }\n else {\n opts.bynmonthday = [];\n opts.bymonthday = [opts.bymonthday];\n }\n // byweekno\n if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) {\n opts.byweekno = [opts.byweekno];\n }\n // byweekday / bynweekday\n if (!isPresent(opts.byweekday)) {\n opts.bynweekday = null;\n }\n else if (isNumber(opts.byweekday)) {\n opts.byweekday = [opts.byweekday];\n opts.bynweekday = null;\n }\n else if (isWeekdayStr(opts.byweekday)) {\n opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday];\n opts.bynweekday = null;\n }\n else if (opts.byweekday instanceof Weekday) {\n if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) {\n opts.byweekday = [opts.byweekday.weekday];\n opts.bynweekday = null;\n }\n else {\n opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]];\n opts.byweekday = null;\n }\n }\n else {\n var byweekday = [];\n var bynweekday = [];\n for (var i = 0; i < opts.byweekday.length; i++) {\n var wday = opts.byweekday[i];\n if (isNumber(wday)) {\n byweekday.push(wday);\n continue;\n }\n else if (isWeekdayStr(wday)) {\n byweekday.push(Weekday.fromStr(wday).weekday);\n continue;\n }\n if (!wday.n || opts.freq > RRule.MONTHLY) {\n byweekday.push(wday.weekday);\n }\n else {\n bynweekday.push([wday.weekday, wday.n]);\n }\n }\n opts.byweekday = notEmpty(byweekday) ? byweekday : null;\n opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null;\n }\n // byhour\n if (!isPresent(opts.byhour)) {\n opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null;\n }\n else if (isNumber(opts.byhour)) {\n opts.byhour = [opts.byhour];\n }\n // byminute\n if (!isPresent(opts.byminute)) {\n opts.byminute =\n opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null;\n }\n else if (isNumber(opts.byminute)) {\n opts.byminute = [opts.byminute];\n }\n // bysecond\n if (!isPresent(opts.bysecond)) {\n opts.bysecond =\n opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null;\n }\n else if (isNumber(opts.bysecond)) {\n opts.bysecond = [opts.bysecond];\n }\n return { parsedOptions: opts };\n}\nexport function buildTimeset(opts) {\n var millisecondModulo = opts.dtstart.getTime() % 1000;\n if (!freqIsDailyOrGreater(opts.freq)) {\n return [];\n }\n var timeset = [];\n opts.byhour.forEach(function (hour) {\n opts.byminute.forEach(function (minute) {\n opts.bysecond.forEach(function (second) {\n timeset.push(new Time(hour, minute, second, millisecondModulo));\n });\n });\n });\n return timeset;\n}\n//# sourceMappingURL=parseoptions.js.map","import { __assign } from \"tslib\";\nimport { Frequency } from './types';\nimport { Weekday } from './weekday';\nimport { untilStringToDate } from './dateutil';\nimport { Days } from './rrule';\nexport function parseString(rfcString) {\n var options = rfcString\n .split('\\n')\n .map(parseLine)\n .filter(function (x) { return x !== null; });\n return __assign(__assign({}, options[0]), options[1]);\n}\nexport function parseDtstart(line) {\n var options = {};\n var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\\s]+)/i.exec(line);\n if (!dtstartWithZone) {\n return options;\n }\n var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2];\n if (tzid) {\n options.tzid = tzid;\n }\n options.dtstart = untilStringToDate(dtstart);\n return options;\n}\nfunction parseLine(rfcString) {\n rfcString = rfcString.replace(/^\\s+|\\s+$/, '');\n if (!rfcString.length)\n return null;\n var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());\n if (!header) {\n return parseRrule(rfcString);\n }\n var key = header[1];\n switch (key.toUpperCase()) {\n case 'RRULE':\n case 'EXRULE':\n return parseRrule(rfcString);\n case 'DTSTART':\n return parseDtstart(rfcString);\n default:\n throw new Error(\"Unsupported RFC prop \".concat(key, \" in \").concat(rfcString));\n }\n}\nfunction parseRrule(line) {\n var strippedLine = line.replace(/^RRULE:/i, '');\n var options = parseDtstart(strippedLine);\n var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';');\n attrs.forEach(function (attr) {\n var _a = attr.split('='), key = _a[0], value = _a[1];\n switch (key.toUpperCase()) {\n case 'FREQ':\n options.freq = Frequency[value.toUpperCase()];\n break;\n case 'WKST':\n options.wkst = Days[value.toUpperCase()];\n break;\n case 'COUNT':\n case 'INTERVAL':\n case 'BYSETPOS':\n case 'BYMONTH':\n case 'BYMONTHDAY':\n case 'BYYEARDAY':\n case 'BYWEEKNO':\n case 'BYHOUR':\n case 'BYMINUTE':\n case 'BYSECOND':\n var num = parseNumber(value);\n var optionKey = key.toLowerCase();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n options[optionKey] = num;\n break;\n case 'BYWEEKDAY':\n case 'BYDAY':\n options.byweekday = parseWeekday(value);\n break;\n case 'DTSTART':\n case 'TZID':\n // for backwards compatibility\n var dtstart = parseDtstart(line);\n options.tzid = dtstart.tzid;\n options.dtstart = dtstart.dtstart;\n break;\n case 'UNTIL':\n options.until = untilStringToDate(value);\n break;\n case 'BYEASTER':\n options.byeaster = Number(value);\n break;\n default:\n throw new Error(\"Unknown RRULE property '\" + key + \"'\");\n }\n });\n return options;\n}\nfunction parseNumber(value) {\n if (value.indexOf(',') !== -1) {\n var values = value.split(',');\n return values.map(parseIndividualNumber);\n }\n return parseIndividualNumber(value);\n}\nfunction parseIndividualNumber(value) {\n if (/^[+-]?\\d+$/.test(value)) {\n return Number(value);\n }\n return value;\n}\nfunction parseWeekday(value) {\n var days = value.split(',');\n return days.map(function (day) {\n if (day.length === 2) {\n // MO, TU, ...\n return Days[day]; // wday instanceof Weekday\n }\n // -1MO, +3FR, 1SO, 13TU ...\n var parts = day.match(/^([+-]?\\d{1,2})([A-Z]{2})$/);\n if (!parts || parts.length < 3) {\n throw new SyntaxError(\"Invalid weekday string: \".concat(day));\n }\n var n = Number(parts[1]);\n var wdaypart = parts[2];\n var wday = Days[wdaypart].weekday;\n return new Weekday(wday, n);\n });\n}\n//# sourceMappingURL=parsestring.js.map","import { dateInTimeZone, timeToUntilString } from './dateutil';\nvar DateWithZone = /** @class */ (function () {\n function DateWithZone(date, tzid) {\n if (isNaN(date.getTime())) {\n throw new RangeError('Invalid date passed to DateWithZone');\n }\n this.date = date;\n this.tzid = tzid;\n }\n Object.defineProperty(DateWithZone.prototype, \"isUTC\", {\n get: function () {\n return !this.tzid || this.tzid.toUpperCase() === 'UTC';\n },\n enumerable: false,\n configurable: true\n });\n DateWithZone.prototype.toString = function () {\n var datestr = timeToUntilString(this.date.getTime(), this.isUTC);\n if (!this.isUTC) {\n return \";TZID=\".concat(this.tzid, \":\").concat(datestr);\n }\n return \":\".concat(datestr);\n };\n DateWithZone.prototype.getTime = function () {\n return this.date.getTime();\n };\n DateWithZone.prototype.rezonedDate = function () {\n if (this.isUTC) {\n return this.date;\n }\n return dateInTimeZone(this.date, this.tzid);\n };\n return DateWithZone;\n}());\nexport { DateWithZone };\n//# sourceMappingURL=datewithzone.js.map","import { RRule, DEFAULT_OPTIONS } from './rrule';\nimport { includes, isPresent, isArray, isNumber, toArray } from './helpers';\nimport { Weekday } from './weekday';\nimport { timeToUntilString } from './dateutil';\nimport { DateWithZone } from './datewithzone';\nexport function optionsToString(options) {\n var rrule = [];\n var dtstart = '';\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === 'tzid')\n continue;\n if (!includes(defaultKeys, keys[i]))\n continue;\n var key = keys[i].toUpperCase();\n var value = options[keys[i]];\n var outValue = '';\n if (!isPresent(value) || (isArray(value) && !value.length))\n continue;\n switch (key) {\n case 'FREQ':\n outValue = RRule.FREQUENCIES[options.freq];\n break;\n case 'WKST':\n if (isNumber(value)) {\n outValue = new Weekday(value).toString();\n }\n else {\n outValue = value.toString();\n }\n break;\n case 'BYWEEKDAY':\n /*\n NOTE: BYWEEKDAY is a special case.\n RRule() deconstructs the rule.options.byweekday array\n into an array of Weekday arguments.\n On the other hand, rule.origOptions is an array of Weekdays.\n We need to handle both cases here.\n It might be worth change RRule to keep the Weekdays.\n \n Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC)\n \n */\n key = 'BYDAY';\n outValue = toArray(value)\n .map(function (wday) {\n if (wday instanceof Weekday) {\n return wday;\n }\n if (isArray(wday)) {\n return new Weekday(wday[0], wday[1]);\n }\n return new Weekday(wday);\n })\n .toString();\n break;\n case 'DTSTART':\n dtstart = buildDtstart(value, options.tzid);\n break;\n case 'UNTIL':\n outValue = timeToUntilString(value, !options.tzid);\n break;\n default:\n if (isArray(value)) {\n var strValues = [];\n for (var j = 0; j < value.length; j++) {\n strValues[j] = String(value[j]);\n }\n outValue = strValues.toString();\n }\n else {\n outValue = String(value);\n }\n }\n if (outValue) {\n rrule.push([key, outValue]);\n }\n }\n var rules = rrule\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value.toString());\n })\n .join(';');\n var ruleString = '';\n if (rules !== '') {\n ruleString = \"RRULE:\".concat(rules);\n }\n return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\\n');\n}\nfunction buildDtstart(dtstart, tzid) {\n if (!dtstart) {\n return '';\n }\n return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString();\n}\n//# sourceMappingURL=optionstostring.js.map","import IterResult from './iterresult';\nimport { clone, cloneDates } from './dateutil';\nimport { isArray } from './helpers';\nfunction argsMatch(left, right) {\n if (Array.isArray(left)) {\n if (!Array.isArray(right))\n return false;\n if (left.length !== right.length)\n return false;\n return left.every(function (date, i) { return date.getTime() === right[i].getTime(); });\n }\n if (left instanceof Date) {\n return right instanceof Date && left.getTime() === right.getTime();\n }\n return left === right;\n}\nvar Cache = /** @class */ (function () {\n function Cache() {\n this.all = false;\n this.before = [];\n this.after = [];\n this.between = [];\n }\n /**\n * @param {String} what - all/before/after/between\n * @param {Array,Date} value - an array of dates, one date, or null\n * @param {Object?} args - _iter arguments\n */\n Cache.prototype._cacheAdd = function (what, value, args) {\n if (value) {\n value = value instanceof Date ? clone(value) : cloneDates(value);\n }\n if (what === 'all') {\n this.all = value;\n }\n else {\n args._value = value;\n this[what].push(args);\n }\n };\n /**\n * @return false - not in the cache\n * @return null - cached, but zero occurrences (before/after)\n * @return Date - cached (before/after)\n * @return [] - cached, but zero occurrences (all/between)\n * @return [Date1, DateN] - cached (all/between)\n */\n Cache.prototype._cacheGet = function (what, args) {\n var cached = false;\n var argsKeys = args ? Object.keys(args) : [];\n var findCacheDiff = function (item) {\n for (var i = 0; i < argsKeys.length; i++) {\n var key = argsKeys[i];\n if (!argsMatch(args[key], item[key])) {\n return true;\n }\n }\n return false;\n };\n var cachedObject = this[what];\n if (what === 'all') {\n cached = this.all;\n }\n else if (isArray(cachedObject)) {\n // Let's see whether we've already called the\n // 'what' method with the same 'args'\n for (var i = 0; i < cachedObject.length; i++) {\n var item = cachedObject[i];\n if (argsKeys.length && findCacheDiff(item))\n continue;\n cached = item._value;\n break;\n }\n }\n if (!cached && this.all) {\n // Not in the cache, but we already know all the occurrences,\n // so we can find the correct dates from the cached ones.\n var iterResult = new IterResult(what, args);\n for (var i = 0; i < this.all.length; i++) {\n if (!iterResult.accept(this.all[i]))\n break;\n }\n cached = iterResult.getValue();\n this._cacheAdd(what, cached, args);\n }\n return isArray(cached)\n ? cloneDates(cached)\n : cached instanceof Date\n ? clone(cached)\n : cached;\n };\n return Cache;\n}());\nexport { Cache };\n//# sourceMappingURL=cache.js.map","import { __spreadArray } from \"tslib\";\nimport { range, repeat } from './helpers';\n// =============================================================================\n// Date masks\n// =============================================================================\n// Every mask is 7 days longer to handle cross-year weekly periods.\nvar M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M28 = range(1, 29);\nvar M29 = range(1, 30);\nvar M30 = range(1, 31);\nvar M31 = range(1, 32);\nvar MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar NM28 = range(-28, 0);\nvar NM29 = range(-29, 0);\nvar NM30 = range(-30, 0);\nvar NM31 = range(-31, 0);\nvar NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];\nvar M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];\nvar WDAYMASK = (function () {\n var wdaymask = [];\n for (var i = 0; i < 55; i++)\n wdaymask = wdaymask.concat(range(7));\n return wdaymask;\n})();\nexport { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK, };\n//# sourceMappingURL=masks.js.map","import { __assign } from \"tslib\";\nimport { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';\nimport { empty, repeat, pymod, includes } from '../helpers';\nimport { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';\nexport function rebuildYear(year, options) {\n var firstyday = datetime(year, 1, 1);\n var yearlen = isLeapYear(year) ? 366 : 365;\n var nextyearlen = isLeapYear(year + 1) ? 366 : 365;\n var yearordinal = toOrdinal(firstyday);\n var yearweekday = getWeekday(firstyday);\n var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });\n if (empty(options.byweekno)) {\n return result;\n }\n result.wnomask = repeat(0, yearlen + 7);\n var firstwkst;\n var wyearlen;\n var no1wkst = (firstwkst = pymod(7 - yearweekday + options.wkst, 7));\n if (no1wkst >= 4) {\n no1wkst = 0;\n // Number of days in the year, plus the days we got\n // from last year.\n wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7);\n }\n else {\n // Number of days in the year, minus the days we\n // left in last year.\n wyearlen = yearlen - no1wkst;\n }\n var div = Math.floor(wyearlen / 7);\n var mod = pymod(wyearlen, 7);\n var numweeks = Math.floor(div + mod / 4);\n for (var j = 0; j < options.byweekno.length; j++) {\n var n = options.byweekno[j];\n if (n < 0) {\n n += numweeks + 1;\n }\n if (!(n > 0 && n <= numweeks)) {\n continue;\n }\n var i = void 0;\n if (n > 1) {\n i = no1wkst + (n - 1) * 7;\n if (no1wkst !== firstwkst) {\n i -= 7 - firstwkst;\n }\n }\n else {\n i = no1wkst;\n }\n for (var k = 0; k < 7; k++) {\n result.wnomask[i] = 1;\n i++;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n if (includes(options.byweekno, 1)) {\n // Check week number 1 of next year as well\n // orig-TODO : Check -numweeks for next year.\n var i = no1wkst + numweeks * 7;\n if (no1wkst !== firstwkst)\n i -= 7 - firstwkst;\n if (i < yearlen) {\n // If week starts in next year, we\n // don't care about it.\n for (var j = 0; j < 7; j++) {\n result.wnomask[i] = 1;\n i += 1;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n }\n if (no1wkst) {\n // Check last week number of last year as\n // well. If no1wkst is 0, either the year\n // started on week start, or week number 1\n // got days from last year, so there are no\n // days from last year's last week number in\n // this year.\n var lnumweeks = void 0;\n if (!includes(options.byweekno, -1)) {\n var lyearweekday = getWeekday(datetime(year - 1, 1, 1));\n var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);\n var lyearlen = isLeapYear(year - 1) ? 366 : 365;\n var weekst = void 0;\n if (lno1wkst >= 4) {\n lno1wkst = 0;\n weekst = lyearlen + pymod(lyearweekday - options.wkst, 7);\n }\n else {\n weekst = yearlen - no1wkst;\n }\n lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4);\n }\n else {\n lnumweeks = -1;\n }\n if (includes(options.byweekno, lnumweeks)) {\n for (var i = 0; i < no1wkst; i++)\n result.wnomask[i] = 1;\n }\n }\n return result;\n}\nfunction baseYearMasks(year) {\n var yearlen = isLeapYear(year) ? 366 : 365;\n var firstyday = datetime(year, 1, 1);\n var wday = getWeekday(firstyday);\n if (yearlen === 365) {\n return {\n mmask: M365MASK,\n mdaymask: MDAY365MASK,\n nmdaymask: NMDAY365MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M365RANGE,\n };\n }\n return {\n mmask: M366MASK,\n mdaymask: MDAY366MASK,\n nmdaymask: NMDAY366MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M366RANGE,\n };\n}\n//# sourceMappingURL=yearinfo.js.map","import { notEmpty, repeat, range, isPresent } from '../helpers';\nimport { Frequency } from '../types';\nimport { rebuildYear } from './yearinfo';\nimport { rebuildMonth } from './monthinfo';\nimport { easter } from './easter';\nimport { Time } from '../datetime';\nimport { datetime, sort, toOrdinal } from '../dateutil';\n// =============================================================================\n// Iterinfo\n// =============================================================================\nvar Iterinfo = /** @class */ (function () {\n // eslint-disable-next-line no-empty-function\n function Iterinfo(options) {\n this.options = options;\n }\n Iterinfo.prototype.rebuild = function (year, month) {\n var options = this.options;\n if (year !== this.lastyear) {\n this.yearinfo = rebuildYear(year, options);\n }\n if (notEmpty(options.bynweekday) &&\n (month !== this.lastmonth || year !== this.lastyear)) {\n var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask;\n this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options);\n }\n if (isPresent(options.byeaster)) {\n this.eastermask = easter(year, options.byeaster);\n }\n };\n Object.defineProperty(Iterinfo.prototype, \"lastyear\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastyear : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"lastmonth\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastmonth : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearlen\", {\n get: function () {\n return this.yearinfo.yearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearordinal\", {\n get: function () {\n return this.yearinfo.yearordinal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mrange\", {\n get: function () {\n return this.yearinfo.mrange;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wdaymask\", {\n get: function () {\n return this.yearinfo.wdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mmask\", {\n get: function () {\n return this.yearinfo.mmask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wnomask\", {\n get: function () {\n return this.yearinfo.wnomask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nwdaymask\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.nwdaymask : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nextyearlen\", {\n get: function () {\n return this.yearinfo.nextyearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mdaymask\", {\n get: function () {\n return this.yearinfo.mdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nmdaymask\", {\n get: function () {\n return this.yearinfo.nmdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Iterinfo.prototype.ydayset = function () {\n return [range(this.yearlen), 0, this.yearlen];\n };\n Iterinfo.prototype.mdayset = function (_, month) {\n var start = this.mrange[month - 1];\n var end = this.mrange[month];\n var set = repeat(null, this.yearlen);\n for (var i = start; i < end; i++)\n set[i] = i;\n return [set, start, end];\n };\n Iterinfo.prototype.wdayset = function (year, month, day) {\n // We need to handle cross-year weeks here.\n var set = repeat(null, this.yearlen + 7);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n var start = i;\n for (var j = 0; j < 7; j++) {\n set[i] = i;\n ++i;\n if (this.wdaymask[i] === this.options.wkst)\n break;\n }\n return [set, start, i];\n };\n Iterinfo.prototype.ddayset = function (year, month, day) {\n var set = repeat(null, this.yearlen);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n set[i] = i;\n return [set, i, i + 1];\n };\n Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) {\n var _this = this;\n var set = [];\n this.options.byminute.forEach(function (minute) {\n set = set.concat(_this.mtimeset(hour, minute, second, millisecond));\n });\n sort(set);\n return set;\n };\n Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) {\n var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });\n sort(set);\n return set;\n };\n Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) {\n return [new Time(hour, minute, second, millisecond)];\n };\n Iterinfo.prototype.getdayset = function (freq) {\n switch (freq) {\n case Frequency.YEARLY:\n return this.ydayset.bind(this);\n case Frequency.MONTHLY:\n return this.mdayset.bind(this);\n case Frequency.WEEKLY:\n return this.wdayset.bind(this);\n case Frequency.DAILY:\n return this.ddayset.bind(this);\n default:\n return this.ddayset.bind(this);\n }\n };\n Iterinfo.prototype.gettimeset = function (freq) {\n switch (freq) {\n case Frequency.HOURLY:\n return this.htimeset.bind(this);\n case Frequency.MINUTELY:\n return this.mtimeset.bind(this);\n case Frequency.SECONDLY:\n return this.stimeset.bind(this);\n }\n };\n return Iterinfo;\n}());\nexport default Iterinfo;\n//# sourceMappingURL=index.js.map","import { RRule } from '../rrule';\nimport { empty, repeat, pymod } from '../helpers';\nexport function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) {\n var result = {\n lastyear: year,\n lastmonth: month,\n nwdaymask: [],\n };\n var ranges = [];\n if (options.freq === RRule.YEARLY) {\n if (empty(options.bymonth)) {\n ranges = [[0, yearlen]];\n }\n else {\n for (var j = 0; j < options.bymonth.length; j++) {\n month = options.bymonth[j];\n ranges.push(mrange.slice(month - 1, month + 1));\n }\n }\n }\n else if (options.freq === RRule.MONTHLY) {\n ranges = [mrange.slice(month - 1, month + 1)];\n }\n if (empty(ranges)) {\n return result;\n }\n // Weekly frequency won't get here, so we may not\n // care about cross-year weekly periods.\n result.nwdaymask = repeat(0, yearlen);\n for (var j = 0; j < ranges.length; j++) {\n var rang = ranges[j];\n var first = rang[0];\n var last = rang[1] - 1;\n for (var k = 0; k < options.bynweekday.length; k++) {\n var i = void 0;\n var _a = options.bynweekday[k], wday = _a[0], n = _a[1];\n if (n < 0) {\n i = last + (n + 1) * 7;\n i -= pymod(wdaymask[i] - wday, 7);\n }\n else {\n i = first + (n - 1) * 7;\n i += pymod(7 - wdaymask[i] + wday, 7);\n }\n if (first <= i && i <= last)\n result.nwdaymask[i] = 1;\n }\n }\n return result;\n}\n//# sourceMappingURL=monthinfo.js.map","export function easter(y, offset) {\n if (offset === void 0) { offset = 0; }\n var a = y % 19;\n var b = Math.floor(y / 100);\n var c = y % 100;\n var d = Math.floor(b / 4);\n var e = b % 4;\n var f = Math.floor((b + 8) / 25);\n var g = Math.floor((b - f + 1) / 3);\n var h = Math.floor(19 * a + b - d - g + 15) % 30;\n var i = Math.floor(c / 4);\n var k = c % 4;\n var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;\n var m = Math.floor((a + 11 * h + 22 * l) / 451);\n var month = Math.floor((h + l - 7 * m + 114) / 31);\n var day = ((h + l - 7 * m + 114) % 31) + 1;\n var date = Date.UTC(y, month - 1, day + offset);\n var yearStart = Date.UTC(y, 0, 1);\n return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];\n}\n//# sourceMappingURL=easter.js.map","import { combine, fromOrdinal, sort } from '../dateutil';\nimport { pymod, isPresent, includes } from '../helpers';\nexport function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {\n var poslist = [];\n for (var j = 0; j < bysetpos.length; j++) {\n var daypos = void 0;\n var timepos = void 0;\n var pos = bysetpos[j];\n if (pos < 0) {\n daypos = Math.floor(pos / timeset.length);\n timepos = pymod(pos, timeset.length);\n }\n else {\n daypos = Math.floor((pos - 1) / timeset.length);\n timepos = pymod(pos - 1, timeset.length);\n }\n var tmp = [];\n for (var k = start; k < end; k++) {\n var val = dayset[k];\n if (!isPresent(val))\n continue;\n tmp.push(val);\n }\n var i = void 0;\n if (daypos < 0) {\n i = tmp.slice(daypos)[0];\n }\n else {\n i = tmp[daypos];\n }\n var time = timeset[timepos];\n var date = fromOrdinal(ii.yearordinal + i);\n var res = combine(date, time);\n // XXX: can this ever be in the array?\n // - compare the actual date instead?\n if (!includes(poslist, res))\n poslist.push(res);\n }\n sort(poslist);\n return poslist;\n}\n//# sourceMappingURL=poslist.js.map","import { freqIsDailyOrGreater } from '../types';\nimport { combine, fromOrdinal, MAXYEAR } from '../dateutil';\nimport Iterinfo from '../iterinfo/index';\nimport { RRule } from '../rrule';\nimport { buildTimeset } from '../parseoptions';\nimport { notEmpty, includes, isPresent } from '../helpers';\nimport { DateWithZone } from '../datewithzone';\nimport { buildPoslist } from './poslist';\nimport { DateTime } from '../datetime';\nexport function iter(iterResult, options) {\n var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;\n var count = options.count;\n if (count === 0 || interval === 0) {\n return emitResult(iterResult);\n }\n var counterDate = DateTime.fromDate(dtstart);\n var ii = new Iterinfo(options);\n ii.rebuild(counterDate.year, counterDate.month);\n var timeset = makeTimeset(ii, counterDate, options);\n for (;;) {\n var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2];\n var filtered = removeFilteredDays(dayset, start, end, ii, options);\n if (notEmpty(bysetpos)) {\n var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset);\n for (var j = 0; j < poslist.length; j++) {\n var res = poslist[j];\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n else {\n for (var j = start; j < end; j++) {\n var currentDay = dayset[j];\n if (!isPresent(currentDay)) {\n continue;\n }\n var date = fromOrdinal(ii.yearordinal + currentDay);\n for (var k = 0; k < timeset.length; k++) {\n var time = timeset[k];\n var res = combine(date, time);\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n }\n if (options.interval === 0) {\n return emitResult(iterResult);\n }\n // Handle frequency and interval\n counterDate.add(options, filtered);\n if (counterDate.year > MAXYEAR) {\n return emitResult(iterResult);\n }\n if (!freqIsDailyOrGreater(freq)) {\n timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0);\n }\n ii.rebuild(counterDate.year, counterDate.month);\n }\n}\nfunction isFiltered(ii, currentDay, options) {\n var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday;\n return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) ||\n (notEmpty(byweekno) && !ii.wnomask[currentDay]) ||\n (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) ||\n (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) ||\n (byeaster !== null && !includes(ii.eastermask, currentDay)) ||\n ((notEmpty(bymonthday) || notEmpty(bynmonthday)) &&\n !includes(bymonthday, ii.mdaymask[currentDay]) &&\n !includes(bynmonthday, ii.nmdaymask[currentDay])) ||\n (notEmpty(byyearday) &&\n ((currentDay < ii.yearlen &&\n !includes(byyearday, currentDay + 1) &&\n !includes(byyearday, -ii.yearlen + currentDay)) ||\n (currentDay >= ii.yearlen &&\n !includes(byyearday, currentDay + 1 - ii.yearlen) &&\n !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))));\n}\nfunction rezoneIfNeeded(date, options) {\n return new DateWithZone(date, options.tzid).rezonedDate();\n}\nfunction emitResult(iterResult) {\n return iterResult.getValue();\n}\nfunction removeFilteredDays(dayset, start, end, ii, options) {\n var filtered = false;\n for (var dayCounter = start; dayCounter < end; dayCounter++) {\n var currentDay = dayset[dayCounter];\n filtered = isFiltered(ii, currentDay, options);\n if (filtered)\n dayset[currentDay] = null;\n }\n return filtered;\n}\nfunction makeTimeset(ii, counterDate, options) {\n var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n if (freqIsDailyOrGreater(freq)) {\n return buildTimeset(options);\n }\n if ((freq >= RRule.HOURLY &&\n notEmpty(byhour) &&\n !includes(byhour, counterDate.hour)) ||\n (freq >= RRule.MINUTELY &&\n notEmpty(byminute) &&\n !includes(byminute, counterDate.minute)) ||\n (freq >= RRule.SECONDLY &&\n notEmpty(bysecond) &&\n !includes(bysecond, counterDate.second))) {\n return [];\n }\n return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond);\n}\n//# sourceMappingURL=index.js.map","import { isValidDate } from './dateutil';\nimport IterResult from './iterresult';\nimport CallbackIterResult from './callbackiterresult';\nimport { fromText, parseText, toText, isFullyConvertible } from './nlp/index';\nimport { Frequency, } from './types';\nimport { parseOptions, initializeOptions } from './parseoptions';\nimport { parseString } from './parsestring';\nimport { optionsToString } from './optionstostring';\nimport { Cache } from './cache';\nimport { Weekday } from './weekday';\nimport { iter } from './iter/index';\n// =============================================================================\n// RRule\n// =============================================================================\nexport var Days = {\n MO: new Weekday(0),\n TU: new Weekday(1),\n WE: new Weekday(2),\n TH: new Weekday(3),\n FR: new Weekday(4),\n SA: new Weekday(5),\n SU: new Weekday(6),\n};\nexport var DEFAULT_OPTIONS = {\n freq: Frequency.YEARLY,\n dtstart: null,\n interval: 1,\n wkst: Days.MO,\n count: null,\n until: null,\n tzid: null,\n bysetpos: null,\n bymonth: null,\n bymonthday: null,\n bynmonthday: null,\n byyearday: null,\n byweekno: null,\n byweekday: null,\n bynweekday: null,\n byhour: null,\n byminute: null,\n bysecond: null,\n byeaster: null,\n};\nexport var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n/**\n *\n * @param {Options?} options - see \n * - The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...\n * @constructor\n */\nvar RRule = /** @class */ (function () {\n function RRule(options, noCache) {\n if (options === void 0) { options = {}; }\n if (noCache === void 0) { noCache = false; }\n // RFC string\n this._cache = noCache ? null : new Cache();\n // used by toString()\n this.origOptions = initializeOptions(options);\n var parsedOptions = parseOptions(options).parsedOptions;\n this.options = parsedOptions;\n }\n RRule.parseText = function (text, language) {\n return parseText(text, language);\n };\n RRule.fromText = function (text, language) {\n return fromText(text, language);\n };\n RRule.fromString = function (str) {\n return new RRule(RRule.parseString(str) || undefined);\n };\n RRule.prototype._iter = function (iterResult) {\n return iter(iterResult, this.options);\n };\n RRule.prototype._cacheGet = function (what, args) {\n if (!this._cache)\n return false;\n return this._cache._cacheGet(what, args);\n };\n RRule.prototype._cacheAdd = function (what, value, args) {\n if (!this._cache)\n return;\n return this._cache._cacheAdd(what, value, args);\n };\n /**\n * @param {Function} iterator - optional function that will be called\n * on each date that is added. It can return false\n * to stop the iteration.\n * @return Array containing all recurrences.\n */\n RRule.prototype.all = function (iterator) {\n if (iterator) {\n return this._iter(new CallbackIterResult('all', {}, iterator));\n }\n var result = this._cacheGet('all');\n if (result === false) {\n result = this._iter(new IterResult('all', {}));\n this._cacheAdd('all', result);\n }\n return result;\n };\n /**\n * Returns all the occurrences of the rrule between after and before.\n * The inc keyword defines what happens if after and/or before are\n * themselves occurrences. With inc == True, they will be included in the\n * list, if they are found in the recurrence set.\n *\n * @return Array\n */\n RRule.prototype.between = function (after, before, inc, iterator) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(after) || !isValidDate(before)) {\n throw new Error('Invalid date passed in to RRule.between');\n }\n var args = {\n before: before,\n after: after,\n inc: inc,\n };\n if (iterator) {\n return this._iter(new CallbackIterResult('between', args, iterator));\n }\n var result = this._cacheGet('between', args);\n if (result === false) {\n result = this._iter(new IterResult('between', args));\n this._cacheAdd('between', result, args);\n }\n return result;\n };\n /**\n * Returns the last recurrence before the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.before = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.before');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('before', args);\n if (result === false) {\n result = this._iter(new IterResult('before', args));\n this._cacheAdd('before', result, args);\n }\n return result;\n };\n /**\n * Returns the first recurrence after the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.after = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.after');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('after', args);\n if (result === false) {\n result = this._iter(new IterResult('after', args));\n this._cacheAdd('after', result, args);\n }\n return result;\n };\n /**\n * Returns the number of recurrences in this set. It will have go trough\n * the whole recurrence, if this hasn't been done before.\n */\n RRule.prototype.count = function () {\n return this.all().length;\n };\n /**\n * Converts the rrule into its string representation\n *\n * @see \n * @return String\n */\n RRule.prototype.toString = function () {\n return optionsToString(this.origOptions);\n };\n /**\n * Will convert all rules described in nlp:ToText\n * to text.\n */\n RRule.prototype.toText = function (gettext, language, dateFormatter) {\n return toText(this, gettext, language, dateFormatter);\n };\n RRule.prototype.isFullyConvertibleToText = function () {\n return isFullyConvertible(this);\n };\n /**\n * @return a RRule instance with the same freq and options\n * as this one (cache is not cloned)\n */\n RRule.prototype.clone = function () {\n return new RRule(this.origOptions);\n };\n // RRule class 'constants'\n RRule.FREQUENCIES = [\n 'YEARLY',\n 'MONTHLY',\n 'WEEKLY',\n 'DAILY',\n 'HOURLY',\n 'MINUTELY',\n 'SECONDLY',\n ];\n RRule.YEARLY = Frequency.YEARLY;\n RRule.MONTHLY = Frequency.MONTHLY;\n RRule.WEEKLY = Frequency.WEEKLY;\n RRule.DAILY = Frequency.DAILY;\n RRule.HOURLY = Frequency.HOURLY;\n RRule.MINUTELY = Frequency.MINUTELY;\n RRule.SECONDLY = Frequency.SECONDLY;\n RRule.MO = Days.MO;\n RRule.TU = Days.TU;\n RRule.WE = Days.WE;\n RRule.TH = Days.TH;\n RRule.FR = Days.FR;\n RRule.SA = Days.SA;\n RRule.SU = Days.SU;\n RRule.parseString = parseString;\n RRule.optionsToString = optionsToString;\n return RRule;\n}());\nexport { RRule };\n//# sourceMappingURL=rrule.js.map","import { __assign } from \"tslib\";\nimport { RRule } from './rrule';\nimport { RRuleSet } from './rruleset';\nimport { untilStringToDate } from './dateutil';\nimport { includes, split } from './helpers';\nimport { parseString, parseDtstart } from './parsestring';\n/**\n * RRuleStr\n * To parse a set of rrule strings\n */\nvar DEFAULT_OPTIONS = {\n dtstart: null,\n cache: false,\n unfold: false,\n forceset: false,\n compatible: false,\n tzid: null,\n};\nexport function parseInput(s, options) {\n var rrulevals = [];\n var rdatevals = [];\n var exrulevals = [];\n var exdatevals = [];\n var parsedDtstart = parseDtstart(s);\n var dtstart = parsedDtstart.dtstart;\n var tzid = parsedDtstart.tzid;\n var lines = splitIntoLines(s, options.unfold);\n lines.forEach(function (line) {\n var _a;\n if (!line)\n return;\n var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value;\n switch (name.toUpperCase()) {\n case 'RRULE':\n if (parms.length) {\n throw new Error(\"unsupported RRULE parm: \".concat(parms.join(',')));\n }\n rrulevals.push(parseString(line));\n break;\n case 'RDATE':\n var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1];\n if (rdateTzid && !tzid) {\n tzid = rdateTzid;\n }\n rdatevals = rdatevals.concat(parseRDate(value, parms));\n break;\n case 'EXRULE':\n if (parms.length) {\n throw new Error(\"unsupported EXRULE parm: \".concat(parms.join(',')));\n }\n exrulevals.push(parseString(value));\n break;\n case 'EXDATE':\n exdatevals = exdatevals.concat(parseRDate(value, parms));\n break;\n case 'DTSTART':\n break;\n default:\n throw new Error('unsupported property: ' + name);\n }\n });\n return {\n dtstart: dtstart,\n tzid: tzid,\n rrulevals: rrulevals,\n rdatevals: rdatevals,\n exrulevals: exrulevals,\n exdatevals: exdatevals,\n };\n}\nfunction buildRule(s, options) {\n var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid;\n var noCache = options.cache === false;\n if (options.compatible) {\n options.forceset = true;\n options.unfold = true;\n }\n if (options.forceset ||\n rrulevals.length > 1 ||\n rdatevals.length ||\n exrulevals.length ||\n exdatevals.length) {\n var rset_1 = new RRuleSet(noCache);\n rset_1.dtstart(dtstart);\n rset_1.tzid(tzid || undefined);\n rrulevals.forEach(function (val) {\n rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n rdatevals.forEach(function (date) {\n rset_1.rdate(date);\n });\n exrulevals.forEach(function (val) {\n rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n exdatevals.forEach(function (date) {\n rset_1.exdate(date);\n });\n if (options.compatible && options.dtstart)\n rset_1.rdate(dtstart);\n return rset_1;\n }\n var val = rrulevals[0] || {};\n return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache);\n}\nexport function rrulestr(s, options) {\n if (options === void 0) { options = {}; }\n return buildRule(s, initializeOptions(options));\n}\nfunction groomRruleOptions(val, dtstart, tzid) {\n return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid });\n}\nfunction initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n keys.forEach(function (key) {\n if (!includes(defaultKeys, key))\n invalid.push(key);\n });\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign(__assign({}, DEFAULT_OPTIONS), options);\n}\nfunction extractName(line) {\n if (line.indexOf(':') === -1) {\n return {\n name: 'RRULE',\n value: line,\n };\n }\n var _a = split(line, ':', 1), name = _a[0], value = _a[1];\n return {\n name: name,\n value: value,\n };\n}\nfunction breakDownLine(line) {\n var _a = extractName(line), name = _a.name, value = _a.value;\n var parms = name.split(';');\n if (!parms)\n throw new Error('empty property name');\n return {\n name: parms[0].toUpperCase(),\n parms: parms.slice(1),\n value: value,\n };\n}\nfunction splitIntoLines(s, unfold) {\n if (unfold === void 0) { unfold = false; }\n s = s && s.trim();\n if (!s)\n throw new Error('Invalid empty string');\n // More info about 'unfold' option\n // Go head to http://www.ietf.org/rfc/rfc2445.txt\n if (!unfold) {\n return s.split(/\\s/);\n }\n var lines = s.split('\\n');\n var i = 0;\n while (i < lines.length) {\n // TODO\n var line = (lines[i] = lines[i].replace(/\\s+$/g, ''));\n if (!line) {\n lines.splice(i, 1);\n }\n else if (i > 0 && line[0] === ' ') {\n lines[i - 1] += line.slice(1);\n lines.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n return lines;\n}\nfunction validateDateParm(parms) {\n parms.forEach(function (parm) {\n if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {\n throw new Error('unsupported RDATE/EXDATE parm: ' + parm);\n }\n });\n}\nfunction parseRDate(rdateval, parms) {\n validateDateParm(parms);\n return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });\n}\n//# sourceMappingURL=rrulestr.js.map","import { __extends } from \"tslib\";\nimport { RRule } from './rrule';\nimport { sort, timeToUntilString } from './dateutil';\nimport { includes } from './helpers';\nimport { iterSet } from './iterset';\nimport { rrulestr } from './rrulestr';\nimport { optionsToString } from './optionstostring';\nfunction createGetterSetter(fieldName) {\n var _this = this;\n return function (field) {\n if (field !== undefined) {\n _this[\"_\".concat(fieldName)] = field;\n }\n if (_this[\"_\".concat(fieldName)] !== undefined) {\n return _this[\"_\".concat(fieldName)];\n }\n for (var i = 0; i < _this._rrule.length; i++) {\n var field_1 = _this._rrule[i].origOptions[fieldName];\n if (field_1) {\n return field_1;\n }\n }\n };\n}\nvar RRuleSet = /** @class */ (function (_super) {\n __extends(RRuleSet, _super);\n /**\n *\n * @param {Boolean?} noCache\n * The same stratagy as RRule on cache, default to false\n * @constructor\n */\n function RRuleSet(noCache) {\n if (noCache === void 0) { noCache = false; }\n var _this = _super.call(this, {}, noCache) || this;\n _this.dtstart = createGetterSetter.apply(_this, ['dtstart']);\n _this.tzid = createGetterSetter.apply(_this, ['tzid']);\n _this._rrule = [];\n _this._rdate = [];\n _this._exrule = [];\n _this._exdate = [];\n return _this;\n }\n RRuleSet.prototype._iter = function (iterResult) {\n return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());\n };\n /**\n * Adds an RRule to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.rrule = function (rrule) {\n _addRule(rrule, this._rrule);\n };\n /**\n * Adds an EXRULE to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.exrule = function (rrule) {\n _addRule(rrule, this._exrule);\n };\n /**\n * Adds an RDate to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.rdate = function (date) {\n _addDate(date, this._rdate);\n };\n /**\n * Adds an EXDATE to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.exdate = function (date) {\n _addDate(date, this._exdate);\n };\n /**\n * Get list of included rrules in this recurrence set.\n *\n * @return List of rrules\n */\n RRuleSet.prototype.rrules = function () {\n return this._rrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of excluded rrules in this recurrence set.\n *\n * @return List of exrules\n */\n RRuleSet.prototype.exrules = function () {\n return this._exrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of rdates\n */\n RRuleSet.prototype.rdates = function () {\n return this._rdate.map(function (e) { return new Date(e.getTime()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of exdates\n */\n RRuleSet.prototype.exdates = function () {\n return this._exdate.map(function (e) { return new Date(e.getTime()); });\n };\n RRuleSet.prototype.valueOf = function () {\n var result = [];\n if (!this._rrule.length && this._dtstart) {\n result = result.concat(optionsToString({ dtstart: this._dtstart }));\n }\n this._rrule.forEach(function (rrule) {\n result = result.concat(rrule.toString().split('\\n'));\n });\n this._exrule.forEach(function (exrule) {\n result = result.concat(exrule\n .toString()\n .split('\\n')\n .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); })\n .filter(function (line) { return !/^DTSTART/.test(line); }));\n });\n if (this._rdate.length) {\n result.push(rdatesToString('RDATE', this._rdate, this.tzid()));\n }\n if (this._exdate.length) {\n result.push(rdatesToString('EXDATE', this._exdate, this.tzid()));\n }\n return result;\n };\n /**\n * to generate recurrence field such as:\n * DTSTART:19970902T010000Z\n * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n */\n RRuleSet.prototype.toString = function () {\n return this.valueOf().join('\\n');\n };\n /**\n * Create a new RRuleSet Object completely base on current instance\n */\n RRuleSet.prototype.clone = function () {\n var rrs = new RRuleSet(!!this._cache);\n this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); });\n this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); });\n this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); });\n this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); });\n return rrs;\n };\n return RRuleSet;\n}(RRule));\nexport { RRuleSet };\nfunction _addRule(rrule, collection) {\n if (!(rrule instanceof RRule)) {\n throw new TypeError(String(rrule) + ' is not RRule instance');\n }\n if (!includes(collection.map(String), String(rrule))) {\n collection.push(rrule);\n }\n}\nfunction _addDate(date, collection) {\n if (!(date instanceof Date)) {\n throw new TypeError(String(date) + ' is not Date instance');\n }\n if (!includes(collection.map(Number), Number(date))) {\n collection.push(date);\n sort(collection);\n }\n}\nfunction rdatesToString(param, rdates, tzid) {\n var isUTC = !tzid || tzid.toUpperCase() === 'UTC';\n var header = isUTC ? \"\".concat(param, \":\") : \"\".concat(param, \";TZID=\").concat(tzid, \":\");\n var dateString = rdates\n .map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })\n .join(',');\n return \"\".concat(header).concat(dateString);\n}\n//# sourceMappingURL=rruleset.js.map","import { DateWithZone } from './datewithzone';\nimport { iter } from './iter';\nimport { sort } from './dateutil';\nexport function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {\n var _exdateHash = {};\n var _accept = iterResult.accept;\n function evalExdate(after, before) {\n _exrule.forEach(function (rrule) {\n rrule.between(after, before, true).forEach(function (date) {\n _exdateHash[Number(date)] = true;\n });\n });\n }\n _exdate.forEach(function (date) {\n var zonedDate = new DateWithZone(date, tzid).rezonedDate();\n _exdateHash[Number(zonedDate)] = true;\n });\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (isNaN(dt))\n return _accept.call(this, date);\n if (!_exdateHash[dt]) {\n evalExdate(new Date(dt - 1), new Date(dt + 1));\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n }\n return true;\n };\n if (iterResult.method === 'between') {\n evalExdate(iterResult.args.after, iterResult.args.before);\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n return true;\n };\n }\n for (var i = 0; i < _rdate.length; i++) {\n var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate();\n if (!iterResult.accept(new Date(zonedDate.getTime())))\n break;\n }\n _rrule.forEach(function (rrule) {\n iter(iterResult, rrule.options);\n });\n var res = iterResult._result;\n sort(res);\n switch (iterResult.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n return ((res.length && res[res.length - 1]) || null);\n case 'after':\n default:\n return ((res.length && res[0]) || null);\n }\n}\n//# sourceMappingURL=iterset.js.map","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport recurring_legacy from \"./recurring_legacy\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\trecurring_legacy,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\n\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onMouseDown\", function(classname) {\r\n\t\treturn !(classname == dhx_time_block);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t\tif (!id) return true;\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(id));\r\n\t});\r\n\tscheduler.attachEvent(\"onClick\", function (event_id, native_event_object){\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(event_id));\r\n });\r\n\tscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tbefore = [ev.start_date, ev.end_date];\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\r\n\t\t//lightbox may not have 'time' section\r\n\t\tif(!(data.start_date && data.end_date)){\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tdata.start_date = new Date(ev.start_date);\r\n\t\t\tdata.end_date = new Date(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif(data.rec_type){\r\n\t\t\t//_roll_back_dates modifies start_date of recurring event, need to check limits after modification\r\n\t\t\t// use a copy to keep original event unchanged\r\n\t\t\tvar data_copy = scheduler._lame_clone(data);\r\n\t\t\tscheduler._roll_back_dates(data_copy);\r\n\t\t\treturn scheduler.checkLimitViolation(data_copy);\r\n\t\t}\r\n\t\treturn scheduler.checkLimitViolation(data);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {\r\n\t\t\t//if newly created event is outside of limited time - crop it, leaving only allowed time\r\n\t\t\tif (ev.start_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.start_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn scheduler.checkLimitViolation(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\r\n};\r\nscheduler._temp_limit_scope();\r\n\r\n\r\n}","import { GoogleMapAdapter } from \"./gMapAdapter\";\r\nimport { OpenStreetMapAdapter } from \"./osmMapAdapter\";\r\nimport { MapboxAdapter } from \"./mapboxAdapter\";\r\nimport { IMapAdapter, ICalendarEvent, IMapSettings } from \"./types\";\r\n\r\ndeclare let google: any;\r\n\r\nexport default function(scheduler: any){\r\n\t\r\nlet mapAdapter: IMapAdapter | null = null;\r\nlet eventHandlerIds: number[] = [];\r\nconst adapters: { [name:string]: IMapAdapter } = {\r\n\tgoogleMap: new GoogleMapAdapter(scheduler),\r\n\topenStreetMaps: new OpenStreetMapAdapter(scheduler),\r\n\tmapbox: new MapboxAdapter(scheduler)\r\n}\r\n\r\nif(!scheduler.ext){\r\n\tscheduler.ext = {};\r\n}\r\nscheduler.ext.mapView = {\r\n\tcreateAdapter: function():IMapAdapter{\r\n\t\treturn adapters[scheduler.config.map_view_provider];\r\n\t},\r\n\tcreateMarker: function(config){\r\n\t\treturn new google.maps.Marker(config);\r\n\t},\r\n\tcurrentAdapter: null,\r\n\tadapters\r\n};\r\nscheduler._latLngUpdate = false; // flag for updating events which don't have event.lat and event.lng\r\nscheduler._eventLocationChanged = false; // flag for checking if the location of the event is changed\r\nscheduler.config.map_view_provider = \"googleMap\";\r\nscheduler.config.map_settings = {\r\n\tinitial_position: {\r\n\t lat: 48.724,\r\n\t lng: 8.215\r\n\t},\r\n\terror_position: {\r\n\t lat: 15,\r\n\t lng: 15\r\n\t},\r\n\tinitial_zoom: 1,\r\n\tzoom_after_resolve: 15,\r\n\tinfo_window_max_width: 300,\r\n\tresolve_user_location: true,\r\n\tresolve_event_location: true,\r\n\tview_provider: \"googleMap\"\r\n}\r\nif (scheduler.config.map_initial_position) {\r\n\tscheduler.config.map_settings.initial_position = {\r\n\t\tlat: scheduler.config.map_initial_position.lat(),\r\n\t\tlng: scheduler.config.map_initial_position.lng(), \r\n\t};\r\n}\r\n\r\nif (scheduler.config.map_error_position) {\r\n\tscheduler.config.map_settings.error_position = {\r\n\t\tlat: scheduler.config.map_error_position.lat(),\r\n\t\tlng: scheduler.config.map_error_position.lng(), \r\n\t};\r\n}\r\n\r\nscheduler.xy.map_date_width = 188; // date column width\r\nscheduler.xy.map_icon_width = 25; // event details icon width\r\nscheduler.xy.map_description_width = 400; // description column width\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\nscheduler.templates.map_info_content = function(event){\r\n return `
Event's text: ${event.text}\r\n\t\t\t\t
Location: ${event.event_location}
\r\n\t\t\t\t
Starts: ${scheduler.templates.tooltip_date_format(event.start_date)}
\r\n\t\t\t\t
Ends: ${scheduler.templates.tooltip_date_format(event.end_date)}
\r\n\t\t\t
`;\r\n};\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\n\r\nfunction setupMapView(scheduler) {\r\n\t// Initialization logic, possibly including creation of a new mapAdapter\r\n\tmapAdapter = scheduler.ext.mapView.createAdapter();\r\n\tattachSchedulerEvents();\r\n}\r\nasync function addEventWithLocation(event: ICalendarEvent, mapAdapter: IMapAdapter){\r\n\tlet coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\tevent.lat = coordinates.lat;\r\n\tevent.lng = coordinates.lng;\r\n\tmapAdapter.removeEventMarker(String(event.id));\r\n\tmapAdapter.addEventMarker(event);\r\n\treturn event;\r\n}\r\nfunction setUserLocation(options: IMapSettings, adapter: IMapAdapter): void{\r\n\tif (options.resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\tadapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tadapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom);\r\n\t}\r\n}\r\nscheduler.dblclick_dhx_map_area = function(e) {\r\n\tlet eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\tif (eventNode){\r\n\t\tlet eventId = eventNode.getAttribute(`${scheduler.config.event_attribute}`);\r\n\t\tscheduler.showLightbox(eventId);\r\n\t}\r\n\tif (!this.config.readonly && this.config.dblclick_create && !eventNode) {\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler.config.map_start,\r\n\t\t\tend_date: scheduler.date.add( scheduler.config.map_start, scheduler.config.time_step, \"minute\"),\r\n\t\t});\r\n\t}\t\r\n};\r\n\r\nfunction attachSchedulerEvents() { \r\n eventHandlerIds.push(\r\n\tscheduler.attachEvent(\"onEventSave\",function(id,ev,is_new){\r\n\t\tlet unmodifiedEvent = scheduler.getEvent(id);\r\n\t\tif (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) {\r\n\t\t\tscheduler._eventLocationChanged = true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}),\r\n scheduler.attachEvent(\"onEventChanged\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !scheduler._latLngUpdate ) {\r\n\t\t\t\t \taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.updateEventMarker(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._latLngUpdate = false;\r\n\t\treturn true;\r\n }),\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_id,new_id){\r\n\t\tlet newIdEvent = scheduler.getEvent(new_id);\r\n\t\tmapAdapter?.removeEventMarker(old_id);\r\n\t\tmapAdapter?.addEventMarker(newIdEvent);\r\n\t}),\r\n scheduler.attachEvent(\"onEventAdded\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n \t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && scheduler._eventLocationChanged) {\r\n\t\t\t\t\taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t\tscheduler._eventLocationChanged = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.addEventMarker(event);\r\n\t\t\t\t\tmapAdapter.onEventClick(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }),\r\n scheduler.attachEvent(\"onClick\", function (id, e){\r\n\t\tconst event = scheduler.getEvent(id);\r\n\t\tif (mapAdapter && event) mapAdapter.onEventClick(event);\r\n\t\treturn false;\r\n }),\r\n scheduler.attachEvent(\"onBeforeEventDelete\", (id, event) => {\r\n\t\tif (mapAdapter) {\r\n\t\t\tmapAdapter.removeEventMarker(id);\r\n\t\t}\r\n\t\treturn true;\r\n })\r\n );\r\n}\r\nfunction detachSchedulerEvents() {\r\n\teventHandlerIds.forEach(id => scheduler.detachEvent(id));\r\n\teventHandlerIds = [];\r\n}\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\r\n\tif(scheduler.config.map_initial_zoom !== undefined){\r\n\t\tscheduler.config.map_settings.initial_zoom = scheduler.config.map_initial_zoom;\r\n\t}\r\n\tif(scheduler.config.map_zoom_after_resolve !== undefined){\r\n\t\tscheduler.config.map_settings.zoom_after_resolve = scheduler.config.map_zoom_after_resolve;\r\n\t}\r\n\tif(scheduler.config.map_infowindow_max_width !== undefined){\r\n\t\tscheduler.config.map_settings.info_window_max_width = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\tif(scheduler.config.map_resolve_user_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_user_location = scheduler.config.map_resolve_user_location;\r\n\t}\r\n\tif(scheduler.config.map_view_provider !== undefined){\r\n\t\tscheduler.config.map_settings.view_provider = scheduler.config.map_view_provider;\r\n\t}\r\n\tif(scheduler.config.map_type !== undefined){\r\n\t\tscheduler.config.map_settings.type = scheduler.config.map_type;\r\n\t}\r\n\tif(scheduler.config.map_resolve_event_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_event_location = scheduler.config.map_resolve_event_location;\r\n\t}\r\n\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\r\n\tlet map = document.createElement('div');\r\n\tmap.className = 'mapContainer';\r\n\tmap.id = 'mapContainer';\r\n\tmap.style.display = \"none\";\r\n\tmap.style.zIndex = \"1\";\r\n\tscheduler._obj.appendChild(map);\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tlet events = scheduler.get_visible_events();\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tmapAdapter.clearEventMarkers();\r\n\t\t\t\tevents.forEach((event) => mapAdapter?.addEventMarker(event));\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\t\tlet mapContainer = document.getElementById('mapContainer');\r\n\t\t_setMapSize('mapContainer');\r\n\r\n\t\t// creating the new logic\r\n\t\tif (mode && mapContainer) {\r\n\t\t\tmap.style.display = 'block';\r\n\t\t\tfill_map_tab();\r\n\t\t\t// case to display several maps and has the opportunity to switch between them\r\n\t\t\tif (scheduler.config.map_view_provider == scheduler.ext.mapView.currentAdapter) {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t} else {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t \tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t\t}\r\n\t\t\tif(mapAdapter) {\r\n\t\t\t\tsetUserLocation(scheduler.config.map_settings, mapAdapter);\r\n\t\t\t}\t\r\n\t\t} else {\r\n\t\t\tmap.style.display = 'none';\r\n\t\t\tscheduler._els.dhx_cal_data[0].style.width = \"100%\";\r\n\t\t \tif (mapAdapter && mapContainer ) {\r\n\t\t\t\tmapAdapter.destroy(mapContainer);\r\n\t\t\t\tmapAdapter = null;\r\n\t\t\t\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t }\r\n\t\t \tdetachSchedulerEvents();\r\n\t\t}\r\n\t};\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tlet map = document.getElementById(elem_id);\r\n\t\tif (map) {\r\n\t\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\t\tlet height = scheduler.$container.querySelector(\".dhx_cal_data\").offsetHeight + scheduler.$container.querySelector(\".dhx_cal_header\").offsetHeight;\r\n\t\t\tif (height < 0)\r\n\t\t\t\theight = 0;\r\n\t\t\tlet width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\t\tif (width < 0)\r\n\t\t\t\twidth = 0;\r\n\t\t\tmap.style.height = height + 'px';\r\n\t\t\tmap.style.width = width + 'px';\r\n\t\t\tmap.style.position = \"absolute\";\r\n\t\t\tmap.style.top = nav_height + \"px\";\r\n\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t} else {\r\n\t\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t}\r\n\t\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t\t}\r\n\t}\t\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tlet events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tlet ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tlet html = \"
\";\r\n\t\tfor (let i = 0; i < events.length; i++) {\r\n\t\t\tlet ev = events[i];\r\n\t\t\tlet event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tlet bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tlet color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tlet ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tlet ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tlet dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (let i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tconst l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\t\r\n\tscheduler.attachEvent(\"onLocationError\", function (id){\r\n\t\talert(\"Location can't be found\");\r\n\t\treturn google.maps.LatLng(51.477840, -0.001492); \r\n\t\t//the coordinates of the Greenwich Royal Observatory\r\n\t})\r\n\tlet _updateEventLocation = async function(event) {\r\n\t\tif (mapAdapter){\r\n\t\t\tconst coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\t\t\tif (coordinates.lat && coordinates.lng) {\r\n\t\t\t\tevent.lat = +coordinates.lat;\r\n\t\t\t\tevent.lng = +coordinates.lng;\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\tevent.lng = scheduler.config.map_settings.error_position.lng;\r\n\t\t\t\tevent.lat = scheduler.config.map_settings.error_position.lat;\r\n\t\t\t}\r\n\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t}\r\n\t};\r\n\tlet _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tevent.lat = +event.lat;\r\n\t\t\tevent.lng = +event.lng;\r\n\t\t}\r\n\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n})\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\n\r\n\r\nlet clickedElementPosition = null;\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tconst container = scheduler.$container;\r\n\tif(container._$quickInfoHandler){\r\n\t\treturn;\r\n\t}else{\r\n\t\tcontainer._$quickInfoHandler = true;\r\n\t\t// store coordinates of clicked segment of an event\r\n\t\t// in case multi section events or multi-line month events\r\n\t\tscheduler.event(container, \"mousedown\", function(e){\r\n\t\t\tconst eventElement = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\t\t\tif (eventElement) {\r\n\t\t\t\tclickedElementPosition = {\r\n\t\t\t\t\tid: eventElement.getAttribute(scheduler.config.event_attribute),\r\n\t\t\t\t\tposition: getPositionInsideScheduler(eventElement)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.attachEvent(\"onDestroy\", () => {\r\n\t\t\tdelete container._$quickInfoHandler;\r\n\t\t});\r\n\t}\r\n});\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n\r\n\tqi.ontransitionend = () => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t\tqi.ontransitionend = null;\r\n\t};\r\n\tsetTimeout(() => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t}, 1);\r\n};\r\n\r\nfunction fitQIInsideWindow(quickInfoPopup){\r\n\tconst popupRect = quickInfoPopup.getBoundingClientRect();\r\n\tconst containerRect = scheduler.$container.getBoundingClientRect();\r\n\r\n\t// calculate the bottom offset of the Quick Info relative to the scheduler container\r\n\tconst offsetBottom = containerRect.bottom - popupRect.bottom;\r\n\r\n\t// If the popup extends outside the scheduler container, adjust its top position\r\n\tif (offsetBottom < 0) {\r\n\t\tquickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`;\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\n\r\nfunction getPositionInsideScheduler(element){\r\n\tlet left = 0;\r\n\tlet top = 0;\r\n\r\n\tlet node = element;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tlet dx = (left + element.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tlet dy = (top + element.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:element.offsetWidth, height:element.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\treturn getPositionInsideScheduler(domEv);\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","import { RRule, rrulestr } from 'rrule';\r\n\r\nexport default function (scheduler) {\r\n\r\n\tfunction clearMilliseconds(date) {\r\n\t\treturn new Date(\r\n\t\t\tdate.getFullYear(),\r\n\t\t\tdate.getMonth(),\r\n\t\t\tdate.getDate(),\r\n\t\t\tdate.getHours(),\r\n\t\t\tdate.getMinutes(),\r\n\t\t\tdate.getSeconds(),\r\n\t\t\t0\r\n\t\t);\r\n\t}\r\n\r\n\tfunction isDeletedOccurrence(event) {\r\n\t\treturn !!event.deleted;\r\n\t}\r\n\r\n\tfunction isSeries(event) {\r\n\t\treturn !!event.rrule && !event.recurring_event_id;\r\n\t}\r\n\r\n\tfunction clearRecurringProperties(event) {\r\n\t\tevent.rrule = \"\";\r\n\t\tevent.original_start = null;\r\n\t\tevent.recurring_event_id = null;\r\n\t\tevent.duration = null;\r\n\t\tevent.deleted = null;\r\n\t}\r\n\r\n\tfunction createException(ev) {\r\n\t\tlet id = ev.id.split(\"#\");\r\n\r\n\t\tlet nid = scheduler.uid();\r\n\t\tscheduler._not_render = true;\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = id[0];\r\n\r\n\t\tlet timestamp = id[1];\r\n\r\n\t\tnev.original_start = new Date(Number(timestamp));\r\n\r\n\t\tscheduler._add_rec_marker(nev, timestamp);\r\n\t\tscheduler.addEvent(nev);\r\n\t\tscheduler._not_render = false;\r\n\t}\r\n\r\n\tscheduler._rec_temp = [];\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_markers = {};\r\n\tscheduler._add_rec_marker = function (ev, time) {\r\n\t\tev._pid_time = time;\r\n\t\tthis._rec_markers[ev.id] = ev;\r\n\t\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\t\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n\t};\r\n\tscheduler._get_rec_marker = function (time, id) {\r\n\t\tlet ch = this._rec_markers_pull[id];\r\n\t\tif (ch) return ch[time];\r\n\t\treturn null;\r\n\t};\r\n\tscheduler._get_rec_markers = function (id) {\r\n\t\treturn (this._rec_markers_pull[id] || []);\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old_add_event = scheduler.addEvent;\r\n\t\tscheduler.addEvent = function (start_date, end_date, text, id, extra_data) {\r\n\t\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\r\n\t\t\t\tif (ev.start_date) {\r\n\t\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t\t}\r\n\t\t\t\tif (ev.end_date) {\r\n\t\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn ev_id;\r\n\t\t};\r\n\t})();\r\n\r\n\tscheduler.attachEvent(\"onEventLoading\", function (event) {\r\n\r\n\t\tif (event.original_start) {\r\n\t\t\tevent.original_start = scheduler.templates.parse_date(event.original_start);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function (id, new_id) {\r\n\t\tif (this._ignore_call) return;\r\n\t\tthis._ignore_call = true;\r\n\r\n\t\tif (scheduler._rec_markers[id]) {\r\n\t\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\t\tdelete scheduler._rec_markers[id];\r\n\t\t}\r\n\r\n\t\tif (scheduler._rec_markers_pull[id]) {\r\n\t\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\t\tdelete scheduler._rec_markers_pull[id];\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\t\tvar tev = this._rec_temp[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i in this._rec_markers) {\r\n\t\t\tvar tev = this._rec_markers[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\ttev._pid_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar el = scheduler._rec_markers[new_id];\r\n\t\tif (el && el._pid_changed) {\r\n\t\t\tdelete el._pid_changed;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (scheduler.$destroyed) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tdelete this._ignore_call;\r\n\t});\r\n\r\n\tfunction deleteEventFromSeries(idTimestamp, ev) {\r\n\t\tlet id = idTimestamp;\r\n\t\tidTimestamp = id.split(\"#\");\r\n\t\tlet nid = scheduler.uid();\r\n\t\tlet tid = (idTimestamp[1]) ? idTimestamp[1] : (ev._pid_time);\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = ev.recurring_event_id || idTimestamp[0];\r\n\t\tnev.original_start = new Date(Number(tid));\r\n\t\tnev.deleted = true;\r\n\t\tscheduler.addEvent(nev);\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && !isDeletedOccurrence(ev))) {\r\n\t\t\tdeleteEventFromSeries(id, ev);\r\n\t\t} else {\r\n\t\t\tif (isSeries(ev) && this._lightbox_id)\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tid = sub[i].id;\r\n\t\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tif (!this._is_virtual_event(id) && this._is_modified_occurence(ev)) {\r\n\t\t\tif (!scheduler._events[id]) {\r\n\t\t\t\tev.deleted = true;\r\n\t\t\t\tthis.setEvent(id, ev);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function (id, event) {\r\n\t\tif (this._loading) return true;\r\n\r\n\t\tvar ev = this.getEvent(id);\r\n\r\n\t\tif (this._is_virtual_event(id)) {\r\n\t\t\tcreateException(ev);\r\n\r\n\t\t} else {\r\n\t\t\tif (ev.start_date) {\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date) {\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev) && this._lightbox_id) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t\t//scheduler.recurrings.rollbackDates(ev);\r\n\t\t\t}\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\t\tvar isEventFound = false;\r\n\t\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\t\tisEventFound = true;\r\n\t\t\t}\r\n\t\t\tif (!isEventFound)\r\n\t\t\t\tthis._select_id = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\", function (id) {\r\n\t\tif (!this._loading) {\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function (id, data, is_new_event) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev))\r\n\t\t\tthis._select_id = null;\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\tclearRecurringProperties(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCancel\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev)) {\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\t\tthis.render_view_data();\r\n\t\t}\r\n\t});\r\n\tscheduler._roll_back_dates = function (ev) {\r\n\t\t//// !!!!! calc temp properties\r\n\t\tif (ev.start_date) {\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif (ev.end_date) {\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\t\tev.end_date = ev._end_date;\r\n\t\tif (ev._start_date) {\r\n\t\t\tev.start_date.setMonth(0);\r\n\t\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._is_virtual_event = function (id) {\r\n\t\treturn id.toString().indexOf(\"#\") != -1;\r\n\t};\r\n\tscheduler._is_modified_occurence = function (ev) {\r\n\t\treturn (ev.recurring_event_id && ev.recurring_event_id != \"0\");\r\n\t};\r\n\r\n\tscheduler.showLightbox_rec = scheduler.showLightbox;\r\n\tscheduler.showLightbox = function (id) {\r\n\t\tvar locale = this.locale;\r\n\t\tvar c = scheduler.config.lightbox_recurring;\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tvar pid = ev.recurring_event_id;\r\n\t\tvar isVirtual = this._is_virtual_event(id);\r\n\t\tif (isVirtual)\r\n\t\t\tpid = id.split(\"#\")[0];\r\n\r\n\t\t// show series\r\n\t\tvar showSeries = function (id) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tevent._end_date = event.end_date;\r\n\t\t\tevent.end_date = new Date(event.start_date.valueOf() + event.duration * 1000);\r\n\t\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t\t};\r\n\r\n\t\tif ((pid || pid * 1 === 0) && isSeries(ev)) {\r\n\t\t\t// direct API call on series id\r\n\t\t\treturn showSeries(id);\r\n\t\t}\r\n\t\tif (!pid || pid === '0' || ((!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual))) {\r\n\t\t\t// editing instance or non recurring event\r\n\t\t\treturn this.showLightbox_rec(id);\r\n\t\t}\r\n\t\tif (c == 'ask') {\r\n\t\t\tvar that = this;\r\n\t\t\tscheduler.modalbox({\r\n\t\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\t\twidth: \"500px\",\r\n\t\t\t\tposition: \"middle\",\r\n\t\t\t\tbuttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\t\tcallback: function (index) {\r\n\t\t\t\t\tswitch (+index) {\r\n\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tshowSeries(pid);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction groupExceptions() {\r\n\t\tconst exceptions = {};\r\n\t\tfor (const i in scheduler._events) {\r\n\t\t\tconst ev = scheduler._events[i];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tif (!exceptions[ev.recurring_event_id]) {\r\n\t\t\t\t\texceptions[ev.recurring_event_id] = {};\r\n\t\t\t\t}\r\n\t\t\t\texceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn exceptions;\r\n\t}\r\n\r\n\tscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function (only_timed) {\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\t\tdelete this._events[this._rec_temp[i].id];\r\n\t\tthis._rec_temp = [];\r\n\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tvar stack = this.get_visible_events_rec(only_timed);\r\n\t\tvar out = [];\r\n\t\tfor (var i = 0; i < stack.length; i++) {\r\n\t\t\tif (stack[i].deleted || stack[i].recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(stack[i])) {\r\n\t\t\t\tthis.repeat_date(stack[i], out, undefined, undefined, undefined, undefined, exceptions);\r\n\t\t\t} else {\r\n\t\t\t\tout.push(stack[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old = scheduler.isOneDayEvent;\r\n\t\tscheduler.isOneDayEvent = function (ev) {\r\n\t\t\tif (isSeries(ev)) return true;\r\n\t\t\treturn old.call(this, ev);\r\n\t\t};\r\n\t\tvar old_update_event = scheduler.updateEvent;\r\n\t\tscheduler.updateEvent = function (id) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\r\n\t\t\tif (ev && isSeries(ev) && !this._is_virtual_event(id)) {\r\n\t\t\t\tscheduler.update_view();\r\n\t\t\t} else {\r\n\t\t\t\told_update_event.call(this, id);\r\n\t\t\t}\r\n\t\t};\r\n\t})();\r\n\r\n\tconst toIcalString = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\r\n\tscheduler.repeat_date = function (ev, stack, non_render, from, to, maxCount, exceptions) {\r\n\t\tif (!ev.rrule) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id];\r\n\t\tif (!seriesExceptions) {\r\n\t\t\tseriesExceptions = {};\r\n\t\t}\r\n\r\n\t\tif (!from) {\r\n\t\t\tfrom = scheduler._min_date;\r\n\t\t}\r\n\t\tif (!to) {\r\n\t\t\tto = scheduler._max_date;\r\n\t\t}\r\n\r\n\t\tconst utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds()));\r\n\t\tconst parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart/*ev.start_date*/ });\r\n\r\n\t\tconst repeatedDates = parsedRRule.between(from, to).map(date => {\r\n\t\t\tconst adjustedDate = new Date(date);\r\n\t\t\tadjustedDate.setHours(ev.start_date.getHours());\r\n\t\t\tadjustedDate.setMinutes(ev.start_date.getMinutes());\r\n\t\t\tadjustedDate.setSeconds(ev.start_date.getSeconds());\r\n\t\t\treturn adjustedDate;\r\n\t\t});\r\n\t\tlet visibleCount = 0;\r\n\r\n\t\tconst eventDuration = ev.duration;\r\n\r\n\t\tfor (let i = 0; i < repeatedDates.length; i++) {\r\n\t\t\tif (maxCount && visibleCount >= maxCount) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst date = repeatedDates[i];\r\n\r\n\t\t\tlet exception = seriesExceptions[date.valueOf()];\r\n\t\t\tif (exception) {\r\n\t\t\t\tif (exception.deleted) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvisibleCount++;\r\n\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst copy = scheduler._copy_event(ev);\r\n\t\t\t\t//copy._timed = ev._timed;\r\n\t\t\t\tcopy.text = ev.text;\r\n\t\t\t\tcopy.start_date = date;\r\n\t\t\t\tcopy.id = ev.id + \"#\" + Math.ceil(date.valueOf());\r\n\t\t\t\tcopy.end_date = new Date(date.valueOf() + eventDuration * 1000);\r\n\t\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date);\r\n\t\t\t\tcopy._timed = scheduler.isOneDayEvent(copy);\r\n\r\n\r\n\r\n\t\t\t\tif (!copy._timed && !scheduler._table_view && !scheduler.config.multi_day) continue;\r\n\t\t\t\tstack.push(copy);\r\n\r\n\t\t\t\tif (!non_render) {\r\n\t\t\t\t\tscheduler._events[copy.id] = copy;\r\n\t\t\t\t\tscheduler._rec_temp.push(copy);\r\n\t\t\t\t}\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._fix_daylight_saving_date = function (start_date, end_date, ev, counter, default_date) {\r\n\t\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\t\tif (shift) {\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\t// e.g. 24h -> 23h\r\n\t\t\t\treturn new Date(counter.valueOf() + ev.duration * 1000 - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// e.g. 24h -> 25h\r\n\t\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Date(default_date.valueOf());\r\n\t};\r\n\tscheduler.getRecDates = function (id, max) {\r\n\t\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\t\tvar recurrings = [];\r\n\t\tmax = max || 100;\r\n\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\treturn [\r\n\t\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t\t];\r\n\t\t}\r\n\t\tif (ev.deleted) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\t\tvar result = [];\r\n\t\tfor (var i = 0; i < recurrings.length; i++) {\r\n\t\t\tif (!recurrings[i].deleted) {\r\n\t\t\t\tresult.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tscheduler.getEvents = function (from, to) {\r\n\t\tvar result = [];\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tfor (var a in this._events) {\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tif (from && to && ev.start_date < to && ev.end_date > from) {\r\n\t\t\t\t\tvar sev = [];\r\n\t\t\t\t\tthis.repeat_date(ev, sev, true, from, to, undefined, exceptions);\r\n\t\t\t\t\tsev.forEach(function(occurence){\r\n\t\t\t\t\t\tif (occurence.start_date < to && occurence.end_date > from) {\r\n\t\t\t\t\t\t\tresult.push(occurence);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else if(!from && !to){\r\n\t\t\t\t\tresult.push(ev);\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\r\n\t//drop secondary attributes\r\n\tscheduler._copy_dummy = function (ev) {\r\n\t\tvar start_date = new Date(this.start_date);\r\n\t\tvar end_date = new Date(this.end_date);\r\n\t\tthis.start_date = start_date;\r\n\t\tthis.end_date = end_date;\r\n\t\tthis.duration = this.rrule = null;\r\n\t};\r\n\r\n\tscheduler.config.include_end_by = false;\r\n\tscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\tscheduler.config.recurring_workdays = [RRule.MO.weekday,RRule.TU.weekday,RRule.WE.weekday,RRule.TH.weekday,RRule.FR.weekday];\r\n\tscheduler.config.repeat_date = \"%m.%d.%Y\";\r\n\tscheduler.config.lightbox.sections = [\r\n\t\t{ name: \"description\", map_to: \"text\", type: \"textarea\", focus: true },\r\n\t\t{ name: \"recurring\", type: \"recurring\", map_to: \"rec_type\" },\r\n\t\t{ name: \"time\", height: 72, type: \"time\", map_to: \"auto\" }\r\n\t];\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function () {\r\n\t\tscheduler._rec_markers = {}; //clear recurring events data\r\n\t\tscheduler._rec_markers_pull = {};\r\n\t\tscheduler._rec_temp = [];\r\n\t});\r\n\r\n\r\n\tfunction getTopLevelOption(rruleObj, untilDate) {\r\n\t\tconst options = rruleObj.options;\r\n\t\tconst until = options.until || untilDate;\r\n\r\n\t\tconst hasEndCondition = options.count || (until && until.getFullYear() !== 9999);\r\n\r\n\t\tif (hasEndCondition) {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\r\n\t\tif (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'DAILY';\r\n\t\t} else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'WEEKLY';\r\n\t\t} else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'MONTHLY';\r\n\t\t} else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'YEARLY';\r\n\t\t} else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler.config.recurring_workdays.length &&\r\n\t\t\toptions.byweekday.includes(RRule.MO) &&\r\n\t\t\toptions.byweekday.includes(RRule.TU) &&\r\n\t\t\toptions.byweekday.includes(RRule.WE) &&\r\n\t\t\toptions.byweekday.includes(RRule.TH) &&\r\n\t\t\toptions.byweekday.includes(RRule.FR)) {\r\n\t\t\treturn 'WORKDAYS';\r\n\t\t} else {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction getWeekdayOfMonth(date) {\r\n\t\tconst dayOfWeek = date.getDay();\r\n\t\tconst dayOfMonth = date.getDate();\r\n\t\tconst dayNumber = Math.ceil(dayOfMonth / 7);\r\n\t\treturn { dayOfWeek, dayNumber };\r\n\t}\r\n\r\n\r\n\tconst jsDaysToRRULEDays = {\r\n\t\t0: \"SU\",\r\n\t\t1: \"MO\",\r\n\t\t2: \"TU\",\r\n\t\t3: \"WE\",\r\n\t\t4: \"TH\",\r\n\t\t5: \"FR\",\r\n\t\t6: \"SA\"\r\n\t};\r\n\tconst RruleDayNumsToJs = {\r\n\t\t0: 1,\r\n\t\t1: 2,\r\n\t\t2: 3,\r\n\t\t3: 4,\r\n\t\t4: 5,\r\n\t\t5: 6,\r\n\t\t6: 0\r\n\t};\r\n\r\n\tfunction fillCustomDaily(node, rule) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\t}\r\n\r\n\tfunction fillCustomWeekly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`);\r\n\t\tdayCheckboxes.forEach((ch) => ch.checked = false);\r\n\t\tif (rule && rule.byweekday) {\r\n\t\t\trule.byweekday.forEach((day) => {\r\n\t\t\t\tconst dayNum = RruleDayNumsToJs[day.weekday];\r\n\t\t\t\tconst dayLabel = jsDaysToRRULEDays[dayNum];\r\n\t\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst dayLabel = jsDaysToRRULEDays[event.start_date.getDay()];\r\n\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction fillCustomMonthly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfMonth.innerText = scheduler.templates.repeat_monthly_date(event.start_date, event);\r\n\t\tnthWeekDayOfMonth.innerText = scheduler.templates.repeat_monthly_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction formatDayNumber(date){\r\n\t\tswitch (date) {\r\n\t\t\tcase 1:\r\n\t\t\tcase 31:\r\n\t\t\t\treturn `${date}st`;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn `${date}nd`;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn `${date}rd`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${date}th`;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.templates.repeat_monthly_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\treturn `Every ${formatDayNumber(date)}`;\r\n\t};\r\n\tscheduler.templates.repeat_monthly_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`;\r\n\t};\r\n\t\r\n\tscheduler.templates.repeat_yearly_month_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(date)} day of ${monthLabel}`;\r\n\t};\r\n\tscheduler.templates.repeat_yearly_month_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`;\r\n\t};\r\n\r\n\tfunction fillCustomYearly(node, rule, event) {\r\n\t\tconst dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfYear.innerText = scheduler.templates.repeat_yearly_month_date(event.start_date, event);\r\n\t\tnthWeekDayOfYear.innerText = scheduler.templates.repeat_yearly_month_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fillEndRule(node, rule, event) {\r\n\t\tconst countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_after\"]`);\r\n\t\tconst ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_ondate\"]`);\r\n\t\tconst endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`);\r\n\t\tcountInput.value = 1;\r\n\r\n\t\tlet formatter = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tondateInput.value = scheduler.config.repeat_date_of_end;\r\n\r\n\t\tif (rule && rule.count) {\r\n\t\t\tendOptionSelect.value = \"AFTER\";\r\n\t\t\tcountInput.value = rule.count;\r\n\t\t} else if (event._end_date && event._end_date.getFullYear() !== 9999) {\r\n\t\t\tendOptionSelect.value = \"ON\";\r\n\t\t\tondateInput.value = formatter(event._end_date);\r\n\t\t} else {\r\n\t\t\tendOptionSelect.value = \"NEVER\";\r\n\t\t}\r\n\t\tendOptionSelect.dispatchEvent(new Event(\"change\"));\r\n\t}\r\n\r\n\tconst getRecValue = {\r\n\t\tMONTHLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.MONTHLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWEEKLY: function (dates) {\r\n\t\t\tlet day = dates.start.getDay() - 1;\r\n\t\t\tif (day == -1) day = 6;\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: [day]\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tDAILY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.DAILY,\r\n\t\t\t\tinterval: 1\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tYEARLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.YEARLY,\r\n\t\t\t\tbymonth: dates.start.getMonth() + 1,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWORKDAYS: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: scheduler.config.recurring_workdays\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tCUSTOM: function (dates, node) {\r\n\t\t\tconst rrule = {};\r\n\t\t\tconst freq = node.querySelector(`[name=\"repeat_interval_unit\"]`).value;\r\n\t\t\tconst interval = Math.max(1, node.querySelector(`[name=\"repeat_interval_value\"]`).value);\r\n\t\t\tconst monthRepeat = node.querySelector(`[name=\"dhx_custom_month_option\"]`).value;\r\n\t\t\tconst yearRepeat = node.querySelector(`[name=\"dhx_custom_year_option\"]`).value;\r\n\r\n\t\t\trrule.interval = interval;\r\n\t\t\tlet days;\r\n\t\t\tlet day;\r\n\r\n\t\t\tswitch (freq) {\r\n\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\trrule.freq = RRule.DAILY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WEEKLY\": \r\n\t\t\t\t\trrule.freq = RRule.WEEKLY;\r\n\t\t\t\t\tdays = [];\r\n\t\t\t\t\tnode.querySelectorAll(`.dhx_form_repeat_custom_week [name=\"week_day\"]`).forEach((ch) => {\r\n\t\t\t\t\t\tif(ch.checked){\r\n\t\t\t\t\t\t\tdays.push(ch.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trrule.byweekday = days.map((day) => {\r\n\t\t\t\t\t\tswitch (day) {\r\n\t\t\t\t\t\t\tcase \"MO\":\r\n\t\t\t\t\t\t\t\treturn RRule.MO.weekday;\r\n\t\t\t\t\t\t\tcase \"TU\":\r\n\t\t\t\t\t\t\t\treturn RRule.TU.weekday;\r\n\t\t\t\t\t\t\tcase \"WE\":\r\n\t\t\t\t\t\t\t\treturn RRule.WE.weekday;\r\n\t\t\t\t\t\t\tcase \"TH\":\r\n\t\t\t\t\t\t\t\treturn RRule.TH.weekday;\r\n\t\t\t\t\t\t\tcase \"FR\":\r\n\t\t\t\t\t\t\t\treturn RRule.FR.weekday;\r\n\t\t\t\t\t\t\tcase \"SA\":\r\n\t\t\t\t\t\t\t\treturn RRule.SA.weekday;\r\n\t\t\t\t\t\t\tcase \"SU\":\r\n\t\t\t\t\t\t\t\treturn RRule.SU.weekday;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\trrule.freq = RRule.MONTHLY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (monthRepeat === \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\trrule.freq = RRule.YEARLY;\r\n\t\t\t\t\trrule.bymonth = dates.start.getMonth() + 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (yearRepeat == \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tlet until = new Date(9999, 1, 1);\r\n\t\t\tconst endRule = node.querySelector(`[name=\"dhx_custom_repeat_ends\"]`);\r\n\t\t\tif(endRule === \"ON\"){\r\n\t\t\t\tuntil = node.querySelector(`[name=\"dhx_form_repeat_ends_ondate\"]`).value;\r\n\t\t\t} else if(endRule === \"AFTER\") {\r\n\t\t\t\trrule.count = Math.max(1, node.querySelector(`[name=\"dhx_form_repeat_ends_after\"]`).value);\r\n\t\t\t}\r\n\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tNEVER: function () {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction fillInDefaults(node, rule, event) {\r\n\t\tfillCustomDaily(node, rule, event);\r\n\t\tfillCustomWeekly(node, rule, event);\r\n\t\tfillCustomMonthly(node, rule, event);\r\n\t\tfillCustomYearly(node, rule, event);\r\n\t\tfillEndRule(node, rule, event);\r\n\t}\r\n\tscheduler.form_blocks[\"recurring\"] = {\r\n\t\trender: function (sns) {\r\n\t\t\tif (sns.form) {\r\n\t\t\t\tlet rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\t\tlet form = rec._get_node(sns.form);\r\n\t\t\t\tlet html = rec._outer_html(form);\r\n\t\t\t\tform.style.display = 'none';\r\n\t\t\t\treturn html;\r\n\t\t\t}\r\n\t\t\tlet loc = scheduler.locale.labels;\r\n\r\n\t\t\treturn `
\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
${loc.repeat_ends}
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t
\r\n\t
`;\r\n\t\t},\r\n\r\n\t\r\n\t\t_init_set_value: function (node, value, event) {\r\n\t\t\tscheduler.form_blocks[\"recurring\"]._ds = { start: event.start_date, end: event.end_date };\r\n\t\t\tfunction hide(node) {\r\n\t\t\t\tnode.classList.add(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction show(node) {\r\n\t\t\t\tnode.classList.remove(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction onRepeatOptionChange(value) {\r\n\t\t\t\tconst repeat = node.querySelector(\".dhx_form_repeat_custom\");\r\n\t\t\t\tif (value === \"CUSTOM\") {\r\n\t\t\t\t\tshow(repeat);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thide(repeat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatIntervalChange(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tweekly: node.querySelector(\".dhx_form_repeat_custom_week\"),\r\n\t\t\t\t\tmonthly: node.querySelector(\".dhx_form_repeat_custom_month\"),\r\n\t\t\t\t\tyearly: node.querySelector(\".dhx_form_repeat_custom_year\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"WEEKLY\":\r\n\t\t\t\t\t\tshow(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\tshow(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\tshow(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatEndRule(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tafter: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after\"),\r\n\t\t\t\t\ton: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"NEVER\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AFTER\":\r\n\t\t\t\t\t\tshow(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ON\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\tshow(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// repeat section change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").addEventListener(\"change\", function () {\r\n\t\t\t\tonRepeatOptionChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat interval change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_custom_interval [name='repeat_interval_unit']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatIntervalChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat end rule\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatEndRule(this.value);\r\n\t\t\t});\r\n\r\n\t\t\tscheduler._lightbox._rec_init_done = true;\r\n\t\t},\r\n\t\tbutton_click: function(){},\r\n\t\tset_value: function (node, value, ev) {\r\n\t\t\tlet rf = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\t\trf._init_set_value(node, value, ev);\r\n\t\t\tnode.open = !ev.rrule;\r\n\r\n\t\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\t\tlet ds = rf._ds;\r\n\t\t\tds.start = ev.start_date;\r\n\t\t\tds.end = ev._end_date;\r\n\r\n\t\t\tif (ev.rrule) {\r\n\t\t\t\tconst rruleset = rrulestr(ev.rrule);\r\n\t\t\t\tfillInDefaults(node, rruleset.origOptions, ev);\r\n\t\t\t\tconst topOption = getTopLevelOption(rruleset, ev._end_date);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = topOption;\r\n\t\t\t\tif(topOption === \"CUSTOM\"){\r\n\t\t\t\t\tlet customFreq;\r\n\t\t\t\t\tswitch (rruleset.origOptions.freq) {\r\n\t\t\t\t\t\tcase RRule.DAILY:\r\n\t\t\t\t\t\t\tcustomFreq = \"DAILY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.WEEKLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"WEEKLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.MONTHLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"MONTHLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.YEARLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"YEARLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(customFreq){\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).value = customFreq;\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).dispatchEvent(new Event(\"change\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t//\trepeat_interval_unit\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tfillInDefaults(node, null, ev);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = \"NEVER\";\r\n\t\t\t}\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").dispatchEvent(new Event(\"change\"));\r\n\r\n\t\t},\r\n\t\tget_value: function (node, ev) {\r\n\t\t\t\r\n\t\t\tif(!node.blocked && node.querySelector(\".dhx_form_repeat_pattern select\").value !== \"NEVER\") {\r\n\t\t\t\tlet ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\t\tlet actual_dates = {};\r\n\r\n\t\t\t\tlet timeControl = getTimeSection();\r\n\r\n\t\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\t\tds.start = actual_dates.start_date;\r\n\t\t\t\tconst pattern = node.querySelector(\".dhx_form_repeat_pattern select\").value;\r\n\t\t\t\tconst recurrence = getRecValue[pattern](ds, node);\r\n\t\t\t\tev.rrule = new RRule(recurrence.rrule).toString().replace(\"RRULE:\", \"\");\r\n\t\t\t\tds.end = recurrence.until;\r\n\r\n\t\t\t\tev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1000);\r\n\r\n\t\t\t\tif (ds._start) {\r\n\t\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\t\tds._start = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._start_date = null;\r\n\r\n\t\t\t\tev._end_date = ds.end;\r\n\t\t\t}else{\r\n\t\t\t\tev.rrule = ev.rrule = \"\";\r\n\t\t\t\tev._end_date = ev.end_date;\r\n\t\t\t}\r\n\r\n\t\t\treturn ev.rrule;\r\n\t\t},\r\n\r\n\t\tfocus: function (node) {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction getTimeSection() {\r\n\t\tlet timeControl = scheduler.formSection('time');\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('time');\r\n\t\t}\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t\t}\r\n\r\n\r\n\t\tif (!timeControl) {\r\n\t\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\t\t\t\t\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\t\t\t\t\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\t\t\t\t\"\",\r\n\t\t\t\t\"scheduler.config.lightbox.sections = [\",\r\n\t\t\t\t\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n\t\t\t\t.join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\treturn timeControl;\r\n\t}\r\n\r\n\tfunction getFirstSectionOfType(type) {\r\n\t\tfor (let i = 0; i < scheduler.config.lightbox.sections.length; i++) {\r\n\t\t\tlet section = scheduler.config.lightbox.sections[i];\r\n\t\t\tif (section.type === type) {\r\n\t\t\t\treturn scheduler.formSection(section.name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar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\t\t\t''+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\tloc.select_year_day2+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t''+loc.repeat_text_occurences_count+'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_year_grid= function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;"],"names":["global$1","window","global","dragHighlightPos","scheduler","dndMarkers","dragStarted","eventNode","event","isEnabled","config","drag_highlight","markTimespan","checkViewName","viewName","viewObj","getView","layout","createMarkerConfig","configSettings","sectionId","style","top","left","marginLeft","sections","markerObject","start_date","end_date","css","html","date","add","createViewMarker","settings","markerConfigs","monthViewMarkersArray","weekDates","currDate","Date","valueOf","obj","push","week_start","cells","$container","querySelectorAll","event_attribute","id","i","length","cloneNode","unitMarkersArray","sectionPropertyName","y_property","map_to","multisection","formatedSections","String","split","section_delimiter","map","element","elems","columnViewMarkersArray","eventNodes","eventNodeClone","getAttribute","forEach","cfg","attachEvent","mode","e","getEvent","target","closest","getState","cascade_event_display","unselect","getActionData","section","n","unmarkTimespan","limitPlugin","mark_now","display_marked_timespans","overwrite_marked_timespans","dhx_time_block","default_timespan_type","get_resulting_options","days","zones","options","type","getZones","ev","timespans","day_index","day_value","timespan_type","s","containers","_props","matrix","container","property","view","linker","_add_timespan_zones","_get_blocked_zones","blockTime","addMarkedTimespan","unblockTime","deleteMarkedTimespan","checkInMarkedTimespan","on_overlap","res","temp_start_date","temp_end_date","_marked_timespans","date_part","getDay","eventStart","_get_zone_minutes","eventEnd","getDate","markerStart","markerEnd","checkLimitViolation","check_limits","c","evs","rec_type","_end_date","seriesEnd","limit_start","limit_end","complete_res","p","_timed","isOneDayEvent","allow","_drag_id","_drag_mode","setHours","setMinutes","checkEvent","callEvent","timeline_zones","blocked_timeline_zones","this","_get_relevant_blocked_zones","resultZones","concat","_mark_now","hide","dhx_now_time","_els","now","_currentDate","_remove_mark_now","_max_date","_min_date","getHours","first_hour","last_hour","locate_holder_day","_append_mark_now","zone_start","_table_view","_mode","start_index","end_index","units_l","size","position","r_divs","t_day","t_div","_render_marked_timespan","els","div","parent","parentNode","removeChild","getMinutes","_prepare_timespan_options","r_configs","temp_configs","Array","t_days","slice","cloned_config","_lame_clone","apply","invert_zones","invertZones","uid","view_key","hasOwnProperty","ids","t_config","_lame_copy","k","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","index","start","end","dates","start_day","delta","t_date","_get_css_classes_by_config","css_classes","join","_get_block_by_config","block","document","createElement","innerHTML","appendChild","area","day","blocks","min_date","max_date","date_to_display","min_day","areas","d","_scales","sday","_cols","_ignores","block_proto","className","height","width","order","inner_index","locate_holder","Math","max","min","all_hours_height","hour_size_px","hour_ms","round","_mark_timespans","data","divs","_on_scale_add_marker","len","childNodes","firstChild","_getClassName","indexOf","configuration","Error","rebuild_els","get_elements","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","offset","splice","_subtract_timespan_zones","is_modified","_","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","arguments","types","t","typedConfig","_get_types_to_render","common","specific","types_to_render","_get_configs_to_render","units","unit","_get_unit_index","day_ind","unitsPerDay","floor","_date","key","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","src","dblclick_create","addEventNow","createMethod","methods","isActive","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","call","restoreMethods","batchUpdatePayload","callback","console","error","$stateProvider","registerProvider","batch_update","noRedraw","dp_mode","call_dp","_dp","updateMode","setUpdateMode","calls","setModeDate","needRender","needUpdateView","repaintEvents","rememberModeDate","render","setCurrentView","updateView","render_data","render_view_data","updateEvent","sendData","initPlugins","deletedEvent","copy","undo_deleted","new_event","message","text","expire","addEvent","limit","batchUpdate","uidSeed","isDate","getFullYear","getMonth","utils","mixin","source","force","f","object","result","isArray","pop","Function","prototype","toString","constructor","Number","Boolean","varType","Object","defined","delay","timeout","timer","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","extend","cssClass","classList","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","isCalendarVisible","destroyCalendar","renderCalendar","navigation","handler","calendar","html_element","renderElement","renderer","rows","cols","value","align","justifyContent","prepareConfig","renderLayout","items","fragment","createDocumentFragment","next","_init_nav_bar","navBar","querySelector","_update_nav_bar","previousHeight","heightChanged","newHeight","xy","nav_height","unset_actions","set_actions","display","isAttachedNode","root","body","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","listenWindowResize","resizeDelay","oldSize","$destroyed","a","b","newSize","triggerSchedulerResize","$root","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","contentWindow","EventHost","_silent_mode","listeners","_silentEnd","createEventStorage","handlers","eventStorage","combinedResult","handlerResult","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","attachAll","name","eventArguments","handlerName","detachEvent","list","eventId","detachAllEvents","defaultDomEvents","el","addEventListener","eventRemove","removeEventListener","domEvents","eventScope","attach","capture","detach","detachAll","staticArray","createEventScope","_eventRemoveAll","_createDomEventScope","_trim","str","trim","replace","_isDate","_isObject","getClassName","node","baseVal","locateCss","classname","strict","trg","srcElement","ind","charAt","right","isVisible","visibility","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","isNaN","hasHref","nodeName","loLowerCase","input","select","textarea","hasAttribute","isShadowDomSupported","head","createShadowRoot","attachShadow","getRootNode","ShadowRoot","host","dom_helpers","getAbsoluteLeft","htmlObject","getOffset","getAbsoluteTop","getOffsetSum","elem","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetRect","box","getBoundingClientRect","test","navigator","userAgent","dummy","dummyBox","docElem","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","selector","insertAfter","newNode","referenceNode","nextSibling","insertBefore","remove","isChildOf","child","contains","getFocusableNodes","nodes","nodesArray","$position","sort","hasShadowParent","getActiveElement","activeElement","shadowRoot","getSelection","focusNode","getRelativeEventPosition","bottom","y","x","clientX","clientY","getTargetNode","tagName","composedPath","getNodePosition","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isIE","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialize$1","serialized","encodeURIComponent","JSON","stringify","generateStringToDate","format","utc","splt","mask","match","code","csp_str_to_date","set","temp","locale","month_short_hash","month_full_hash","UTC","cspEnabled","useCsp","csp","undefined","init","month_short","month_full","old","setSeconds","setMilliseconds","setTime","getTime","time_part","getTimezoneOffset","shift","start_on_monday","month_start","setDate","year_start","setMonth","day_start","_add_days","inc","ndate","rest","hours","setYear","to_fixed","num","date_to_str","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","parseYMD","parseMDY","parseDMY","dateString","parse_exact_format","datestr","nday","first_thursday","year_number","ordinal_date","convert_to_utc","getSerializator","_events","_loaded","_load","url","from","_load_url","to","prevent_cache","_load_mode","lf","templates","load_format","cache_line","temp_to","ajax","get","ajaxCallback","response","on_load","_parsers","xml","canParse","xhr","responseXML","xmlDoc","parse","responseText","topElement","xmltop","loader","csrfToken","dhtmlx","security_key","opts","xpath","arr","serverList","itms","j","attrs","attributes","label","attr","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","err","events","dhx_security","collections","collections_loaded","collection","option","option_key","ical","RegExp","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","parse_date","dh","dm","utcMark","dy","dn","dd","server_utc","foundParser","parser","_process","status","_process_loading","_loading","_not_render","_render_wait","_after_call","_tagvalue","_init_date","_helpers","parseDate","getSerializableData","createSerializator","serialize","dataset","allEvents","exportedEvent","exportValue","rawValue","xml_format","format_date","load","setLoadMode","array","show_loading","_x","_y","_obj","_init_touch_events","touch","MSStream","platform","maxTouchPoints","scroll_width","_mobile","touchEventsSupported","createEvent","_touch_events","touches","pageX","pageY","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","names","accessor","ignore","tracker","drag_mode","scroll_mode","action_mode","dblclicktime","attachTouchEvent","_is_lightbox_open","passive","drag_cancel","_hide_global_tip","_on_mouse_up","_temp_touch_block","_drag_pos","_pointerDragId","acc","dnd","timeline","original_render","drag_id","getEvents","_sorder","_count","_on_mouse_move","preventDefault","cancelBubble","_update_global_tip","abs","fake_event","pointerId","_click","dhx_cal_data","_on_dbl_click","_block_next_stop","touch_drag","actTask","_locate_event","fakeTask","sourceTask","_ignore_next_click","previousSibling","_on_mouse_down","for_rendered","_rendered","touch_tip","_show_global_tip","touch_swipe_dates","s_ev","e_ev","step","max_dy","scrollable","dx","dhx_cal_next_button","dhx_cal_prev_button","toptip","_global_tip","time","event_header","day_date","labels","drag_to_create","drag_to_move","calculatedMaterial","cachedBorderBoxValue","checkIfBorderBoxStyling","_is_material_skin","probe","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","flatSkinHourScale","_addThemeClass","skin","_skin_settings","use_select_menu_space","wide_form","displayed_event_color","displayed_event_text_color","_skin_xy","lightbox_additional_height","bar_height","_build_skin_info","clearInterval","monitorIntervalId","setInterval","csstheme","setSkin","styles","themeVar","themeName","isCssVarTheme","cssValues","oldMaterialTheme","links","getElementsByTagName","href","themeNameFromFile","_theme_info","theme","cssVarTheme","values","themeVariables","_configure","col","_skin_init","hour_scale","hour_date","_old_month_day","month_day","old_month_day","dhx_cal_today_button","tab","header","tabs","specialTabs","tabName","find","filter","firstTab","reverse","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_new_event","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","deleteEvent","_add_rec_marker","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","which","keyCode","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","_waiAria","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","title","content","message_ok","message_cancel","buttons","btn","getElementById","hidden","focus","alertPopup","confirmPopup","boxPopup","box_params","params","focusable","messageInfoAttr","timers","pull","seed","hideAll","popups","alert","confirm","modalbox","setTransactionMode","total","headers","payload","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","val","_columns","getSyncState","enableDataNames","enablePartialDataSend","_changed","master","rowId","state","findRow","existing","getUserData","set_invalid","is_invalid","markRow","_methods","details","getActionByState","checkBeforeUpdate","editStop","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","stack","keys","pref","_applyPayload","urlSeparator","dataToSend","self","queryParams","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","method","preprocessedData","_cleanupItemBeforeSend","action","query","_onResolvedCreateUpdate","tag","resultState","setRequestHeader","sid","tid","afterUpdateCallback","routerMode","actionPromise","create","delete","update","then","catch","valid","_forEachUpdatedRow","_getAllData","out","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","_is_virtual_event","_set_event_text_style","r","cssText","event_updated","rec_pattern","_dp_change_event_id","new_id","changeEventId","_dp_hook_delete","setDp","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","func","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","destructor","processedData","updatedItem","output","_prepareDataItem","item","processedItem","formatDate","dataItem","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","icon_details","icon_edit","icon_delete","confirm_closing","confirm_deleting","section_description","section_time","full_day","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","prev","year","month","hour","minute","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","repeat_never","repeat_daily","repeat_workdays","repeat_weekly","repeat_monthly","repeat_yearly","repeat_custom","repeat_freq_day","repeat_freq_week","repeat_freq_month","repeat_freq_year","repeat_on_date","repeat_ends","month_for_recurring","day_for_recurring","be","agenda_tab","description","year_tab","week_agenda_tab","ca","cn","cs","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","direction","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","maxDate","labelFormat","dayElement","weeks","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","stateProviders","internal","provider","unregisterProvider","stateProvider","commonViews","agenda","grid","week_agenda","anythingElse","requiredExtensions","_commonErrorMessages","unknownView","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","exportToPNG","exportToPDF","nav_bar","_detachDomEvent","_init_once","scheduler_resize_listener","hasSchedulerMarkup","wai_aria_application_role","views","_grid","log","rtl","_scroll","init_templates","set_sizes","$initialized","min_event_height","scale_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","edit_save","edit_cancel","functor","scale_x","materialScalePlaceholder","set_xy","_lightbox","_setLbPosition","_data_width","prepareValue","prepared","class_name","attr_value","labelAttr","domEventsScope","getDaysDifference","startDate","endDate","differenceInDays","_select_id","_close_not_saved","previousSelection","editor_id","_edit_id","lightbox_id","_lightbox_id","select_id","expanded","readonly","icon","def_step","dhx_cal_tab","deprecated_name","substring","_dhtmlx_confirm","title_confirm_deleting","edit","save","showLightbox","form","base","duration","event_duration","time_step","start_hour","_drag_event","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","_colsS","$domHelpers","dataArea","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","title_confirm_closing","positive_closing","_correct_shift","back","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","has_moved","_correct_drag_start_date","_start_correction","_end_correction","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","maxY","precisePos","minDate","preciseDate","cursor","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","_allow_dnd","update_render","sx","update_view","drag_event_body","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","moved","_dhx_changed","is_new","edit_on_create","details_on_create","_trigger_dyn_loading","_reset_ignores","_reset_scale","isViewExists","_set_aria_buttons_attrs","buttonGroups","group","headerButtonsAttributes","icon_form","oldClass","newClass","multidayScroll","dhx_multi_day","prev_scroll","preserve_scroll","_dy_shift","headerToggleState","_render_x_header","offset_top","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","count","count_n","_get_timeunit_start","_get_view_end","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","scales","cls","firstHalf","slotDate","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","_getNavDateElement","drag_resize","drag_move","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","totalWidth","col_length","hiddenWidth","c2","cc","hourScaleAttr","scroll_hour","now_date","preserve","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","cellBody","bf1","getLabel","lightbox","updateCollection","list_name","resetLightbox","hideCover","cache","n_ev","_focus","endColumnIndex","eventLength","startColumnIndex","_get_date_index","last_column","check","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","end_slot","fd","start_slot","_get_section_property","_is_initialized","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","setAttributes","role","getHeaderCellAttr","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","agendaDetailsBtnString","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","buttonLabel","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","dom","assert","show_errors","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","$","counter","Promise","clearAll","createConfig","async","serializeRequestParams","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","xpathExp","docObj","selectNodes","first","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","readyState","filePath","open","toUpperCase","send","$ajax","default_date","month_date","load_date","week_date","date_format","api_date","day_column_padding","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","quick_info_detached","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","ajax_error","delay_render","timeline_swap_resize","$initial","xml_date","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","clear_view","extra_data","silent","setEvent","hash","create_getter","create_setter","is_visible_events","clear_event","evFirstHour","evLastHour","lastHour","checkEndDate","get_visible_events","only_timed","filter_event","_is_main_area_event","hold","full","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","_get_event_bar_pos","widt","x2","_pre_render_events","render_event_bar","max_evs","max_month_events","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_table","_pre_render_events_line","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","weekCellIndex","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","zIndex","color","setProperty","tplClass","_editor","shiftKey","ariaAttr","icons","icons_str","currentIcon","textColor","highlightEventPosition","contentA","contentB","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","getSectionTop","posFromDate","_smartRenderingEnabled","restoreOriginalColors","scrollTo","_append_drag_marker","m","scale","lastChild","_update_marker_position","getLightboxRoot","cspEnvironment","salesforceEnvironment","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","dt","last","limit_time_select","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","inputBlock","fallback","inputId","old_id","getRootView","hooks","didInsert","cmp","skins","jQuery","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","oldDate","oldMode","updateFlags","lazy_updateView","ars","createDataProcessor","tMode","dhtmlxError","catchError","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","addPlugins","ext","activePlugins","plugins","extensionList","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","ExtensionsManager","_extensions","attaches","attachScheduler","_genStr","attachObject","vs","av","sched","schedId","setSizes","_viewRestore","notImplemented","modals","modalsStack","isModal","afterPopup","trapFocus","currentTarget","$keyboardNavigation","_keyNavMessagePopup","focusElement","backupFocus","key_nav_legacy","_temp_key_scope","key_nav","_pasteDate","_pasteSection","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","dispatcher","copyEvent","_make_pasted_event","event_pid","event_length","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","ctrlKey","metaKey","_buffer_event","_key_nav_copy_paste","getActiveNode","new_ev","scheduler_handlers","attachSchedulerHandlers","waitCall","keyDownHandler","focusHandler","keepScrollPosition","focusGlobalNode","enable","reFocusActiveNode","activeNode","isValid","MinicalButton","MinicalCell","mousedownHandler","dataAreaClick","listOfScales","some","Event","TimeSlot","nextSlot","setActiveNode","removeAttribute","evNode","prevState","lastStart","lastEnd","lastSection","getNode","GoogleMapAdapter","_markers","zoom","zoom_after_resolve","initial_zoom","lat","lng","setCenter","setZoom","error_position","google","maps","trigger","mapOptions","center","initial_position","mapId","scrollwheel","mapTypeId","Map","__gm","messageOverlay","outerContainer","setOptions","addListener","geocoder","Geocoder","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","event_location","formatted_address","clearInstanceListeners","AdvancedMarkerElement","importLibrary","mapView","createMarker","setMap","infoWindow","close","InfoWindow","maxWidth","info_window_max_width","setContent","map_info_content","anchor","markerInfo","setVisible","setPosition","latlng","LatLng","clearEventMarkers","latitude","longitude","string","address","OpenStreetMapAdapter","openPopup","closeTooltip","setView","mapWrapper","L","tileLayer","addTo","on","fetch","country","myIcon","iconUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupConfig","minWidth","markerPopup","popup","tooltip","markerConfig","bindPopup","bindTooltip","removeLayer","setLatLng","lon","MapboxAdapter","getPopup","isOpen","togglePopup","mapboxgl","accessToken","lngLat","features","place_name","Popup","focusAfterOpen","setMaxWidth","setHTML","Marker","setLngLat","setPopup","resolveAddress","ALL_WEEKDAYS","Weekday","weekday","fromStr","nth","equals","other","getJsWeekday","isPresent","isNumber","isWeekdayStr","includes","rang","repeat","times","padStart","targetLength","padString","sep","splits","pymod","divmod","mod","empty","notEmpty","datetime","MONTH_DAYS","ONE_DAY","MAXYEAR","ORDINAL_BASE","PY_WEEKDAYS","isLeapYear","isValidDate","toOrdinal","date2","differencems","fromOrdinal","ordinal","getMonthDays","getWeekday","monthRange","combine","getMilliseconds","clone","cloneDates","clones","timeToUntilString","untilStringToDate","until","bits","dateTZtoISO8601","timeZone","IterResult","_result","before","after","accept","tooEarly","tooLate","extendStatics","setPrototypeOf","__proto__","__extends","TypeError","__","__assign","assign","__spreadArray","pack","l","Frequency","CallbackIterResult","_super","iterator","_this","ENGLISH","dayNames","monthNames","tokens","SKIP","number","numberAsText","every","at","the","second","third","for","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","may","june","july","august","september","october","november","december","comma","defaultGetText","defaultDateFormatter","ToText","rrule","gettext","language","dateFormatter","origOptions","bymonthday","bynmonthday","byweekday","allWeeks","someWeeks","isWeekdays","isEveryDay","sortWeekDays","isFullyConvertible","freq","IMPLEMENTED","RRule","FREQUENCIES","plural","HOURLY","MINUTELY","DAILY","bymonth","_bymonth","_bymonthday","_byweekday","byhour","_byhour","WEEKLY","MONTHLY","YEARLY","byyearday","byweekno","weekdaytext","monthtext","npos","wday","finalDelim","delim","o","realCallback","delimiter","finalDelimiter","Parser","rules","done","nextSymbol","isDone","symbol","best","bestSymbol","name_1","v","acceptNumber","expect","parseText","ttr","AT","F","MO","TU","WE","TH","FR","ON","wkd","decodeWKD","decodeNTH","decodeM","freqIsDailyOrGreater","fromText","Time","millisecond","DateTime","fromDate","getYear","addYears","years","addMonths","yearDiv","monthMod","addWeekly","wkst","fixDay","addDaily","addHours","filtered","_a","dayDiv","hourMod","addMinutes","minutes","byminute","hourDiv","minuteMod","addSeconds","seconds","bysecond","minuteDiv","secondMod","daysinmonth","SECONDLY","initializeOptions","_i","keys_1","defaultKeys","parseOptions","DEFAULT_OPTIONS","byeaster","dtstart","bysetpos","bynweekday","parsedOptions","parseString","rfcString","parseLine","parseDtstart","line","dtstartWithZone","tzid","parseRrule","Days","parseIndividualNumber","optionKey","parts","SyntaxError","wdaypart","DateWithZone","RangeError","defineProperty","enumerable","configurable","isUTC","rezonedDate","localTimeZone","Intl","DateTimeFormat","resolvedOptions","dateInLocalTZ","tzOffset","optionsToString","outValue","buildDtstart","strValues","ruleString","argsMatch","Cache","all","between","_cacheAdd","what","_value","_cacheGet","cached","argsKeys","findCacheDiff","cachedObject","iterResult","M365MASK","M366MASK","M28","M29","M30","M31","MDAY366MASK","MDAY365MASK","NM28","NM29","NM30","NM31","NMDAY366MASK","NMDAY365MASK","M366RANGE","M365RANGE","WDAYMASK","wdaymask","rebuildYear","firstwkst","wyearlen","firstyday","yearlen","nextyearlen","yearordinal","yearweekday","mmask","mdaymask","nmdaymask","mrange","wnomask","no1wkst","numweeks","lnumweeks","lyearweekday","lno1wkst","lyearlen","weekst","Iterinfo","rebuild","lastyear","yearinfo","lastmonth","monthinfo","nwdaymask","ranges","eastermask","g","yearStart","ydayset","mdayset","wdayset","ddayset","htimeset","mtimeset","stimeset","getdayset","gettimeset","buildPoslist","timeset","ii","dayset","poslist","daypos","timepos","tmp","iter","emitResult","counterDate","millisecondModulo","removeFilteredDays","rezoneIfNeeded","currentDay","isFiltered","dayCounter","SA","SU","noCache","_cache","fromString","_iter","toText","isFullyConvertibleToText","unfold","forceset","compatible","parseInput","rrulevals","rdatevals","exrulevals","exdatevals","parsedDtstart","lines","_b","parms","rdateTzid","parseRDate","rrulestr","rset_1","RRuleSet","groomRruleOptions","rdate","exrule","exdate","rdateval","parm","createGetterSetter","fieldName","field","_rrule","field_1","_rdate","_exrule","_exdate","_exdateHash","_accept","evalExdate","zonedDate","_addRule","_addDate","rrules","exrules","rdates","exdates","_dtstart","rdatesToString","rrs","rule","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","viewport","_getViewPortSize","tooltipNode","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","_getViewPort","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","hideTooltip","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","delayShow","utils.default","show","tooltip_timeout","tooltip_hide_timeout","gplExtensions","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","_agendaScrollTop","agenda_area","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","rowAttr","dateHeader","descriptionHeader","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","renderDay","calendarEvent","selectedId","all_timed_month","is_event_short","_safe_copy","proto","isPrototypeOf","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","_setTempSection","event_id","collision_limit","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","evs_dates","getRecDates","tevs","concurrent","checked_mode","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","year_y","cur_height","week_agenda_scale_height","eventsContainer","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","cookie_param","old_load","drag_between","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","selected_id","addOption","disable","selectOption","setComboValue","all_options","single_option","getIndexByValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","getTimeline","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","info","_plain_export_copy","$text","_create_hidden_form","submit","_hidden_export_form","_get_export_size","footer","A5","A4","A3","A2","A1","A0","dataX","cSize","parseFloat","smartRendering","initialSizes","smart_rendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","grid_view","html_templates","getScope","scopes","minicalButton","minicalDate","SchedulerNode","DataArea","timeSlot","searchMap","key_nav_step","addShortcut","shortcut","scope","scopeObject","getShortcutHandler","commands","shortcuts","findHandler","removeShortcut","unbind","disp","setDefaultNode","_compose","createCommand","modifiers","alt","ctrl","meta","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","doAction","returnValue","bindAll","initKeys","nextItem","currentFocus","currentIndex","renderMultiple","currentStart","currentEnd","_modes","_getMode","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","round_position","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","tempStart","tempEnd","_timeline_getX","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","lineHeight","getDefaultNode","getMode","blur","_compareEvents","_pickEvent","startId","nextEventHandler","nextEvent","currEvent","visibleDates","nextEv","prevEventHandler","HeaderCell","getNodes","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","defaultCell","_getSection","_getNodes","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","_moveToSlot","slot","movingDate","getDefaultDate","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","timeslot","_getMultisectionView","_getNextSection","nextIndex","defaultSlot","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","globalNode","_getGrid","_getNode","enabled","newRow","newCol","blurNode","editor","defaultPrevented","schedulerNode","_timeout","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","cellIndex","td","renderMinical","cal","added","destroyMinical","_def_count","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_view","_temp_limit_scope","om","od","nm","nd","isBlocked","date_end","resetDate","is_new_event","data_copy","native_object","_mark_now_timer","map_view","mapAdapter","eventHandlerIds","adapters","googleMap","openStreetMaps","mapbox","setupMapView","createAdapter","unmodifiedEvent","_eventLocationChanged","map_settings","resolve_event_location","_latLngUpdate","addEventWithLocation","updateEventMarker","newIdEvent","removeEventMarker","addEventMarker","onEventClick","coordinates","map_view_provider","currentAdapter","resolve_user_location","view_provider","map_initial_position","map_error_position","map_date_width","map_icon_width","map_description_width","add_map","map_date","map_time","map_text","map_start","dblclick_dhx_map_area","map_initial_zoom","map_zoom_after_resolve","map_infowindow_max_width","map_resolve_user_location","map_type","map_resolve_event_location","fill_map_tab","_selected_event_id","ariaButtonAttr","map_end","mapContainer","adapter","elem_id","marginRight","marginTop","destroy","initialize","geolocation","getCurrentPosition","coords","_updateEventLocation","_event_resolve_delay","ret","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","_render_calendar","unmarkCalendar","cont","tpos","_get_def_cont","$dom","dateAttribute","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","calendars","arrow","dayHeaders","dayCells","inputs","selects","inp","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","monthheight","old_s","multiselect","_children","_mark_inputs","_ids","script_url","divLoading","multisource","mvc","update_timer","use_id","sanitize","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","last_event","dragger","dhtmlDragAndDropObject","stopDrag","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_end","xml_top","profile","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","to_pdf","objects","getPDFData","toPDF","toPDFRange","quick_info","show_quick_info","clickedElementPosition","fitQIInsideWindow","quickInfoPopup","popupRect","offsetBottom","getPositionInsideScheduler","_$quickInfoHandler","eventElement","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","ontransitionend","_quick_info_onscroll_handler","$testmode","_qi_button_click","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","txt_replace","txts","txtt","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","originalForm","readonlyForm","_lightbox_r","clearMilliseconds","isSeries","recurring_event_id","old_add_event","groupExceptions","exceptions","original_start","_rec_temp","_rec_markers_pull","_rec_markers","_pid_time","_get_rec_marker","ch","_get_rec_markers","ev_id","_ignore_call","tev","_pid_changed","_is_modified_occurence","idTimestamp","nid","nev","sub","isEventFound","_start_date","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","repeat_date","old_update_event","toIcalString","getWeekdayOfMonth","dayOfWeek","dayOfMonth","dayNumber","non_render","maxCount","seriesExceptions","utcStart","repeatedDates","adjustedDate","visibleCount","eventDuration","exception","_fix_daylight_saving_date","recurrings","sev","occurence","include_end_by","recurring_workdays","jsDaysToRRULEDays","RruleDayNumsToJs","formatDayNumber","repeat_monthly_date","repeat_monthly_weekday","nthDayOfMonth","repeat_yearly_month_date","repeat_yearly_month_weekday","getRecValue","WORKDAYS","CUSTOM","monthRepeat","yearRepeat","endRule","NEVER","fillInDefaults","dayNum","dayLabel","dateOfMonth","nthWeekDayOfMonth","dateOfYear","nthWeekDayOfYear","countInput","ondateInput","endOptionSelect","formatter","repeat_date_of_end","dispatchEvent","getFirstSectionOfType","rec","_get_node","_outer_html","loc","_init_set_value","_ds","weekly","monthly","yearly","_rec_init_done","rf","blocked","rruleset","topOption","rruleObj","untilDate","customFreq","actual_dates","timeControl","recurrence","_start","recurring_legacy","getRecurringSection","occurrence_timestamp_in_utc","outerHTML","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","str_date_format","date_str","register_els","inps","change_current_view","set_end_rule","_get_repeat_code","get_rcode","str_date","transpose_type","get_numeric_value","repeat_precise","start_exists","transpose_day_week","set_rcode","_set_repeat_code","MouseEvent","elements","_toggle_block","getTimeSection","_get_button","_get_form","backgroundPosition","transponse_size","day_week","originalMonth","newMonth","cor","cor2","cday","transposeRecurring","recurringParts","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","startHour","ted","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","s2d","d2s","select_event","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_year_grid","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","datepicker","locateEvent","factory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","addCalendar","$dhx"],"mappings":"AAUA,MAAAA,KAPqB,OAAXC,SAAW,MACNA,SAEAC;ACNA,SAASC,GAAiBC,GACrC;AAAA,MAAIC,IAAa,CACbC,GAAAA,IAAAA,IACAC,IAAY,MACZC,IAAQ;AAEZ,WAASC,IAAAA;AACL,WAAOL,EAAUM,OAAOC,kBAAkBP,EAAUQ;AAAAA,EACvD;AAED,WAASC,EAAcC,GAAAA;AACnB,UAAMC,IAAUX,EAAUY,QAAQF,CAAAA;AAClC,WAAGC,IACQA,EAAQE,SAEZH;AAAAA,EACV;AA4BD,WAASI,EAAmBC,GAAAA;AACxB,YAAMX,OAAEA,GAAKS,QAAEA,GAAMH,UAAEA,GAAQM,WAAEA,GAASb,WAAEA,MAAcY;AAjB9D,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AAW,EAAA;AAAA,IAC/D,GAAM,EAAC5O,SAGFqlG,CAAAA,GAAAA,EAAWh0F;AACb,iBAAUrvB,KAASqjH,EAAWh0F;AAC7BzvB,UAAUkE,YAAY9D,GAAOqjH,EAAWh0F,OAAOrvB,CAAAA,CAAAA;AAI9CqjH,IAAAA,EAAWr7F,UACbpoB,EAAUigE,KAAKE,UAAUsjD,EAAWr7F,MAAAA,GAGlC3c,MAAM6L,QAAQmsG,EAAWzW,SAC3ByW,KAAAA,EAAWzW,UAAUhpG,QAAQ,SAASiW,GACrCja;AAAAA,QAAU6jH,YAAY5pG,CAAAA;AAAAA,IAC1B,IAGKwpG,EAAWr9G,YACbpG,EAAU4oB,KAAK66F,EAAWr9G,SAE1BpG,IAAAA,EAAU4oB,KAGR66F,GAAAA,EAAWh0G,SACHg0G,OAAAA,EAAWh0G,QAAS,WAC7BzP,EAAU4yB,KAAK6wF,EAAWh0G,IAAAA,IAE1BzP,EAAU+tB,MAAM01F,EAAWh0G,IAG7B;AAAA,EAAA;AAAA,EDxFmC64E,EAE/BtoF,GAAAA,KAAYmjH,GAAQhkD,qBACpBD,GAAAA,KAAY,EACjBuC,QAAQzhE,GAAU6e,KAAKskG,GAAQ1hD,QAAQ0hD,EAAAA,EAAAA;AAGxCtjH,OAAOG,YAAYA,IACnBH,OAAOq/D,YAAYA,IAEfr/D,OAAOikH,SACVjkH,OAAOikH,OAAO,KAGfjkH,OAAOikH,KAAK9jH,YAAYA,IACxBH,OAAOikH,KAAK5kD,YAAYA;","x_google_ignoreList":[84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111]} \ No newline at end of file diff --git a/codebase/dhtmlxscheduler.js b/codebase/dhtmlxscheduler.js index 21212cc..62985cd 100644 --- a/codebase/dhtmlxscheduler.js +++ b/codebase/dhtmlxscheduler.js @@ -1,37 +1,49 @@ -(function(F,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):P((F=typeof globalThis<"u"?globalThis:F||self).dhtmlxscheduler={})})(this,function(F){"use strict";const P=typeof window<"u"?window:global;function de(e){function h(o){var t=document.createElement("div");return(o||"").split(" ").forEach(function(n){t.classList.add(n)}),t}var a={rows_container:function(){return h("dhx_cal_navbar_rows_container")},row:function(){return h("dhx_cal_navbar_row")},view:function(o){var t=h("dhx_cal_tab");return t.setAttribute("name",o.view+"_tab"),t.setAttribute("data-tab",o.view),e.config.fix_tab_position&&(o.$firstTab?t.classList.add("dhx_cal_tab_first"):o.$lastTab?t.classList.add("dhx_cal_tab_last"):o.view!=="week"&&t.classList.add("dhx_cal_tab_standalone"),o.$segmentedTab&&t.classList.add("dhx_cal_tab_segmented")),t},date:function(){return h("dhx_cal_date")},button:function(o){return h("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab")},builtInButton:function(o){return h("dhx_cal_"+o.view+"_button dhx_cal_nav_button")},spacer:function(){return h("dhx_cal_line_spacer")},minicalendarButton:function(o){var t=h("dhx_minical_icon");return o.click||t.$_eventAttached||e.event(t,"click",function(){e.isCalendarVisible()?e.destroyCalendar():e.renderCalendar({position:this,date:e.getState().date,navigation:!0,handler:function(n,s){e.setCurrentView(n),e.destroyCalendar()}})}),t},html_element:function(o){return h("dhx_cal_nav_content")}};function r(o){var t=function(c){var u;if(c.view)switch(c.view){case"today":case"next":case"prev":u=a.builtInButton;break;case"date":u=a.date;break;case"spacer":u=a.spacer;break;case"button":u=a.button;break;case"minicalendar":u=a.minicalendarButton;break;default:u=a.view}else c.rows?u=a.rows_container:c.cols&&(u=a.row);return u}(o);if(t){var n=t(o);if(o.css&&n.classList.add(o.css),o.width&&((s=o.width)===1*s&&(s+="px"),n.style.width=s),o.height&&((s=o.height)===1*s&&(s+="px"),n.style.height=s),o.click&&e.event(n,"click",o.click),o.html&&(n.innerHTML=o.html),o.align){var s="";o.align=="right"?s="flex-end":o.align=="left"&&(s="flex-start"),n.style.justifyContent=s}return n}}function d(o){return typeof o=="string"&&(o={view:o}),o.view||o.rows||o.cols||(o.view="button"),o}function i(o){var t,n=document.createDocumentFragment();t=Array.isArray(o)?o:[o];for(var s=0;s=0){if(!a)return r;var _=i===0||!(d.charAt(i-1)||"").trim(),o=i+h.length>=d.length||!d.charAt(i+h.length).trim();if(_&&o)return r}}r=r.parentNode}return null}function fe(e){var h=!1,a=!1;if(window.getComputedStyle){var r=window.getComputedStyle(e,null);h=r.display,a=r.visibility}else e.currentStyle&&(h=e.currentStyle.display,a=e.currentStyle.visibility);var d=!1,i=ie({target:e},"dhx_form_repeat",!1);return i&&(d=i.style.height=="0px"),d=d||!e.offsetHeight,h!="none"&&a!="hidden"&&!d}function ve(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function ge(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function me(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function re(){return document.head.createShadowRoot||document.head.attachShadow}function oe(e){if(!e||!re())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}const B={getAbsoluteLeft:function(e){return this.getOffset(e).left},getAbsoluteTop:function(e){return this.getOffset(e).top},getOffsetSum:function(e){for(var h=0,a=0;e;)h+=parseInt(e.offsetTop),a+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:h,left:a}},getOffsetRect:function(e){var h=e.getBoundingClientRect(),a=0,r=0;if(/Mobi/.test(navigator.userAgent)){var d=document.createElement("div");d.style.position="absolute",d.style.left="0px",d.style.top="0px",d.style.width="1px",d.style.height="1px",document.body.appendChild(d);var i=d.getBoundingClientRect();a=h.top-i.top,r=h.left-i.left,d.parentNode.removeChild(d)}else{var _=document.body,o=document.documentElement,t=window.pageYOffset||o.scrollTop||_.scrollTop,n=window.pageXOffset||o.scrollLeft||_.scrollLeft,s=o.clientTop||_.clientTop||0,c=o.clientLeft||_.clientLeft||0;a=h.top+t-s,r=h.left+n-c}return{top:Math.round(a),left:Math.round(r)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,h){return e&&h?G(e,h):null},insertAfter:function(e,h){h.nextSibling?h.parentNode.insertBefore(e,h.nextSibling):h.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},isChildOf:function(e,h){return h.contains(e)},getFocusableNodes:function(e){for(var h=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),a=Array.prototype.slice.call(h,0),r=0;r=0||navigator.userAgent.indexOf("Trident")>=0),isOpera:R&&navigator.userAgent.indexOf("Opera")>=0,isChrome:R&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:R&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:R&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:R&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:R&&navigator.userAgent.indexOf("Edge")!=-1,isNode:!R||typeof navigator>"u"};function X(e){if(typeof e=="string"||typeof e=="number")return e;var h="";for(var a in e){var r="";e.hasOwnProperty(a)&&(r=a+"="+(r=typeof e[a]=="string"?encodeURIComponent(e[a]):typeof e[a]=="number"?e[a]:encodeURIComponent(JSON.stringify(e[a]))),h.length&&(r="&"+r),h+=r)}return h}function be(e){var h=function(i,_){for(var o="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",t=i.match(/%[a-zA-Z]/g),n=0;n50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":o+="set[3]=temp["+n+"]||0;";break;case"%i":o+="set[4]=temp["+n+"]||0;";break;case"%Y":o+="set[0]=temp["+n+"]||0;";break;case"%a":case"%A":o+="set[3]=set[3]%12+((temp["+n+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":o+="set[5]=temp["+n+"]||0;";break;case"%M":o+="set[1]=this.locale.date.month_short_hash[temp["+n+"]]||0;";break;case"%F":o+="set[1]=this.locale.date.month_full_hash[temp["+n+"]]||0;"}var s="set[0],set[1],set[2],set[3],set[4],set[5]";return _&&(s=" Date.UTC("+s+")"),new Function("date","var set=[0,0,1,0,0,0]; "+o+" return new Date("+s+");")},a=function(i,_){const o=i.match(/%[a-zA-Z]/g);return function(t){for(var n=[0,0,1,0,0,0],s=t.match(/[a-zA-Z]+|[0-9]+/g),c=0;c50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":n[3]=s[c]||0;break;case"%i":n[4]=s[c]||0;break;case"%Y":n[0]=s[c]||0;break;case"%a":case"%A":n[3]=n[3]%12+((s[c]||"").toLowerCase()=="am"?0:12);break;case"%s":n[5]=s[c]||0;break;case"%M":n[1]=e.locale.date.month_short_hash[s[c]]||0;break;case"%F":n[1]=e.locale.date.month_full_hash[s[c]]||0}return _?new Date(Date.UTC(n[0],n[1],n[2],n[3],n[4],n[5])):new Date(n[0],n[1],n[2],n[3],n[4],n[5])}};let r;function d(){var i=!1;return e.config.csp==="auto"?(r===void 0&&(r=function(){try{new Function("cspEnabled = false;"),r=!1}catch{r=!0}return r}()),i=r):i=e.config.csp,i}e.date={init:function(){for(var i=e.locale.date.month_short,_=e.locale.date.month_short_hash={},o=0;o0){var t=(+o-+i)%864e5;if(t&&i.getTimezoneOffset()==o.getTimezoneOffset()){var n=t/36e5;o.setTime(o.getTime()+60*(24-n)*60*1e3)}}return _>=0&&!i.getHours()&&o.getHours()&&(o.getDate()11?"pm":"am":n.getHours()>11?"pm":"am";case"%A":return t?n.getUTCHours()>11?"PM":"AM":n.getHours()>11?"PM":"AM";case"%s":return t?e.date.to_fixed(n.getUTCSeconds()):e.date.to_fixed(n.getSeconds());case"%W":return t?e.date.to_fixed(e.date.getUTCISOWeek(n)):e.date.to_fixed(e.date.getISOWeek(n));default:return s}})}}(i,_):(i=i.replace(/%[a-zA-Z]/g,function(o){switch(o){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return o}}),_&&(i=i.replace(/date\.get/g,"date.getUTC")),new Function("date",'return "'+i+'";').bind(e))},str_to_date:function(i,_,o){var t=d()?a:h,n=t(i,_),s=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,c=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,u=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,v=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,m=t("%Y-%m-%d %H:%i:%s",_),l=t("%m/%d/%Y %H:%i:%s",_),f=t("%d-%m-%Y %H:%i:%s",_);return function(g){if(!o&&!e.config.parse_exact_format){if(g&&g.getISOWeek)return new Date(g);if(typeof g=="number")return new Date(g);if(p=g,s.test(String(p)))return m(g);if(function(y){return c.test(String(y))}(g))return l(g);if(function(y){return u.test(String(y))}(g))return f(g);if(function(y){return v.test(y)}(g))return new Date(g)}var p;return n.call(e,g)}},getISOWeek:function(i){if(!i)return!1;var _=(i=this.date_part(new Date(i))).getDay();_===0&&(_=7);var o=new Date(i.valueOf());o.setDate(i.getDate()+(4-_));var t=o.getFullYear(),n=Math.round((o.getTime()-new Date(t,0,1).getTime())/864e5);return 1+Math.floor(n/7)},getUTCISOWeek:function(i){return this.getISOWeek(this.convert_to_utc(i))},convert_to_utc:function(i){return new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds())}}}function se(e){return(function(){var h={};for(var a in this._events){var r=this._events[a];r.id.toString().indexOf("#")==-1&&(h[r.id]=r)}return h}).bind(e)}function xe(e){e._loaded={},e._load=function(a,r){if(a=a||this._load_url){var d;if(a+=(a.indexOf("?")==-1?"?":"&")+"timeshift="+new Date().getTimezoneOffset(),this.config.prevent_cache&&(a+="&uid="+this.uid()),r=r||this._date,this._load_mode){var i=this.templates.load_format;for(r=this.date[this._load_mode+"_start"](new Date(r.valueOf()));r>this._min_date;)r=this.date.add(r,-1,this._load_mode);d=r;for(var _=!0;dr&&this._loaded[i(o)]);if(d<=r)return!1;for(e.ajax.get(a+"&from="+i(r)+"&to="+i(d),t);r=400)&&(this.callEvent("onLoadError",[a.xmlDoc]),r=[]),this._process_loading(r),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(a){this._loading=!0,this._not_render=!0;for(var r=0;r1)&&(this.xy.scroll_width=0,this._mobile=!0),this.config.touch){var h=!0;try{document.createEvent("TouchEvent")}catch{h=!1}h?this._touch_events(["touchmove","touchstart","touchend"],function(a){return a.touches&&a.touches.length>1?null:a.touches[0]?{target:a.target,pageX:a.touches[0].pageX,pageY:a.touches[0].pageY,clientX:a.touches[0].clientX,clientY:a.touches[0].clientY}:a},function(){return!1}):window.PointerEvent||window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(a){return a.pointerType=="mouse"?null:a},function(a){return!a||a.pointerType=="mouse"}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(a){return a.pointerType==a.MSPOINTER_TYPE_MOUSE?null:a},function(a){return!a||a.pointerType==a.MSPOINTER_TYPE_MOUSE})}},e._touch_events=function(h,a,r){var d,i,_,o,t,n,s=0;function c(v,m,l){e.event(v,m,function(f){return!!e._is_lightbox_open()||(r(f)?void 0:l(f))},{passive:!1})}function u(v){r(v)||(e._hide_global_tip(),o&&(e._on_mouse_up(a(v)),e._temp_touch_block=!1),e._drag_id=null,e._drag_mode=null,e._drag_pos=null,e._pointerDragId=null,clearTimeout(_),o=n=!1,t=!0)}c(document.body,h[0],function(v){if(!r(v)){var m=a(v);if(m){if(o)return function(l){if(!r(l)){var f=e.getState().drag_mode,g=!!e.matrix&&e.matrix[e._mode],p=e.render_view_data;f=="create"&&g&&(e.render_view_data=function(){for(var y=e.getState().drag_id,w=e.getEvent(y),b=g.y_property,k=e.getEvents(w.start_date,w.end_date),E=0;E5||Math.abs(d.pageY-i.pageY)>5)&&(t=!0,clearTimeout(_)):t=!0)}}}),c(this._els.dhx_cal_data[0],"touchcancel",u),c(this._els.dhx_cal_data[0],"contextmenu",function(v){if(!r(v))return n?(v&&v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,!1):void 0}),c(this._obj,h[1],function(v){var m;if(document&&document.body&&document.body.classList.add("dhx_cal_touch_active"),!r(v))if(e._pointerDragId=v.pointerId,o=t=!1,n=!0,m=i=a(v)){var l=new Date;if(!t&&!o&&l-s<250)return e._click.dhx_cal_data(m),window.setTimeout(function(){e.$destroyed||e._on_dbl_click(m)},50),v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,e._block_next_stop=!0,!1;if(s=l,!t&&!o&&e.config.touch_drag){var f=e._locate_event(document.activeElement),g=e._locate_event(m.target),p=d?e._locate_event(d.target):null;if(f&&g&&f==g&&f!=p)return v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,e._ignore_next_click=!1,e._click.dhx_cal_data(m),d=m,!1;_=setTimeout(function(){if(!e.$destroyed){o=!0;var y=d.target,w=e._getClassName(y);y&&w.indexOf("dhx_body")!=-1&&(y=y.previousSibling),e._on_mouse_down(d,y),e._drag_mode&&e._drag_mode!="create"&&e.for_rendered(e._drag_id,function(b,k){b.style.display="none",e._rendered.splice(k,1)}),e.config.touch_tip&&e._show_global_tip(),e.updateEvent(e._drag_id)}},e.config.touch_drag),d=m}}else t=!0}),c(this._els.dhx_cal_data[0],h[2],function(v){if(document&&document.body&&document.body.classList.remove("dhx_cal_touch_active"),!r(v))return e.config.touch_swipe_dates&&!o&&function(m,l,f,g){if(!m||!l)return!1;for(var p=m.target;p&&p!=e._obj;)p=p.parentNode;if(p!=e._obj||e.matrix&&e.matrix[e.getState().mode]&&e.matrix[e.getState().mode].scrollable)return!1;var y=Math.abs(m.pageY-l.pageY),w=Math.abs(m.pageX-l.pageX);return yf&&(!y||w/y>3)&&(m.pageX>l.pageX?e._click.dhx_cal_next_button():e._click.dhx_cal_prev_button(),!0)}(d,i,200,100)&&(e._block_next_stop=!0),o&&(e._ignore_next_click=!0,setTimeout(function(){e._ignore_next_click=!1},100)),u(v),e._block_next_stop?(e._block_next_stop=!1,v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,!1):void 0}),e.event(document.body,h[2],u)},e._show_global_tip=function(){e._hide_global_tip();var h=e._global_tip=document.createElement("div");h.className="dhx_global_tip",e._update_global_tip(1),document.body.appendChild(h)},e._update_global_tip=function(h){var a=e._global_tip;if(a){var r="";if(e._drag_id&&!h){var d=e.getEvent(e._drag_id);d&&(r="
"+(d._timed?e.templates.event_header(d.start_date,d.end_date,d):e.templates.day_date(d.start_date,d.end_date,d))+"
")}e._drag_mode=="create"||e._drag_mode=="new-size"?a.innerHTML=(e.locale.labels.drag_to_create||"Drag to create")+r:a.innerHTML=(e.locale.labels.drag_to_move||"Drag to move")+r}},e._hide_global_tip=function(){var h=e._global_tip;h&&h.parentNode&&(h.parentNode.removeChild(h),e._global_tip=0)}}function ke(e){var h,a;function r(){if(e._is_material_skin())return!0;if(a!==void 0)return a;var o=document.createElement("div");o.style.position="absolute",o.style.left="-9999px",o.style.top="-9999px",o.innerHTML="
",document.body.appendChild(o);var t=window.getComputedStyle(o.querySelector(".dhx_body")).getPropertyValue("box-sizing");document.body.removeChild(o),(a=t==="border-box")||setTimeout(function(){a=void 0},1e3)}function d(){if(!e._is_material_skin()&&!e._border_box_events()){var o=a;a=void 0,h=void 0,o!==r()&&e.$container&&e.getState().mode&&e.setCurrentView()}}function i(o){var t=o.getMinutes();return t=t<10?"0"+t:t,""+o.getHours()+" "+t+""}e._addThemeClass=function(){document.documentElement.setAttribute("data-scheduler-theme",e.skin)},e._skin_settings={fix_tab_position:[1,0],use_select_menu_space:[1,0],wide_form:[1,0],hour_size_px:[44,42],displayed_event_color:["#ff4a4a","ffc5ab"],displayed_event_text_color:["#ffef80","7e2727"]},e._skin_xy={lightbox_additional_height:[90,50],nav_height:[59,22],bar_height:[24,20]},e._is_material_skin=function(){return e.skin?(e.skin+"").indexOf("material")>-1:function(){if(h===void 0){var o=document.createElement("div");o.style.position="absolute",o.style.left="-9999px",o.style.top="-9999px",o.innerHTML="
",document.body.appendChild(o);var t=window.getComputedStyle(o.querySelector(".dhx_cal_scale_placeholder")).getPropertyValue("position");h=t==="absolute",setTimeout(function(){h=null,o&&o.parentNode&&o.parentNode.removeChild(o)},500)}return h}()},e._build_skin_info=function(){(function(){const v=e.$container;clearInterval(_),v&&(_=setInterval(()=>{const m=getComputedStyle(v).getPropertyValue("--dhx-scheduler-theme");m&&m!==e.skin&&e.setSkin(m)},100))})();const o=getComputedStyle(this.$container),t=o.getPropertyValue("--dhx-scheduler-theme");let n,s=!!t,c={},u=!1;if(s){n=t;for(let v in e.xy)c[v]=o.getPropertyValue(`--dhx-scheduler-xy-${v}`);c.hour_size_px=o.getPropertyValue("--dhx-scheduler-config-hour_size_px"),c.wide_form=o.getPropertyValue("--dhx-scheduler-config-form_wide")}else n=function(){for(var v=document.getElementsByTagName("link"),m=0;m{switch(n.getAttribute("data-tab")||n.getAttribute("name")){case"day":case"day_tab":n.classList.add("dhx_cal_tab_first"),n.classList.add("dhx_cal_tab_segmented");break;case"week":case"week_tab":n.classList.add("dhx_cal_tab_segmented");break;case"month":case"month_tab":n.classList.add("dhx_cal_tab_last"),n.classList.add("dhx_cal_tab_segmented");break;default:n.classList.add("dhx_cal_tab_standalone")}}),function(n){if(e.config.header)return;const s=Array.from(n.querySelectorAll(".dhx_cal_tab")),c=["day","week","month"].map(v=>s.find(m=>m.getAttribute("data-tab")===v)).filter(v=>v!==void 0);let u=s.length>0?s[0]:null;c.reverse().forEach(v=>{n.insertBefore(v,u),u=v})}(e._els.dhx_cal_navline[0]))},{once:!0})}}function Ee(e,h){this.$scheduler=e,this.$dp=h,this._dataProcessorHandlers=[],this.attach=function(){var a=this.$dp,r=this.$scheduler;this._dataProcessorHandlers.push(r.attachEvent("onEventAdded",function(d){!this._loading&&this._validId(d)&&a.setUpdated(d,!0,"inserted")})),this._dataProcessorHandlers.push(r.attachEvent("onConfirmedBeforeEventDelete",function(d){if(this._validId(d)){var i=a.getState(d);return i=="inserted"||this._new_event?(a.setUpdated(d,!1),!0):i!="deleted"&&(i=="true_deleted"||(a.setUpdated(d,!0,"deleted"),!1))}})),this._dataProcessorHandlers.push(r.attachEvent("onEventChanged",function(d){!this._loading&&this._validId(d)&&a.setUpdated(d,!0,"updated")})),this._dataProcessorHandlers.push(r.attachEvent("onClearAll",function(){a._in_progress={},a._invalid={},a.updatedRows=[],a._waitMode=0})),a.attachEvent("insertCallback",r._update_callback),a.attachEvent("updateCallback",r._update_callback),a.attachEvent("deleteCallback",function(d,i){r.getEvent(i)?(r.setUserData(i,this.action_param,"true_deleted"),r.deleteEvent(i)):r._add_rec_marker&&r._update_callback(d,i)})},this.detach=function(){for(var a in this._dataProcessorHandlers){var r=this._dataProcessorHandlers[a];this.$scheduler.detachEvent(r)}this._dataProcessorHandlers=[]}}function Z(e){return this.serverProcessor=e,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this._headers=null,this._payload=null,this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),W(this),this}function De(e){var h="data-dhxbox",a=null;function r(g,p){var y=g.callback;m.hide(g.box),a=g.box=null,y&&y(p)}function d(g){if(a){var p=g.which||g.keyCode,y=!1;if(l.keyboard){if(p==13||p==32){var w=g.target||g.srcElement;B.getClassName(w).indexOf("scheduler_popup_button")>-1&&w.click?w.click():(r(a,!0),y=!0)}p==27&&(r(a,!1),y=!0)}return y?(g.preventDefault&&g.preventDefault(),!(g.cancelBubble=!0)):void 0}}function i(g){i.cover||(i.cover=document.createElement("div"),e.event(i.cover,"keydown",d),i.cover.className="dhx_modal_cover",document.body.appendChild(i.cover)),i.cover.style.display=g?"inline-block":"none"}function _(g,p,y){var w=e._waiAria.messageButtonAttrString(g),b=(p||"").toLowerCase().replace(/ /g,"_");return`
${g}
`}function o(){for(var g=[].slice.apply(arguments,[0]),p=0;p'+E.title+"
"),M+='
'+(E.content?"":E.text)+'
',D&&(M+=_(o(E.ok,e.locale.labels.message_ok,"OK"),"ok",!0)),x&&(M+=_(o(E.cancel,e.locale.labels.message_cancel,"Cancel"),"cancel",!1)),E.buttons)for(var A=0;A",k.className="scheduler-info dhtmlx-info scheduler-"+b.type+" dhtmlx-"+b.type,e.event(k,"click",function(){l.hide(b.id),b=null}),e._waiAria.messageInfoAttr(k),l.position=="bottom"&&l.area.firstChild?l.area.insertBefore(k,l.area.firstChild):l.area.appendChild(k),b.expire>0&&(l.timers[b.id]=window.setTimeout(function(){l&&l.hide(b.id)},b.expire)),l.pull[b.id]=k,k=null,b.id}(g)}};l.seed=new Date().valueOf(),l.uid=I.uid,l.expire=4e3,l.keyboard=!0,l.position="top",l.pull={},l.timers={},l.hideAll=function(){for(var g in l.pull)l.hide(g)},l.hide=function(g){var p=l.pull[g];p&&p.parentNode&&(window.setTimeout(function(){p.parentNode.removeChild(p),p=null},2e3),p.className+=" hidden",l.timers[g]&&window.clearTimeout(l.timers[g]),delete l.pull[g])};var f=[];return e.attachEvent("onMessagePopup",function(g){f.push(g)}),e.attachEvent("onAfterMessagePopup",function(g){for(var p=0;p{this.callEvent("onStateChange",[i,d])})}getState(){return{...this.state,mode:this.state.modes[this.state.currentModeIndex]}}setState(h){const a={...this.state};h.mode&&(h.currentModeIndex=this.state.modes.indexOf(h.mode)),this.state={...this.state,...h},this._notifyStateChange(a,this.state),this.container&&this.render(this.container)}onStateChange(h){return this.onStateChangeHandlers.push(h),()=>{const a=this.onStateChangeHandlers.indexOf(h);a!==-1&&this.onStateChangeHandlers.splice(a,1)}}_notifyStateChange(h,a){this.onStateChangeHandlers.forEach(r=>r(h,a))}_adjustDate(h){const{mode:a,date:r}=this.getState(),d=new Date(r);a==="days"?d.setMonth(r.getMonth()+h):a==="months"?d.setFullYear(r.getFullYear()+h):d.setFullYear(r.getFullYear()+10*h),this.setState({date:d})}_toggleMode(){const h=(this.state.currentModeIndex+1)%this.state.modes.length;this.setState({currentModeIndex:h})}_renderCalendarHeader(h){const{mode:a,date:r}=this.getState(),d=document.createElement("div");d.classList.add("dhx_cal_datepicker_header");const i=document.createElement("button");i.classList.add("dhx_cal_datepicker_arrow","scheduler_icon","arrow_left"),d.appendChild(i);const _=document.createElement("div");if(_.classList.add("dhx_cal_datepicker_title"),a==="days")_.innerText=r.toLocaleString("default",{month:"long"})+" "+r.getFullYear();else if(a==="months")_.innerText=r.getFullYear();else{const t=10*Math.floor(r.getFullYear()/10);_.innerText=`${t} - ${t+9}`}this._domEvents.attach(_,"click",this._toggleMode.bind(this)),d.appendChild(_);const o=document.createElement("button");o.classList.add("dhx_cal_datepicker_arrow","scheduler_icon","arrow_right"),d.appendChild(o),h.appendChild(d),this._domEvents.attach(i,"click",this._adjustDate.bind(this,-1)),this._domEvents.attach(o,"click",this._adjustDate.bind(this,1))}render(h){this._domEvents.detachAll(),this.container=h||this.container,this.container.innerHTML="",this.element||(this.element=document.createElement("div"),this.element.classList.add("dhx_cal_datepicker")),this.element.innerHTML="",this.container.appendChild(this.element),this._renderCalendarHeader(this.element);const a=document.createElement("div");a.classList.add("dhx_cal_datepicker_data"),this.element.appendChild(a);const{mode:r}=this.getState();r==="days"?this._renderDayGrid(a):r==="months"?this._renderMonthGrid(a):this._renderYearGrid(a)}_renderDayGridHeader(h){const{date:a}=this.getState(),r=this.scheduler;let d=r.date.week_start(new Date(a));const i=r.date.add(r.date.week_start(new Date(a)),1,"week");h.classList.add("dhx_cal_datepicker_days");const _=r.date.date_to_str("%D");for(;d.valueOf()(y[this.scheduler.date.day_start(new Date(w)).valueOf()]=!0,y),{}),n=document.createElement("div");this._renderDayGridHeader(n),h.appendChild(n);const s=this.scheduler,c=s.date.week_start(s.date.month_start(new Date(a))),u=s.date.month_start(new Date(a)),v=s.date.add(s.date.month_start(new Date(a)),1,"month");let m=s.date.add(s.date.month_start(new Date(a)),1,"month");const l=s.date.date_part(s._currentDate());m.getDay()!==0&&(m=s.date.add(s.date.week_start(m),1,"week"));let f=this._weeksBetween(c,m);i&&f{const w=y.target.closest("[data-cell-date]"),b=new Date(w.getAttribute("data-cell-date"));this.callEvent("onDateClick",[b,y])});g.valueOf()=v.valueOf()&&y.classList.add("dhx_after"),g.getDay()!==0&&g.getDay()!==6||y.classList.add("dhx_cal_datepicker_weekend"),g.valueOf()==l.valueOf()&&y.classList.add("dhx_now"),_&&o&&g.valueOf()>=_.valueOf()&&g.valueOf(){const n=document.createElement("div");n.classList.add("dhx_cal_datepicker_month"),a.getMonth()===t.getMonth()&&n.classList.add("dhx_cal_datepicker_current"),n.setAttribute("data-month",t.getMonth()),n.innerHTML=i(t),this._domEvents.attach(n,"click",()=>{const s=new Date(t);this.setState({date:s,mode:"days"})}),r.appendChild(n)}),h.appendChild(r);const _=document.createElement("div");_.classList.add("dhx_cal_datepicker_done");const o=document.createElement("button");o.innerText="Done",o.classList.add("dhx_cal_datepicker_done_btn"),this._domEvents.attach(o,"click",()=>{this.setState({mode:"days"})}),_.appendChild(o),h.appendChild(_)}_renderYearGrid(h){const{date:a}=this.getState(),r=10*Math.floor(a.getFullYear()/10),d=document.createElement("div");d.classList.add("dhx_cal_datepicker_years");for(let o=r-1;o<=r+10;o++){const t=document.createElement("div");t.innerText=o,t.classList.add("dhx_cal_datepicker_year"),t.setAttribute("data-year",o),a.getFullYear()===o&&t.classList.add("dhx_cal_datepicker_current"),this._domEvents.attach(t,"click",()=>{this.setState({date:new Date(o,a.getMonth(),1),mode:"months"})}),d.appendChild(t)}h.appendChild(d);const i=document.createElement("div");i.classList.add("dhx_cal_datepicker_done");const _=document.createElement("button");_.innerText="Done",_.classList.add("dhx_cal_datepicker_done_btn"),this._domEvents.attach(_,"click",()=>{this.setState({mode:"months"})}),i.appendChild(_),h.appendChild(i)}destructor(){this.onStateChangeHandlers=[],this.element&&(this.element.innerHTML="",this.element.remove()),this._domEvents.detachAll(),this.callEvent("onDestroy",[]),this.detachAllEvents(),this.scheduler=null}}function nt(e){const h={version:"7.0.5"};(function(t){var n={agenda:"https://docs.dhtmlx.com/scheduler/agenda_view.html",grid:"https://docs.dhtmlx.com/scheduler/grid_view.html",map:"https://docs.dhtmlx.com/scheduler/map_view.html",unit:"https://docs.dhtmlx.com/scheduler/units_view.html",timeline:"https://docs.dhtmlx.com/scheduler/timeline_view.html",week_agenda:"https://docs.dhtmlx.com/scheduler/weekagenda_view.html",year:"https://docs.dhtmlx.com/scheduler/year_view.html",anythingElse:"https://docs.dhtmlx.com/scheduler/views.html"},s={agenda:"ext/dhtmlxscheduler_agenda_view.js",grid:"ext/dhtmlxscheduler_grid_view.js",map:"ext/dhtmlxscheduler_map_view.js",unit:"ext/dhtmlxscheduler_units.js",timeline:"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js",week_agenda:"ext/dhtmlxscheduler_week_agenda.js",year:"ext/dhtmlxscheduler_year_view.js",limit:"ext/dhtmlxscheduler_limit.js"};t._commonErrorMessages={unknownView:function(c){var u=s[c]?"You're probably missing "+s[c]+".":"";return"`"+c+"` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \nRelated docs: "+(n[c]||n.anythingElse)+` -`+(u?u+` -`:"")},collapsedContainer:function(c){return`Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. +(function(he,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):G((he=typeof globalThis<"u"?globalThis:he||self).dhtmlxscheduler={})})(this,function(he){"use strict";const G=typeof window<"u"?window:global;function Nt(e){let i=[],t=!1,r=null,d=null;function n(){return e.config.drag_highlight&&e.markTimespan}function s(o){const l=e.getView(o);return l?l.layout:o}function _(o){const{event:l,layout:h,viewName:v,sectionId:u,eventNode:f}=o;(function(m,g){switch(g){case"month":m.style.top="",m.style.left="";break;case"timeline":m.style.left="",m.style.marginLeft="1px";break;default:m.style.top=""}})(f,h);const c={};let p={start_date:l.start_date,end_date:l.end_date,css:"dhx_scheduler_dnd_marker",html:f};return h!="timeline"&&h!="month"||(p={...p,end_date:e.date.add(l.start_date,1,"minute")}),u&&(c[v]=u,p.sections=c),p}function a(o){const{layout:l}=o;let h;switch(l){case"month":h=function(v){let u=[];const{event:f,layout:c,viewName:p,sectionId:m}=v,g=[];let y=new Date(f.start_date);for(;y.valueOf()String(b)),x=[];for(let b=0;b{i.push(e.markTimespan(v))})}e.attachEvent("onBeforeDrag",function(o,l,h){return n()&&(t=!0,d=e.getEvent(o),r=h.target.closest(`[${e.config.event_attribute}]`),s(e.getState().mode)=="units"&&e.config.cascade_event_display&&(e.unselect(o),r=h.target.closest(`[${e.config.event_attribute}]`))),!0}),e.attachEvent("onEventDrag",function(o,l,h){if(t&&n()){t=!1;const v=e.getState().mode,u=s(v),f=e.getActionData(h).section;d&&a({event:d,layout:u,viewName:v,sectionId:f,eventNode:r})}}),e.attachEvent("onDragEnd",function(o,l,h){for(let v=0;vl||n.end_date.getDate()!=o.getDate()?1440:e._get_zone_minutes(n.end_date),m=u[f],g=u[f+1];if(mc&&!(a=typeof _=="function"&&_(n,c,p,m,g)))break}}return!a},e.checkLimitViolation=function(n){if(!n||!e.config.check_limits)return!0;var s=e,_=s.config,a=[];if(n.rec_type&&n._end_date||n.rrule){const u=n._end_date||n.end_date;return!_.limit_start||!_.limit_end||u.valueOf()>=_.limit_start.valueOf()&&n.start_date.valueOf()<=_.limit_end.valueOf()}a=[n];for(var o=!0,l=0;l=_.limit_start.valueOf()&&v.end_date.valueOf()<=_.limit_end.valueOf())&&(h=!e.checkInMarkedTimespan(v,i,function(u,f,c,p,m){var g=!0;return f<=m&&f>=p&&((m==1440||c<=m)&&(g=!1),u._timed&&s._drag_id&&s._drag_mode=="new-size"?(u.start_date.setHours(0),u.start_date.setMinutes(m)):g=!1),(c>=p&&c<=m||fm)&&(u._timed&&s._drag_id&&s._drag_mode=="new-size"?(u.end_date.setHours(0),u.end_date.setMinutes(p)):g=!1),g})),h||(h=s.checkEvent("onLimitViolation")?s.callEvent("onLimitViolation",[v.id,v]):h),o=o&&h}return o||(s._drag_id=null,s._drag_mode=null),o},e._get_blocked_zones=function(n,s,_,a,o){var l=[];if(n&&n[s])for(var h=n[s],v=this._get_relevant_blocked_zones(_,a,h,o),u=0;uthis._min_date&&_.getHours()>=a.first_hour&&_.getHours()1?(v.size&&v.options.length&&(n=(v.position+n)/v.options.length*v.size),l=n,h=n+u):h=(l=0)+u;for(var f=[],c=l;cn.start_date||n.days!==void 0&&n.zones)&&!n.type)return s;n.zones=="fullday"&&(n.zones=[0,1440]),n.zones&&n.invert_zones&&(n.zones=e.invertZones(n.zones)),n.id=e.uid(),n.css=n.css||"",n.type=n.type||t;var h=n.sections;if(h){for(var v in h)if(h.hasOwnProperty(v)){var u=h[v];for(u instanceof Array||(u=[u]),o=0;og?e._get_zone_minutes(p):0,k=m>y||m.getDate()!=g.getDate()?1440:e._get_zone_minutes(m);x.zones=[b,k],s.push(x),g=y,y=e.date.add(y,1,"day")}else c.days instanceof Date&&(c.days=e.date.date_part(c.days).valueOf()),c.zones=n.zones.slice(),s.push(c)}return s},e._get_dates_by_index=function(n,s,_){var a=[];s=e.date.date_part(new Date(s||e._min_date)),_=new Date(_||e._max_date);for(var o=s.getDay(),l=n-o>=0?n-o:7-s.getDay()+n,h=e.date.add(s,l,"day");h<_;h=e.date.add(h,1,"week"))a.push(h);return a},e._get_css_classes_by_config=function(n){var s=[];return n.type==i&&(s.push(i),n.css&&s.push(i+"_reset")),s.push("dhx_marked_timespan",n.css),s.join(" ")},e._get_block_by_config=function(n){var s=document.createElement("div");return n.html&&(typeof n.html=="string"?s.innerHTML=n.html:s.appendChild(n.html)),s},e._render_marked_timespan=function(n,s,_){var a=[],o=e.config,l=this._min_date,h=this._max_date,v=!1;if(!o.display_marked_timespans)return a;if(!_&&_!==0){if(n.days<7)_=n.days;else{var u=new Date(n.days);if(v=+u,!(+h>+u&&+l<=+u))return a;_=u.getDay()}var f=l.getDay();f>_?_=7-(f-_):_-=f}var c=n.zones,p=e._get_css_classes_by_config(n);if(e._table_view&&e._mode=="month"){var m=[],g=[];if(s)m.push(s),g.push(_);else{g=v?[v]:e._get_dates_by_index(_);for(var y=0;y1?D=D*(w.size||w.options.length)+S:(D=S,w.size&&D>w.position+w.size&&(D=0))}for(s=s||e.locate_holder(D),y=0;y-1||(s.push.apply(s,e._on_scale_add_marker(h,a)),a=e.date.add(a,1,"day"))}}return s},e.markTimespan=function(n){if(!this._els)throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.");var s=!1;this._els.dhx_cal_data||(e.get_elements(),s=!0);var _=e._marked_timespans_ids,a=e._marked_timespans_types,o=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(n);var l=e._mark_timespans();return s&&(e._els=[]),e._marked_timespans_ids=_,e._marked_timespans_types=a,e._marked_timespans=o,l},e.unmarkTimespan=function(n){if(n)for(var s=0;sl&&u<=l||u=o)_[a]=Math.min(o,u),_[a+1]=Math.max(l,f),a-=2;else{if(!h)continue;var c=o>u?0:2;_.splice(a+c,0,u,f)}s.splice(v--,2);break}return _},e._subtract_timespan_zones=function(n,s){for(var _=n.slice(),a=0;a<_.length;a+=2)for(var o=_[a],l=_[a+1],h=0;ho&&v=v&&l<=u&&_.splice(a,2),ou&&_.splice(f?a+2:a,f?0:2,u,l),a-=2;break}}return _},e.invertZones=function(n){return e._subtract_timespan_zones([0,1440],n.slice())},e._delete_marked_timespan_by_id=function(n){var s=e._marked_timespans_ids[n];if(s){for(var _=0;_1){var p=Math.round((s-e._min_date)/864e5),m=u.size||f.length;s=e.date.add(e._min_date,Math.floor(p/m),"day"),s=e.date.date_part(s)}else s=e.date.date_part(new Date(this._date));if(_=s.getDay(),a=s.valueOf(),l[o]&&l[o][c.key]){var g=l[o][c.key],y=e._get_types_to_render(g[_],g[a]);h.push.apply(h,e._get_configs_to_render(y))}}var x=l.global;if(e.config.overwrite_marked_timespans){var b=x[a]||x[_];h.push.apply(h,e._get_configs_to_render(b))}else x[a]&&h.push.apply(h,e._get_configs_to_render(x[a])),x[_]&&h.push.apply(h,e._get_configs_to_render(x[_]));for(var k=0;k{c&&(v.setModeDate.date=c),p&&(v.setModeDate.mode=p)};var f={render:(c,p)=>{v.needRender=!0,u(c,p)},setCurrentView:(c,p)=>{v.needRender=!0,u(c,p)},updateView:(c,p)=>{v.needUpdateView=!0,u(c,p)},render_data:()=>v.needRender=!0,render_view_data:c=>{c&&c.length?c.forEach(p=>v.repaintEvents[p.id]=!0):v.needRender=!0}};if(n.call(this,f),t=!0,this.callEvent("onBeforeBatchUpdate",[]),_(a),this.callEvent("onAfterBatchUpdate",[]),s.call(this),t=!1,!o)if(v.needRender)e.render(v.setModeDate.date,v.setModeDate.mode);else if(v.needUpdateView)e.updateView(v.setModeDate.date,v.setModeDate.mode);else for(const c in v.repaintEvents)e.updateEvent(c);h&&(this._dp.setUpdateMode(l),this._dp.sendData())}}function At(e){(function(i){i.attachEvent("onEventDeleted",function(t,r){let d=i.copy(r);i.config.undo_deleted&&!i.getState().new_event&&i.message({text:`
+ Event deleted + +
`,expire:1e4,type:"popup_after_delete",callback:function(n){n.target.closest(`[data-deleted-event-id="${r.id}"]`)&&(i.addEvent(d),i.render())}})})})(e),Nt(e),Mt(e),function(i){i.batchUpdate=Tt(i)}(e)}var Ct=Date.now();function Te(e){return!(!e||typeof e!="object")&&!!(e.getFullYear&&e.getMonth&&e.getDate)}const ee={uid:function(){return Ct++},mixin:function(e,i,t){for(var r in i)(e[r]===void 0||t)&&(e[r]=i[r]);return e},copy:function e(i){var t,r,d;if(i&&typeof i=="object")switch(!0){case Te(i):r=new Date(i);break;case(d=i,Array.isArray?Array.isArray(d):d&&d.length!==void 0&&d.pop&&d.push):for(r=new Array(i.length),t=0;t=0){if(!t)return r;var s=n===0||!(d.charAt(n-1)||"").trim(),_=n+i.length>=d.length||!d.charAt(n+i.length).trim();if(s&&_)return r}}r=r.parentNode}return null}function qt(e){var i=!1,t=!1;if(window.getComputedStyle){var r=window.getComputedStyle(e,null);i=r.display,t=r.visibility}else e.currentStyle&&(i=e.currentStyle.display,t=e.currentStyle.visibility);var d=!1,n=Ze({target:e},"dhx_form_repeat",!1);return n&&(d=n.style.height=="0px"),d=d||!e.offsetHeight,i!="none"&&t!="hidden"&&!d}function jt(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function Pt(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function It(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function Qe(){return document.head.createShadowRoot||document.head.attachShadow}function et(e){if(!e||!Qe())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}const se={getAbsoluteLeft:function(e){return this.getOffset(e).left},getAbsoluteTop:function(e){return this.getOffset(e).top},getOffsetSum:function(e){for(var i=0,t=0;e;)i+=parseInt(e.offsetTop),t+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:i,left:t}},getOffsetRect:function(e){var i=e.getBoundingClientRect(),t=0,r=0;if(/Mobi/.test(navigator.userAgent)){var d=document.createElement("div");d.style.position="absolute",d.style.left="0px",d.style.top="0px",d.style.width="1px",d.style.height="1px",document.body.appendChild(d);var n=d.getBoundingClientRect();t=i.top-n.top,r=i.left-n.left,d.parentNode.removeChild(d)}else{var s=document.body,_=document.documentElement,a=window.pageYOffset||_.scrollTop||s.scrollTop,o=window.pageXOffset||_.scrollLeft||s.scrollLeft,l=_.clientTop||s.clientTop||0,h=_.clientLeft||s.clientLeft||0;t=i.top+a-l,r=i.left+o-h}return{top:Math.round(t),left:Math.round(r)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,i){return e&&i?Ce(e,i):null},insertAfter:function(e,i){i.nextSibling?i.parentNode.insertBefore(e,i.nextSibling):i.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},isChildOf:function(e,i){return i.contains(e)},getFocusableNodes:function(e){for(var i=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),t=Array.prototype.slice.call(i,0),r=0;r=0||navigator.userAgent.indexOf("Trident")>=0),isOpera:de&&navigator.userAgent.indexOf("Opera")>=0,isChrome:de&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:de&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:de&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:de&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:de&&navigator.userAgent.indexOf("Edge")!=-1,isNode:!de||typeof navigator>"u"};function Oe(e){if(typeof e=="string"||typeof e=="number")return e;var i="";for(var t in e){var r="";e.hasOwnProperty(t)&&(r=t+"="+(r=typeof e[t]=="string"?encodeURIComponent(e[t]):typeof e[t]=="number"?e[t]:encodeURIComponent(JSON.stringify(e[t]))),i.length&&(r="&"+r),i+=r)}return i}function Ut(e){var i=function(n,s){for(var _="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",a=n.match(/%[a-zA-Z]/g),o=0;o50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":_+="set[3]=temp["+o+"]||0;";break;case"%i":_+="set[4]=temp["+o+"]||0;";break;case"%Y":_+="set[0]=temp["+o+"]||0;";break;case"%a":case"%A":_+="set[3]=set[3]%12+((temp["+o+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":_+="set[5]=temp["+o+"]||0;";break;case"%M":_+="set[1]=this.locale.date.month_short_hash[temp["+o+"]]||0;";break;case"%F":_+="set[1]=this.locale.date.month_full_hash[temp["+o+"]]||0;"}var l="set[0],set[1],set[2],set[3],set[4],set[5]";return s&&(l=" Date.UTC("+l+")"),new Function("date","var set=[0,0,1,0,0,0]; "+_+" return new Date("+l+");")},t=function(n,s){const _=n.match(/%[a-zA-Z]/g);return function(a){for(var o=[0,0,1,0,0,0],l=a.match(/[a-zA-Z]+|[0-9]+/g),h=0;h<_.length;h++)switch(_[h]){case"%j":case"%d":o[2]=l[h]||1;break;case"%n":case"%m":o[1]=(l[h]||1)-1;break;case"%y":o[0]=1*l[h]+(l[h]>50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":o[3]=l[h]||0;break;case"%i":o[4]=l[h]||0;break;case"%Y":o[0]=l[h]||0;break;case"%a":case"%A":o[3]=o[3]%12+((l[h]||"").toLowerCase()=="am"?0:12);break;case"%s":o[5]=l[h]||0;break;case"%M":o[1]=e.locale.date.month_short_hash[l[h]]||0;break;case"%F":o[1]=e.locale.date.month_full_hash[l[h]]||0}return s?new Date(Date.UTC(o[0],o[1],o[2],o[3],o[4],o[5])):new Date(o[0],o[1],o[2],o[3],o[4],o[5])}};let r;function d(){var n=!1;return e.config.csp==="auto"?(r===void 0&&(r=function(){try{new Function("cspEnabled = false;"),r=!1}catch{r=!0}return r}()),n=r):n=e.config.csp,n}e.date={init:function(){for(var n=e.locale.date.month_short,s=e.locale.date.month_short_hash={},_=0;_0){var a=(+_-+n)%864e5;if(a&&n.getTimezoneOffset()==_.getTimezoneOffset()){var o=a/36e5;_.setTime(_.getTime()+60*(24-o)*60*1e3)}}return s>=0&&!n.getHours()&&_.getHours()&&(_.getDate()11?"pm":"am":o.getHours()>11?"pm":"am";case"%A":return a?o.getUTCHours()>11?"PM":"AM":o.getHours()>11?"PM":"AM";case"%s":return a?e.date.to_fixed(o.getUTCSeconds()):e.date.to_fixed(o.getSeconds());case"%W":return a?e.date.to_fixed(e.date.getUTCISOWeek(o)):e.date.to_fixed(e.date.getISOWeek(o));default:return l}})}}(n,s):(n=n.replace(/%[a-zA-Z]/g,function(_){switch(_){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return _}}),s&&(n=n.replace(/date\.get/g,"date.getUTC")),new Function("date",'return "'+n+'";').bind(e))},str_to_date:function(n,s,_){var a=d()?t:i,o=a(n,s),l=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,h=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,v=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,u=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,f=a("%Y-%m-%d %H:%i:%s",s),c=a("%m/%d/%Y %H:%i:%s",s),p=a("%d-%m-%Y %H:%i:%s",s);return function(m){if(!_&&!e.config.parse_exact_format){if(m&&m.getISOWeek)return new Date(m);if(typeof m=="number")return new Date(m);if(g=m,l.test(String(g)))return f(m);if(function(y){return h.test(String(y))}(m))return c(m);if(function(y){return v.test(String(y))}(m))return p(m);if(function(y){return u.test(y)}(m))return new Date(m)}var g;return o.call(e,m)}},getISOWeek:function(n){if(!n)return!1;var s=(n=this.date_part(new Date(n))).getDay();s===0&&(s=7);var _=new Date(n.valueOf());_.setDate(n.getDate()+(4-s));var a=_.getFullYear(),o=Math.round((_.getTime()-new Date(a,0,1).getTime())/864e5);return 1+Math.floor(o/7)},getUTCISOWeek:function(n){return this.getISOWeek(this.convert_to_utc(n))},convert_to_utc:function(n){return new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())}}}function tt(e){return(function(){var i={};for(var t in this._events){var r=this._events[t];r.id.toString().indexOf("#")==-1&&(i[r.id]=r)}return i}).bind(e)}function Vt(e){e._loaded={},e._load=function(t,r){if(t=t||this._load_url){var d;if(t+=(t.indexOf("?")==-1?"?":"&")+"timeshift="+new Date().getTimezoneOffset(),this.config.prevent_cache&&(t+="&uid="+this.uid()),r=r||this._date,this._load_mode){var n=this.templates.load_format;for(r=this.date[this._load_mode+"_start"](new Date(r.valueOf()));r>this._min_date;)r=this.date.add(r,-1,this._load_mode);d=r;for(var s=!0;dr&&this._loaded[n(_)]);if(d<=r)return!1;for(e.ajax.get(t+"&from="+n(r)+"&to="+n(d),a);r=400)&&(this.callEvent("onLoadError",[t.xmlDoc]),r=[]),this._process_loading(r),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(t){this._loading=!0,this._not_render=!0;for(var r=0;r1)&&(this.xy.scroll_width=0,this._mobile=!0),this.config.touch){var i=!0;try{document.createEvent("TouchEvent")}catch{i=!1}i?this._touch_events(["touchmove","touchstart","touchend"],function(t){return t.touches&&t.touches.length>1?null:t.touches[0]?{target:t.target,pageX:t.touches[0].pageX,pageY:t.touches[0].pageY,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}:t},function(){return!1}):window.PointerEvent||window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(t){return t.pointerType=="mouse"?null:t},function(t){return!t||t.pointerType=="mouse"}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(t){return t.pointerType==t.MSPOINTER_TYPE_MOUSE?null:t},function(t){return!t||t.pointerType==t.MSPOINTER_TYPE_MOUSE})}},e._touch_events=function(i,t,r){var d,n,s,_,a,o,l=0;function h(u,f,c){e.event(u,f,function(p){return!!e._is_lightbox_open()||(r(p)?void 0:c(p))},{passive:!1})}function v(u){r(u)||(e._hide_global_tip(),_&&(e._on_mouse_up(t(u)),e._temp_touch_block=!1),e._drag_id=null,e._drag_mode=null,e._drag_pos=null,e._pointerDragId=null,clearTimeout(s),_=o=!1,a=!0)}h(document.body,i[0],function(u){if(!r(u)){var f=t(u);if(f){if(_)return function(c){if(!r(c)){var p=e.getState().drag_mode,m=!!e.matrix&&e.matrix[e._mode],g=e.render_view_data;p=="create"&&m&&(e.render_view_data=function(){for(var y=e.getState().drag_id,x=e.getEvent(y),b=m.y_property,k=e.getEvents(x.start_date,x.end_date),E=0;E5||Math.abs(d.pageY-n.pageY)>5)&&(a=!0,clearTimeout(s)):a=!0)}}}),h(this._els.dhx_cal_data[0],"touchcancel",v),h(this._els.dhx_cal_data[0],"contextmenu",function(u){if(!r(u))return o?(u&&u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,!1):void 0}),h(this._obj,i[1],function(u){var f;if(document&&document.body&&document.body.classList.add("dhx_cal_touch_active"),!r(u))if(e._pointerDragId=u.pointerId,_=a=!1,o=!0,f=n=t(u)){var c=new Date;if(!a&&!_&&c-l<250)return e._click.dhx_cal_data(f),window.setTimeout(function(){e.$destroyed||e._on_dbl_click(f)},50),u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,e._block_next_stop=!0,!1;if(l=c,!a&&!_&&e.config.touch_drag){var p=e._locate_event(document.activeElement),m=e._locate_event(f.target),g=d?e._locate_event(d.target):null;if(p&&m&&p==m&&p!=g)return u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,e._ignore_next_click=!1,e._click.dhx_cal_data(f),d=f,!1;s=setTimeout(function(){if(!e.$destroyed){_=!0;var y=d.target,x=e._getClassName(y);y&&x.indexOf("dhx_body")!=-1&&(y=y.previousSibling),e._on_mouse_down(d,y),e._drag_mode&&e._drag_mode!="create"&&e.for_rendered(e._drag_id,function(b,k){b.style.display="none",e._rendered.splice(k,1)}),e.config.touch_tip&&e._show_global_tip(),e.updateEvent(e._drag_id)}},e.config.touch_drag),d=f}}else a=!0}),h(this._els.dhx_cal_data[0],i[2],function(u){if(document&&document.body&&document.body.classList.remove("dhx_cal_touch_active"),!r(u))return e.config.touch_swipe_dates&&!_&&function(f,c,p,m){if(!f||!c)return!1;for(var g=f.target;g&&g!=e._obj;)g=g.parentNode;if(g!=e._obj||e.matrix&&e.matrix[e.getState().mode]&&e.matrix[e.getState().mode].scrollable)return!1;var y=Math.abs(f.pageY-c.pageY),x=Math.abs(f.pageX-c.pageX);return yp&&(!y||x/y>3)&&(f.pageX>c.pageX?e._click.dhx_cal_next_button():e._click.dhx_cal_prev_button(),!0)}(d,n,200,100)&&(e._block_next_stop=!0),_&&(e._ignore_next_click=!0,setTimeout(function(){e._ignore_next_click=!1},100)),v(u),e._block_next_stop?(e._block_next_stop=!1,u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,!1):void 0}),e.event(document.body,i[2],v)},e._show_global_tip=function(){e._hide_global_tip();var i=e._global_tip=document.createElement("div");i.className="dhx_global_tip",e._update_global_tip(1),document.body.appendChild(i)},e._update_global_tip=function(i){var t=e._global_tip;if(t){var r="";if(e._drag_id&&!i){var d=e.getEvent(e._drag_id);d&&(r="
"+(d._timed?e.templates.event_header(d.start_date,d.end_date,d):e.templates.day_date(d.start_date,d.end_date,d))+"
")}e._drag_mode=="create"||e._drag_mode=="new-size"?t.innerHTML=(e.locale.labels.drag_to_create||"Drag to create")+r:t.innerHTML=(e.locale.labels.drag_to_move||"Drag to move")+r}},e._hide_global_tip=function(){var i=e._global_tip;i&&i.parentNode&&(i.parentNode.removeChild(i),e._global_tip=0)}}function Ft(e){var i,t;function r(){if(e._is_material_skin())return!0;if(t!==void 0)return t;var _=document.createElement("div");_.style.position="absolute",_.style.left="-9999px",_.style.top="-9999px",_.innerHTML="
",document.body.appendChild(_);var a=window.getComputedStyle(_.querySelector(".dhx_body")).getPropertyValue("box-sizing");document.body.removeChild(_),(t=a==="border-box")||setTimeout(function(){t=void 0},1e3)}function d(){if(!e._is_material_skin()&&!e._border_box_events()){var _=t;t=void 0,i=void 0,_!==r()&&e.$container&&e.getState().mode&&e.setCurrentView()}}function n(_){var a=_.getMinutes();return a=a<10?"0"+a:a,""+_.getHours()+" "+a+""}e._addThemeClass=function(){document.documentElement.setAttribute("data-scheduler-theme",e.skin)},e._skin_settings={fix_tab_position:[1,0],use_select_menu_space:[1,0],wide_form:[1,0],hour_size_px:[44,42],displayed_event_color:["#ff4a4a","ffc5ab"],displayed_event_text_color:["#ffef80","7e2727"]},e._skin_xy={lightbox_additional_height:[90,50],nav_height:[59,22],bar_height:[24,20]},e._is_material_skin=function(){return e.skin?(e.skin+"").indexOf("material")>-1:function(){if(i===void 0){var _=document.createElement("div");_.style.position="absolute",_.style.left="-9999px",_.style.top="-9999px",_.innerHTML="
",document.body.appendChild(_);var a=window.getComputedStyle(_.querySelector(".dhx_cal_scale_placeholder")).getPropertyValue("position");i=a==="absolute",setTimeout(function(){i=null,_&&_.parentNode&&_.parentNode.removeChild(_)},500)}return i}()},e._build_skin_info=function(){(function(){const u=e.$container;clearInterval(s),u&&(s=setInterval(()=>{const f=getComputedStyle(u).getPropertyValue("--dhx-scheduler-theme");f&&f!==e.skin&&e.setSkin(f)},100))})();const _=getComputedStyle(this.$container),a=_.getPropertyValue("--dhx-scheduler-theme");let o,l=!!a,h={},v=!1;if(l){o=a;for(let u in e.xy)h[u]=_.getPropertyValue(`--dhx-scheduler-xy-${u}`);h.hour_size_px=_.getPropertyValue("--dhx-scheduler-config-hour_size_px"),h.wide_form=_.getPropertyValue("--dhx-scheduler-config-form_wide")}else o=function(){for(var u=document.getElementsByTagName("link"),f=0;f{switch(o.getAttribute("data-tab")||o.getAttribute("name")){case"day":case"day_tab":o.classList.add("dhx_cal_tab_first"),o.classList.add("dhx_cal_tab_segmented");break;case"week":case"week_tab":o.classList.add("dhx_cal_tab_segmented");break;case"month":case"month_tab":o.classList.add("dhx_cal_tab_last"),o.classList.add("dhx_cal_tab_segmented");break;default:o.classList.add("dhx_cal_tab_standalone")}}),function(o){if(e.config.header)return;const l=Array.from(o.querySelectorAll(".dhx_cal_tab")),h=["day","week","month"].map(u=>l.find(f=>f.getAttribute("data-tab")===u)).filter(u=>u!==void 0);let v=l.length>0?l[0]:null;h.reverse().forEach(u=>{o.insertBefore(u,v),v=u})}(e._els.dhx_cal_navline[0]))},{once:!0})}}function Jt(e,i){this.$scheduler=e,this.$dp=i,this._dataProcessorHandlers=[],this.attach=function(){var t=this.$dp,r=this.$scheduler;this._dataProcessorHandlers.push(r.attachEvent("onEventAdded",function(d){!this._loading&&this._validId(d)&&t.setUpdated(d,!0,"inserted")})),this._dataProcessorHandlers.push(r.attachEvent("onConfirmedBeforeEventDelete",function(d){if(this._validId(d)){var n=t.getState(d);return n=="inserted"||this._new_event?(t.setUpdated(d,!1),!0):n!="deleted"&&(n=="true_deleted"||(t.setUpdated(d,!0,"deleted"),!1))}})),this._dataProcessorHandlers.push(r.attachEvent("onEventChanged",function(d){!this._loading&&this._validId(d)&&t.setUpdated(d,!0,"updated")})),this._dataProcessorHandlers.push(r.attachEvent("onClearAll",function(){t._in_progress={},t._invalid={},t.updatedRows=[],t._waitMode=0})),t.attachEvent("insertCallback",r._update_callback),t.attachEvent("updateCallback",r._update_callback),t.attachEvent("deleteCallback",function(d,n){r.getEvent(n)?(r.setUserData(n,this.action_param,"true_deleted"),r.deleteEvent(n)):r._add_rec_marker&&r._update_callback(d,n)})},this.detach=function(){for(var t in this._dataProcessorHandlers){var r=this._dataProcessorHandlers[t];this.$scheduler.detachEvent(r)}this._dataProcessorHandlers=[]}}function Le(e){return this.serverProcessor=e,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this._headers=null,this._payload=null,this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),Ae(this),this}function Wt(e){var i="data-dhxbox",t=null;function r(m,g){var y=m.callback;f.hide(m.box),t=m.box=null,y&&y(g)}function d(m){if(t){var g=m.which||m.keyCode,y=!1;if(c.keyboard){if(g==13||g==32){var x=m.target||m.srcElement;se.getClassName(x).indexOf("scheduler_popup_button")>-1&&x.click?x.click():(r(t,!0),y=!0)}g==27&&(r(t,!1),y=!0)}return y?(m.preventDefault&&m.preventDefault(),!(m.cancelBubble=!0)):void 0}}function n(m){n.cover||(n.cover=document.createElement("div"),e.event(n.cover,"keydown",d),n.cover.className="dhx_modal_cover",document.body.appendChild(n.cover)),n.cover.style.display=m?"inline-block":"none"}function s(m,g,y){var x=e._waiAria.messageButtonAttrString(m),b=(g||"").toLowerCase().replace(/ /g,"_");return`
${m}
`}function _(){for(var m=[].slice.apply(arguments,[0]),g=0;g'+E.title+"
"),M+='
'+(E.content?"":E.text)+'
',D&&(M+=s(_(E.ok,e.locale.labels.message_ok,"OK"),"ok",!0)),w&&(M+=s(_(E.cancel,e.locale.labels.message_cancel,"Cancel"),"cancel",!1)),E.buttons)for(var T=0;T",k.className="scheduler-info dhtmlx-info scheduler-"+b.type+" dhtmlx-"+b.type,e.event(k,"click",function(E){b.callback&&b.callback.call(this,E),c.hide(b.id),b=null}),e._waiAria.messageInfoAttr(k),c.position=="bottom"&&c.area.firstChild?c.area.insertBefore(k,c.area.firstChild):c.area.appendChild(k),b.expire>0&&(c.timers[b.id]=window.setTimeout(function(){c&&c.hide(b.id)},b.expire)),c.pull[b.id]=k,k=null,b.id}(m)}};c.seed=new Date().valueOf(),c.uid=ee.uid,c.expire=4e3,c.keyboard=!0,c.position="top",c.pull={},c.timers={},c.hideAll=function(){for(var m in c.pull)c.hide(m)},c.hide=function(m){var g=c.pull[m];g&&g.parentNode&&(window.setTimeout(function(){g.parentNode.removeChild(g),g=null},2e3),g.className+=" hidden",c.timers[m]&&window.clearTimeout(c.timers[m]),delete c.pull[m])};var p=[];return e.attachEvent("onMessagePopup",function(m){p.push(m)}),e.attachEvent("onAfterMessagePopup",function(m){for(var g=0;g{this.callEvent("onStateChange",[n,d])})}getState(){return{...this.state,mode:this.state.modes[this.state.currentModeIndex]}}setState(i){const t={...this.state};i.mode&&(i.currentModeIndex=this.state.modes.indexOf(i.mode)),this.state={...this.state,...i},this._notifyStateChange(t,this.state),this.container&&this.render(this.container)}onStateChange(i){return this.onStateChangeHandlers.push(i),()=>{const t=this.onStateChangeHandlers.indexOf(i);t!==-1&&this.onStateChangeHandlers.splice(t,1)}}_notifyStateChange(i,t){this.onStateChangeHandlers.forEach(r=>r(i,t))}_adjustDate(i){const{mode:t,date:r}=this.getState(),d=new Date(r);t==="days"?d.setMonth(r.getMonth()+i):t==="months"?d.setFullYear(r.getFullYear()+i):d.setFullYear(r.getFullYear()+10*i),this.setState({date:d})}_toggleMode(){const i=(this.state.currentModeIndex+1)%this.state.modes.length;this.setState({currentModeIndex:i})}_renderCalendarHeader(i){const{mode:t,date:r}=this.getState(),d=document.createElement("div");d.classList.add("dhx_cal_datepicker_header");const n=document.createElement("button");n.classList.add("dhx_cal_datepicker_arrow","scheduler_icon","arrow_left"),d.appendChild(n);const s=document.createElement("div");if(s.classList.add("dhx_cal_datepicker_title"),t==="days")s.innerText=r.toLocaleString("default",{month:"long"})+" "+r.getFullYear();else if(t==="months")s.innerText=r.getFullYear();else{const a=10*Math.floor(r.getFullYear()/10);s.innerText=`${a} - ${a+9}`}this._domEvents.attach(s,"click",this._toggleMode.bind(this)),d.appendChild(s);const _=document.createElement("button");_.classList.add("dhx_cal_datepicker_arrow","scheduler_icon","arrow_right"),d.appendChild(_),i.appendChild(d),this._domEvents.attach(n,"click",this._adjustDate.bind(this,-1)),this._domEvents.attach(_,"click",this._adjustDate.bind(this,1))}render(i){this._domEvents.detachAll(),this.container=i||this.container,this.container.innerHTML="",this.element||(this.element=document.createElement("div"),this.element.classList.add("dhx_cal_datepicker")),this.element.innerHTML="",this.container.appendChild(this.element),this._renderCalendarHeader(this.element);const t=document.createElement("div");t.classList.add("dhx_cal_datepicker_data"),this.element.appendChild(t);const{mode:r}=this.getState();r==="days"?this._renderDayGrid(t):r==="months"?this._renderMonthGrid(t):this._renderYearGrid(t)}_renderDayGridHeader(i){const{date:t}=this.getState(),r=this.scheduler;let d=r.date.week_start(new Date(t));const n=r.date.add(r.date.week_start(new Date(t)),1,"week");i.classList.add("dhx_cal_datepicker_days");const s=r.date.date_to_str("%D");for(;d.valueOf()(y[this.scheduler.date.day_start(new Date(x)).valueOf()]=!0,y),{}),o=document.createElement("div");this._renderDayGridHeader(o),i.appendChild(o);const l=this.scheduler,h=l.date.week_start(l.date.month_start(new Date(t))),v=l.date.month_start(new Date(t)),u=l.date.add(l.date.month_start(new Date(t)),1,"month");let f=l.date.add(l.date.month_start(new Date(t)),1,"month");const c=l.date.date_part(l._currentDate());f.getDay()!==0&&(f=l.date.add(l.date.week_start(f),1,"week"));let p=this._weeksBetween(h,f);n&&p{const x=y.target.closest("[data-cell-date]"),b=new Date(x.getAttribute("data-cell-date"));this.callEvent("onDateClick",[b,y])});m.valueOf()=u.valueOf()&&y.classList.add("dhx_after"),m.getDay()!==0&&m.getDay()!==6||y.classList.add("dhx_cal_datepicker_weekend"),m.valueOf()==c.valueOf()&&y.classList.add("dhx_now"),s&&_&&m.valueOf()>=s.valueOf()&&m.valueOf()<_.valueOf()&&y.classList.add("dhx_cal_datepicker_current"),a[m.valueOf()]&&y.classList.add("dhx_cal_datepicker_event"),y.classList.add("dhx_cal_datepicker_date"),g.appendChild(y),m=l.date.add(m,1,"day")}i.appendChild(g)}_renderMonthGrid(i){const{date:t}=this.getState(),r=document.createElement("div");r.classList.add("dhx_cal_datepicker_months");const d=[];for(let a=0;a<12;a++)d.push(new Date(t.getFullYear(),a,1));const n=this.scheduler.date.date_to_str("%M");d.forEach(a=>{const o=document.createElement("div");o.classList.add("dhx_cal_datepicker_month"),t.getMonth()===a.getMonth()&&o.classList.add("dhx_cal_datepicker_current"),o.setAttribute("data-month",a.getMonth()),o.innerHTML=n(a),this._domEvents.attach(o,"click",()=>{const l=new Date(a);this.setState({date:l,mode:"days"})}),r.appendChild(o)}),i.appendChild(r);const s=document.createElement("div");s.classList.add("dhx_cal_datepicker_done");const _=document.createElement("button");_.innerText="Done",_.classList.add("dhx_cal_datepicker_done_btn"),this._domEvents.attach(_,"click",()=>{this.setState({mode:"days"})}),s.appendChild(_),i.appendChild(s)}_renderYearGrid(i){const{date:t}=this.getState(),r=10*Math.floor(t.getFullYear()/10),d=document.createElement("div");d.classList.add("dhx_cal_datepicker_years");for(let _=r-1;_<=r+10;_++){const a=document.createElement("div");a.innerText=_,a.classList.add("dhx_cal_datepicker_year"),a.setAttribute("data-year",_),t.getFullYear()===_&&a.classList.add("dhx_cal_datepicker_current"),this._domEvents.attach(a,"click",()=>{this.setState({date:new Date(_,t.getMonth(),1),mode:"months"})}),d.appendChild(a)}i.appendChild(d);const n=document.createElement("div");n.classList.add("dhx_cal_datepicker_done");const s=document.createElement("button");s.innerText="Done",s.classList.add("dhx_cal_datepicker_done_btn"),this._domEvents.attach(s,"click",()=>{this.setState({mode:"months"})}),n.appendChild(s),i.appendChild(n)}destructor(){this.onStateChangeHandlers=[],this.element&&(this.element.innerHTML="",this.element.remove()),this._domEvents.detachAll(),this.callEvent("onDestroy",[]),this.detachAllEvents(),this.scheduler=null}}function Sa(e){const i={version:"7.1.0"};i.$stateProvider=function(){const a={};return{getState:function(o){if(a[o])return a[o].method();{const l={};for(const h in a)a[h].internal||ee.mixin(l,a[h].method(),!0);return l}},registerProvider:function(o,l,h){a[o]={method:l,internal:h}},unregisterProvider:function(o){delete a[o]}}}(),i.getState=i.$stateProvider.getState,function(a){var o={agenda:"https://docs.dhtmlx.com/scheduler/agenda_view.html",grid:"https://docs.dhtmlx.com/scheduler/grid_view.html",map:"https://docs.dhtmlx.com/scheduler/map_view.html",unit:"https://docs.dhtmlx.com/scheduler/units_view.html",timeline:"https://docs.dhtmlx.com/scheduler/timeline_view.html",week_agenda:"https://docs.dhtmlx.com/scheduler/weekagenda_view.html",year:"https://docs.dhtmlx.com/scheduler/year_view.html",anythingElse:"https://docs.dhtmlx.com/scheduler/views.html"},l={agenda:"ext/dhtmlxscheduler_agenda_view.js",grid:"ext/dhtmlxscheduler_grid_view.js",map:"ext/dhtmlxscheduler_map_view.js",unit:"ext/dhtmlxscheduler_units.js",timeline:"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js",week_agenda:"ext/dhtmlxscheduler_week_agenda.js",year:"ext/dhtmlxscheduler_year_view.js",limit:"ext/dhtmlxscheduler_limit.js"};a._commonErrorMessages={unknownView:function(h){var v=l[h]?"You're probably missing "+l[h]+".":"";return"`"+h+"` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \nRelated docs: "+(o[h]||o.anythingElse)+` +`+(v?v+` +`:"")},collapsedContainer:function(h){return`Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. Make sure that the container has some initial height or use different units. For example:
-`}},t.createTimelineView=function(){throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: "+s.timeline+` -Related docs: `+n.timeline)},t.createUnitsView=function(){throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: "+s.unit+` -Related docs: `+n.unit)},t.createGridView=function(){throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: "+s.grid+` -Related docs: `+n.grid)},t.addMarkedTimespan=function(){throw new Error(`scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js -Related docs: https://docs.dhtmlx.com/scheduler/limits.html`)},t.renderCalendar=function(){throw new Error(`scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js -https://docs.dhtmlx.com/scheduler/minicalendar.html`)},t.exportToPNG=function(){throw new Error(["scheduler.exportToPNG is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join(` -`))},t.exportToPDF=function(){throw new Error(["scheduler.exportToPDF is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join(` -`))}})(h),he(h),function(t){W(t),de(t),t._detachDomEvent=function(l,f,g){l.removeEventListener?l.removeEventListener(f,g,!1):l.detachEvent&&l.detachEvent("on"+f,g)},t._init_once=function(){_e(t),t._init_once=function(){}};const n={render:function(l){return t._init_nav_bar(l)}},s={render:function(l){const f=document.createElement("div");return f.className="dhx_cal_header",f}},c={render:function(l){const f=document.createElement("div");return f.className="dhx_cal_data",f}};function u(l){return!!(l.querySelector(".dhx_cal_header")&&l.querySelector(".dhx_cal_data")&&l.querySelector(".dhx_cal_navline"))}t.init=function(l,f,g){if(!this.$destroyed){if(f=f||t._currentDate(),g=g||"week",this._obj&&this.unset_actions(),this._obj=typeof l=="string"?document.getElementById(l):l,this.$container=this._obj,this.$root=this._obj,!this.$container.offsetHeight&&this.$container.offsetWidth&&this.$container.style.height==="100%"&&window.console.error(t._commonErrorMessages.collapsedContainer(),this.$container),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&this.$container.setAttribute("role","application"),this.config.header||u(this.$container)||(this.config.header=function(p){const y=["day","week","month"];if(p.matrix)for(const w in p.matrix)y.push(w);if(p._props)for(const w in p._props)y.push(w);if(p._grid&&p._grid.names)for(const w in p._grid.names)y.push(w);return["map","agenda","week_agenda","year"].forEach(function(w){p[w+"_view"]&&y.push(w)}),y.concat(["date"]).concat(["prev","today","next"])}(this),window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.","Using a default header configuration: ","scheduler.config.header = "+JSON.stringify(this.config.header,null,2),"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join(` -`))),this.config.header)this.$container.innerHTML="",this.$container.classList.add("dhx_cal_container"),this.config.header.height&&(this.xy.nav_height=this.config.header.height),this.$container.appendChild(n.render(this.config.header)),this.$container.appendChild(s.render()),this.$container.appendChild(c.render());else if(!u(this.$container))throw new Error(["Required DOM elements are missing from the scheduler container.","Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup","Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join(` -`));this.config.rtl&&(this.$container.className+=" dhx_cal_container_rtl"),this._skin_init&&t._skin_init(),t.date.init(),this._scroll=!0,this._els=[],this.get_elements(),this.init_templates(),this.set_actions(),this._init_once(),this._init_touch_events(),this.set_sizes(),t.callEvent("onSchedulerReady",[]),t.$initialized=!0,this.setCurrentView(f,g)}},t.xy={min_event_height:20,bar_height:24,scale_width:50,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140,month_head_height:22,event_header_height:14},t.keys={edit_save:13,edit_cancel:27},t.bind=function(l,f){return l.bind?l.bind(f):function(){return l.apply(f,arguments)}},t.set_sizes=function(){var l=this._x=this._obj.clientWidth-this.xy.margin_left,f=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,g=this.$container.querySelector(".dhx_cal_scale_placeholder");t._is_material_skin()?(g||((g=document.createElement("div")).className="dhx_cal_scale_placeholder",this.$container.insertBefore(g,this._els.dhx_cal_header[0])),g.style.display="block",this.set_xy(g,l,this.xy.scale_height+1,0,this._els.dhx_cal_header[0].offsetTop)):g&&g.parentNode.removeChild(g),this._lightbox&&(t.$container.offsetWidth<1200||this._setLbPosition(document.querySelector(".dhx_cal_light"))),this._data_width=l-f,this._els.dhx_cal_navline[0].style.width=l+"px";const p=this._els.dhx_cal_header[0];this.set_xy(p,this._data_width,this.xy.scale_height),p.style.left="",p.style.right="",this._table_view?this.config.rtl?p.style.right="-1px":p.style.left="-1px":this.config.rtl?p.style.right=`${this.xy.scale_width}px`:p.style.left=`${this.xy.scale_width}px`},t.set_xy=function(l,f,g,p,y){function w(k){let E=k;return isNaN(Number(E))||(E=Math.max(0,E)+"px"),E}var b="left";f!==void 0&&(l.style.width=w(f)),g!==void 0&&(l.style.height=w(g)),arguments.length>3&&(p!==void 0&&(this.config.rtl&&(b="right"),l.style[b]=p+"px"),y!==void 0&&(l.style.top=y+"px"))},t.get_elements=function(){const l=this._obj.getElementsByTagName("DIV");for(let f=0;f500&&t.unselect()},dhx_cal_prev_button:function(){t._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(l,f){let g=1;t.config.rtl&&(f=-f,g=-g),t.setCurrentView(t.date.add(t.date[t._mode+"_start"](new Date(t._date)),f||g,t._mode))},dhx_cal_today_button:function(){t.callEvent("onBeforeTodayDisplayed",[])&&t.setCurrentView(t._currentDate())},dhx_cal_tab:function(){const l=this.getAttribute("data-tab"),f=this.getAttribute("name"),g=l||f.substring(0,f.search("_tab"));t.setCurrentView(t._date,g)},buttons:{delete:function(l){const f=t.locale.labels.confirm_deleting;t._dhtmlx_confirm({message:f,title:t.locale.labels.title_confirm_deleting,callback:function(){t.deleteEvent(l)},config:{ok:t.locale.labels.icon_delete}})},edit:function(l){t.edit(l)},save:function(l){t.editStop(!0)},details:function(l){t.showLightbox(l)},form:function(l){t.showLightbox(l)},cancel:function(l){t.editStop(!1)}}},t._dhtmlx_confirm=function({message:l,title:f,callback:g,config:p}){if(!l)return g();p=p||{};const y={...p,text:l};f&&(y.title=f),g&&(y.callback=function(w){w&&g()}),t.confirm(y)},t.addEventNow=function(l,f,g){let p={};t._isObject(l)&&!t._isDate(l)&&(p=l,l=null);const y=6e4*(this.config.event_duration||this.config.time_step);l||(l=p.start_date||Math.round(t._currentDate().valueOf()/y)*y);let w=new Date(l);if(!f){let E=this.config.first_hour;E>w.getHours()&&(w.setHours(E),l=w.valueOf()),f=l.valueOf()+y}let b=new Date(f);w.valueOf()==b.valueOf()&&b.setTime(b.valueOf()+y),p.start_date=p.start_date||w,p.end_date=p.end_date||b,p.text=p.text||this.locale.labels.new_event,p.id=this._drag_id=p.id||this.uid(),this._drag_mode="new-size",this._loading=!0;const k=this.addEvent(p);return this.callEvent("onEventCreated",[this._drag_id,g]),this._loading=!1,this._drag_event={},this._on_mouse_up(g),k},t._on_dbl_click=function(l,f){if(f=f||l.target,this.config.readonly)return;const g=t._getClassName(f).split(" ")[0];switch(g){case"dhx_scale_holder":case"dhx_scale_holder_now":case"dhx_month_body":case"dhx_wa_day_data":if(!t.config.dblclick_create)break;this.addEventNow(this.getActionData(l).date,null,l);break;case"dhx_cal_event":case"dhx_wa_ev_body":case"dhx_agenda_line":case"dhx_cal_agenda_event_line":case"dhx_grid_event":case"dhx_cal_event_line":case"dhx_cal_event_clear":{const p=this._locate_event(f);if(!this.callEvent("onDblClick",[p,l]))return;this.config.details_on_dblclick||this._table_view||!this.getEvent(p)._timed||!this.config.select?this.showLightbox(p):this.edit(p);break}case"dhx_time_block":case"dhx_cal_container":return;default:{const p=this["dblclick_"+g];if(p)p.call(this,l);else if(f.parentNode&&f!=this)return t._on_dbl_click(l,f.parentNode);break}}},t._get_column_index=function(l){let f=0;if(this._cols){let g=0,p=0;for(;g+this._cols[p]=this._cols.length)for(;f>=1&&this._ignores[Math.floor(f)];)f--}return f},t._week_indexes_from_pos=function(l){if(this._cols){const f=this._get_column_index(l.x);return l.x=Math.min(this._cols.length-1,Math.max(0,Math.ceil(f)-1)),l.y=Math.max(0,Math.ceil(60*l.y/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step),l}return l},t._mouse_coords=function(l){let f;const g=document.body,p=document.documentElement;f=this.$env.isIE||!l.pageX&&!l.pageY?{x:l.clientX+(g.scrollLeft||p.scrollLeft||0)-g.clientLeft,y:l.clientY+(g.scrollTop||p.scrollTop||0)-g.clientTop}:{x:l.pageX,y:l.pageY},this.config.rtl&&this._colsS?(f.x=this.$container.querySelector(".dhx_cal_data").offsetWidth-f.x,f.x+=this.$domHelpers.getAbsoluteLeft(this._obj),this._mode!=="month"&&(f.x-=this.xy.scale_width)):f.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);const y=this.$container.querySelector(".dhx_cal_data");f.y-=this.$domHelpers.getAbsoluteTop(y)-this._els.dhx_cal_data[0].scrollTop,f.ev=l;const w=this["mouse_"+this._mode];if(w)f=w.call(this,f);else if(this._table_view){const b=this._get_column_index(f.x);if(!this._cols||!this._colsS)return f;let k=0;for(k=1;kf.y);k++);f.y=Math.ceil(24*(Math.max(0,b)+7*Math.max(0,k-1))*60/this.config.time_step),(t._drag_mode||this._mode=="month")&&(f.y=24*(Math.max(0,Math.ceil(b)-1)+7*Math.max(0,k-1))*60/this.config.time_step),this._drag_mode=="move"&&t._ignores_detected&&t.config.preserve_length&&(f._ignores=!0,this._drag_event._event_length||(this._drag_event._event_length=this._get_real_event_length(this._drag_event.start_date,this._drag_event.end_date,{x_step:1,x_unit:"day"}))),f.x=0}else f=this._week_indexes_from_pos(f);return f.timestamp=+new Date,f},t._close_not_saved=function(){if(new Date().valueOf()-(t._new_event||0)>500&&t._edit_id){const l=t.locale.labels.confirm_closing;t._dhtmlx_confirm({message:l,title:t.locale.labels.title_confirm_closing,callback:function(){t.editStop(t.config.positive_closing)}}),l&&(this._drag_id=this._drag_pos=this._drag_mode=null)}},t._correct_shift=function(l,f){return l-6e4*(new Date(t._min_date).getTimezoneOffset()-new Date(l).getTimezoneOffset())*(f?-1:1)},t._is_pos_changed=function(l,f){function g(p,y,w){return Math.abs(p-y)>w}return!l||!this._drag_pos||!!(this._drag_pos.has_moved||!this._drag_pos.timestamp||f.timestamp-this._drag_pos.timestamp>100||g(l.ev.clientX,f.ev.clientX,5)||g(l.ev.clientY,f.ev.clientY,5))},t._correct_drag_start_date=function(l){let f;t.matrix&&(f=t.matrix[t._mode]),f=f||{x_step:1,x_unit:"day"},l=new Date(l);let g=1;return(f._start_correction||f._end_correction)&&(g=60*(f.last_hour||0)-(60*l.getHours()+l.getMinutes())||1),1*l+(t._get_fictional_event_length(l,g,f)-g)},t._correct_drag_end_date=function(l,f){let g;t.matrix&&(g=t.matrix[t._mode]),g=g||{x_step:1,x_unit:"day"};const p=1*l+t._get_fictional_event_length(l,f,g);return new Date(1*p-(t._get_fictional_event_length(p,-1,g,-1)+1))},t._on_mouse_move=function(l){if(this._drag_mode){var f=this._mouse_coords(l);if(this._is_pos_changed(this._drag_pos,f)){var g,p;if(this._edit_id!=this._drag_id&&this._close_not_saved(),!this._drag_mode)return;var y=null;if(this._drag_pos&&!this._drag_pos.has_moved&&((y=this._drag_pos).has_moved=!0),this._drag_pos=f,this._drag_pos.has_moved=!0,this._drag_mode=="create"){if(y&&(f=y),this._close_not_saved(),this.unselect(this._select_id),this._loading=!0,g=this._get_date_from_pos(f).valueOf(),!this._drag_start)return this.callEvent("onBeforeEventCreated",[l,this._drag_id])?(this._loading=!1,void(this._drag_start=g)):void(this._loading=!1);p=g,this._drag_start;var w=new Date(this._drag_start),b=new Date(p);this._mode!="day"&&this._mode!="week"||w.getHours()!=b.getHours()||w.getMinutes()!=b.getMinutes()||(b=new Date(this._drag_start+1e3)),this._drag_id=this.uid(),this.addEvent(w,b,this.locale.labels.new_event,this._drag_id,f.fields),this.callEvent("onEventCreated",[this._drag_id,l]),this._loading=!1,this._drag_mode="new-size"}var k,E=this.config.time_step,D=this.getEvent(this._drag_id);if(t.matrix&&(k=t.matrix[t._mode]),k=k||{x_step:1,x_unit:"day"},this._drag_mode=="move")g=this._min_date.valueOf()+6e4*(f.y*this.config.time_step+24*f.x*60),!f.custom&&this._table_view&&(g+=1e3*this.date.time_part(D.start_date)),!this._table_view&&this._dragEventBody&&this._drag_event._move_event_shift===void 0&&(this._drag_event._move_event_shift=g-D.start_date),this._drag_event._move_event_shift&&(g-=this._drag_event._move_event_shift),g=this._correct_shift(g),f._ignores&&this.config.preserve_length&&this._table_view&&k?(g=t._correct_drag_start_date(g),p=t._correct_drag_end_date(g,this._drag_event._event_length)):p=D.end_date.valueOf()-(D.start_date.valueOf()-g);else{if(g=D.start_date.valueOf(),p=D.end_date.valueOf(),this._table_view){var x=this._min_date.valueOf()+f.y*this.config.time_step*6e4+(f.custom?0:864e5);if(this._mode=="month")if(x=this._correct_shift(x,!1),this._drag_from_start){var S=864e5;x<=t.date.date_part(new Date(p+S-1)).valueOf()&&(g=x-S)}else p=x;else this.config.preserve_length?f.resize_from_start?g=t._correct_drag_start_date(x):p=t._correct_drag_end_date(x,0):f.resize_from_start?g=x:p=x}else{var N=this.date.date_part(new Date(D.end_date.valueOf()-1)).valueOf(),M=new Date(N),A=this.config.first_hour,C=60/E*(this.config.last_hour-A);this.config.time_step=1;var T=this._mouse_coords(l);this.config.time_step=E;var O=f.y*E*6e4,L=Math.min(f.y+1,C)*E*6e4,H=6e4*T.y;p=Math.abs(O-H)>Math.abs(L-H)?N+L:N+O,p+=6e4*(new Date(p).getTimezoneOffset()-M.getTimezoneOffset()),this._els.dhx_cal_data[0].style.cursor="s-resize",this._mode!="week"&&this._mode!="day"||(p=this._correct_shift(p))}if(this._drag_mode=="new-size")if(p<=this._drag_start){var V=f.shift||(this._table_view&&!f.custom?864e5:0);g=p-(f.shift?0:V),p=this._drag_start+(V||6e4*E)}else g=this._drag_start;else p<=g&&(p=g+6e4*E)}var z=new Date(p-1),$=new Date(g);if(this._drag_mode=="move"&&t.config.limit_drag_out&&(+$<+t._min_date||+p>+t._max_date)){if(+D.start_date<+t._min_date||+D.end_date>+t._max_date)$=new Date(D.start_date),p=new Date(D.end_date);else{var j=p-$;+$<+t._min_date?($=new Date(t._min_date),f._ignores&&this.config.preserve_length&&this._table_view?($=new Date(t._correct_drag_start_date($)),k._start_correction&&($=new Date($.valueOf()+k._start_correction)),p=new Date(1*$+this._get_fictional_event_length($,this._drag_event._event_length,k))):p=new Date(+$+j)):(p=new Date(t._max_date),f._ignores&&this.config.preserve_length&&this._table_view?(k._end_correction&&(p=new Date(p.valueOf()-k._end_correction)),p=new Date(1*p-this._get_fictional_event_length(p,0,k,!0)),$=new Date(1*p-this._get_fictional_event_length(p,this._drag_event._event_length,k,!0)),this._ignores_detected&&($=t.date.add($,k.x_step,k.x_unit),p=new Date(1*p-this._get_fictional_event_length(p,0,k,!0)),p=t.date.add(p,k.x_step,k.x_unit))):$=new Date(+p-j))}z=new Date(p-1)}if(!this._table_view&&this._dragEventBody&&!t.config.all_timed&&(!t._get_section_view()&&f.x!=this._get_event_sday({start_date:new Date(g),end_date:new Date(g)})||new Date(g).getHours()=this.config.last_hour)||(j=p-$,S=this._min_date.valueOf()+24*f.x*60*6e4,(p=t.date.date_part(new Date(S))).setHours(this.config.last_hour),z=new Date(p-1),this._drag_mode=="move"&&($=new Date(+p-j))),this._table_view||z.getDate()==$.getDate()&&z.getHours()=y?T+=" dhx_after":g.valueOf()==b.valueOf()&&(T+=" dhx_now"),this._ignores_detected&&this._ignores[A]&&(T+=" dhx_scale_ignore"),C.className=T+" "+this.templates.month_date_class(g,b),C.setAttribute("data-cell-date",t.templates.format_date(g));var O="dhx_month_body",L="dhx_month_head";if(A===0&&this.config.left_border&&(O+=" dhx_month_body_border",L+=" dhx_month_head_border"),this._ignores_detected&&this._ignores[A])C.appendChild(document.createElement("div")),C.appendChild(document.createElement("div"));else{C.style.width=k[A],this._waiAria.monthCellAttr(C,g);var H=document.createElement("div");H.style.height=t.xy.month_head_height+"px",H.className=L,H.innerHTML=this.templates.month_day(g),C.appendChild(H);var V=document.createElement("div");V.className=O,C.appendChild(V)}var z=g.getDate();(g=this.date.add(g,1,"day")).getDate()-z>1&&(g=new Date(g.getFullYear(),g.getMonth(),z+1,12,0))}t._colsS.heights[E]=S,S+=x(E)}return this._min_date=w,this._max_date=g,l.innerHTML="",l.appendChild(N),this._scales={},l.querySelectorAll("[data-cell-date]").forEach($=>{const j=t.templates.parse_date($.getAttribute("data-cell-date")),U=$.querySelector(".dhx_month_body");this._scales[+j]=U,this.callEvent("onScaleAdd",[this._scales[+j],j])}),this._max_date},t._reset_month_scale=function(l,f,g,p){var y=t.date.add(f,1,"month"),w=t._currentDate();this.date.date_part(w),this.date.date_part(g),p=p||Math.ceil(Math.round((y.valueOf()-g.valueOf())/864e5)/7);var b=Math.floor(l.clientHeight/p)-this.xy.month_head_height;return this._colsS.height=b+this.xy.month_head_height,this._colsS.heights=[],t._render_month_scale(l,f,g,p)},t.getView=function(l){return l||(l=t.getState().mode),t.matrix&&t.matrix[l]?t.matrix[l]:t._props&&t._props[l]?t._props[l]:null},t.getLabel=function(l,f){for(var g=this.config.lightbox.sections,p=0;pt.getState().max_date.valueOf()&&(p+=m(f,t.getState().max_date))):p=Math.round(y/60/60/1e3/24);for(var k=!0;bC.valueOf()&&(D+=S-C),S.valueOf()>A.valueOf()?D+=g._start_correction:D+=60*S.getHours()*60*1e3+60*S.getMinutes()*1e3,x.valueOf()`,"gm"),s=new RegExp(" +","gm");function c(l){return(l+"").replace(n," ").replace(s," ")}var u=new RegExp("'","gm");function v(l){return(l+"").replace(u,"'")}for(var m in t._waiAria={getAttributeString:function(l){var f=[" "];for(var g in l)if(typeof l[g]!="function"&&typeof l[g]!="object"){var p=v(c(l[g]));f.push(g+"='"+p+"'")}return f.push(" "),f.join(" ")},setAttributes:function(l,f){for(var g in f)l.setAttribute(g,c(f[g]));return l},labelAttr:function(l,f){return this.setAttributes(l,{"aria-label":f})},label:function(l){return t._waiAria.getAttributeString({"aria-label":l})},hourScaleAttr:function(l,f){this.labelAttr(l,f)},monthCellAttr:function(l,f){this.labelAttr(l,t.templates.day_date(f))},navBarDateAttr:function(l,f){this.labelAttr(l,f)},dayHeaderAttr:function(l,f){this.labelAttr(l,f)},dayColumnAttr:function(l,f){this.dayHeaderAttr(l,t.templates.day_date(f))},headerButtonsAttributes:function(l,f){return this.setAttributes(l,{role:"button","aria-label":f})},headerToggleState:function(l,f){return this.setAttributes(l,{"aria-pressed":f?"true":"false"})},getHeaderCellAttr:function(l){return t._waiAria.getAttributeString({"aria-label":l})},eventAttr:function(l,f){this._eventCommonAttr(l,f)},_eventCommonAttr:function(l,f){f.setAttribute("aria-label",c(t.templates.event_text(l.start_date,l.end_date,l))),t.config.readonly&&f.setAttribute("aria-readonly",!0),l.$dataprocessor_class&&f.setAttribute("aria-busy",!0),f.setAttribute("aria-selected",t.getState().select_id==l.id?"true":"false")},setEventBarAttr:function(l,f){this._eventCommonAttr(l,f)},_getAttributes:function(l,f){var g={setAttribute:function(p,y){this[p]=y}};return l.apply(this,[f,g]),g},eventBarAttrString:function(l){return this.getAttributeString(this._getAttributes(this.setEventBarAttr,l))},agendaHeadAttrString:function(){return this.getAttributeString({role:"row"})},agendaHeadDateString:function(l){return this.getAttributeString({role:"columnheader","aria-label":l})},agendaHeadDescriptionString:function(l){return this.agendaHeadDateString(l)},agendaDataAttrString:function(){return this.getAttributeString({role:"grid"})},agendaEventAttrString:function(l){var f=this._getAttributes(this._eventCommonAttr,l);return f.role="row",this.getAttributeString(f)},agendaDetailsBtnString:function(){return this.getAttributeString({role:"button","aria-label":t.locale.labels.icon_details})},gridAttrString:function(){return this.getAttributeString({role:"grid"})},gridRowAttrString:function(l){return this.agendaEventAttrString(l)},gridCellAttrString:function(l,f,g){return this.getAttributeString({role:"gridcell","aria-label":[f.label===void 0?f.id:f.label,": ",g]})},mapAttrString:function(){return this.gridAttrString()},mapRowAttrString:function(l){return this.gridRowAttrString(l)},mapDetailsBtnString:function(){return this.agendaDetailsBtnString()},minicalHeader:function(l,f){this.setAttributes(l,{id:f+"","aria-live":"assertice","aria-atomic":"true"})},minicalGrid:function(l,f){this.setAttributes(l,{"aria-labelledby":f+"",role:"grid"})},minicalRow:function(l){this.setAttributes(l,{role:"row"})},minicalDayCell:function(l,f){var g=f.valueOf()=t._min_date.valueOf();this.setAttributes(l,{role:"gridcell","aria-label":t.templates.day_date(f),"aria-selected":g?"true":"false"})},minicalHeadCell:function(l){this.setAttributes(l,{role:"columnheader"})},weekAgendaDayCell:function(l,f){var g=l.querySelector(".dhx_wa_scale_bar"),p=l.querySelector(".dhx_wa_day_data"),y=t.uid()+"";this.setAttributes(g,{id:y}),this.setAttributes(p,{"aria-labelledby":y})},weekAgendaEvent:function(l,f){this.eventAttr(f,l)},lightboxHiddenAttr:function(l){l.setAttribute("aria-hidden","true")},lightboxVisibleAttr:function(l){l.setAttribute("aria-hidden","false")},lightboxSectionButtonAttrString:function(l){return this.getAttributeString({role:"button","aria-label":l,tabindex:"0"})},yearHeader:function(l,f){this.setAttributes(l,{id:f+""})},yearGrid:function(l,f){this.minicalGrid(l,f)},yearHeadCell:function(l){return this.minicalHeadCell(l)},yearRow:function(l){return this.minicalRow(l)},yearDayCell:function(l){this.setAttributes(l,{role:"gridcell"})},lightboxAttr:function(l){l.setAttribute("role","dialog"),l.setAttribute("aria-hidden","true"),l.firstChild.setAttribute("role","heading")},lightboxButtonAttrString:function(l){return this.getAttributeString({role:"button","aria-label":t.locale.labels[l],tabindex:"0"})},eventMenuAttrString:function(l){return this.getAttributeString({role:"button","aria-label":t.locale.labels[l]})},lightboxHeader:function(l,f){l.setAttribute("aria-label",f)},lightboxSelectAttrString:function(l){var f="";switch(l){case"%Y":f=t.locale.labels.year;break;case"%m":f=t.locale.labels.month;break;case"%d":f=t.locale.labels.day;break;case"%H:%i":f=t.locale.labels.hour+" "+t.locale.labels.minute}return t._waiAria.getAttributeString({"aria-label":f})},messageButtonAttrString:function(l){return"tabindex='0' role='button' aria-label='"+l+"'"},messageInfoAttr:function(l){l.setAttribute("role","alert")},messageModalAttr:function(l,f){l.setAttribute("role","dialog"),f&&l.setAttribute("aria-labelledby",f)},quickInfoAttr:function(l){l.setAttribute("role","dialog")},quickInfoHeaderAttrString:function(){return" role='heading' "},quickInfoHeader:function(l,f){l.setAttribute("aria-label",f)},quickInfoButtonAttrString:function(l){return t._waiAria.getAttributeString({role:"button","aria-label":l,tabindex:"0"})},tooltipAttr:function(l){l.setAttribute("role","tooltip")},tooltipVisibleAttr:function(l){l.setAttribute("aria-hidden","false")},tooltipHiddenAttr:function(l){l.setAttribute("aria-hidden","true")}},t._waiAria)t._waiAria[m]=function(l){return function(){return t.config.wai_aria_attributes?l.apply(this,arguments):" "}}(t._waiAria[m])})()}(h),h.utils=I,h.$domHelpers=B,h.utils.dom=B,h.uid=I.uid,h.mixin=I.mixin,h.defined=I.defined,h.assert=function(t){return function(n,s){n||t.config.show_errors&&t.callEvent("onError",[s])!==!1&&(t.message?t.message({type:"error",text:s,expire:-1}):console.log(s))}}(h),h.copy=I.copy,h._createDatePicker=function(t,n){return new at(h,t,n)},h._getFocusableNodes=B.getFocusableNodes,h._getClassName=B.getClassName,h._locate_css=B.locateCss;const a=De(h);var r,d,i;h.utils.mixin(h,a),h.env=h.$env=ye,h.Promise=window.Promise,function(t){t.destructor=function(){for(var n in t.callEvent("onDestroy",[]),this.clearAll(),this.$container&&(this.$container.innerHTML=""),this._eventRemoveAll&&this._eventRemoveAll(),this.resetLightbox&&this.resetLightbox(),this._dp&&this._dp.destructor&&this._dp.destructor(),this.detachAllEvents(),this)n.indexOf("$")===0&&delete this[n];t.$destroyed=!0}}(h),function(t){function n(s,c){var u={method:s};if(c.length===0)throw new Error("Arguments list of query is wrong.");if(c.length===1)return typeof c[0]=="string"?(u.url=c[0],u.async=!0):(u.url=c[0].url,u.async=c[0].async||!0,u.callback=c[0].callback,u.headers=c[0].headers),c[0].data?typeof c[0].data!="string"?u.data=X(c[0].data):u.data=c[0].data:u.data="",u;switch(u.url=c[0],s){case"GET":case"DELETE":u.callback=c[1],u.headers=c[2];break;case"POST":case"PUT":c[1]?typeof c[1]!="string"?u.data=X(c[1]):u.data=c[1]:u.data="",u.callback=c[2],u.headers=c[3]}return u}t.Promise=window.Promise,t.ajax={cache:!0,method:"get",serializeRequestParams:X,parse:function(s){return typeof s!="string"?s:(s=s.replace(/^[\s]+/,""),typeof DOMParser>"u"||t.$env.isIE?window.ActiveXObject!==void 0&&((c=new window.ActiveXObject("Microsoft.XMLDOM")).async="false",c.loadXML(s)):c=new DOMParser().parseFromString(s,"text/xml"),c);var c},xmltop:function(s,c,u){if(c.status===void 0||c.status<400){var v=c.responseXML?c.responseXML||c:this.parse(c.responseText||c);if(v&&v.documentElement!==null&&!v.getElementsByTagName("parsererror").length)return v.getElementsByTagName(s)[0]}return u!==-1&&t.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],u]),document.createElement("DIV")},xpath:function(s,c){if(c.nodeName||(c=c.responseXML||c),t.$env.isIE)return c.selectNodes(s)||[];for(var u,v=[],m=(c.ownerDocument||c).evaluate(s,c,null,XPathResult.ANY_TYPE,null);u=m.iterateNext();)v.push(u);return v},query:function(s){return this._call(s.method||"GET",s.url,s.data||"",s.async||!0,s.callback,s.headers)},get:function(s,c,u){var v=n("GET",arguments);return this.query(v)},getSync:function(s,c){var u=n("GET",arguments);return u.async=!1,this.query(u)},put:function(s,c,u,v){var m=n("PUT",arguments);return this.query(m)},del:function(s,c,u){var v=n("DELETE",arguments);return this.query(v)},post:function(s,c,u,v){arguments.length==1?c="":arguments.length==2&&typeof c=="function"&&(u=c,c="");var m=n("POST",arguments);return this.query(m)},postSync:function(s,c,u){c=c===null?"":String(c);var v=n("POST",arguments);return v.async=!1,this.query(v)},_call:function(s,c,u,v,m,l){return new t.Promise((function(f,g){var p=typeof XMLHttpRequest===void 0||t.$env.isIE?new window.ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest,y=navigator.userAgent.match(/AppleWebKit/)!==null&&navigator.userAgent.match(/Qt/)!==null&&navigator.userAgent.match(/Safari/)!==null;if(v&&p.addEventListener("readystatechange",function(){if(p.readyState==4||y&&p.readyState==3){if((p.status!=200||p.responseText==="")&&!t.callEvent("onAjaxError",[p]))return;setTimeout(function(){typeof m=="function"&&m.apply(window,[{xmlDoc:p,filePath:c}]),f(p),typeof m=="function"&&(m=null,p=null)},0)}}),s!="GET"||this.cache||(c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"),p.open(s,c,v),l)for(var w in l)p.setRequestHeader(w,l[w]);else s.toUpperCase()=="POST"||s=="PUT"||s=="DELETE"?p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):s=="GET"&&(u=null);if(p.setRequestHeader("X-Requested-With","XMLHttpRequest"),p.send(u),!v)return{xmlDoc:p,filePath:c}}).bind(this))},urlSeparator:function(s){return s.indexOf("?")!=-1?"&":"?"}},t.$ajax=t.ajax}(h),be(h),function(t){t.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D %j",hour_date:"%H:%i",month_day:"%d",date_format:"%Y-%m-%d %H:%i",api_date:"%d-%m-%Y %H:%i",parse_exact_format:!1,preserve_length:!0,time_step:5,displayed_event_color:"#ff4a4a",displayed_event_text_color:"#ffef80",wide_form:0,day_column_padding:8,use_select_menu_space:!0,fix_tab_position:!0,start_on_monday:!0,first_hour:0,last_hour:24,readonly:!1,drag_resize:!0,drag_move:!0,drag_create:!0,drag_event_body:!0,dblclick_create:!0,details_on_dblclick:!0,edit_on_create:!0,details_on_create:!0,header:null,hour_size_px:44,resize_month_events:!1,resize_month_timed:!1,responsive_lightbox:!1,separate_short_events:!0,rtl:!1,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,multi_day:!0,multi_day_height_limit:200,drag_lightbox:!0,preserve_scroll:!0,select:!0,server_utc:!1,touch:!0,touch_tip:!0,touch_drag:500,touch_swipe_dates:!1,quick_info_detached:!0,positive_closing:!1,drag_highlight:!0,limit_drag_out:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},highlight_displayed_event:!0,left_border:!1,ajax_error:"alert",delay_render:0,timeline_swap_resize:!0,wai_aria_attributes:!0,wai_aria_application_role:!0,csp:"auto",event_attribute:"data-event-id",show_errors:!0},t.config.buttons_left.$initial=t.config.buttons_left.join(),t.config.buttons_right.$initial=t.config.buttons_right.join(),t._helpers={parseDate:function(n){return(t.templates.xml_date||t.templates.parse_date)(n)},formatDate:function(n){return(t.templates.xml_format||t.templates.format_date)(n)}},t.templates={},t.init_templates=function(){var n=t.date.date_to_str,s=t.config;(function(c,u){for(var v in u)c[v]||(c[v]=u[v])})(t.templates,{day_date:n(s.default_date),month_date:n(s.month_date),week_date:function(c,u){return s.rtl?t.templates.day_date(t.date.add(u,-1,"day"))+" – "+t.templates.day_date(c):t.templates.day_date(c)+" – "+t.templates.day_date(t.date.add(u,-1,"day"))},day_scale_date:n(s.default_date),time_slot_text:function(c){return""},time_slot_class:function(c){return""},month_scale_date:n(s.week_date),week_scale_date:n(s.day_date),hour_scale:n(s.hour_date),time_picker:n(s.hour_date),event_date:n(s.hour_date),month_day:n(s.month_day),load_format:n(s.load_date),format_date:n(s.date_format,s.server_utc),parse_date:t.date.str_to_date(s.date_format,s.server_utc),api_date:t.date.str_to_date(s.api_date,!1,!1),event_header:function(c,u,v){return v._mode==="small"||v._mode==="smallest"?t.templates.event_date(c):t.templates.event_date(c)+" - "+t.templates.event_date(u)},event_text:function(c,u,v){return v.text},event_class:function(c,u,v){return""},month_date_class:function(c){return""},week_date_class:function(c){return""},event_bar_date:function(c,u,v){return t.templates.event_date(c)},event_bar_text:function(c,u,v){return v.text},month_events_link:function(c,u){return"View more("+u+" events)"},drag_marker_class:function(c,u,v){return""},drag_marker_content:function(c,u,v){return""},tooltip_date_format:t.date.date_to_str("%Y-%m-%d %H:%i"),tooltip_text:function(c,u,v){return"Event: "+v.text+"
Start date: "+t.templates.tooltip_date_format(c)+"
End date: "+t.templates.tooltip_date_format(u)},calendar_month:n("%F %Y"),calendar_scale_date:n("%D"),calendar_date:n("%d"),calendar_time:n("%d-%m-%Y")}),this.callEvent("onTemplatesReady",[])}}(h),function(t){t._events={},t.clearAll=function(){this._events={},this._loaded={},this._edit_id=null,this._select_id=null,this._drag_id=null,this._drag_mode=null,this._drag_pos=null,this._new_event=null,this.clear_view(),this.callEvent("onClearAll",[])},t.addEvent=function(n,s,c,u,v){if(!arguments.length)return this.addEventNow();var m=n;arguments.length!=1&&((m=v||{}).start_date=n,m.end_date=s,m.text=c,m.id=u),m.id=m.id||t.uid(),m.text=m.text||"",typeof m.start_date=="string"&&(m.start_date=this.templates.api_date(m.start_date)),typeof m.end_date=="string"&&(m.end_date=this.templates.api_date(m.end_date));var l=6e4*(this.config.event_duration||this.config.time_step);m.start_date.valueOf()==m.end_date.valueOf()&&m.end_date.setTime(m.end_date.valueOf()+l),m.start_date.setMilliseconds(0),m.end_date.setMilliseconds(0),m._timed=this.isOneDayEvent(m);var f=!this._events[m.id];return this._events[m.id]=m,this.event_updated(m),this._loading||this.callEvent(f?"onEventAdded":"onEventChanged",[m.id,m]),m.id},t.deleteEvent=function(n,s){var c=this._events[n];(s||this.callEvent("onBeforeEventDelete",[n,c])&&this.callEvent("onConfirmedBeforeEventDelete",[n,c]))&&(c&&(t.getState().select_id==n&&t.unselect(),delete this._events[n],this.event_updated(c),this._drag_id==c.id&&(this._drag_id=null,this._drag_mode=null,this._drag_pos=null)),this.callEvent("onEventDeleted",[n,c]))},t.getEvent=function(n){return this._events[n]},t.setEvent=function(n,s){s.id||(s.id=n),this._events[n]=s},t.for_rendered=function(n,s){for(var c=this._rendered.length-1;c>=0;c--)this._rendered[c].getAttribute(this.config.event_attribute)==n&&s(this._rendered[c],c)},t.changeEventId=function(n,s){if(n!=s){var c=this._events[n];c&&(c.id=s,this._events[s]=c,delete this._events[n]),this.for_rendered(n,function(u){u.setAttribute("event_id",s),u.setAttribute(t.config.event_attribute,s)}),this._select_id==n&&(this._select_id=s),this._edit_id==n&&(this._edit_id=s),this.callEvent("onEventIdChange",[n,s])}},function(){for(var n=["text","Text","start_date","StartDate","end_date","EndDate"],s=function(v){return function(m){return t.getEvent(m)[v]}},c=function(v){return function(m,l){var f=t.getEvent(m);f[v]=l,f._changed=!0,f._timed=this.isOneDayEvent(f),t.event_updated(f,!0)}},u=0;uu||c<=v)&&(s>=u||s24-(this.config.last_hour-this.config.first_hour)||sv))}return!1},t.isOneDayEvent=function(n){var s=new Date(n.end_date.valueOf()-1);return n.start_date.getFullYear()===s.getFullYear()&&n.start_date.getMonth()===s.getMonth()&&n.start_date.getDate()===s.getDate()&&n.end_date.valueOf()-n.start_date.valueOf()<864e5},t.get_visible_events=function(n){var s=[];for(var c in this._events)this.is_visible_events(this._events[c])&&(n&&!this._events[c]._timed||this.filter_event(c,this._events[c])&&s.push(this._events[c]));return s},t.filter_event=function(n,s){var c=this["filter_"+this._mode];return!c||c(n,s)},t._is_main_area_event=function(n){return!!n._timed},t.render_view_data=function(n,s){var c=!1;if(!n){if(c=!0,this._not_render)return void(this._render_wait=!0);this._render_wait=!1,this.clear_view(),n=this.get_visible_events(!(this._table_view||this.config.multi_day))}for(var u=0,v=n.length;up){var y=p;1*this.config.max_month_events!==this.config.max_month_events||v[f]<=this.config.max_month_events?y=v[f]*c:(this.config.max_month_events+1)*c>p&&(y=(this.config.max_month_events+1)*c),l[f].style.height=y+this.xy.month_head_height+"px"}v[f]=(v[f-1]||0)+t._get_first_visible_cell(g).offsetHeight}v.unshift(0);const M=this.$container.querySelector(".dhx_cal_data");if(M.offsetHeightM.id?1:-1:N.start_date>M.start_date?1:-1});var c=[],u=[];this._min_mapped_duration=Math.floor(60*this.xy.min_event_height/this.config.hour_size_px);for(var v=0;vS&&(S=y[E]._sorder);m._sorder=S+1,m._inner=!1}else m._sorder=0;y.splice(b,b==y.length?0:1,m),y.length>(y.max_count||0)?(y.max_count=y.length,m._count=y.length):m._count=m._count?m._count:1}(g=this.config.last_hour)&&(u.push(m),n[v]=m=this._copy_event(m),g=this.config.last_hour&&(m.end_date.setMinutes(0),m.end_date.setHours(this.config.last_hour)),m.start_date>m.end_date||g==this.config.last_hour)&&(n.splice(v,1),v--)}}if(!s){for(v=0;vc.id?1:-1:s.start_date>c.start_date?1:-1})},t._is_any_multiday_cell_visible=function(n,s,c){var u=this._cols.length,v=!1,m=n,l=!0,f=new Date(s);for(t.date.day_start(new Date(s)).valueOf()!=s.valueOf()&&(f=t.date.day_start(f),f=t.date.add(f,1,"day"));mthis._max_date&&(w.last_chunk=!1,k=this._max_date);var E=this.locate_holder_day(b,!1,p);if(p._sday=E%l,!this._ignores[p._sday]||!p._timed){var D=this.locate_holder_day(k,!0,p)||l;if(p._eday=D%l||l,p._length=D-E,p._sweek=Math.floor((this._correct_shift(b.valueOf(),1)-this._min_date.valueOf())/(864e5*l)),t._is_any_multiday_cell_visible(b,k,p)){var x,S=v[p._sweek];for(x=0;x"+n.text+"",this._editor=N.querySelector("textarea"),t.event(this._editor,"keydown",function(L){if(L.shiftKey)return!0;var H=L.keyCode;H==t.keys.edit_save&&t.editStop(!0),H==t.keys.edit_cancel&&t.editStop(!1),H!=t.keys.edit_save&&H!=t.keys.edit_cancel||L.preventDefault&&L.preventDefault()}),t.event(this._editor,"selectstart",function(L){return L.cancelBubble=!0,!0}),t._focus(this._editor,!0),this._els.dhx_cal_data[0].scrollLeft=0}if(this.xy.menu_width!==0&&this._select_id==n.id){this.config.cascade_event_display&&this._drag_mode&&(x.style.zIndex=1);for(var M,A=this.config["icons_"+(this._edit_id==n.id?"edit":"select")],C="",T=0;T
`}var O=this._render_v_bar(n,b-u-1,f,u,null,"","
",C,!0);n.color&&O.style.setProperty("--dhx-scheduler-event-background",n.color),n.textColor&&O.style.setProperty("--dhx-scheduler-event-color",n.textColor),this._els.dhx_cal_data[0].appendChild(O),this._rendered.push(O)}this.config.drag_highlight&&this._drag_id==n.id&&this.highlightEventPosition(n)}}},t._render_v_bar=function(n,s,c,u,v,m,l,f,g){var p=document.createElement("div"),y=n.id,w=g?"dhx_cal_event dhx_cal_select_menu":"dhx_cal_event",b=t.getState();b.drag_id==n.id&&(w+=" dhx_cal_event_drag"),b.select_id==n.id&&(w+=" dhx_cal_event_selected");var k=t.templates.event_class(n.start_date,n.end_date,n);k&&(w=w+" "+k),this.config.cascade_event_display&&(w+=" dhx_cal_event_cascade");var E=u-1,D='
';p.innerHTML=D;var x=p.cloneNode(!0).firstChild;if(!g&&t.renderEvent(x,n,u,v,l,f))return n.color&&x.style.setProperty("--dhx-scheduler-event-background",n.color),n.textColor&&x.style.setProperty("--dhx-scheduler-event-color",n.textColor),x;x=p.firstChild,n.color&&x.style.setProperty("--dhx-scheduler-event-background",n.color),n.textColor&&x.style.setProperty("--dhx-scheduler-event-color",n.textColor);var S='
 
';S+='
'+l+"
",S+='
'+f+"
";var N="dhx_event_resize dhx_footer";return(g||n._drag_resize===!1)&&(N="dhx_resize_denied "+N),S+='
',x.innerHTML=S,x},t.renderEvent=function(){return!1},t.locate_holder=function(n){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[n]},t.locate_holder_day=function(n,s){var c=Math.floor((this._correct_shift(n,1)-this._min_date)/864e5);return s&&this.date.time_part(n)&&c++,c},t._get_dnd_order=function(n,s,c){if(!this._drag_event)return n;this._drag_event._orig_sorder?n=this._drag_event._orig_sorder:this._drag_event._orig_sorder=n;for(var u=s*n;u+s>c;)n--,u-=s;return Math.max(n,0)},t._get_event_bar_pos=function(n){var s=this.config.rtl,c=this._colsS,u=c[n._sday],v=c[n._eday];s&&(u=c[c.col_length]-c[n._eday]+c[0],v=c[c.col_length]-c[n._sday]+c[0]),v==u&&(v=c[n._eday+1]);var m=this.xy.bar_height,l=n._sorder;if(n.id==this._drag_id){var f=c.heights[n._sweek+1]-c.heights[n._sweek]-this.xy.month_head_height;l=t._get_dnd_order(l,m,f)}var g=l*m;return{x:u,x2:v,y:c.heights[n._sweek]+(c.height?this.xy.month_scale_height+2:2)+g}},t.render_event_bar=function(n){var s=this._rendered_location,c=this._get_event_bar_pos(n),u=c.y,v=c.x,m=c.x2,l="";if(m){var f=t.config.resize_month_events&&this._mode=="month"&&(!n._timed||t.config.resize_month_timed),g=document.createElement("div"),p=n.hasOwnProperty("_first_chunk")&&n._first_chunk,y=n.hasOwnProperty("_last_chunk")&&n._last_chunk,w=f&&(n._timed||p),b=f&&(n._timed||y),k=!0,E="dhx_cal_event_clear";n._timed&&!f||(k=!1,E="dhx_cal_event_line"),p&&(E+=" dhx_cal_event_line_start"),y&&(E+=" dhx_cal_event_line_end"),w&&(l+="
"),b&&(l+="
");var D=t.templates.event_class(n.start_date,n.end_date,n);D&&(E+=" "+D);var x=n.color?"--dhx-scheduler-event-background:"+n.color+";":"",S=n.textColor?"--dhx-scheduler-event-color:"+n.textColor+";":"",N=["position:absolute","top:"+u+"px","left:"+v+"px","width:"+(m-v-(k?1:0))+"px","height:"+(this.xy.bar_height-2)+"px",S,x,n._text_style||""].join(";"),M="
";f&&(M+=l),t.getState().mode=="month"&&(n=t.getEvent(n.id)),n._timed&&(M+=`${t.templates.event_bar_date(n.start_date,n.end_date,n)}`),M+="
",M+=t.templates.event_bar_text(n.start_date,n.end_date,n)+"
",M+="
",M+="
",g.innerHTML=M,this._rendered.push(g.firstChild),s.appendChild(g.firstChild)}},t._locate_event=function(n){for(var s=null;n&&!s&&n.getAttribute;)s=n.getAttribute(this.config.event_attribute),n=n.parentNode;return s},t.edit=function(n){this._edit_id!=n&&(this.editStop(!1,n),this._edit_id=n,this.updateEvent(n))},t.editStop=function(n,s){if(!s||this._edit_id!=s){var c=this.getEvent(this._edit_id);c&&(n&&(c.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(c.id),this._edit_stop_event(c,n))}},t._edit_stop_event=function(n,s){this._new_event?(s?this.callEvent("onEventAdded",[n.id,n]):n&&this.deleteEvent(n.id,!0),this._new_event=null):s&&this.callEvent("onEventChanged",[n.id,n])},t.getEvents=function(n,s){var c=[];for(var u in this._events){var v=this._events[u];v&&(!n&&!s||v.start_daten)&&c.push(v)}return c},t.getRenderedEvent=function(n){if(n){for(var s=t._rendered,c=0;c-1&&(y=y.split(t.config.section_delimiter)[0])}var w=f.getSectionTop(y),b=f.posFromDate(p.start_date),k=t.$container.querySelector(".dhx_timeline_data_wrapper");if(b-=(k.offsetWidth-f.dx)/2,w=w-k.offsetHeight/2+f.dy/2,f._smartRenderingEnabled())var E=f.attachEvent("onScroll",function(){D(),f.detachEvent(E)});f.scrollTo({left:b,top:w}),f._smartRenderingEnabled()||D()}}else D();t.callEvent("onAfterEventDisplay",[c,s])}function D(){c.color=m,c.textColor=l}}}(h),function(t){t._append_drag_marker=function(n){if(!n.parentNode){var s=t._els.dhx_cal_data[0].lastChild,c=t._getClassName(s);c.indexOf("dhx_scale_holder")<0&&s.previousSibling&&(s=s.previousSibling),c=t._getClassName(s),s&&c.indexOf("dhx_scale_holder")===0&&s.appendChild(n)}},t._update_marker_position=function(n,s){var c=t._calc_event_y(s,0);n.style.top=c.top+"px",n.style.height=c.height+"px"},t.highlightEventPosition=function(n){var s=document.createElement("div");s.setAttribute("event_id",n.id),s.setAttribute(this.config.event_attribute,n.id),this._rendered.push(s),this._update_marker_position(s,n);var c=this.templates.drag_marker_class(n.start_date,n.end_date,n),u=this.templates.drag_marker_content(n.start_date,n.end_date,n);s.className="dhx_drag_marker",c&&(s.className+=" "+c),u&&(s.innerHTML=u),this._append_drag_marker(s)}}(h),xe(h),function(t){function n(){const s=t.config.csp===!0,c=!!window.Sfdc||!!window.$A||window.Aura||"$shadowResolver$"in document.body;return s||c?t.$root:document.body}t._lightbox_controls={},t.formSection=function(s){for(var c=this.config.lightbox.sections,u=0;u
"},set_value:function(s,c,u,v){s.innerHTML=c||""},get_value:function(s,c,u){return s.innerHTML||""},focus:function(s){}},textarea:{render:function(s){return`
`},set_value:function(s,c,u){t.form_blocks.textarea._get_input(s).value=c||""},get_value:function(s,c){return t.form_blocks.textarea._get_input(s).value},focus:function(s){var c=t.form_blocks.textarea._get_input(s);t._focus(c,!0)},_get_input:function(s){return s.getElementsByTagName("textarea")[0]}},select:{render:function(s){for(var c="
"},set_value:function(s,c,u,v){var m=s.firstChild;!m._dhx_onchange&&v.onchange&&(t.event(m,"change",v.onchange),m._dhx_onchange=!0),c===void 0&&(c=(m.options[0]||{}).value),m.value=c||""},get_value:function(s,c){return s.firstChild.value},focus:function(s){var c=s.firstChild;t._focus(c,!0)}},time:{render:function(s){s.time_format||(s.time_format=["%H:%i","%d","%m","%Y"]),s._time_format_order={};var c=s.time_format,u=t.config,v=t.date.date_part(t._currentDate()),m=1440,l=0;t.config.limit_time_select&&(m=60*u.last_hour+1,l=60*u.first_hour,v.setHours(u.first_hour));for(var f="",g=0;g0&&(f+=" ");var y="",w="";switch(p){case"%Y":var b,k,E;y="dhx_lightbox_year_select",s._time_format_order[3]=g,s.year_range&&(isNaN(s.year_range)?s.year_range.push&&(k=s.year_range[0],E=s.year_range[1]):b=s.year_range),b=b||10;var D=D||Math.floor(b/2);k=k||v.getFullYear()-D,E=E||k+b;for(var x=k;x"+x+"";break;case"%m":for(y="dhx_lightbox_month_select",s._time_format_order[2]=g,x=0;x<12;x++)w+="";break;case"%d":for(y="dhx_lightbox_day_select",s._time_format_order[1]=g,x=1;x<32;x++)w+="";break;case"%H:%i":y="dhx_lightbox_time_select",s._time_format_order[0]=g,x=l;var S=v.getDate();for(s._time_values=[];x"+this.templates.time_picker(v)+"",s._time_values.push(x),v.setTime(v.valueOf()+60*this.config.time_step*1e3),x=24*(v.getDate()!=S?1:0)*60+60*v.getHours()+v.getMinutes()}if(w){var N=t._waiAria.lightboxSelectAttrString(p);f+=" "}}return"
"+f+"  –  "+f+"
"},set_value:function(s,c,u,v){var m,l,f=t.config,g=s.getElementsByTagName("select"),p=v._time_format_order;if(f.full_day){if(!s._full_day){var y="";t.config.wide_form||(y=s.previousSibling.innerHTML+y),s.previousSibling.innerHTML=y,s._full_day=!0}var w=s.previousSibling.getElementsByTagName("input")[0];w.checked=t.date.time_part(u.start_date)===0&&t.date.time_part(u.end_date)===0,g[p[0]].disabled=w.checked,g[p[0]+g.length/2].disabled=w.checked,w.$_eventAttached||(w.$_eventAttached=!0,t.event(w,"click",function(){if(w.checked){var D={};t.form_blocks.time.get_value(s,D,v),m=t.date.date_part(D.start_date),(+(l=t.date.date_part(D.end_date))==+m||+l>=+m&&(u.end_date.getHours()!==0||u.end_date.getMinutes()!==0))&&(l=t.date.add(l,1,"day"))}else m=null,l=null;g[p[0]].disabled=w.checked,g[p[0]+g.length/2].disabled=w.checked,E(g,0,m||u.start_date),E(g,4,l||u.end_date)}))}if(f.auto_end_date&&f.event_duration)for(var b=function(){f.auto_end_date&&f.event_duration&&(m=new Date(g[p[3]].value,g[p[2]].value,g[p[1]].value,0,g[p[0]].value),l=new Date(m.getTime()+60*t.config.event_duration*1e3),E(g,4,l))},k=0;k<4;k++)g[k].$_eventAttached||(g[k].$_eventAttached=!0,t.event(g[k],"change",b));function E(D,x,S){for(var N=v._time_values,M=60*S.getHours()+S.getMinutes(),A=M,C=!1,T=0;T";for(var v=0;v
"+t.locale.labels[u[v]]+"
";u=this.config.buttons_right;var m=t.config.rtl;for(v=0;v
",c+="
"+t.locale.labels[u[v]]+"
";c+="
",c+="
",s.innerHTML=c,t.config.drag_lightbox&&(t.event(s.firstChild,"mousedown",t._ready_to_dnd),t.event(s.firstChild,"selectstart",function(b){return b.preventDefault(),!1}),s.firstChild.style.cursor="move",t._init_dnd_events()),this._waiAria.lightboxAttr(s),this.show_cover(),this._cover.insertBefore(s,this._cover.firstChild),this._lightbox=s;var l=this.config.lightbox.sections;for(c="",v=0;v
"+this.locale.labels["button_"+l[v].button]+"
"),this.config.wide_form&&(c+="
");var p=this.locale.labels["section_"+l[v].name];typeof p!="string"&&(p=l[v].name),c+="
"+g+"
"+f.render.call(this,l[v]),c+="
"}}var y=s.getElementsByTagName("div");for(v=0;v
  +`}},a.createTimelineView=function(){throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: "+l.timeline+` +Related docs: `+o.timeline)},a.createUnitsView=function(){throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: "+l.unit+` +Related docs: `+o.unit)},a.createGridView=function(){throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: "+l.grid+` +Related docs: `+o.grid)},a.addMarkedTimespan=function(){throw new Error(`scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js +Related docs: https://docs.dhtmlx.com/scheduler/limits.html`)},a.renderCalendar=function(){throw new Error(`scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js +https://docs.dhtmlx.com/scheduler/minicalendar.html`)},a.exportToPNG=function(){throw new Error(["scheduler.exportToPNG is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join(` +`))},a.exportToPDF=function(){throw new Error(["scheduler.exportToPDF is not implemented.","This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html","Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join(` +`))}}(i),zt(i),function(a){Ae(a),Ot(a),a._detachDomEvent=function(c,p,m){c.removeEventListener?c.removeEventListener(p,m,!1):c.detachEvent&&c.detachEvent("on"+p,m)},a._init_once=function(){Lt(a),a._init_once=function(){}};const o={render:function(c){return a._init_nav_bar(c)}},l={render:function(c){const p=document.createElement("div");return p.className="dhx_cal_header",p}},h={render:function(c){const p=document.createElement("div");return p.className="dhx_cal_data",p}};function v(c){return!!(c.querySelector(".dhx_cal_header")&&c.querySelector(".dhx_cal_data")&&c.querySelector(".dhx_cal_navline"))}a.init=function(c,p,m){if(!this.$destroyed){if(p=p||a._currentDate(),m=m||"week",this._obj&&this.unset_actions(),this._obj=typeof c=="string"?document.getElementById(c):c,this.$container=this._obj,this.$root=this._obj,!this.$container.offsetHeight&&this.$container.offsetWidth&&this.$container.style.height==="100%"&&window.console.error(a._commonErrorMessages.collapsedContainer(),this.$container),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&this.$container.setAttribute("role","application"),this.config.header||v(this.$container)||(this.config.header=function(g){const y=["day","week","month"];if(g.matrix)for(const x in g.matrix)y.push(x);if(g._props)for(const x in g._props)y.push(x);if(g._grid&&g._grid.names)for(const x in g._grid.names)y.push(x);return["map","agenda","week_agenda","year"].forEach(function(x){g[x+"_view"]&&y.push(x)}),y.concat(["date"]).concat(["prev","today","next"])}(this),window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.","Using a default header configuration: ","scheduler.config.header = "+JSON.stringify(this.config.header,null,2),"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join(` +`))),this.config.header)this.$container.innerHTML="",this.$container.classList.add("dhx_cal_container"),this.config.header.height&&(this.xy.nav_height=this.config.header.height),this.$container.appendChild(o.render(this.config.header)),this.$container.appendChild(l.render()),this.$container.appendChild(h.render());else if(!v(this.$container))throw new Error(["Required DOM elements are missing from the scheduler container.","Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup","Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join(` +`));this.config.rtl&&(this.$container.className+=" dhx_cal_container_rtl"),this._skin_init&&a._skin_init(),a.date.init(),this._scroll=!0,this._els=[],this.get_elements(),this.init_templates(),this.set_actions(),this._init_once(),this._init_touch_events(),this.set_sizes(),a.callEvent("onSchedulerReady",[]),a.$initialized=!0,this.setCurrentView(p,m)}},a.xy={min_event_height:20,bar_height:24,scale_width:50,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140,month_head_height:22,event_header_height:14},a.keys={edit_save:13,edit_cancel:27},a.bind=function(c,p){return c.bind?c.bind(p):function(){return c.apply(p,arguments)}},a.set_sizes=function(){var c=this._x=this._obj.clientWidth-this.xy.margin_left,p=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,m=this.$container.querySelector(".dhx_cal_scale_placeholder");a._is_material_skin()?(m||((m=document.createElement("div")).className="dhx_cal_scale_placeholder",this.$container.insertBefore(m,this._els.dhx_cal_header[0])),m.style.display="block",this.set_xy(m,c,this.xy.scale_height+1,0,this._els.dhx_cal_header[0].offsetTop)):m&&m.parentNode.removeChild(m),this._lightbox&&(a.$container.offsetWidth<1200||this._setLbPosition(document.querySelector(".dhx_cal_light"))),this._data_width=c-p,this._els.dhx_cal_navline[0].style.width=c+"px";const g=this._els.dhx_cal_header[0];this.set_xy(g,this._data_width,this.xy.scale_height),g.style.left="",g.style.right="",this._table_view?this.config.rtl?g.style.right="-1px":g.style.left="-1px":this.config.rtl?g.style.right=`${this.xy.scale_width}px`:g.style.left=`${this.xy.scale_width}px`},a.set_xy=function(c,p,m,g,y){function x(k){let E=k;return isNaN(Number(E))||(E=Math.max(0,E)+"px"),E}var b="left";p!==void 0&&(c.style.width=x(p)),m!==void 0&&(c.style.height=x(m)),arguments.length>3&&(g!==void 0&&(this.config.rtl&&(b="right"),c.style[b]=g+"px"),y!==void 0&&(c.style.top=y+"px"))},a.get_elements=function(){const c=this._obj.getElementsByTagName("DIV");for(let p=0;p500&&a.unselect()},dhx_cal_prev_button:function(){a._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(c,p){let m=1;a.config.rtl&&(p=-p,m=-m),a.setCurrentView(a.date.add(a.date[a._mode+"_start"](new Date(a._date)),p||m,a._mode))},dhx_cal_today_button:function(){a.callEvent("onBeforeTodayDisplayed",[])&&a.setCurrentView(a._currentDate())},dhx_cal_tab:function(){const c=this.getAttribute("data-tab"),p=this.getAttribute("name"),m=c||p.substring(0,p.search("_tab"));a.setCurrentView(a._date,m)},buttons:{delete:function(c){const p=a.locale.labels.confirm_deleting;a._dhtmlx_confirm({message:p,title:a.locale.labels.title_confirm_deleting,callback:function(){a.deleteEvent(c)},config:{ok:a.locale.labels.icon_delete}})},edit:function(c){a.edit(c)},save:function(c){a.editStop(!0)},details:function(c){a.showLightbox(c)},form:function(c){a.showLightbox(c)},cancel:function(c){a.editStop(!1)}}},a._dhtmlx_confirm=function({message:c,title:p,callback:m,config:g}){if(!c)return m();g=g||{};const y={...g,text:c};p&&(y.title=p),m&&(y.callback=function(x){x&&m()}),a.confirm(y)},a.addEventNow=function(c,p,m){let g={};a._isObject(c)&&!a._isDate(c)&&(g=c,c=null);const y=6e4*(this.config.event_duration||this.config.time_step);c||(c=g.start_date||Math.round(a._currentDate().valueOf()/y)*y);let x=new Date(c);if(!p){let E=this.config.first_hour;E>x.getHours()&&(x.setHours(E),c=x.valueOf()),p=c.valueOf()+y}let b=new Date(p);x.valueOf()==b.valueOf()&&b.setTime(b.valueOf()+y),g.start_date=g.start_date||x,g.end_date=g.end_date||b,g.text=g.text||this.locale.labels.new_event,g.id=this._drag_id=g.id||this.uid(),this._drag_mode="new-size",this._loading=!0;const k=this.addEvent(g);return this.callEvent("onEventCreated",[this._drag_id,m]),this._loading=!1,this._drag_event={},this._on_mouse_up(m),k},a._on_dbl_click=function(c,p){if(p=p||c.target,this.config.readonly)return;const m=a._getClassName(p).split(" ")[0];switch(m){case"dhx_scale_holder":case"dhx_scale_holder_now":case"dhx_month_body":case"dhx_wa_day_data":if(!a.config.dblclick_create)break;this.addEventNow(this.getActionData(c).date,null,c);break;case"dhx_cal_event":case"dhx_wa_ev_body":case"dhx_agenda_line":case"dhx_cal_agenda_event_line":case"dhx_grid_event":case"dhx_cal_event_line":case"dhx_cal_event_clear":{const g=this._locate_event(p);if(!this.callEvent("onDblClick",[g,c]))return;this.config.details_on_dblclick||this._table_view||!this.getEvent(g)._timed||!this.config.select?this.showLightbox(g):this.edit(g);break}case"dhx_time_block":case"dhx_cal_container":return;default:{const g=this["dblclick_"+m];if(g)g.call(this,c);else if(p.parentNode&&p!=this)return a._on_dbl_click(c,p.parentNode);break}}},a._get_column_index=function(c){let p=0;if(this._cols){let m=0,g=0;for(;m+this._cols[g]=this._cols.length)for(;p>=1&&this._ignores[Math.floor(p)];)p--}return p},a._week_indexes_from_pos=function(c){if(this._cols){const p=this._get_column_index(c.x);return c.x=Math.min(this._cols.length-1,Math.max(0,Math.ceil(p)-1)),c.y=Math.max(0,Math.ceil(60*c.y/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step),c}return c},a._mouse_coords=function(c){let p;const m=document.body,g=document.documentElement;p=this.$env.isIE||!c.pageX&&!c.pageY?{x:c.clientX+(m.scrollLeft||g.scrollLeft||0)-m.clientLeft,y:c.clientY+(m.scrollTop||g.scrollTop||0)-m.clientTop}:{x:c.pageX,y:c.pageY},this.config.rtl&&this._colsS?(p.x=this.$container.querySelector(".dhx_cal_data").offsetWidth-p.x,p.x+=this.$domHelpers.getAbsoluteLeft(this._obj),this._mode!=="month"&&(p.x-=this.xy.scale_width)):p.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);const y=this.$container.querySelector(".dhx_cal_data");p.y-=this.$domHelpers.getAbsoluteTop(y)-this._els.dhx_cal_data[0].scrollTop,p.ev=c;const x=this["mouse_"+this._mode];if(x)p=x.call(this,p);else if(this._table_view){const b=this._get_column_index(p.x);if(!this._cols||!this._colsS)return p;let k=0;for(k=1;kp.y);k++);p.y=Math.ceil(24*(Math.max(0,b)+7*Math.max(0,k-1))*60/this.config.time_step),(a._drag_mode||this._mode=="month")&&(p.y=24*(Math.max(0,Math.ceil(b)-1)+7*Math.max(0,k-1))*60/this.config.time_step),this._drag_mode=="move"&&a._ignores_detected&&a.config.preserve_length&&(p._ignores=!0,this._drag_event._event_length||(this._drag_event._event_length=this._get_real_event_length(this._drag_event.start_date,this._drag_event.end_date,{x_step:1,x_unit:"day"}))),p.x=0}else p=this._week_indexes_from_pos(p);return p.timestamp=+new Date,p},a._close_not_saved=function(){if(new Date().valueOf()-(a._new_event||0)>500&&a._edit_id){const c=a.locale.labels.confirm_closing;a._dhtmlx_confirm({message:c,title:a.locale.labels.title_confirm_closing,callback:function(){a.editStop(a.config.positive_closing)}}),c&&(this._drag_id=this._drag_pos=this._drag_mode=null)}},a._correct_shift=function(c,p){return c-6e4*(new Date(a._min_date).getTimezoneOffset()-new Date(c).getTimezoneOffset())*(p?-1:1)},a._is_pos_changed=function(c,p){function m(g,y,x){return Math.abs(g-y)>x}return!c||!this._drag_pos||!!(this._drag_pos.has_moved||!this._drag_pos.timestamp||p.timestamp-this._drag_pos.timestamp>100||m(c.ev.clientX,p.ev.clientX,5)||m(c.ev.clientY,p.ev.clientY,5))},a._correct_drag_start_date=function(c){let p;a.matrix&&(p=a.matrix[a._mode]),p=p||{x_step:1,x_unit:"day"},c=new Date(c);let m=1;return(p._start_correction||p._end_correction)&&(m=60*(p.last_hour||0)-(60*c.getHours()+c.getMinutes())||1),1*c+(a._get_fictional_event_length(c,m,p)-m)},a._correct_drag_end_date=function(c,p){let m;a.matrix&&(m=a.matrix[a._mode]),m=m||{x_step:1,x_unit:"day"};const g=1*c+a._get_fictional_event_length(c,p,m);return new Date(1*g-(a._get_fictional_event_length(g,-1,m,-1)+1))},a._on_mouse_move=function(c){if(this._drag_mode){var p=this._mouse_coords(c);if(this._is_pos_changed(this._drag_pos,p)){var m,g;if(this._edit_id!=this._drag_id&&this._close_not_saved(),!this._drag_mode)return;var y=null;if(this._drag_pos&&!this._drag_pos.has_moved&&((y=this._drag_pos).has_moved=!0),this._drag_pos=p,this._drag_pos.has_moved=!0,this._drag_mode=="create"){if(y&&(p=y),this._close_not_saved(),this.unselect(this._select_id),this._loading=!0,m=this._get_date_from_pos(p).valueOf(),!this._drag_start)return this.callEvent("onBeforeEventCreated",[c,this._drag_id])?(this._loading=!1,void(this._drag_start=m)):void(this._loading=!1);g=m,this._drag_start;var x=new Date(this._drag_start),b=new Date(g);this._mode!="day"&&this._mode!="week"||x.getHours()!=b.getHours()||x.getMinutes()!=b.getMinutes()||(b=new Date(this._drag_start+1e3)),this._drag_id=this.uid(),this.addEvent(x,b,this.locale.labels.new_event,this._drag_id,p.fields),this.callEvent("onEventCreated",[this._drag_id,c]),this._loading=!1,this._drag_mode="new-size"}var k,E=this.config.time_step,D=this.getEvent(this._drag_id);if(a.matrix&&(k=a.matrix[a._mode]),k=k||{x_step:1,x_unit:"day"},this._drag_mode=="move")m=this._min_date.valueOf()+6e4*(p.y*this.config.time_step+24*p.x*60),!p.custom&&this._table_view&&(m+=1e3*this.date.time_part(D.start_date)),!this._table_view&&this._dragEventBody&&this._drag_event._move_event_shift===void 0&&(this._drag_event._move_event_shift=m-D.start_date),this._drag_event._move_event_shift&&(m-=this._drag_event._move_event_shift),m=this._correct_shift(m),p._ignores&&this.config.preserve_length&&this._table_view&&k?(m=a._correct_drag_start_date(m),g=a._correct_drag_end_date(m,this._drag_event._event_length)):g=D.end_date.valueOf()-(D.start_date.valueOf()-m);else{if(m=D.start_date.valueOf(),g=D.end_date.valueOf(),this._table_view){var w=this._min_date.valueOf()+p.y*this.config.time_step*6e4+(p.custom?0:864e5);if(this._mode=="month")if(w=this._correct_shift(w,!1),this._drag_from_start){var S=864e5;w<=a.date.date_part(new Date(g+S-1)).valueOf()&&(m=w-S)}else g=w;else this.config.preserve_length?p.resize_from_start?m=a._correct_drag_start_date(w):g=a._correct_drag_end_date(w,0):p.resize_from_start?m=w:g=w}else{var N=this.date.date_part(new Date(D.end_date.valueOf()-1)).valueOf(),M=new Date(N),T=this.config.first_hour,A=60/E*(this.config.last_hour-T);this.config.time_step=1;var H=this._mouse_coords(c);this.config.time_step=E;var $=p.y*E*6e4,I=Math.min(p.y+1,A)*E*6e4,z=6e4*H.y;g=Math.abs($-z)>Math.abs(I-z)?N+I:N+$,g+=6e4*(new Date(g).getTimezoneOffset()-M.getTimezoneOffset()),this._els.dhx_cal_data[0].style.cursor="s-resize",this._mode!="week"&&this._mode!="day"||(g=this._correct_shift(g))}if(this._drag_mode=="new-size")if(g<=this._drag_start){var K=p.shift||(this._table_view&&!p.custom?864e5:0);m=g-(p.shift?0:K),g=this._drag_start+(K||6e4*E)}else m=this._drag_start;else g<=m&&(g=m+6e4*E)}var U=new Date(g-1),q=new Date(m);if(this._drag_mode=="move"&&a.config.limit_drag_out&&(+q<+a._min_date||+g>+a._max_date)){if(+D.start_date<+a._min_date||+D.end_date>+a._max_date)q=new Date(D.start_date),g=new Date(D.end_date);else{var B=g-q;+q<+a._min_date?(q=new Date(a._min_date),p._ignores&&this.config.preserve_length&&this._table_view?(q=new Date(a._correct_drag_start_date(q)),k._start_correction&&(q=new Date(q.valueOf()+k._start_correction)),g=new Date(1*q+this._get_fictional_event_length(q,this._drag_event._event_length,k))):g=new Date(+q+B)):(g=new Date(a._max_date),p._ignores&&this.config.preserve_length&&this._table_view?(k._end_correction&&(g=new Date(g.valueOf()-k._end_correction)),g=new Date(1*g-this._get_fictional_event_length(g,0,k,!0)),q=new Date(1*g-this._get_fictional_event_length(g,this._drag_event._event_length,k,!0)),this._ignores_detected&&(q=a.date.add(q,k.x_step,k.x_unit),g=new Date(1*g-this._get_fictional_event_length(g,0,k,!0)),g=a.date.add(g,k.x_step,k.x_unit))):q=new Date(+g-B))}U=new Date(g-1)}if(!this._table_view&&this._dragEventBody&&!a.config.all_timed&&(!a._get_section_view()&&p.x!=this._get_event_sday({start_date:new Date(m),end_date:new Date(m)})||new Date(m).getHours()=this.config.last_hour)||(B=g-q,S=this._min_date.valueOf()+24*p.x*60*6e4,(g=a.date.date_part(new Date(S))).setHours(this.config.last_hour),U=new Date(g-1),this._drag_mode=="move"&&(q=new Date(+g-B))),this._table_view||U.getDate()==q.getDate()&&U.getHours()=y?H+=" dhx_after":m.valueOf()==b.valueOf()&&(H+=" dhx_now"),this._ignores_detected&&this._ignores[T]&&(H+=" dhx_scale_ignore"),A.className=H+" "+this.templates.month_date_class(m,b),A.setAttribute("data-cell-date",a.templates.format_date(m));var $="dhx_month_body",I="dhx_month_head";if(T===0&&this.config.left_border&&($+=" dhx_month_body_border",I+=" dhx_month_head_border"),this._ignores_detected&&this._ignores[T])A.appendChild(document.createElement("div")),A.appendChild(document.createElement("div"));else{A.style.width=k[T],this._waiAria.monthCellAttr(A,m);var z=document.createElement("div");z.style.height=a.xy.month_head_height+"px",z.className=I,z.innerHTML=this.templates.month_day(m),A.appendChild(z);var K=document.createElement("div");K.className=$,A.appendChild(K)}var U=m.getDate();(m=this.date.add(m,1,"day")).getDate()-U>1&&(m=new Date(m.getFullYear(),m.getMonth(),U+1,12,0))}a._colsS.heights[E]=S,S+=w(E)}return this._min_date=x,this._max_date=m,c.innerHTML="",c.appendChild(N),this._scales={},c.querySelectorAll("[data-cell-date]").forEach(q=>{const B=a.templates.parse_date(q.getAttribute("data-cell-date")),ke=q.querySelector(".dhx_month_body");this._scales[+B]=ke,this.callEvent("onScaleAdd",[this._scales[+B],B])}),this._max_date},a._reset_month_scale=function(c,p,m,g){var y=a.date.add(p,1,"month"),x=a._currentDate();this.date.date_part(x),this.date.date_part(m),g=g||Math.ceil(Math.round((y.valueOf()-m.valueOf())/864e5)/7);var b=Math.floor(c.clientHeight/g)-this.xy.month_head_height;return this._colsS.height=b+this.xy.month_head_height,this._colsS.heights=[],a._render_month_scale(c,p,m,g)},a.getView=function(c){return c||(c=a.getState().mode),a.matrix&&a.matrix[c]?a.matrix[c]:a._props&&a._props[c]?a._props[c]:null},a.getLabel=function(c,p){for(var m=this.config.lightbox.sections,g=0;ga.getState().max_date.valueOf()&&(g+=f(p,a.getState().max_date))):g=Math.round(y/60/60/1e3/24);for(var k=!0;bA.valueOf()&&(D+=S-A),S.valueOf()>T.valueOf()?D+=m._start_correction:D+=60*S.getHours()*60*1e3+60*S.getMinutes()*1e3,w.valueOf()`,"gm"),l=new RegExp(" +","gm");function h(c){return(c+"").replace(o," ").replace(l," ")}var v=new RegExp("'","gm");function u(c){return(c+"").replace(v,"'")}for(var f in a._waiAria={getAttributeString:function(c){var p=[" "];for(var m in c)if(typeof c[m]!="function"&&typeof c[m]!="object"){var g=u(h(c[m]));p.push(m+"='"+g+"'")}return p.push(" "),p.join(" ")},setAttributes:function(c,p){for(var m in p)c.setAttribute(m,h(p[m]));return c},labelAttr:function(c,p){return this.setAttributes(c,{"aria-label":p})},label:function(c){return a._waiAria.getAttributeString({"aria-label":c})},hourScaleAttr:function(c,p){this.labelAttr(c,p)},monthCellAttr:function(c,p){this.labelAttr(c,a.templates.day_date(p))},navBarDateAttr:function(c,p){this.labelAttr(c,p)},dayHeaderAttr:function(c,p){this.labelAttr(c,p)},dayColumnAttr:function(c,p){this.dayHeaderAttr(c,a.templates.day_date(p))},headerButtonsAttributes:function(c,p){return this.setAttributes(c,{role:"button","aria-label":p})},headerToggleState:function(c,p){return this.setAttributes(c,{"aria-pressed":p?"true":"false"})},getHeaderCellAttr:function(c){return a._waiAria.getAttributeString({"aria-label":c})},eventAttr:function(c,p){this._eventCommonAttr(c,p)},_eventCommonAttr:function(c,p){p.setAttribute("aria-label",h(a.templates.event_text(c.start_date,c.end_date,c))),a.config.readonly&&p.setAttribute("aria-readonly",!0),c.$dataprocessor_class&&p.setAttribute("aria-busy",!0),p.setAttribute("aria-selected",a.getState().select_id==c.id?"true":"false")},setEventBarAttr:function(c,p){this._eventCommonAttr(c,p)},_getAttributes:function(c,p){var m={setAttribute:function(g,y){this[g]=y}};return c.apply(this,[p,m]),m},eventBarAttrString:function(c){return this.getAttributeString(this._getAttributes(this.setEventBarAttr,c))},agendaHeadAttrString:function(){return this.getAttributeString({role:"row"})},agendaHeadDateString:function(c){return this.getAttributeString({role:"columnheader","aria-label":c})},agendaHeadDescriptionString:function(c){return this.agendaHeadDateString(c)},agendaDataAttrString:function(){return this.getAttributeString({role:"grid"})},agendaEventAttrString:function(c){var p=this._getAttributes(this._eventCommonAttr,c);return p.role="row",this.getAttributeString(p)},agendaDetailsBtnString:function(){return this.getAttributeString({role:"button","aria-label":a.locale.labels.icon_details})},gridAttrString:function(){return this.getAttributeString({role:"grid"})},gridRowAttrString:function(c){return this.agendaEventAttrString(c)},gridCellAttrString:function(c,p,m){return this.getAttributeString({role:"gridcell","aria-label":[p.label===void 0?p.id:p.label,": ",m]})},mapAttrString:function(){return this.gridAttrString()},mapRowAttrString:function(c){return this.gridRowAttrString(c)},mapDetailsBtnString:function(){return this.agendaDetailsBtnString()},minicalHeader:function(c,p){this.setAttributes(c,{id:p+"","aria-live":"assertice","aria-atomic":"true"})},minicalGrid:function(c,p){this.setAttributes(c,{"aria-labelledby":p+"",role:"grid"})},minicalRow:function(c){this.setAttributes(c,{role:"row"})},minicalDayCell:function(c,p){var m=p.valueOf()=a._min_date.valueOf();this.setAttributes(c,{role:"gridcell","aria-label":a.templates.day_date(p),"aria-selected":m?"true":"false"})},minicalHeadCell:function(c){this.setAttributes(c,{role:"columnheader"})},weekAgendaDayCell:function(c,p){var m=c.querySelector(".dhx_wa_scale_bar"),g=c.querySelector(".dhx_wa_day_data"),y=a.uid()+"";this.setAttributes(m,{id:y}),this.setAttributes(g,{"aria-labelledby":y})},weekAgendaEvent:function(c,p){this.eventAttr(p,c)},lightboxHiddenAttr:function(c){c.setAttribute("aria-hidden","true")},lightboxVisibleAttr:function(c){c.setAttribute("aria-hidden","false")},lightboxSectionButtonAttrString:function(c){return this.getAttributeString({role:"button","aria-label":c,tabindex:"0"})},yearHeader:function(c,p){this.setAttributes(c,{id:p+""})},yearGrid:function(c,p){this.minicalGrid(c,p)},yearHeadCell:function(c){return this.minicalHeadCell(c)},yearRow:function(c){return this.minicalRow(c)},yearDayCell:function(c){this.setAttributes(c,{role:"gridcell"})},lightboxAttr:function(c){c.setAttribute("role","dialog"),c.setAttribute("aria-hidden","true"),c.firstChild.setAttribute("role","heading")},lightboxButtonAttrString:function(c){return this.getAttributeString({role:"button","aria-label":a.locale.labels[c],tabindex:"0"})},eventMenuAttrString:function(c){return this.getAttributeString({role:"button","aria-label":a.locale.labels[c]})},lightboxHeader:function(c,p){c.setAttribute("aria-label",p)},lightboxSelectAttrString:function(c){var p="";switch(c){case"%Y":p=a.locale.labels.year;break;case"%m":p=a.locale.labels.month;break;case"%d":p=a.locale.labels.day;break;case"%H:%i":p=a.locale.labels.hour+" "+a.locale.labels.minute}return a._waiAria.getAttributeString({"aria-label":p})},messageButtonAttrString:function(c){return"tabindex='0' role='button' aria-label='"+c+"'"},messageInfoAttr:function(c){c.setAttribute("role","alert")},messageModalAttr:function(c,p){c.setAttribute("role","dialog"),p&&c.setAttribute("aria-labelledby",p)},quickInfoAttr:function(c){c.setAttribute("role","dialog")},quickInfoHeaderAttrString:function(){return" role='heading' "},quickInfoHeader:function(c,p){c.setAttribute("aria-label",p)},quickInfoButtonAttrString:function(c){return a._waiAria.getAttributeString({role:"button","aria-label":c,tabindex:"0"})},tooltipAttr:function(c){c.setAttribute("role","tooltip")},tooltipVisibleAttr:function(c){c.setAttribute("aria-hidden","false")},tooltipHiddenAttr:function(c){c.setAttribute("aria-hidden","true")}},a._waiAria)a._waiAria[f]=function(c){return function(){return a.config.wai_aria_attributes?c.apply(this,arguments):" "}}(a._waiAria[f])})()}(i),i.utils=ee,i.$domHelpers=se,i.utils.dom=se,i.uid=ee.uid,i.mixin=ee.mixin,i.defined=ee.defined,i.assert=function(a){return function(o,l){o||a.config.show_errors&&a.callEvent("onError",[l])!==!1&&(a.message?a.message({type:"error",text:l,expire:-1}):console.log(l))}}(i),i.copy=ee.copy,i._createDatePicker=function(a,o){return new Da(i,a,o)},i._getFocusableNodes=se.getFocusableNodes,i._getClassName=se.getClassName,i._locate_css=se.locateCss;const t=Wt(i);var r,d,n;i.utils.mixin(i,t),i.env=i.$env=Yt,i.Promise=window.Promise,function(a){a.destructor=function(){for(var o in a.callEvent("onDestroy",[]),this.clearAll(),this.$container&&(this.$container.innerHTML=""),this._eventRemoveAll&&this._eventRemoveAll(),this.resetLightbox&&this.resetLightbox(),this._dp&&this._dp.destructor&&this._dp.destructor(),this.detachAllEvents(),this)o.indexOf("$")===0&&delete this[o];a.$destroyed=!0}}(i),function(a){function o(l,h){var v={method:l};if(h.length===0)throw new Error("Arguments list of query is wrong.");if(h.length===1)return typeof h[0]=="string"?(v.url=h[0],v.async=!0):(v.url=h[0].url,v.async=h[0].async||!0,v.callback=h[0].callback,v.headers=h[0].headers),h[0].data?typeof h[0].data!="string"?v.data=Oe(h[0].data):v.data=h[0].data:v.data="",v;switch(v.url=h[0],l){case"GET":case"DELETE":v.callback=h[1],v.headers=h[2];break;case"POST":case"PUT":h[1]?typeof h[1]!="string"?v.data=Oe(h[1]):v.data=h[1]:v.data="",v.callback=h[2],v.headers=h[3]}return v}a.Promise=window.Promise,a.ajax={cache:!0,method:"get",serializeRequestParams:Oe,parse:function(l){return typeof l!="string"?l:(l=l.replace(/^[\s]+/,""),typeof DOMParser>"u"||a.$env.isIE?window.ActiveXObject!==void 0&&((h=new window.ActiveXObject("Microsoft.XMLDOM")).async="false",h.loadXML(l)):h=new DOMParser().parseFromString(l,"text/xml"),h);var h},xmltop:function(l,h,v){if(h.status===void 0||h.status<400){var u=h.responseXML?h.responseXML||h:this.parse(h.responseText||h);if(u&&u.documentElement!==null&&!u.getElementsByTagName("parsererror").length)return u.getElementsByTagName(l)[0]}return v!==-1&&a.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],v]),document.createElement("DIV")},xpath:function(l,h){if(h.nodeName||(h=h.responseXML||h),a.$env.isIE)return h.selectNodes(l)||[];for(var v,u=[],f=(h.ownerDocument||h).evaluate(l,h,null,XPathResult.ANY_TYPE,null);v=f.iterateNext();)u.push(v);return u},query:function(l){return this._call(l.method||"GET",l.url,l.data||"",l.async||!0,l.callback,l.headers)},get:function(l,h,v){var u=o("GET",arguments);return this.query(u)},getSync:function(l,h){var v=o("GET",arguments);return v.async=!1,this.query(v)},put:function(l,h,v,u){var f=o("PUT",arguments);return this.query(f)},del:function(l,h,v){var u=o("DELETE",arguments);return this.query(u)},post:function(l,h,v,u){arguments.length==1?h="":arguments.length==2&&typeof h=="function"&&(v=h,h="");var f=o("POST",arguments);return this.query(f)},postSync:function(l,h,v){h=h===null?"":String(h);var u=o("POST",arguments);return u.async=!1,this.query(u)},_call:function(l,h,v,u,f,c){return new a.Promise((function(p,m){var g=typeof XMLHttpRequest===void 0||a.$env.isIE?new window.ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest,y=navigator.userAgent.match(/AppleWebKit/)!==null&&navigator.userAgent.match(/Qt/)!==null&&navigator.userAgent.match(/Safari/)!==null;if(u&&g.addEventListener("readystatechange",function(){if(g.readyState==4||y&&g.readyState==3){if((g.status!=200||g.responseText==="")&&!a.callEvent("onAjaxError",[g]))return;setTimeout(function(){typeof f=="function"&&f.apply(window,[{xmlDoc:g,filePath:h}]),p(g),typeof f=="function"&&(f=null,g=null)},0)}}),l!="GET"||this.cache||(h+=(h.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"),g.open(l,h,u),c)for(var x in c)g.setRequestHeader(x,c[x]);else l.toUpperCase()=="POST"||l=="PUT"||l=="DELETE"?g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):l=="GET"&&(v=null);if(g.setRequestHeader("X-Requested-With","XMLHttpRequest"),g.send(v),!u)return{xmlDoc:g,filePath:h}}).bind(this))},urlSeparator:function(l){return l.indexOf("?")!=-1?"&":"?"}},a.$ajax=a.ajax}(i),Ut(i),function(a){a.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D %j",hour_date:"%H:%i",month_day:"%d",date_format:"%Y-%m-%d %H:%i",api_date:"%d-%m-%Y %H:%i",parse_exact_format:!1,preserve_length:!0,time_step:5,displayed_event_color:"#ff4a4a",displayed_event_text_color:"#ffef80",wide_form:0,day_column_padding:8,use_select_menu_space:!0,fix_tab_position:!0,start_on_monday:!0,first_hour:0,last_hour:24,readonly:!1,drag_resize:!0,drag_move:!0,drag_create:!0,drag_event_body:!0,dblclick_create:!0,details_on_dblclick:!0,edit_on_create:!0,details_on_create:!0,header:null,hour_size_px:44,resize_month_events:!1,resize_month_timed:!1,responsive_lightbox:!1,separate_short_events:!0,rtl:!1,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,multi_day:!0,multi_day_height_limit:200,drag_lightbox:!0,preserve_scroll:!0,select:!0,undo_deleted:!0,server_utc:!1,touch:!0,touch_tip:!0,touch_drag:500,touch_swipe_dates:!1,quick_info_detached:!0,positive_closing:!1,drag_highlight:!0,limit_drag_out:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},highlight_displayed_event:!0,left_border:!1,ajax_error:"alert",delay_render:0,timeline_swap_resize:!0,wai_aria_attributes:!0,wai_aria_application_role:!0,csp:"auto",event_attribute:"data-event-id",show_errors:!0},a.config.buttons_left.$initial=a.config.buttons_left.join(),a.config.buttons_right.$initial=a.config.buttons_right.join(),a._helpers={parseDate:function(o){return(a.templates.xml_date||a.templates.parse_date)(o)},formatDate:function(o){return(a.templates.xml_format||a.templates.format_date)(o)}},a.templates={},a.init_templates=function(){var o=a.date.date_to_str,l=a.config;(function(h,v){for(var u in v)h[u]||(h[u]=v[u])})(a.templates,{day_date:o(l.default_date),month_date:o(l.month_date),week_date:function(h,v){return l.rtl?a.templates.day_date(a.date.add(v,-1,"day"))+" – "+a.templates.day_date(h):a.templates.day_date(h)+" – "+a.templates.day_date(a.date.add(v,-1,"day"))},day_scale_date:o(l.default_date),time_slot_text:function(h){return""},time_slot_class:function(h){return""},month_scale_date:o(l.week_date),week_scale_date:o(l.day_date),hour_scale:o(l.hour_date),time_picker:o(l.hour_date),event_date:o(l.hour_date),month_day:o(l.month_day),load_format:o(l.load_date),format_date:o(l.date_format,l.server_utc),parse_date:a.date.str_to_date(l.date_format,l.server_utc),api_date:a.date.str_to_date(l.api_date,!1,!1),event_header:function(h,v,u){return u._mode==="small"||u._mode==="smallest"?a.templates.event_date(h):a.templates.event_date(h)+" - "+a.templates.event_date(v)},event_text:function(h,v,u){return u.text},event_class:function(h,v,u){return""},month_date_class:function(h){return""},week_date_class:function(h){return""},event_bar_date:function(h,v,u){return a.templates.event_date(h)},event_bar_text:function(h,v,u){return u.text},month_events_link:function(h,v){return"View more("+v+" events)"},drag_marker_class:function(h,v,u){return""},drag_marker_content:function(h,v,u){return""},tooltip_date_format:a.date.date_to_str("%Y-%m-%d %H:%i"),tooltip_text:function(h,v,u){return"Event: "+u.text+"
Start date: "+a.templates.tooltip_date_format(h)+"
End date: "+a.templates.tooltip_date_format(v)},calendar_month:o("%F %Y"),calendar_scale_date:o("%D"),calendar_date:o("%d"),calendar_time:o("%d-%m-%Y")}),this.callEvent("onTemplatesReady",[])}}(i),function(a){a._events={},a.clearAll=function(){this._events={},this._loaded={},this._edit_id=null,this._select_id=null,this._drag_id=null,this._drag_mode=null,this._drag_pos=null,this._new_event=null,this.clear_view(),this.callEvent("onClearAll",[])},a.addEvent=function(o,l,h,v,u){if(!arguments.length)return this.addEventNow();var f=o;arguments.length!=1&&((f=u||{}).start_date=o,f.end_date=l,f.text=h,f.id=v),f.id=f.id||a.uid(),f.text=f.text||"",typeof f.start_date=="string"&&(f.start_date=this.templates.api_date(f.start_date)),typeof f.end_date=="string"&&(f.end_date=this.templates.api_date(f.end_date));var c=6e4*(this.config.event_duration||this.config.time_step);f.start_date.valueOf()==f.end_date.valueOf()&&f.end_date.setTime(f.end_date.valueOf()+c),f.start_date.setMilliseconds(0),f.end_date.setMilliseconds(0),f._timed=this.isOneDayEvent(f);var p=!this._events[f.id];return this._events[f.id]=f,this.event_updated(f),this._loading||this.callEvent(p?"onEventAdded":"onEventChanged",[f.id,f]),f.id},a.deleteEvent=function(o,l){var h=this._events[o];(l||this.callEvent("onBeforeEventDelete",[o,h])&&this.callEvent("onConfirmedBeforeEventDelete",[o,h]))&&(h&&(a.getState().select_id==o&&a.unselect(),delete this._events[o],this.event_updated(h),this._drag_id==h.id&&(this._drag_id=null,this._drag_mode=null,this._drag_pos=null)),this.callEvent("onEventDeleted",[o,h]))},a.getEvent=function(o){return this._events[o]},a.setEvent=function(o,l){l.id||(l.id=o),this._events[o]=l},a.for_rendered=function(o,l){for(var h=this._rendered.length-1;h>=0;h--)this._rendered[h].getAttribute(this.config.event_attribute)==o&&l(this._rendered[h],h)},a.changeEventId=function(o,l){if(o!=l){var h=this._events[o];h&&(h.id=l,this._events[l]=h,delete this._events[o]),this.for_rendered(o,function(v){v.setAttribute("event_id",l),v.setAttribute(a.config.event_attribute,l)}),this._select_id==o&&(this._select_id=l),this._edit_id==o&&(this._edit_id=l),this.callEvent("onEventIdChange",[o,l])}},function(){for(var o=["text","Text","start_date","StartDate","end_date","EndDate"],l=function(u){return function(f){return a.getEvent(f)[u]}},h=function(u){return function(f,c){var p=a.getEvent(f);p[u]=c,p._changed=!0,p._timed=this.isOneDayEvent(p),a.event_updated(p,!0)}},v=0;vv||h<=u)&&(l>=v||l24-(this.config.last_hour-this.config.first_hour)||lu))}return!1},a.isOneDayEvent=function(o){var l=new Date(o.end_date.valueOf()-1);return o.start_date.getFullYear()===l.getFullYear()&&o.start_date.getMonth()===l.getMonth()&&o.start_date.getDate()===l.getDate()&&o.end_date.valueOf()-o.start_date.valueOf()<864e5},a.get_visible_events=function(o){var l=[];for(var h in this._events)this.is_visible_events(this._events[h])&&(o&&!this._events[h]._timed||this.filter_event(h,this._events[h])&&l.push(this._events[h]));return l},a.filter_event=function(o,l){var h=this["filter_"+this._mode];return!h||h(o,l)},a._is_main_area_event=function(o){return!!o._timed},a.render_view_data=function(o,l){var h=!1;if(!o){if(h=!0,this._not_render)return void(this._render_wait=!0);this._render_wait=!1,this.clear_view(),o=this.get_visible_events(!(this._table_view||this.config.multi_day))}for(var v=0,u=o.length;vg){var y=g;1*this.config.max_month_events!==this.config.max_month_events||u[p]<=this.config.max_month_events?y=u[p]*h:(this.config.max_month_events+1)*h>g&&(y=(this.config.max_month_events+1)*h),c[p].style.height=y+this.xy.month_head_height+"px"}u[p]=(u[p-1]||0)+a._get_first_visible_cell(m).offsetHeight}u.unshift(0);const M=this.$container.querySelector(".dhx_cal_data");if(M.offsetHeightM.id?1:-1:N.start_date>M.start_date?1:-1});var h=[],v=[];this._min_mapped_duration=Math.floor(60*this.xy.min_event_height/this.config.hour_size_px);for(var u=0;uS&&(S=y[E]._sorder);f._sorder=S+1,f._inner=!1}else f._sorder=0;y.splice(b,b==y.length?0:1,f),y.length>(y.max_count||0)?(y.max_count=y.length,f._count=y.length):f._count=f._count?f._count:1}(m=this.config.last_hour)&&(v.push(f),o[u]=f=this._copy_event(f),m=this.config.last_hour&&(f.end_date.setMinutes(0),f.end_date.setHours(this.config.last_hour)),f.start_date>f.end_date||m==this.config.last_hour)&&(o.splice(u,1),u--)}}if(!l){for(u=0;uh.id?1:-1:l.start_date>h.start_date?1:-1})},a._is_any_multiday_cell_visible=function(o,l,h){var v=this._cols.length,u=!1,f=o,c=!0,p=new Date(l);for(a.date.day_start(new Date(l)).valueOf()!=l.valueOf()&&(p=a.date.day_start(p),p=a.date.add(p,1,"day"));fthis._max_date&&(x.last_chunk=!1,k=this._max_date);var E=this.locate_holder_day(b,!1,g);if(g._sday=E%c,!this._ignores[g._sday]||!g._timed){var D=this.locate_holder_day(k,!0,g)||c;if(g._eday=D%c||c,g._length=D-E,g._sweek=Math.floor((this._correct_shift(b.valueOf(),1)-this._min_date.valueOf())/(864e5*c)),a._is_any_multiday_cell_visible(b,k,g)){var w,S=u[g._sweek];for(w=0;w"+o.text+"",this._editor=N.querySelector("textarea"),a.event(this._editor,"keydown",function(I){if(I.shiftKey)return!0;var z=I.keyCode;z==a.keys.edit_save&&a.editStop(!0),z==a.keys.edit_cancel&&a.editStop(!1),z!=a.keys.edit_save&&z!=a.keys.edit_cancel||I.preventDefault&&I.preventDefault()}),a.event(this._editor,"selectstart",function(I){return I.cancelBubble=!0,!0}),a._focus(this._editor,!0),this._els.dhx_cal_data[0].scrollLeft=0}if(this.xy.menu_width!==0&&this._select_id==o.id){this.config.cascade_event_display&&this._drag_mode&&(w.style.zIndex=1);for(var M,T=this.config["icons_"+(this._edit_id==o.id?"edit":"select")],A="",H=0;H
`}var $=this._render_v_bar(o,b-v-1,p,v,null,"","
",A,!0);o.color&&$.style.setProperty("--dhx-scheduler-event-background",o.color),o.textColor&&$.style.setProperty("--dhx-scheduler-event-color",o.textColor),this._els.dhx_cal_data[0].appendChild($),this._rendered.push($)}this.config.drag_highlight&&this._drag_id==o.id&&this.highlightEventPosition(o)}}},a._render_v_bar=function(o,l,h,v,u,f,c,p,m){var g=document.createElement("div"),y=o.id,x=m?"dhx_cal_event dhx_cal_select_menu":"dhx_cal_event",b=a.getState();b.drag_id==o.id&&(x+=" dhx_cal_event_drag"),b.select_id==o.id&&(x+=" dhx_cal_event_selected");var k=a.templates.event_class(o.start_date,o.end_date,o);k&&(x=x+" "+k),this.config.cascade_event_display&&(x+=" dhx_cal_event_cascade");var E=v-1,D=`
+
`;g.innerHTML=D;var w=g.cloneNode(!0).firstChild;if(!m&&a.renderEvent(w,o,v,u,c,p))return o.color&&w.style.setProperty("--dhx-scheduler-event-background",o.color),o.textColor&&w.style.setProperty("--dhx-scheduler-event-color",o.textColor),w;w=g.firstChild,o.color&&w.style.setProperty("--dhx-scheduler-event-background",o.color),o.textColor&&w.style.setProperty("--dhx-scheduler-event-color",o.textColor);var S='
 
';S+='
'+c+"
",S+='
'+p+"
";var N="dhx_event_resize dhx_footer";return(m||o._drag_resize===!1)&&(N="dhx_resize_denied "+N),S+='
',w.innerHTML=S,w},a.renderEvent=function(){return!1},a.locate_holder=function(o){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[o]},a.locate_holder_day=function(o,l){var h=Math.floor((this._correct_shift(o,1)-this._min_date)/864e5);return l&&this.date.time_part(o)&&h++,h},a._get_dnd_order=function(o,l,h){if(!this._drag_event)return o;this._drag_event._orig_sorder?o=this._drag_event._orig_sorder:this._drag_event._orig_sorder=o;for(var v=l*o;v+l>h;)o--,v-=l;return Math.max(o,0)},a._get_event_bar_pos=function(o){var l=this.config.rtl,h=this._colsS,v=h[o._sday],u=h[o._eday];l&&(v=h[h.col_length]-h[o._eday]+h[0],u=h[h.col_length]-h[o._sday]+h[0]),u==v&&(u=h[o._eday+1]);var f=this.xy.bar_height,c=o._sorder;if(o.id==this._drag_id){var p=h.heights[o._sweek+1]-h.heights[o._sweek]-this.xy.month_head_height;c=a._get_dnd_order(c,f,p)}var m=c*f;return{x:v,x2:u,y:h.heights[o._sweek]+(h.height?this.xy.month_scale_height+2:2)+m}},a.render_event_bar=function(o){var l=this._rendered_location,h=this._get_event_bar_pos(o),v=h.y,u=h.x,f=h.x2,c="";if(f){var p=a.config.resize_month_events&&this._mode=="month"&&(!o._timed||a.config.resize_month_timed),m=document.createElement("div"),g=o.hasOwnProperty("_first_chunk")&&o._first_chunk,y=o.hasOwnProperty("_last_chunk")&&o._last_chunk,x=p&&(o._timed||g),b=p&&(o._timed||y),k=!0,E="dhx_cal_event_clear";o._timed&&!p||(k=!1,E="dhx_cal_event_line"),g&&(E+=" dhx_cal_event_line_start"),y&&(E+=" dhx_cal_event_line_end"),x&&(c+="
"),b&&(c+="
");var D=a.templates.event_class(o.start_date,o.end_date,o);D&&(E+=" "+D);var w=o.color?"--dhx-scheduler-event-background:"+o.color+";":"",S=o.textColor?"--dhx-scheduler-event-color:"+o.textColor+";":"",N=["position:absolute","top:"+v+"px","left:"+u+"px","width:"+(f-u-(k?1:0))+"px","height:"+(this.xy.bar_height-2)+"px",S,w,o._text_style||""].join(";"),M="
";p&&(M+=c),a.getState().mode=="month"&&(o=a.getEvent(o.id)),o._timed&&(M+=`${a.templates.event_bar_date(o.start_date,o.end_date,o)}`),M+="
",M+=a.templates.event_bar_text(o.start_date,o.end_date,o)+"
",M+="
",M+="
",m.innerHTML=M,this._rendered.push(m.firstChild),l.appendChild(m.firstChild)}},a._locate_event=function(o){for(var l=null;o&&!l&&o.getAttribute;)l=o.getAttribute(this.config.event_attribute),o=o.parentNode;return l},a.edit=function(o){this._edit_id!=o&&(this.editStop(!1,o),this._edit_id=o,this.updateEvent(o))},a.editStop=function(o,l){if(!l||this._edit_id!=l){var h=this.getEvent(this._edit_id);h&&(o&&(h.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(h.id),this._edit_stop_event(h,o))}},a._edit_stop_event=function(o,l){this._new_event?(l?this.callEvent("onEventAdded",[o.id,o]):o&&this.deleteEvent(o.id,!0),this._new_event=null):l&&this.callEvent("onEventChanged",[o.id,o])},a.getEvents=function(o,l){var h=[];for(var v in this._events){var u=this._events[v];u&&(!o&&!l||u.start_dateo)&&h.push(u)}return h},a.getRenderedEvent=function(o){if(o){for(var l=a._rendered,h=0;h-1&&(y=y.split(a.config.section_delimiter)[0])}var x=p.getSectionTop(y),b=p.posFromDate(g.start_date),k=a.$container.querySelector(".dhx_timeline_data_wrapper");if(b-=(k.offsetWidth-p.dx)/2,x=x-k.offsetHeight/2+p.dy/2,p._smartRenderingEnabled())var E=p.attachEvent("onScroll",function(){D(),p.detachEvent(E)});p.scrollTo({left:b,top:x}),p._smartRenderingEnabled()||D()}}else D();a.callEvent("onAfterEventDisplay",[h,l])}function D(){h.color=f,h.textColor=c}}}(i),function(a){a._append_drag_marker=function(o){if(!o.parentNode){var l=a._els.dhx_cal_data[0].lastChild,h=a._getClassName(l);h.indexOf("dhx_scale_holder")<0&&l.previousSibling&&(l=l.previousSibling),h=a._getClassName(l),l&&h.indexOf("dhx_scale_holder")===0&&l.appendChild(o)}},a._update_marker_position=function(o,l){var h=a._calc_event_y(l,0);o.style.top=h.top+"px",o.style.height=h.height+"px"},a.highlightEventPosition=function(o){var l=document.createElement("div");l.setAttribute("event_id",o.id),l.setAttribute(this.config.event_attribute,o.id),this._rendered.push(l),this._update_marker_position(l,o);var h=this.templates.drag_marker_class(o.start_date,o.end_date,o),v=this.templates.drag_marker_content(o.start_date,o.end_date,o);l.className="dhx_drag_marker",h&&(l.className+=" "+h),v&&(l.innerHTML=v),this._append_drag_marker(l)}}(i),Vt(i),function(a){function o(){const l=a.config.csp===!0,h=!!window.Sfdc||!!window.$A||window.Aura||"$shadowResolver$"in document.body;return l||h?a.$root:document.body}a._lightbox_controls={},a.formSection=function(l){for(var h=this.config.lightbox.sections,v=0;v
"},set_value:function(l,h,v,u){l.innerHTML=h||""},get_value:function(l,h,v){return l.innerHTML||""},focus:function(l){}},textarea:{render:function(l){return`
`},set_value:function(l,h,v){a.form_blocks.textarea._get_input(l).value=h||""},get_value:function(l,h){return a.form_blocks.textarea._get_input(l).value},focus:function(l){var h=a.form_blocks.textarea._get_input(l);a._focus(h,!0)},_get_input:function(l){return l.getElementsByTagName("textarea")[0]}},select:{render:function(l){for(var h="
"},set_value:function(l,h,v,u){var f=l.firstChild;!f._dhx_onchange&&u.onchange&&(a.event(f,"change",u.onchange),f._dhx_onchange=!0),h===void 0&&(h=(f.options[0]||{}).value),f.value=h||""},get_value:function(l,h){return l.firstChild.value},focus:function(l){var h=l.firstChild;a._focus(h,!0)}},time:{render:function(l){l.time_format||(l.time_format=["%H:%i","%d","%m","%Y"]),l._time_format_order={};var h=l.time_format,v=a.config,u=a.date.date_part(a._currentDate()),f=1440,c=0;a.config.limit_time_select&&(f=60*v.last_hour+1,c=60*v.first_hour,u.setHours(v.first_hour));for(var p="",m=0;m0&&(p+=" ");var y="",x="";switch(g){case"%Y":var b,k,E;y="dhx_lightbox_year_select",l._time_format_order[3]=m,l.year_range&&(isNaN(l.year_range)?l.year_range.push&&(k=l.year_range[0],E=l.year_range[1]):b=l.year_range),b=b||10;var D=D||Math.floor(b/2);k=k||u.getFullYear()-D,E=E||k+b;for(var w=k;w"+w+"";break;case"%m":for(y="dhx_lightbox_month_select",l._time_format_order[2]=m,w=0;w<12;w++)x+="";break;case"%d":for(y="dhx_lightbox_day_select",l._time_format_order[1]=m,w=1;w<32;w++)x+="";break;case"%H:%i":y="dhx_lightbox_time_select",l._time_format_order[0]=m,w=c;var S=u.getDate();for(l._time_values=[];w"+this.templates.time_picker(u)+"",l._time_values.push(w),u.setTime(u.valueOf()+60*this.config.time_step*1e3),w=24*(u.getDate()!=S?1:0)*60+60*u.getHours()+u.getMinutes()}if(x){var N=a._waiAria.lightboxSelectAttrString(g);p+=" "}}return"
"+p+"  –  "+p+"
"},set_value:function(l,h,v,u){var f,c,p=a.config,m=l.getElementsByTagName("select"),g=u._time_format_order;if(p.full_day){if(!l._full_day){var y="";a.config.wide_form||(y=l.previousSibling.innerHTML+y),l.previousSibling.innerHTML=y,l._full_day=!0}var x=l.previousSibling.getElementsByTagName("input")[0];x.checked=a.date.time_part(v.start_date)===0&&a.date.time_part(v.end_date)===0,m[g[0]].disabled=x.checked,m[g[0]+m.length/2].disabled=x.checked,x.$_eventAttached||(x.$_eventAttached=!0,a.event(x,"click",function(){if(x.checked){var D={};a.form_blocks.time.get_value(l,D,u),f=a.date.date_part(D.start_date),(+(c=a.date.date_part(D.end_date))==+f||+c>=+f&&(v.end_date.getHours()!==0||v.end_date.getMinutes()!==0))&&(c=a.date.add(c,1,"day"))}else f=null,c=null;m[g[0]].disabled=x.checked,m[g[0]+m.length/2].disabled=x.checked,E(m,0,f||v.start_date),E(m,4,c||v.end_date)}))}if(p.auto_end_date&&p.event_duration)for(var b=function(){p.auto_end_date&&p.event_duration&&(f=new Date(m[g[3]].value,m[g[2]].value,m[g[1]].value,0,m[g[0]].value),c=new Date(f.getTime()+60*a.config.event_duration*1e3),E(m,4,c))},k=0;k<4;k++)m[k].$_eventAttached||(m[k].$_eventAttached=!0,a.event(m[k],"change",b));function E(D,w,S){for(var N=u._time_values,M=60*S.getHours()+S.getMinutes(),T=M,A=!1,H=0;H";for(var u=0;u
"+a.locale.labels[v[u]]+"
";v=this.config.buttons_right;var f=a.config.rtl;for(u=0;u",h+="
"+a.locale.labels[v[u]]+"
";h+="",h+="",l.innerHTML=h,a.config.drag_lightbox&&(a.event(l.firstChild,"mousedown",a._ready_to_dnd),a.event(l.firstChild,"selectstart",function(b){return b.preventDefault(),!1}),l.firstChild.style.cursor="move",a._init_dnd_events()),this._waiAria.lightboxAttr(l),this.show_cover(),this._cover.insertBefore(l,this._cover.firstChild),this._lightbox=l;var c=this.config.lightbox.sections;for(h="",u=0;u
"+this.locale.labels["button_"+c[u].button]+"
"),this.config.wide_form&&(h+="
");var g=this.locale.labels["section_"+c[u].name];typeof g!="string"&&(g=c[u].name),h+="
"+m+"
"+p.render.call(this,c[u]),h+="
"}}var y=l.getElementsByTagName("div");for(u=0;u
 
-
`}(h),we(h),function(t){t.getRootView=function(){return{view:{render:function(){return{tag:"div",type:1,attrs:{style:"width:100%;height:100%;"},hooks:{didInsert:function(){t.setCurrentView()}},body:[{el:this.el,type:1}]}},init:function(){var n=document.createElement("DIV");n.id="scheduler_"+t.uid(),n.style.width="100%",n.style.height="100%",n.classList.add("dhx_cal_container"),n.cmp="grid",n.innerHTML='
',t.init(n),this.el=n}},type:4}}}(h),ke(h),window.jQuery&&(r=window.jQuery,d=0,i=[],r.fn.dhx_scheduler=function(t){if(typeof t!="string"){var n=[];return this.each(function(){if(this&&this.getAttribute)if(this.getAttribute("dhxscheduler"))n.push(window[this.getAttribute("dhxscheduler")]);else{var s="scheduler";d&&(s="scheduler"+(d+1),window[s]=Scheduler.getSchedulerInstance());var c=window[s];for(var u in this.setAttribute("dhxscheduler",s),t)u!="data"&&(c.config[u]=t[u]);this.getElementsByTagName("div").length||(this.innerHTML='
',this.className+=" dhx_cal_container"),c.init(this,c.config.date,c.config.mode),t.data&&c.parse(t.data),n.push(c),d++}}),n.length===1?n[0]:n}if(i[t])return i[t].apply(this,[]);r.error("Method "+t+" does not exist on jQuery.dhx_scheduler")}),function(t){(function(){var n=t.setCurrentView,s=t.updateView,c=null,u=null,v=function(f,g){var p=this;P.clearTimeout(u),P.clearTimeout(c);var y=p._date,w=p._mode;l(this,f,g),u=setTimeout(function(){t.$destroyed||(p.callEvent("onBeforeViewChange",[w,y,g||p._mode,f||p._date])?(s.call(p,f,g),p.callEvent("onViewChange",[p._mode,p._date]),P.clearTimeout(c),u=0):l(p,y,w))},t.config.delay_render)},m=function(f,g){var p=this,y=arguments;l(this,f,g),P.clearTimeout(c),c=setTimeout(function(){t.$destroyed||u||s.apply(p,y)},t.config.delay_render)};function l(f,g,p){g&&(f._date=g),p&&(f._mode=p)}t.attachEvent("onSchedulerReady",function(){t.config.delay_render?(t.setCurrentView=v,t.updateView=m):(t.setCurrentView=n,t.updateView=s)})})()}(h),function(t){t.createDataProcessor=function(n){var s,c;n instanceof Function?s=n:n.hasOwnProperty("router")?s=n.router:n.hasOwnProperty("event")&&(s=n),c=s?"CUSTOM":n.mode||"REST-JSON";var u=new Z(n.url);return u.init(t),u.setTransactionMode({mode:c,router:s},n.batchUpdate),u},t.DataProcessor=Z}(h),function(t){t.attachEvent("onSchedulerReady",function(){typeof dhtmlxError<"u"&&window.dhtmlxError.catchError("LoadXML",function(n,s,c){var u=c[0].responseText;switch(t.config.ajax_error){case"alert":P.alert(u);break;case"console":P.console.log(u)}})})}(h);const _=new qe({en:He,ar:Se,be:Ne,ca:Me,cn:Ae,cs:Ce,da:Te,de:Oe,el:$e,es:Le,fi:ze,fr:je,he:Pe,hu:Ve,id:Ie,it:Be,jp:Re,nb:Fe,nl:Je,no:Ue,pl:Ye,pt:We,ro:Ke,ru:Ge,si:Xe,sk:Ze,sv:Qe,tr:et,ua:tt});h.i18n={addLocale:_.addLocale,setLocale:function(t){if(typeof t=="string"){var n=_.getLocale(t);n||(n=_.getLocale("en")),h.locale=n}else if(t)if(h.locale)for(var s in t)t[s]&&typeof t[s]=="object"?(h.locale[s]||(h.locale[s]={}),h.mixin(h.locale[s],t[s],!0)):h.locale[s]=t[s];else h.locale=t;var c=h.locale.labels;c.dhx_save_btn=c.icon_save,c.dhx_cancel_btn=c.icon_cancel,c.dhx_delete_btn=c.icon_delete,h.$container&&h.get_elements()},getLocale:_.getLocale},h.i18n.setLocale("en"),h.ext={};const o={};return h.plugins=function(t){(function(s,c,u){const v=[];for(const m in s)if(s[m]){const l=m.toLowerCase();c[l]&&c[l].forEach(function(f){const g=f.toLowerCase();s[g]||v.push(g)}),v.push(l)}return v.sort(function(m,l){const f=u[m]||0,g=u[l]||0;return f>g?1:f
';var d=document.createElement("DIV");return d.id="dhxSchedObj_"+this._genStr(12),d.innerHTML='
'+a+'
',document.body.appendChild(d.firstChild),this.attachObject(d.id,!1,!0),this.vs[this.av].sched=r,this.vs[this.av].schedId=d.id,r.setSizes=r.updateView,r.destructor=function(){},r.init(d.id,e,h),this.vs[this._viewRestore()].sched});const q=(e,h)=>{h(!1,`The ${e} extension is not included in this version of dhtmlxScheduler.
+
`}(i),Bt(i),function(a){a.getRootView=function(){return{view:{render:function(){return{tag:"div",type:1,attrs:{style:"width:100%;height:100%;"},hooks:{didInsert:function(){a.setCurrentView()}},body:[{el:this.el,type:1}]}},init:function(){var o=document.createElement("DIV");o.id="scheduler_"+a.uid(),o.style.width="100%",o.style.height="100%",o.classList.add("dhx_cal_container"),o.cmp="grid",o.innerHTML='
',a.init(o),this.el=o}},type:4}}}(i),Ft(i),window.jQuery&&(r=window.jQuery,d=0,n=[],r.fn.dhx_scheduler=function(a){if(typeof a!="string"){var o=[];return this.each(function(){if(this&&this.getAttribute)if(this.getAttribute("dhxscheduler"))o.push(window[this.getAttribute("dhxscheduler")]);else{var l="scheduler";d&&(l="scheduler"+(d+1),window[l]=Scheduler.getSchedulerInstance());var h=window[l];for(var v in this.setAttribute("dhxscheduler",l),a)v!="data"&&(h.config[v]=a[v]);this.getElementsByTagName("div").length||(this.innerHTML='
',this.className+=" dhx_cal_container"),h.init(this,h.config.date,h.config.mode),a.data&&h.parse(a.data),o.push(h),d++}}),o.length===1?o[0]:o}if(n[a])return n[a].apply(this,[]);r.error("Method "+a+" does not exist on jQuery.dhx_scheduler")}),function(a){(function(){var o=a.setCurrentView,l=a.updateView,h=null,v=null,u=function(p,m){var g=this;G.clearTimeout(v),G.clearTimeout(h);var y=g._date,x=g._mode;c(this,p,m),v=setTimeout(function(){a.$destroyed||(g.callEvent("onBeforeViewChange",[x,y,m||g._mode,p||g._date])?(l.call(g,p,m),g.callEvent("onViewChange",[g._mode,g._date]),G.clearTimeout(h),v=0):c(g,y,x))},a.config.delay_render)},f=function(p,m){var g=this,y=arguments;c(this,p,m),G.clearTimeout(h),h=setTimeout(function(){a.$destroyed||v||l.apply(g,y)},a.config.delay_render)};function c(p,m,g){m&&(p._date=m),g&&(p._mode=g)}a.attachEvent("onSchedulerReady",function(){a.config.delay_render?(a.setCurrentView=u,a.updateView=f):(a.setCurrentView=o,a.updateView=l)})})()}(i),function(a){a.createDataProcessor=function(o){var l,h;o instanceof Function?l=o:o.hasOwnProperty("router")?l=o.router:o.hasOwnProperty("event")&&(l=o),h=l?"CUSTOM":o.mode||"REST-JSON";var v=new Le(o.url);return v.init(a),v.setTransactionMode({mode:h,router:l},o.batchUpdate),v},a.DataProcessor=Le}(i),function(a){a.attachEvent("onSchedulerReady",function(){typeof dhtmlxError<"u"&&window.dhtmlxError.catchError("LoadXML",function(o,l,h){var v=h[0].responseText;switch(a.config.ajax_error){case"alert":G.alert(v);break;case"console":G.console.log(v)}})})}(i);const s=new ha({en:na,ar:Kt,be:Gt,ca:Xt,cn:Zt,cs:Qt,da:ea,de:ta,el:aa,es:ra,fi:ia,fr:oa,he:sa,hu:da,id:_a,it:la,jp:ca,nb:ua,nl:fa,no:pa,pl:ma,pt:va,ro:ga,ru:ya,si:ba,sk:xa,sv:ka,tr:wa,ua:Ea});i.i18n={addLocale:s.addLocale,setLocale:function(a){if(typeof a=="string"){var o=s.getLocale(a);o||(o=s.getLocale("en")),i.locale=o}else if(a)if(i.locale)for(var l in a)a[l]&&typeof a[l]=="object"?(i.locale[l]||(i.locale[l]={}),i.mixin(i.locale[l],a[l],!0)):i.locale[l]=a[l];else i.locale=a;var h=i.locale.labels;h.dhx_save_btn=h.icon_save,h.dhx_cancel_btn=h.icon_cancel,h.dhx_delete_btn=h.icon_delete,i.$container&&i.get_elements()},getLocale:s.getLocale},i.i18n.setLocale("en"),At(i),i.ext={};const _={};return i.plugins=function(a){(function(l,h,v){const u=[];for(const f in l)if(l[f]){const c=f.toLowerCase();h[c]&&h[c].forEach(function(p){const m=p.toLowerCase();l[m]||u.push(m)}),u.push(c)}return u.sort(function(f,c){const p=v[f]||0,m=v[c]||0;return p>m?1:p
';var d=document.createElement("DIV");return d.id="dhxSchedObj_"+this._genStr(12),d.innerHTML='
'+t+'
',document.body.appendChild(d.firstChild),this.attachObject(d.id,!1,!0),this.vs[this.av].sched=r,this.vs[this.av].schedId=d.id,r.setSizes=r.updateView,r.destructor=function(){},r.init(d.id,e,i),this.vs[this._viewRestore()].sched});const _e=(e,i)=>{i(!1,`The ${e} extension is not included in this version of dhtmlxScheduler.
You may need a Professional version of the component.
- Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`)};function rt(e){(function(){var h=[];function a(){return!!h.length}function r(o){setTimeout(function(){if(e.$destroyed)return!0;a()||function(t,n){for(;t&&t!=n;)t=t.parentNode;return t==n}(document.activeElement,e.$container)||e.focus()},1)}function d(o){var t=(o=o||window.event).currentTarget;t==h[h.length-1]&&e.$keyboardNavigation.trapFocus(t,o)}if(e.attachEvent("onLightbox",function(){var o;o=e.getLightbox(),e.eventRemove(o,"keydown",d),e.event(o,"keydown",d),h.push(o)}),e.attachEvent("onAfterLightbox",function(){var o=h.pop();o&&e.eventRemove(o,"keydown",d),r()}),e.attachEvent("onAfterQuickInfo",function(){r()}),!e._keyNavMessagePopup){e._keyNavMessagePopup=!0;var i=null,_=null;const o=[];e.attachEvent("onMessagePopup",function(t){for(i=document.activeElement,_=i;_&&e._getClassName(_).indexOf("dhx_cal_data")<0;)_=_.parentNode;_&&(_=_.parentNode),e.eventRemove(t,"keydown",d),e.event(t,"keydown",d),o.push(t)}),e.attachEvent("onAfterMessagePopup",function(){var t=o.pop();t&&e.eventRemove(t,"keydown",d),setTimeout(function(){if(e.$destroyed)return!0;for(var n=document.activeElement;n&&e._getClassName(n).indexOf("dhx_cal_light")<0;)n=n.parentNode;n||(i&&i.parentNode?i.focus():_&&_.parentNode&&_.focus(),i=null,_=null)},1)})}e.$keyboardNavigation.isModal=a})()}function ot(e){e._temp_key_scope=function(){e.config.key_nav=!0,e.$keyboardNavigation._pasteDate=null,e.$keyboardNavigation._pasteSection=null;var h=null,a={};function r(_){_=_||window.event,a.x=_.clientX,a.y=_.clientY}function d(){for(var _,o,t=document.elementFromPoint(a.x,a.y);t&&t!=e._obj;)t=t.parentNode;return _=t==e._obj,o=e.$keyboardNavigation.dispatcher.isEnabled(),_||o}function i(_){return e._lame_copy({},_)}document.body?e.event(document.body,"mousemove",r):e.event(window,"load",function(){e.event(document.body,"mousemove",r)}),e.attachEvent("onMouseMove",function(_,o){var t=e.getState();if(t.mode&&t.min_date){var n=e.getActionData(o);e.$keyboardNavigation._pasteDate=n.date,e.$keyboardNavigation._pasteSection=n.section}}),e._make_pasted_event=function(_){var o=e.$keyboardNavigation._pasteDate,t=e.$keyboardNavigation._pasteSection,n=_.end_date-_.start_date,s=i(_);if(function(u){delete u.rec_type,delete u.rec_pattern,delete u.event_pid,delete u.event_length}(s),s.start_date=new Date(o),s.end_date=new Date(s.start_date.valueOf()+n),t){var c=e._get_section_property();e.config.multisection?s[c]=_[c]:s[c]=t}return s},e._do_paste=function(_,o,t){e.callEvent("onBeforeEventPasted",[_,o,t])!==!1&&(e.addEvent(o),e.callEvent("onEventPasted",[_,o,t]))},e._is_key_nav_active=function(){return!(!this._is_initialized()||this._is_lightbox_open()||!this.config.key_nav)},e.event(document,"keydown",function(_){(_.ctrlKey||_.metaKey)&&_.keyCode==86&&e._buffer_event&&!e.$keyboardNavigation.dispatcher.isEnabled()&&(e.$keyboardNavigation.dispatcher.isActive=d())}),e._key_nav_copy_paste=function(_){if(!e._is_key_nav_active())return!0;if(_.keyCode==37||_.keyCode==39){_.cancelBubble=!0;var o=e.date.add(e._date,_.keyCode==37?-1:1,e._mode);return e.setCurrentView(o),!0}var t,n=(t=e.$keyboardNavigation.dispatcher.getActiveNode())&&t.eventId?t.eventId:e._select_id;if((_.ctrlKey||_.metaKey)&&_.keyCode==67)return n&&(e._buffer_event=i(e.getEvent(n)),h=!0,e.callEvent("onEventCopied",[e.getEvent(n)])),!0;if((_.ctrlKey||_.metaKey)&&_.keyCode==88&&n){h=!1;var s=e._buffer_event=i(e.getEvent(n));e.updateEvent(s.id),e.callEvent("onEventCut",[s])}if((_.ctrlKey||_.metaKey)&&_.keyCode==86&&d()){if(s=(s=e._buffer_event?e.getEvent(e._buffer_event.id):e._buffer_event)||e._buffer_event){var c=e._make_pasted_event(s);h?(c.id=e.uid(),e._do_paste(h,c,s)):e.callEvent("onBeforeEventChanged",[c,_,!1,s])&&(e._do_paste(h,c,s),h=!0)}return!0}}},e._temp_key_scope()}function st(e){e.$keyboardNavigation.attachSchedulerHandlers=function(){var h,a=e.$keyboardNavigation.dispatcher,r=function(t){if(e.config.key_nav)return a.keyDownHandler(t)},d=function(){a.keepScrollPosition(function(){a.focusGlobalNode()})};e.attachEvent("onDataRender",function(){e.config.key_nav&&a.isEnabled()&&!e.getState().editor_id&&(clearTimeout(h),h=setTimeout(function(){if(e.$destroyed)return!0;a.isEnabled()||a.enable(),i()}))});var i=function(){if(a.isEnabled()){var t=a.getActiveNode();t&&(t.isValid()||(t=t.fallback()),!t||t instanceof e.$keyboardNavigation.MinicalButton||t instanceof e.$keyboardNavigation.MinicalCell||a.keepScrollPosition(function(){t.focus(!0)}))}};function _(t){if(!e.config.key_nav)return!0;const n=e.getView();let s=!1;if(e.getState().mode==="month")s=e.$keyboardNavigation.isChildOf(t.target||t.srcElement,e.$container.querySelector(".dhx_cal_month_table"));else if(n&&n.layout==="timeline")s=e.$keyboardNavigation.isChildOf(t.target||t.srcElement,e.$container.querySelector(".dhx_timeline_data_col"));else{const v=e.$container.querySelectorAll(".dhx_scale_holder");s=Array.from(v).some(m=>m===t.target.parentNode)}var c,u=e.getActionData(t);e._locate_event(t.target||t.srcElement)?c=new e.$keyboardNavigation.Event(e._locate_event(t.target||t.srcElement)):s&&(c=new e.$keyboardNavigation.TimeSlot,u.date&&s&&(c=c.nextSlot(new e.$keyboardNavigation.TimeSlot(u.date,null,u.section)))),c&&(a.isEnabled()?u.date&&s&&a.delay(function(){a.setActiveNode(c)}):a.activeNode=c)}e.attachEvent("onSchedulerReady",function(){var t=e.$container;e.eventRemove(document,"keydown",r),e.eventRemove(t,"mousedown",_),e.eventRemove(t,"focus",d),e.config.key_nav?(e.event(document,"keydown",r),e.event(t,"mousedown",_),e.event(t,"focus",d),t.setAttribute("tabindex","0")):t.removeAttribute("tabindex")});var o=e.updateEvent;e.updateEvent=function(t){var n=o.apply(this,arguments);if(e.config.key_nav&&a.isEnabled()&&e.getState().select_id==t){var s=new e.$keyboardNavigation.Event(t);e.getState().lightbox_id||function(c){if(e.config.key_nav&&a.isEnabled()){var u=c,v=new e.$keyboardNavigation.Event(u.eventId);if(!v.isValid()){var m=v.start||u.start,l=v.end||u.end,f=v.section||u.section;(v=new e.$keyboardNavigation.TimeSlot(m,l,f)).isValid()||(v=new e.$keyboardNavigation.TimeSlot)}a.setActiveNode(v);var g=a.getActiveNode();g&&g.getNode&&document.activeElement!=g.getNode()&&a.focusNode(a.getActiveNode())}}(s)}return n},e.attachEvent("onEventDeleted",function(t){return e.config.key_nav&&a.isEnabled()&&a.getActiveNode().eventId==t&&a.setActiveNode(new e.$keyboardNavigation.TimeSlot),!0}),e.attachEvent("onClearAll",function(){if(!e.config.key_nav)return!0;a.isEnabled()&&a.getActiveNode()instanceof e.$keyboardNavigation.Event&&a.setActiveNode(new e.$keyboardNavigation.TimeSlot)})}}class dt{constructor(h){this._scheduler=h}getNode(){const h=this._scheduler;return this._tooltipNode||(this._tooltipNode=document.createElement("div"),this._tooltipNode.className="dhtmlXTooltip scheduler_tooltip tooltip",h._waiAria.tooltipAttr(this._tooltipNode)),h.config.rtl?this._tooltipNode.classList.add("dhtmlXTooltip_rtl"):this._tooltipNode.classList.remove("dhtmlXTooltip_rtl"),this._tooltipNode}setViewport(h){return this._root=h,this}show(h,a){const r=this._scheduler,d=r.$domHelpers,i=document.body,_=this.getNode();if(d.isChildOf(_,i)||(this.hide(),i.appendChild(_)),this._isLikeMouseEvent(h)){const o=this._calculateTooltipPosition(h);a=o.top,h=o.left}return _.style.top=a+"px",_.style.left=h+"px",r._waiAria.tooltipVisibleAttr(_),this}hide(){const h=this._scheduler,a=this.getNode();return a&&a.parentNode&&a.parentNode.removeChild(a),h._waiAria.tooltipHiddenAttr(a),this}setContent(h){return this.getNode().innerHTML=h,this}_isLikeMouseEvent(h){return!(!h||typeof h!="object")&&"clientX"in h&&"clientY"in h}_getViewPort(){return this._root||document.body}_calculateTooltipPosition(h){const a=this._scheduler,r=a.$domHelpers,d=this._getViewPortSize(),i=this.getNode(),_={top:0,left:0,width:i.offsetWidth,height:i.offsetHeight,bottom:0,right:0},o=a.config.tooltip_offset_x,t=a.config.tooltip_offset_y,n=document.body,s=r.getRelativeEventPosition(h,n),c=r.getNodePosition(n);s.y+=c.y,_.top=s.y,_.left=s.x,_.top+=t,_.left+=o,_.bottom=_.top+_.height,_.right=_.left+_.width;const u=window.scrollY+n.scrollTop;return _.topd.bottom&&(_.bottom=d.bottom,_.top=_.bottom-_.height),_.leftd.right&&(_.right=d.right,_.left=_.right-_.width),s.x>=_.left&&s.x<=_.right&&(_.left=s.x-_.width-o,_.right=_.left+_.width),s.y>=_.top&&s.y<=_.bottom&&(_.top=s.y-_.height-t,_.bottom=_.top+_.height),_}_getViewPortSize(){const h=this._scheduler,a=h.$domHelpers,r=this._getViewPort();let d,i=r,_=window.scrollY+document.body.scrollTop,o=window.scrollX+document.body.scrollLeft;return r===h.$event_data?(i=h.$event,_=0,o=0,d=a.getNodePosition(h.$event)):d=a.getNodePosition(i),{left:d.x+o,top:d.y+_,width:d.width,height:d.height,bottom:d.y+d.height+_,right:d.x+d.width+o}}}class _t{constructor(h){this._listeners={},this.tooltip=new dt(h),this._scheduler=h,this._domEvents=h._createDomEventScope(),this._initDelayedFunctions()}destructor(){this.tooltip.hide(),this._domEvents.detachAll()}hideTooltip(){this.delayHide()}attach(h){let a=document.body;const r=this._scheduler,d=r.$domHelpers;h.global||(a=r.$root);let i=null;const _=o=>{const t=d.getTargetNode(o),n=d.closest(t,h.selector);if(d.isChildOf(t,this.tooltip.getNode()))return;const s=()=>{i=n,h.onmouseenter(o,n)};i?n&&n===i?h.onmousemove(o,n):(h.onmouseleave(o,i),i=null,n&&n!==i&&s()):n&&s()};this.detach(h.selector),this._domEvents.attach(a,"mousemove",_),this._listeners[h.selector]={node:a,handler:_}}detach(h){const a=this._listeners[h];a&&this._domEvents.detach(a.node,"mousemove",a.handler)}tooltipFor(h){const a=r=>{let d=r;return document.createEventObject&&!document.createEvent&&(d=document.createEventObject(r)),d};this._initDelayedFunctions(),this.attach({selector:h.selector,global:h.global,onmouseenter:(r,d)=>{const i=h.html(r,d);i&&this.delayShow(a(r),i)},onmousemove:(r,d)=>{const i=h.html(r,d);i?this.delayShow(a(r),i):(this.delayShow.$cancelTimeout(),this.delayHide())},onmouseleave:()=>{this.delayShow.$cancelTimeout(),this.delayHide()}})}_initDelayedFunctions(){const h=this._scheduler;this.delayShow&&this.delayShow.$cancelTimeout(),this.delayHide&&this.delayHide.$cancelTimeout(),this.tooltip.hide(),this.delayShow=I.delay((a,r)=>{h.callEvent("onBeforeTooltip",[a])===!1?this.tooltip.hide():(this.tooltip.setContent(r),this.tooltip.show(a))},h.config.tooltip_timeout||1),this.delayHide=I.delay(()=>{this.delayShow.$cancelTimeout(),this.tooltip.hide()},h.config.tooltip_hide_timeout||1)}}const lt={active_links:function(e){e.config.active_link_view="day",e._active_link_click=function(h){var a=h.target.getAttribute("data-link-date"),r=e.date.str_to_date(e.config.api_date,!1,!0);if(a)return e.setCurrentView(r(a),e.config.active_link_view),h&&h.preventDefault&&h.preventDefault(),!1},e.attachEvent("onTemplatesReady",function(){var h=function(r,d){d=d||r+"_scale_date",e.templates["_active_links_old_"+d]||(e.templates["_active_links_old_"+d]=e.templates[d]);var i=e.templates["_active_links_old_"+d],_=e.date.date_to_str(e.config.api_date);e.templates[d]=function(o){return""+i(o)+""}};if(h("week"),h("","month_day"),this.matrix)for(var a in this.matrix)h(a);this._detachDomEvent(this._obj,"click",e._active_link_click),e.event(this._obj,"click",e._active_link_click)})},agenda_legacy:function(e){e.date.add_agenda_legacy=function(h){return e.date.add(h,1,"year")},e.templates.agenda_legacy_time=function(h,a,r){return r._timed?this.day_date(r.start_date,r.end_date,r)+" "+this.event_date(h):e.templates.day_date(h)+" – "+e.templates.day_date(a)},e.templates.agenda_legacy_text=function(h,a,r){return r.text},e.templates.agenda_legacy_date=function(){return""},e.date.agenda_legacy_start=function(){return e.date.date_part(e._currentDate())},e.attachEvent("onTemplatesReady",function(){var h=e.dblclick_dhx_cal_data;e.dblclick_dhx_cal_data=function(){if(this._mode=="agenda_legacy")!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(h)return h.apply(this,arguments)};var a=e.render_data;e.render_data=function(i){if(this._mode!="agenda_legacy")return a.apply(this,arguments);d()};var r=e.render_view_data;function d(){var i=e.get_visible_events();i.sort(function(g,p){return g.start_date>p.start_date?1:-1});for(var _,o="
",t=0;t
"+(e.config.rtl?e.templates.agenda_time(n.end_date,n.start_date,n):e.templates.agenda_time(n.start_date,n.end_date,n))+"
",o+=`
+ Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`)};function Ma(e){(function(){var i=[];function t(){return!!i.length}function r(_){setTimeout(function(){if(e.$destroyed)return!0;t()||function(a,o){for(;a&&a!=o;)a=a.parentNode;return a==o}(document.activeElement,e.$container)||e.focus()},1)}function d(_){var a=(_=_||window.event).currentTarget;a==i[i.length-1]&&e.$keyboardNavigation.trapFocus(a,_)}if(e.attachEvent("onLightbox",function(){var _;_=e.getLightbox(),e.eventRemove(_,"keydown",d),e.event(_,"keydown",d),i.push(_)}),e.attachEvent("onAfterLightbox",function(){var _=i.pop();_&&e.eventRemove(_,"keydown",d),r()}),e.attachEvent("onAfterQuickInfo",function(){r()}),!e._keyNavMessagePopup){e._keyNavMessagePopup=!0;var n=null,s=null;const _=[];e.attachEvent("onMessagePopup",function(a){for(n=document.activeElement,s=n;s&&e._getClassName(s).indexOf("dhx_cal_data")<0;)s=s.parentNode;s&&(s=s.parentNode),e.eventRemove(a,"keydown",d),e.event(a,"keydown",d),_.push(a)}),e.attachEvent("onAfterMessagePopup",function(){var a=_.pop();a&&e.eventRemove(a,"keydown",d),setTimeout(function(){if(e.$destroyed)return!0;for(var o=document.activeElement;o&&e._getClassName(o).indexOf("dhx_cal_light")<0;)o=o.parentNode;o||(n&&n.parentNode?n.focus():s&&s.parentNode&&s.focus(),n=null,s=null)},1)})}e.$keyboardNavigation.isModal=t})()}function Ta(e){e._temp_key_scope=function(){e.config.key_nav=!0,e.$keyboardNavigation._pasteDate=null,e.$keyboardNavigation._pasteSection=null;var i=null,t={};function r(s){s=s||window.event,t.x=s.clientX,t.y=s.clientY}function d(){for(var s,_,a=document.elementFromPoint(t.x,t.y);a&&a!=e._obj;)a=a.parentNode;return s=a==e._obj,_=e.$keyboardNavigation.dispatcher.isEnabled(),s||_}function n(s){return e._lame_copy({},s)}document.body?e.event(document.body,"mousemove",r):e.event(window,"load",function(){e.event(document.body,"mousemove",r)}),e.attachEvent("onMouseMove",function(s,_){var a=e.getState();if(a.mode&&a.min_date){var o=e.getActionData(_);e.$keyboardNavigation._pasteDate=o.date,e.$keyboardNavigation._pasteSection=o.section}}),e._make_pasted_event=function(s){var _=e.$keyboardNavigation._pasteDate,a=e.$keyboardNavigation._pasteSection,o=s.end_date-s.start_date,l=n(s);if(function(v){delete v.rec_type,delete v.rec_pattern,delete v.event_pid,delete v.event_length}(l),l.start_date=new Date(_),l.end_date=new Date(l.start_date.valueOf()+o),a){var h=e._get_section_property();e.config.multisection?l[h]=s[h]:l[h]=a}return l},e._do_paste=function(s,_,a){e.callEvent("onBeforeEventPasted",[s,_,a])!==!1&&(e.addEvent(_),e.callEvent("onEventPasted",[s,_,a]))},e._is_key_nav_active=function(){return!(!this._is_initialized()||this._is_lightbox_open()||!this.config.key_nav)},e.event(document,"keydown",function(s){(s.ctrlKey||s.metaKey)&&s.keyCode==86&&e._buffer_event&&!e.$keyboardNavigation.dispatcher.isEnabled()&&(e.$keyboardNavigation.dispatcher.isActive=d())}),e._key_nav_copy_paste=function(s){if(!e._is_key_nav_active())return!0;if(s.keyCode==37||s.keyCode==39){s.cancelBubble=!0;var _=e.date.add(e._date,s.keyCode==37?-1:1,e._mode);return e.setCurrentView(_),!0}var a,o=(a=e.$keyboardNavigation.dispatcher.getActiveNode())&&a.eventId?a.eventId:e._select_id;if((s.ctrlKey||s.metaKey)&&s.keyCode==67)return o&&(e._buffer_event=n(e.getEvent(o)),i=!0,e.callEvent("onEventCopied",[e.getEvent(o)])),!0;if((s.ctrlKey||s.metaKey)&&s.keyCode==88&&o){i=!1;var l=e._buffer_event=n(e.getEvent(o));e.updateEvent(l.id),e.callEvent("onEventCut",[l])}if((s.ctrlKey||s.metaKey)&&s.keyCode==86&&d()){if(l=(l=e._buffer_event?e.getEvent(e._buffer_event.id):e._buffer_event)||e._buffer_event){var h=e._make_pasted_event(l);i?(h.id=e.uid(),e._do_paste(i,h,l)):e.callEvent("onBeforeEventChanged",[h,s,!1,l])&&(e._do_paste(i,h,l),i=!0)}return!0}}},e._temp_key_scope()}function Aa(e){e.$keyboardNavigation.attachSchedulerHandlers=function(){var i,t=e.$keyboardNavigation.dispatcher,r=function(a){if(e.config.key_nav)return t.keyDownHandler(a)},d=function(){t.keepScrollPosition(function(){t.focusGlobalNode()})};e.attachEvent("onDataRender",function(){e.config.key_nav&&t.isEnabled()&&!e.getState().editor_id&&(clearTimeout(i),i=setTimeout(function(){if(e.$destroyed)return!0;t.isEnabled()||t.enable(),n()}))});var n=function(){if(t.isEnabled()){var a=t.getActiveNode();a&&(a.isValid()||(a=a.fallback()),!a||a instanceof e.$keyboardNavigation.MinicalButton||a instanceof e.$keyboardNavigation.MinicalCell||t.keepScrollPosition(function(){a.focus(!0)}))}};function s(a){if(!e.config.key_nav)return!0;const o=e.getView();let l=!1;if(e.getState().mode==="month")l=e.$keyboardNavigation.isChildOf(a.target||a.srcElement,e.$container.querySelector(".dhx_cal_month_table"));else if(o&&o.layout==="timeline")l=e.$keyboardNavigation.isChildOf(a.target||a.srcElement,e.$container.querySelector(".dhx_timeline_data_col"));else{const u=e.$container.querySelectorAll(".dhx_scale_holder");l=Array.from(u).some(f=>f===a.target.parentNode)}var h,v=e.getActionData(a);e._locate_event(a.target||a.srcElement)?h=new e.$keyboardNavigation.Event(e._locate_event(a.target||a.srcElement)):l&&(h=new e.$keyboardNavigation.TimeSlot,v.date&&l&&(h=h.nextSlot(new e.$keyboardNavigation.TimeSlot(v.date,null,v.section)))),h&&(t.isEnabled()?v.date&&l&&t.delay(function(){t.setActiveNode(h)}):t.activeNode=h)}e.attachEvent("onSchedulerReady",function(){var a=e.$container;e.eventRemove(document,"keydown",r),e.eventRemove(a,"mousedown",s),e.eventRemove(a,"focus",d),e.config.key_nav?(e.event(document,"keydown",r),e.event(a,"mousedown",s),e.event(a,"focus",d),a.setAttribute("tabindex","0")):a.removeAttribute("tabindex")});var _=e.updateEvent;e.updateEvent=function(a){var o=_.apply(this,arguments);if(e.config.key_nav&&t.isEnabled()&&e.getState().select_id==a){var l=new e.$keyboardNavigation.Event(a);e.getState().lightbox_id||function(h){if(e.config.key_nav&&t.isEnabled()){var v=h,u=new e.$keyboardNavigation.Event(v.eventId);if(!u.isValid()){var f=u.start||v.start,c=u.end||v.end,p=u.section||v.section;(u=new e.$keyboardNavigation.TimeSlot(f,c,p)).isValid()||(u=new e.$keyboardNavigation.TimeSlot)}t.setActiveNode(u);var m=t.getActiveNode();m&&m.getNode&&document.activeElement!=m.getNode()&&t.focusNode(t.getActiveNode())}}(l)}return o},e.attachEvent("onEventDeleted",function(a){return e.config.key_nav&&t.isEnabled()&&t.getActiveNode().eventId==a&&t.setActiveNode(new e.$keyboardNavigation.TimeSlot),!0}),e.attachEvent("onClearAll",function(){if(!e.config.key_nav)return!0;t.isEnabled()&&t.getActiveNode()instanceof e.$keyboardNavigation.Event&&t.setActiveNode(new e.$keyboardNavigation.TimeSlot)})}}class Ca{constructor(i){this.map=null,this._markers=[],this.scheduler=i}onEventClick(i){if(this._markers&&this._markers.length>0){for(let t=0;t{this.infoWindow&&this.infoWindow.close(),this.infoWindow=new google.maps.InfoWindow({maxWidth:this.settings.info_window_max_width}),this.infoWindow.setContent(this.scheduler.templates.map_info_content(i)),this.infoWindow.open({anchor:d,map:this.map})});let n={event:i,...t,marker:d};this._markers.push(n)}removeEventMarker(i){for(let t=0;t0){for(let i=0;i{t.geocode({address:i},function(d,n){n==google.maps.GeocoderStatus.OK?r({lat:d[0].geometry.location.lat(),lng:d[0].geometry.location.lng()}):(console.error("Geocode was not successful for the following reason: "+n),r({}))})})}}class Oa{constructor(i){this.map=null,this._markers=[],this.scheduler=i}onEventClick(i){if(this._markers&&this._markers.length>0)for(let t=0;ta.json());if(_.address){let a=_.address.country;r.addEventNow({lat:s.latlng.lat,lng:s.latlng.lng,event_location:a,start_date:r.getState().date,end_date:r.date.add(r.getState().date,r.config.time_step,"minute")})}else console.error("unable recieve a position of the event",_.error)}),this.map=n,this.settings=t}destroy(i){for(this.map.remove();i.firstChild;)i.firstChild.remove();i.innerHTML=""}addEventMarker(i){const t=L.icon({iconUrl:"https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png",iconSize:[25,41],shadowSize:[30,65],iconAnchor:[12,41],shadowAnchor:[7,65]});let r={minWidth:180,maxWidth:this.settings.info_window_max_width};const d=L.popup(r).setContent(this.scheduler.templates.map_info_content(i)),n=L.tooltip().setContent(i.text);let s=[i.lat,i.lng];i.lat&&i.lng||(s=[this.settings.error_position.lat,this.settings.error_position.lng]);const _={event:i,marker:L.marker(s,{icon:t}).bindPopup(d).bindTooltip(n).addTo(this.map)};this._markers.push(_)}removeEventMarker(i){for(let t=0;td.json());return r&&r.length?(t.lat=+r[0].lat,t.lng=+r[0].lon):console.error(`Unable recieve a position of the event's location: ${i}`),t}}class La{constructor(i){this.map=null,this._markers=[],this.scheduler=i}onEventClick(i){if(this._markers&&this._markers.length>0)for(let t=0;t_.json());if(s.features){let _=s.features[0].place_name;r.addEventNow({lat:n.lngLat.lat,lng:n.lngLat.lng,event_location:_,start_date:r.getState().date,end_date:r.date.add(r.getState().date,r.config.time_step,"minute")})}else console.error("unable recieve a position of the event")}),this.map=d,this.settings=t}destroy(i){for(this.map.remove();i.firstChild;)i.firstChild.remove();i.innerHTML=""}addEventMarker(i){let t=[i.lng,i.lat];i.lat&&i.lng||(t=[this.settings.error_position.lng,this.settings.error_position.lat]);const r=new mapboxgl.Popup({offset:25,focusAfterOpen:!1}).setMaxWidth(`${this.settings.info_window_max_width}px`).setHTML(this.scheduler.templates.map_info_content(i)),d={event:i,marker:new mapboxgl.Marker().setLngLat(t).setPopup(r).addTo(this.map)};this._markers.push(d)}removeEventMarker(i){for(let t=0;td.json()),r={};return t&&t.features.length?(r.lng=t.features[0].center[0],r.lat=t.features[0].center[1]):console.error(`Unable recieve a position of the event's location: ${i}`),r}}var He=["MO","TU","WE","TH","FR","SA","SU"],W=function(){function e(i,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=i,this.n=t}return e.fromStr=function(i){return new e(He.indexOf(i))},e.prototype.nth=function(i){return this.n===i?this:new e(this.weekday,i)},e.prototype.equals=function(i){return this.weekday===i.weekday&&this.n===i.n},e.prototype.toString=function(){var i=He[this.weekday];return this.n&&(i=(this.n>0?"+":"")+String(this.n)+i),i},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e}(),Y=function(e){return e!=null},ae=function(e){return typeof e=="number"},at=function(e){return typeof e=="string"&&He.includes(e)},X=Array.isArray,ne=function(e,i){i===void 0&&(i=e),arguments.length===1&&(i=e,e=0);for(var t=[],r=e;r>=0,r.length>i?String(r):((i-=r.length)>t.length&&(t+=j(t,i/t.length)),t.slice(0,i)+String(r))}var Ha=function(e,i,t){var r=e.split(i);return t?r.slice(0,t).concat([r.slice(t).join(i)]):r},Q=function(e,i){var t=e%i;return t*i<0?t+i:t},$e=function(e,i){return{div:Math.floor(e/i),mod:Q(e,i)}},re=function(e){return!Y(e)||e.length===0},V=function(e){return!re(e)},R=function(e,i){return V(e)&&e.indexOf(i)!==-1},ue=function(e,i,t,r,d,n){return r===void 0&&(r=0),d===void 0&&(d=0),n===void 0&&(n=0),new Date(Date.UTC(e,i-1,t,r,d,n))},$a=[31,28,31,30,31,30,31,31,30,31,30,31],nt=864e5,rt=9999,it=ue(1970,1,1),za=[6,0,1,2,3,4,5],ge=function(e){return e%4==0&&e%100!=0||e%400==0},ot=function(e){return e instanceof Date},ye=function(e){return ot(e)&&!isNaN(e.getTime())},ze=function(e){return i=it,t=e.getTime()-i.getTime(),Math.round(t/nt);var i,t},st=function(e){return new Date(it.getTime()+e*nt)},qa=function(e){var i=e.getUTCMonth();return i===1&&ge(e.getUTCFullYear())?29:$a[i]},pe=function(e){return za[e.getUTCDay()]},dt=function(e,i){var t=ue(e,i+1,1);return[pe(t),qa(t)]},_t=function(e,i){return i=i||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()))},qe=function(e){return new Date(e.getTime())},lt=function(e){for(var i=[],t=0;tthis.maxDate;if(this.method==="between"){if(t)return!0;if(r)return!1}else if(this.method==="before"){if(r)return!1}else if(this.method==="after")return!!t||(this.add(i),!1);return this.add(i)},e.prototype.add=function(i){return this._result.push(i),!0},e.prototype.getValue=function(){var i=this._result;switch(this.method){case"all":case"between":return i;default:return i.length?i[i.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Ie=function(e,i){return Ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var d in r)Object.prototype.hasOwnProperty.call(r,d)&&(t[d]=r[d])},Ie(e,i)};function Re(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function t(){this.constructor=e}Ie(e,i),e.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}var Z=function(){return Z=Object.assign||function(e){for(var i,t=1,r=arguments.length;ti[0].length)&&(i=d,t=r)}if(i!=null&&(this.text=this.text.substr(i[0].length),this.text===""&&(this.done=!0)),i==null)return this.done=!0,this.symbol=null,void(this.value=null)}while(t==="SKIP");return this.symbol=t,this.value=i,!0},e.prototype.accept=function(i){if(this.symbol===i){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(i){if(this.accept(i))return!0;throw new Error("expected "+i+" but found "+this.symbol)},e}();function ft(e,i){i===void 0&&(i=we);var t={},r=new Ia(i.tokens);return r.start(e)?(function(){r.expect("every");var l=r.acceptNumber();if(l&&(t.interval=parseInt(l[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":t.freq=C.DAILY,r.nextSymbol()&&(n(),o());break;case"weekday(s)":t.freq=C.WEEKLY,t.byweekday=[C.MO,C.TU,C.WE,C.TH,C.FR],r.nextSymbol(),n(),o();break;case"week(s)":t.freq=C.WEEKLY,r.nextSymbol()&&(d(),n(),o());break;case"hour(s)":t.freq=C.HOURLY,r.nextSymbol()&&(d(),o());break;case"minute(s)":t.freq=C.MINUTELY,r.nextSymbol()&&(d(),o());break;case"month(s)":t.freq=C.MONTHLY,r.nextSymbol()&&(d(),o());break;case"year(s)":t.freq=C.YEARLY,r.nextSymbol()&&(d(),o());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=C.WEEKLY;var h=r.symbol.substr(0,2).toUpperCase();if(t.byweekday=[C[h]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var v=_();if(!v)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");t.byweekday.push(C[v]),r.nextSymbol()}n(),function(){r.accept("on"),r.accept("the");var f=a();if(f)for(t.bymonthday=[f],r.nextSymbol();r.accept("comma");){if(!(f=a()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");t.bymonthday.push(f),r.nextSymbol()}}(),o();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=C.YEARLY,t.bymonth=[s()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var u=s();if(!u)throw new Error("Unexpected symbol "+r.symbol+", expected month");t.bymonth.push(u),r.nextSymbol()}d(),o();break;default:throw new Error("Unknown symbol")}}(),t):null;function d(){var l=r.accept("on"),h=r.accept("the");if(l||h)do{var v=a(),u=_(),f=s();if(v)u?(r.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(C[u].nth(v))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(v),r.accept("day(s)"));else if(u)r.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(C[u]);else if(r.symbol==="weekday(s)")r.nextSymbol(),t.byweekday||(t.byweekday=[C.MO,C.TU,C.WE,C.TH,C.FR]);else if(r.symbol==="week(s)"){r.nextSymbol();var c=r.acceptNumber();if(!c)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(t.byweekno=[parseInt(c[0],10)];r.accept("comma");){if(!(c=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");t.byweekno.push(parseInt(c[0],10))}}else{if(!f)return;r.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(f)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function n(){if(r.accept("at"))do{var l=r.acceptNumber();if(!l)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(t.byhour=[parseInt(l[0],10)];r.accept("comma");){if(!(l=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");t.byhour.push(parseInt(l[0],10))}}while(r.accept("comma")||r.accept("at"))}function s(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function _(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function a(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var l=parseInt(r.value[1],10);if(l<-366||l>366)throw new Error("Nth out of range: "+l);return r.nextSymbol(),r.accept("last")?-l:l;default:return!1}}function o(){if(r.symbol==="until"){var l=Date.parse(r.text);if(!l)throw new Error("Cannot parse until date:"+r.text);t.until=new Date(l)}else r.accept("for")&&(t.count=parseInt(r.value[0],10),r.expect("number"))}}function Ye(e){return e12){var r=Math.floor(this.month/12),d=Q(this.month,12);this.month=d,this.year+=r,this.month===0&&(this.month=12,--this.year)}},i.prototype.addWeekly=function(t,r){r>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-r))+7*t:this.day+=-(this.getWeekday()-r)+7*t,this.fixDay()},i.prototype.addDaily=function(t){this.day+=t,this.fixDay()},i.prototype.addHours=function(t,r,d){for(r&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var n=$e(this.hour,24),s=n.div,_=n.mod;if(s&&(this.hour=_,this.addDaily(s)),re(d)||R(d,this.hour))break}},i.prototype.addMinutes=function(t,r,d,n){for(r&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var s=$e(this.minute,60),_=s.div,a=s.mod;if(_&&(this.minute=a,this.addHours(_,!1,d)),(re(d)||R(d,this.hour))&&(re(n)||R(n,this.minute)))break}},i.prototype.addSeconds=function(t,r,d,n,s){for(r&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var _=$e(this.second,60),a=_.div,o=_.mod;if(a&&(this.second=o,this.addMinutes(a,!1,d,n)),(re(d)||R(d,this.hour))&&(re(n)||R(n,this.minute))&&(re(s)||R(s,this.second)))break}},i.prototype.fixDay=function(){if(!(this.day<=28)){var t=dt(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>rt))return;t=dt(this.year,this.month-1)[1]}}},i.prototype.add=function(t,r){var d=t.freq,n=t.interval,s=t.wkst,_=t.byhour,a=t.byminute,o=t.bysecond;switch(d){case P.YEARLY:return this.addYears(n);case P.MONTHLY:return this.addMonths(n);case P.WEEKLY:return this.addWeekly(n,s);case P.DAILY:return this.addDaily(n);case P.HOURLY:return this.addHours(n,r,_);case P.MINUTELY:return this.addMinutes(n,r,_,a);case P.SECONDLY:return this.addSeconds(n,r,_,a,o)}},i}(Ee);function pt(e){for(var i=[],t=0,r=Object.keys(e);t=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(i.byweekno||V(i.byweekno)||V(i.byyearday)||i.bymonthday||V(i.bymonthday)||Y(i.byweekday)||Y(i.byeaster)))switch(i.freq){case C.YEARLY:i.bymonth||(i.bymonth=i.dtstart.getUTCMonth()+1),i.bymonthday=i.dtstart.getUTCDate();break;case C.MONTHLY:i.bymonthday=i.dtstart.getUTCDate();break;case C.WEEKLY:i.byweekday=[pe(i.dtstart)]}if(Y(i.bymonth)&&!X(i.bymonth)&&(i.bymonth=[i.bymonth]),Y(i.byyearday)&&!X(i.byyearday)&&ae(i.byyearday)&&(i.byyearday=[i.byyearday]),Y(i.bymonthday))if(X(i.bymonthday)){var r=[],d=[];for(t=0;t0?r.push(n):n<0&&d.push(n)}i.bymonthday=r,i.bynmonthday=d}else i.bymonthday<0?(i.bynmonthday=[i.bymonthday],i.bymonthday=[]):(i.bynmonthday=[],i.bymonthday=[i.bymonthday]);else i.bymonthday=[],i.bynmonthday=[];if(Y(i.byweekno)&&!X(i.byweekno)&&(i.byweekno=[i.byweekno]),Y(i.byweekday))if(ae(i.byweekday))i.byweekday=[i.byweekday],i.bynweekday=null;else if(at(i.byweekday))i.byweekday=[W.fromStr(i.byweekday).weekday],i.bynweekday=null;else if(i.byweekday instanceof W)!i.byweekday.n||i.freq>C.MONTHLY?(i.byweekday=[i.byweekday.weekday],i.bynweekday=null):(i.bynweekday=[[i.byweekday.weekday,i.byweekday.n]],i.byweekday=null);else{var s=[],_=[];for(t=0;tC.MONTHLY?s.push(a.weekday):_.push([a.weekday,a.n])}i.byweekday=V(s)?s:null,i.bynweekday=V(_)?_:null}else i.bynweekday=null;return Y(i.byhour)?ae(i.byhour)&&(i.byhour=[i.byhour]):i.byhour=i.freq=4?(l=0,r=o.yearlen+Q(a-i.wkst,7)):r=n-l;for(var h=Math.floor(r/7),v=Q(r,7),u=Math.floor(h+v/4),f=0;f0&&c<=u){var p=void 0;c>1?(p=l+7*(c-1),l!==t&&(p-=7-t)):p=l;for(var m=0;m<7&&(o.wnomask[p]=1,p++,o.wdaymask[p]!==i.wkst);m++);}}if(R(i.byweekno,1)&&(p=l+7*u,l!==t&&(p-=7-t),p=4?(x=0,k=b+Q(y-i.wkst,7)):k=n-l,g=Math.floor(52+Q(k,7)/4)}if(R(i.byweekno,g))for(p=0;p=C.HOURLY&&V(M)&&!R(M,w.hour)||N>=C.MINUTELY&&V(T)&&!R(T,w.minute)||N>=C.SECONDLY&&V(A)&&!R(A,w.second)?[]:D.gettimeset(N)(w.hour,w.minute,w.second,w.millisecond)}(o,a,i);;){var h=o.getdayset(r)(a.year,a.month,a.day),v=h[0],u=h[1],f=h[2],c=hn(v,u,f,o,i);if(V(s))for(var p=ln(s,l,u,f,o,v),m=0;mn)return oe(e);if(g>=t){var y=bt(g,i);if(!e.accept(y)||_&&!--_)return oe(e)}}else for(m=u;mn||g>=t&&(y=bt(g,i),!e.accept(y)||_&&!--_))return oe(e)}}if(i.interval===0||(a.add(i,c),a.year>rt))return oe(e);Ye(r)||(l=o.gettimeset(r)(a.hour,a.minute,a.second,0)),o.rebuild(a.year,a.month)}}function cn(e,i,t){var r=t.bymonth,d=t.byweekno,n=t.byweekday,s=t.byeaster,_=t.bymonthday,a=t.bynmonthday,o=t.byyearday;return V(r)&&!R(r,e.mmask[i])||V(d)&&!e.wnomask[i]||V(n)&&!R(n,e.wdaymask[i])||V(e.nwdaymask)&&!e.nwdaymask[i]||s!==null&&!R(e.eastermask,i)||(V(_)||V(a))&&!R(_,e.mdaymask[i])&&!R(a,e.nmdaymask[i])||V(o)&&(i=e.yearlen&&!R(o,i+1-e.yearlen)&&!R(o,-e.nextyearlen+i-e.yearlen))}function bt(e,i){return new Se(e,i.tzid).rezonedDate()}function oe(e){return e.getValue()}function hn(e,i,t,r,d){for(var n=!1,s=i;s0&&f[0]===" "?(v[u-1]+=f.slice(1),v.splice(u,1)):u+=1:v.splice(u,1)}return v}(e,i.unfold);return o.forEach(function(l){var h;if(l){var v=function(m){var g=function(k){if(k.indexOf(":")===-1)return{name:"RRULE",value:k};var E=Ha(k,":",1),D=E[0],w=E[1];return{name:D,value:w}}(m),y=g.name,x=g.value,b=y.split(";");if(!b)throw new Error("empty property name");return{name:b[0].toUpperCase(),parms:b.slice(1),value:x}}(l),u=v.name,f=v.parms,c=v.value;switch(u.toUpperCase()){case"RRULE":if(f.length)throw new Error("unsupported RRULE parm: ".concat(f.join(",")));t.push(Ue(l));break;case"RDATE":var p=((h=/RDATE(?:;TZID=([^:=]+))?/i.exec(l))!==null&&h!==void 0?h:[])[1];p&&!a&&(a=p),r=r.concat(kt(c,f));break;case"EXRULE":if(f.length)throw new Error("unsupported EXRULE parm: ".concat(f.join(",")));d.push(Ue(c));break;case"EXDATE":n=n.concat(kt(c,f));break;case"DTSTART":break;default:throw new Error("unsupported property: "+u)}}}),{dtstart:_,tzid:a,rrulevals:t,rdatevals:r,exrulevals:d,exdatevals:n}}function Ne(e,i){return i===void 0&&(i={}),function(t,r){var d=fn(t,r),n=d.rrulevals,s=d.rdatevals,_=d.exrulevals,a=d.exdatevals,o=d.dtstart,l=d.tzid,h=r.cache===!1;if(r.compatible&&(r.forceset=!0,r.unfold=!0),r.forceset||n.length>1||s.length||_.length||a.length){var v=new pn(h);return v.dtstart(o),v.tzid(l||void 0),n.forEach(function(f){v.rrule(new C(Fe(f,o,l),h))}),s.forEach(function(f){v.rdate(f)}),_.forEach(function(f){v.exrule(new C(Fe(f,o,l),h))}),a.forEach(function(f){v.exdate(f)}),r.compatible&&r.dtstart&&v.rdate(o),v}var u=n[0]||{};return new C(Fe(u,u.dtstart||r.dtstart||o,u.tzid||r.tzid||l),h)}(e,function(t){var r=[],d=Object.keys(t),n=Object.keys(xt);if(d.forEach(function(s){R(n,s)||r.push(s)}),r.length)throw new Error("Invalid options: "+r.join(", "));return Z(Z({},xt),t)}(i))}function Fe(e,i,t){return Z(Z({},e),{dtstart:i,tzid:t})}function kt(e,i){return function(t){t.forEach(function(r){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(r))throw new Error("unsupported RDATE/EXDATE parm: "+r)})}(i),e.split(",").map(function(t){return Pe(t)})}function wt(e){var i=this;return function(t){if(t!==void 0&&(i["_".concat(e)]=t),i["_".concat(e)]!==void 0)return i["_".concat(e)];for(var r=0;rd.bottom&&(s.bottom=d.bottom,s.top=s.bottom-s.height),s.leftd.right&&(s.right=d.right,s.left=s.right-s.width),l.x>=s.left&&l.x<=s.right&&(s.left=l.x-s.width-_,s.right=s.left+s.width),l.y>=s.top&&l.y<=s.bottom&&(s.top=l.y-s.height-a,s.bottom=s.top+s.height),s}_getViewPortSize(){const i=this._scheduler,t=i.$domHelpers,r=this._getViewPort();let d,n=r,s=window.scrollY+document.body.scrollTop,_=window.scrollX+document.body.scrollLeft;return r===i.$event_data?(n=i.$event,s=0,_=0,d=t.getNodePosition(i.$event)):d=t.getNodePosition(n),{left:d.x+_,top:d.y+s,width:d.width,height:d.height,bottom:d.y+d.height+s,right:d.x+d.width+_}}}class vn{constructor(i){this._listeners={},this.tooltip=new mn(i),this._scheduler=i,this._domEvents=i._createDomEventScope(),this._initDelayedFunctions()}destructor(){this.tooltip.hide(),this._domEvents.detachAll()}hideTooltip(){this.delayHide()}attach(i){let t=document.body;const r=this._scheduler,d=r.$domHelpers;i.global||(t=r.$root);let n=null;const s=_=>{const a=d.getTargetNode(_),o=d.closest(a,i.selector);if(d.isChildOf(a,this.tooltip.getNode()))return;const l=()=>{n=o,i.onmouseenter(_,o)};n?o&&o===n?i.onmousemove(_,o):(i.onmouseleave(_,n),n=null,o&&o!==n&&l()):o&&l()};this.detach(i.selector),this._domEvents.attach(t,"mousemove",s),this._listeners[i.selector]={node:t,handler:s}}detach(i){const t=this._listeners[i];t&&this._domEvents.detach(t.node,"mousemove",t.handler)}tooltipFor(i){const t=r=>{let d=r;return document.createEventObject&&!document.createEvent&&(d=document.createEventObject(r)),d};this._initDelayedFunctions(),this.attach({selector:i.selector,global:i.global,onmouseenter:(r,d)=>{const n=i.html(r,d);n&&this.delayShow(t(r),n)},onmousemove:(r,d)=>{const n=i.html(r,d);n?this.delayShow(t(r),n):(this.delayShow.$cancelTimeout(),this.delayHide())},onmouseleave:()=>{this.delayShow.$cancelTimeout(),this.delayHide()}})}_initDelayedFunctions(){const i=this._scheduler;this.delayShow&&this.delayShow.$cancelTimeout(),this.delayHide&&this.delayHide.$cancelTimeout(),this.tooltip.hide(),this.delayShow=ee.delay((t,r)=>{i.callEvent("onBeforeTooltip",[t])===!1?this.tooltip.hide():(this.tooltip.setContent(r),this.tooltip.show(t))},i.config.tooltip_timeout||1),this.delayHide=ee.delay(()=>{this.delayShow.$cancelTimeout(),this.tooltip.hide()},i.config.tooltip_hide_timeout||1)}}const gn={active_links:function(e){e.config.active_link_view="day",e._active_link_click=function(i){var t=i.target.getAttribute("data-link-date"),r=e.date.str_to_date(e.config.api_date,!1,!0);if(t)return e.setCurrentView(r(t),e.config.active_link_view),i&&i.preventDefault&&i.preventDefault(),!1},e.attachEvent("onTemplatesReady",function(){var i=function(r,d){d=d||r+"_scale_date",e.templates["_active_links_old_"+d]||(e.templates["_active_links_old_"+d]=e.templates[d]);var n=e.templates["_active_links_old_"+d],s=e.date.date_to_str(e.config.api_date);e.templates[d]=function(_){return""+n(_)+""}};if(i("week"),i("","month_day"),this.matrix)for(var t in this.matrix)i(t);this._detachDomEvent(this._obj,"click",e._active_link_click),e.event(this._obj,"click",e._active_link_click)})},agenda_legacy:function(e){e.date.add_agenda_legacy=function(i){return e.date.add(i,1,"year")},e.templates.agenda_legacy_time=function(i,t,r){return r._timed?this.day_date(r.start_date,r.end_date,r)+" "+this.event_date(i):e.templates.day_date(i)+" – "+e.templates.day_date(t)},e.templates.agenda_legacy_text=function(i,t,r){return r.text},e.templates.agenda_legacy_date=function(){return""},e.date.agenda_legacy_start=function(){return e.date.date_part(e._currentDate())},e.attachEvent("onTemplatesReady",function(){var i=e.dblclick_dhx_cal_data;e.dblclick_dhx_cal_data=function(){if(this._mode=="agenda_legacy")!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(i)return i.apply(this,arguments)};var t=e.render_data;e.render_data=function(n){if(this._mode!="agenda_legacy")return t.apply(this,arguments);d()};var r=e.render_view_data;function d(){var n=e.get_visible_events();n.sort(function(m,g){return m.start_date>g.start_date?1:-1});for(var s,_="
",a=0;a
"+(e.config.rtl?e.templates.agenda_time(o.end_date,o.start_date,o):e.templates.agenda_time(o.start_date,o.end_date,o))+"
",_+=`
-
`,o+=""+e.templates.agenda_text(n.start_date,n.end_date,n)+"
"}o+="
",e._els.dhx_cal_data[0].innerHTML=o,e._els.dhx_cal_data[0].childNodes[0].scrollTop=e._agendaScrollTop||0;var m=e._els.dhx_cal_data[0].childNodes[0];m.childNodes[m.childNodes.length-1].style.height=m.offsetHeight
"+o.date+"
"+o.description+"
",e._table_view=!0,e.set_sizes()}}(i),i?(e._cols=null,e._colsS=null,e._table_view=!0,d()):e._table_view=!1}})},agenda_view:function(e){e.date.add_agenda=function(d,i){return e.date.add(d,1*i,"month")},e.templates.agenda_time=function(d,i,_){return _._timed?`${this.event_date(d)} - ${this.event_date(i)}`:e.locale.labels.full_day},e.templates.agenda_text=function(d,i,_){return _.text};const h=e.date.date_to_str("%F %j"),a=e.date.date_to_str("%l");e.templates.agenda_day=function(d){return`
${h(d)}
-
${a(d)}
`},e.templates.agenda_date=function(d,i){return e.templates.month_date(e.getState().date)},e.date.agenda_start=function(d){return e.date.month_start(new Date(d))};let r=0;e.attachEvent("onTemplatesReady",function(){var d=e.dblclick_dhx_cal_data;e.dblclick_dhx_cal_data=function(){if(this._mode=="agenda")!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(d)return d.apply(this,arguments)};var i=e.render_data;e.render_data=function(n){if(this._mode!="agenda")return i.apply(this,arguments);o()};var _=e.render_view_data;function o(){const n=e.get_visible_events();n.sort(function(f,g){return f.start_date>g.start_date?1:-1});const s={};let c=e.getState().min_date;const u=e.getState().max_date;for(;c.valueOf(){let g=e.date.day_start(new Date(f.start_date));for(;g.valueOf()${e.locale.labels.agenda_tab}`;e._els.dhx_cal_data[0].scrollTop=r;let m=e._els.dhx_cal_data[0].querySelectorAll(".dhx_cal_agenda_event_line");e._rendered=[];for(var l=0;l`,_+=""+e.templates.agenda_text(o.start_date,o.end_date,o)+""}_+="
",e._els.dhx_cal_data[0].innerHTML=_,e._els.dhx_cal_data[0].childNodes[0].scrollTop=e._agendaScrollTop||0;var f=e._els.dhx_cal_data[0].childNodes[0];f.childNodes[f.childNodes.length-1].style.height=f.offsetHeight
"+_.date+"
"+_.description+"",e._table_view=!0,e.set_sizes()}}(n),n?(e._cols=null,e._colsS=null,e._table_view=!0,d()):e._table_view=!1}})},agenda_view:function(e){e.date.add_agenda=function(d,n){return e.date.add(d,1*n,"month")},e.templates.agenda_time=function(d,n,s){return s._timed?`${this.event_date(d)} - ${this.event_date(n)}`:e.locale.labels.full_day},e.templates.agenda_text=function(d,n,s){return s.text};const i=e.date.date_to_str("%F %j"),t=e.date.date_to_str("%l");e.templates.agenda_day=function(d){return`
${i(d)}
+
${t(d)}
`},e.templates.agenda_date=function(d,n){return e.templates.month_date(e.getState().date)},e.date.agenda_start=function(d){return e.date.month_start(new Date(d))};let r=0;e.attachEvent("onTemplatesReady",function(){var d=e.dblclick_dhx_cal_data;e.dblclick_dhx_cal_data=function(){if(this._mode=="agenda")!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(d)return d.apply(this,arguments)};var n=e.render_data;e.render_data=function(o){if(this._mode!="agenda")return n.apply(this,arguments);_()};var s=e.render_view_data;function _(){const o=e.get_visible_events();o.sort(function(p,m){return p.start_date>m.start_date?1:-1});const l={};let h=e.getState().min_date;const v=e.getState().max_date;for(;h.valueOf(){let m=e.date.day_start(new Date(p.start_date));for(;m.valueOf()${e.locale.labels.agenda_tab}`;e._els.dhx_cal_data[0].scrollTop=r;let f=e._els.dhx_cal_data[0].querySelectorAll(".dhx_cal_agenda_event_line");e._rendered=[];for(var c=0;c -
${e.templates.agenda_day(n)}
+
${e.templates.agenda_day(o)}
-`;return s.forEach(u=>{c+=function(v,m){const l=e.templates.agenda_time(m.start_date,m.end_date,m),f=e.getState().select_id,g=e.templates.event_class(m.start_date,m.end_date,m),p=e.templates.agenda_text(m.start_date,m.end_date,m);let y="";return(m.color||m.textColor)&&(y=` style="${m.color?"--dhx-scheduler-event-background:"+m.color+";":""}${m.textColor?"--dhx-scheduler-event-color:"+m.textColor+";":""}" `),`
+`;return l.forEach(v=>{h+=function(u,f){const c=e.templates.agenda_time(f.start_date,f.end_date,f),p=e.getState().select_id,m=e.templates.event_class(f.start_date,f.end_date,f),g=e.templates.agenda_text(f.start_date,f.end_date,f);let y="";return(f.color||f.textColor)&&(y=` style="${f.color?"--dhx-scheduler-event-background:"+f.color+";":""}${f.textColor?"--dhx-scheduler-event-color:"+f.textColor+";":""}" `),`
-
${l}
-
${p}
-
`}(0,u)}),c+="
",c}e.render_view_data=function(){return this._mode=="agenda"&&(r=e._els.dhx_cal_data[0].scrollTop,e._els.dhx_cal_data[0].scrollTop=0),_.apply(this,arguments)},e.agenda_view=function(n){n?(e._min_date=e.config.agenda_start||e.date.agenda_start(e._date),e._max_date=e.config.agenda_end||e.date.add_agenda(e._min_date,1),e._cols=null,e._colsS=null,e._table_view=!0,e._getNavDateElement().innerHTML=e.templates.agenda_date(e._date),o()):e._table_view=!1}})},all_timed:function(e){e.config.all_timed="short",e.config.all_timed_month=!1;var h=function(o){return!((o.end_date-o.start_date)/36e5>=24)||e._drag_mode=="resize"&&e._drag_id==o.id};e._safe_copy=function(o){var t=null,n=e._copy_event(o);return o.event_pid&&(t=e.getEvent(o.event_pid)),t&&t.isPrototypeOf(o)&&(delete n.event_length,delete n.event_pid,delete n.rec_pattern,delete n.rec_type),n};var a=e._pre_render_events_line,r=e._pre_render_events_table,d=function(o,t){return this._table_view?r.call(this,o,t):a.call(this,o,t)};e._pre_render_events_line=e._pre_render_events_table=function(o,t){if(!this.config.all_timed||this._table_view&&this._mode!="month"||this._mode=="month"&&!this.config.all_timed_month)return d.call(this,o,t);for(var n=0;nthis._min_date&&c.start_date+y}function f(p){var y=e.date.add(p,1,"day");return y=e.date.date_part(y)}function g(p,y){var w=e.date.date_part(new Date(p));return w.setHours(y),w}};var i=e.get_visible_events;e.get_visible_events=function(o){return this.config.all_timed&&this.config.multi_day?i.call(this,!1):i.call(this,o)},e.attachEvent("onBeforeViewChange",function(o,t,n,s){return e._allow_dnd=n=="day"||n=="week"||e.getView(n),!0}),e._is_main_area_event=function(o){return!!(o._timed||this.config.all_timed===!0||this.config.all_timed=="short"&&h(o))};var _=e.updateEvent;e.updateEvent=function(o){var t,n,s=e.getEvent(o);s&&(t=e.config.all_timed&&!(e.isOneDayEvent(e._events[o])||e.getState().drag_id))&&(n=e.config.update_render,e.config.update_render=!0),_.apply(e,arguments),s&&t&&(e.config.update_render=n)}},collision:function(e){var h,a;function r(d){e._get_section_view()&&d&&(h=e.getEvent(d)[e._get_section_property()])}e.config.collision_limit=1,e.attachEvent("onBeforeDrag",function(d){return r(d),!0}),e.attachEvent("onBeforeLightbox",function(d){var i=e.getEvent(d);return a=[i.start_date,i.end_date],r(d),!0}),e.attachEvent("onEventChanged",function(d){if(!d||!e.getEvent(d))return!0;var i=e.getEvent(d);if(!e.checkCollision(i)){if(!a)return!1;i.start_date=a[0],i.end_date=a[1],i._timed=this.isOneDayEvent(i)}return!0}),e.attachEvent("onBeforeEventChanged",function(d,i,_){return e.checkCollision(d)}),e.attachEvent("onEventAdded",function(d,i){e.checkCollision(i)||e.deleteEvent(d)}),e.attachEvent("onEventSave",function(d,i,_){if((i=e._lame_clone(i)).id=d,!i.start_date||!i.end_date){var o=e.getEvent(d);i.start_date=new Date(o.start_date),i.end_date=new Date(o.end_date)}return i.rec_type&&e._roll_back_dates(i),e.checkCollision(i)}),e._check_sections_collision=function(d,i){var _=e._get_section_property();return d[_]==i[_]&&d.id!=i.id},e.checkCollision=function(d){var i=[],_=e.config.collision_limit;if(d.rec_type)for(var o=e.getRecDates(d),t=0;t=_&&(l=!1)}else i.length>=_&&(l=!1);if(!l){var g=!e.callEvent("onEventCollision",[d,i]);return g||(d[m]=h||d[m]),g}return l}},container_autoresize:function(e){e.config.container_autoresize=!0,e.config.month_day_min_height=90,e.config.min_grid_size=25,e.config.min_map_size=400;var h=e._pre_render_events,a=!0,r=0,d=0;e._pre_render_events=function(s,c){if(!e.config.container_autoresize||!a)return h.apply(this,arguments);var u=this.xy.bar_height,v=this._colsS.heights,m=this._colsS.heights=[0,0,0,0,0,0,0],l=this._els.dhx_cal_data[0];if(s=this._table_view?this._pre_render_events_table(s,c):this._pre_render_events_line(s,c),this._table_view)if(c)this._colsS.heights=v;else{var f=l.firstChild;const E=f.querySelectorAll(".dhx_cal_month_row");if(E){for(var g=0;gthis._colsS.height-this.xy.month_head_height){var p=E[g].querySelectorAll(".dhx_cal_month_cell"),y=this._colsS.height-this.xy.month_head_height;1*this.config.max_month_events!==this.config.max_month_events||m[g]<=this.config.max_month_events?y=m[g]*u:(this.config.max_month_events+1)*u>this._colsS.height-this.xy.month_head_height&&(y=(this.config.max_month_events+1)*u),E[g].style.height=y+this.xy.month_head_height+"px";for(var w=0;wM&&(M=v.childNodes[A].offsetHeight);m=M}else m=Math.max(v.offsetHeight-1,v.scrollHeight);if(l=="month")e.config.month_day_min_height&&!s&&(m=v.querySelectorAll(".dhx_cal_month_row").length*e.config.month_day_min_height),s&&(v.style.height=m+"px");else if(l=="year")m=190*e.config.year_y;else if(l=="agenda"){if(m=0,v.childNodes&&v.childNodes.length)for(var f=0;fy&&(y=g)}m=3*y}else if(l=="map"){m=0;var D=v.querySelectorAll(".dhx_map_line");for(f=0;f0){var m=document.cookie.indexOf(v);if(m!=-1){m+=v.length;var l=document.cookie.indexOf(";",m);return l==-1&&(l=document.cookie.length),document.cookie.substring(m,l)}}return""}(n);if(s){e._min_date||(e._min_date=o),(s=unescape(s).split("@"))[0]=this._helpers.parseDate(s[0]);var c=this.isViewExists(s[1])?s[1]:_;return o=isNaN(+s[0])?o:s[0],window.setTimeout(function(){e.$destroyed||e.setCurrentView(o,c)},1),!1}}return!0}),e.attachEvent("onViewChange",function(d,i){var _,o,t=h(e),n=escape(this._helpers.formatDate(i)+"@"+d);o=t+"="+n+((_="expires=Sun, 31 Jan 9999 22:00:00 GMT")?"; "+_:""),document.cookie=o});var r=e._load;e._load=function(){var d=arguments;if(e._date)r.apply(this,d);else{var i=this;window.setTimeout(function(){r.apply(i,d)},1)}}},daytimeline:function(e){q("Day Timeline",e.assert)},drag_between:function(e){q("Drag Between",e.assert)},editors:function(e){e.form_blocks.combo={render:function(h){h.cached_options||(h.cached_options={});var a="";return a+="
"},set_value:function(h,a,r,d){(function(){v();var u=e.attachEvent("onAfterLightbox",function(){v(),e.detachEvent(u)});function v(){if(h._combo&&h._combo.DOMParent){var m=h._combo;m.unload?m.unload():m.destructor&&m.destructor(),m.DOMParent=m.DOMelem=null}}})(),window.dhx_globalImgPath=d.image_path||"/",h._combo=new dhtmlXCombo(h,d.name,h.offsetWidth-8),d.onchange&&h._combo.attachEvent("onChange",d.onchange),d.options_height&&h._combo.setOptionHeight(d.options_height);var i=h._combo;if(i.enableFilteringMode(d.filtering,d.script_path||null,!!d.cache),d.script_path){var _=r[d.map_to];_?d.cached_options[_]?(i.addOption(_,d.cached_options[_]),i.disable(1),i.selectOption(0),i.disable(0)):e.ajax.get(d.script_path+"?id="+_+"&uid="+e.uid(),function(u){var v,m=u.xmlDoc.responseText;try{v=JSON.parse(m).options[0].text}catch{v=e.ajax.xpath("//option",u.xmlDoc)[0].childNodes[0].nodeValue}d.cached_options[_]=v,i.addOption(_,v),i.disable(1),i.selectOption(0),i.disable(0)}):i.setComboValue("")}else{for(var o=[],t=0;t`;for(var r=0;r "+h.options[r].label+""}return a+=""},set_value:function(h,a,r,d){for(var i=h.getElementsByTagName("input"),_=0;_':""},set_value:function(h,a,r,d){h=e._lightbox.querySelector(`#${d.id}`);var i=e.uid(),_=d.checked_value!==void 0?a==d.checked_value:!!a;h.className+=" dhx_cal_checkbox";var o="",t="";if(e.config.wide_form?(h.innerHTML=t,h.nextSibling.innerHTML=o):h.innerHTML=o+t,d.handler){var n=h.getElementsByTagName("input")[0];if(n.$_eventAttached)return;n.$_eventAttached=!0,e.event(n,"click",d.handler)}},get_value:function(h,a,r){var d=(h=e._lightbox.querySelector(`#${r.id}`)).getElementsByTagName("input")[0];return d||(d=h.nextSibling.getElementsByTagName("input")[0]),d.checked?r.checked_value||!0:r.unchecked_value||!1},focus:function(h){}}},expand:function(e){e.ext.fullscreen={toggleIcon:null},e.expand=function(){if(e.callEvent("onBeforeExpand",[])){var h=e._obj;do h._position=h.style.position||"",h.style.position="static";while((h=h.parentNode)&&h.style);(h=e._obj).style.position="absolute",h._width=h.style.width,h._height=h.style.height,h.style.width=h.style.height="100%",h.style.top=h.style.left="0px";var a=document.body;a.scrollTop=0,(a=a.parentNode)&&(a.scrollTop=0),document.body._overflow=document.body.style.overflow||"",document.body.style.overflow="hidden",e._maximize(),e.callEvent("onExpand",[])}},e.collapse=function(){if(e.callEvent("onBeforeCollapse",[])){var h=e._obj;do h.style.position=h._position;while((h=h.parentNode)&&h.style);(h=e._obj).style.width=h._width,h.style.height=h._height,document.body.style.overflow=document.body._overflow,e._maximize(),e.callEvent("onCollapse",[])}},e.attachEvent("onTemplatesReady",function(){var h=document.createElement("div");h.className="dhx_expand_icon",e.ext.fullscreen.toggleIcon=h,h.innerHTML=` +
${c}
+
${g}
+`}(0,v)}),h+="",h}e.render_view_data=function(){return this._mode=="agenda"&&(r=e._els.dhx_cal_data[0].scrollTop,e._els.dhx_cal_data[0].scrollTop=0),s.apply(this,arguments)},e.agenda_view=function(o){o?(e._min_date=e.config.agenda_start||e.date.agenda_start(e._date),e._max_date=e.config.agenda_end||e.date.add_agenda(e._min_date,1),e._cols=null,e._colsS=null,e._table_view=!0,e._getNavDateElement().innerHTML=e.templates.agenda_date(e._date),_()):e._table_view=!1}})},all_timed:function(e){e.config.all_timed="short",e.config.all_timed_month=!1;var i=function(_){return!((_.end_date-_.start_date)/36e5>=24)||e._drag_mode=="resize"&&e._drag_id==_.id};e._safe_copy=function(_){var a=null,o=e._copy_event(_);return _.event_pid&&(a=e.getEvent(_.event_pid)),a&&a.isPrototypeOf(_)&&(delete o.event_length,delete o.event_pid,delete o.rec_pattern,delete o.rec_type),o};var t=e._pre_render_events_line,r=e._pre_render_events_table,d=function(_,a){return this._table_view?r.call(this,_,a):t.call(this,_,a)};e._pre_render_events_line=e._pre_render_events_table=function(_,a){if(!this.config.all_timed||this._table_view&&this._mode!="month"||this._mode=="month"&&!this.config.all_timed_month)return d.call(this,_,a);for(var o=0;o<_.length;o++){var l=_[o];if(!l._timed)if(this.config.all_timed!="short"||i(l)){var h=this._safe_copy(l);l._virtual?h._first_chunk=!1:h._first_chunk=!0,h._drag_resize=!1,h._virtual=!0,h.start_date=new Date(h.start_date),c(l)?(h.end_date=p(h.start_date),this.config.last_hour!=24&&(h.end_date=m(h.start_date,this.config.last_hour))):h.end_date=new Date(l.end_date);var v=!1;h.start_datethis._min_date&&h.start_date+y}function p(g){var y=e.date.add(g,1,"day");return y=e.date.date_part(y)}function m(g,y){var x=e.date.date_part(new Date(g));return x.setHours(y),x}};var n=e.get_visible_events;e.get_visible_events=function(_){return this.config.all_timed&&this.config.multi_day?n.call(this,!1):n.call(this,_)},e.attachEvent("onBeforeViewChange",function(_,a,o,l){return e._allow_dnd=o=="day"||o=="week"||e.getView(o),!0}),e._is_main_area_event=function(_){return!!(_._timed||this.config.all_timed===!0||this.config.all_timed=="short"&&i(_))};var s=e.updateEvent;e.updateEvent=function(_){var a,o,l=e.getEvent(_);l&&(a=e.config.all_timed&&!(e.isOneDayEvent(e._events[_])||e.getState().drag_id))&&(o=e.config.update_render,e.config.update_render=!0),s.apply(e,arguments),l&&a&&(e.config.update_render=o)}},collision:function(e){var i,t;function r(d){e._get_section_view()&&d&&(i=e.getEvent(d)[e._get_section_property()])}e.config.collision_limit=1,e.attachEvent("onBeforeDrag",function(d){return r(d),!0}),e.attachEvent("onBeforeLightbox",function(d){var n=e.getEvent(d);return t=[n.start_date,n.end_date],r(d),!0}),e.attachEvent("onEventChanged",function(d){if(!d||!e.getEvent(d))return!0;var n=e.getEvent(d);if(!e.checkCollision(n)){if(!t)return!1;n.start_date=t[0],n.end_date=t[1],n._timed=this.isOneDayEvent(n)}return!0}),e.attachEvent("onBeforeEventChanged",function(d,n,s){return e.checkCollision(d)}),e.attachEvent("onEventAdded",function(d,n){e.checkCollision(n)||e.deleteEvent(d)}),e.attachEvent("onEventSave",function(d,n,s){if((n=e._lame_clone(n)).id=d,!n.start_date||!n.end_date){var _=e.getEvent(d);n.start_date=new Date(_.start_date),n.end_date=new Date(_.end_date)}return n.rec_type&&e._roll_back_dates(n),e.checkCollision(n)}),e._check_sections_collision=function(d,n){var s=e._get_section_property();return d[s]==n[s]&&d.id!=n.id},e.checkCollision=function(d){var n=[],s=e.config.collision_limit;if(d.rec_type)for(var _=e.getRecDates(d),a=0;a<_.length;a++)for(var o=e.getEvents(_[a].start_date,_[a].end_date),l=0;l=s&&(c=!1)}else n.length>=s&&(c=!1);if(!c){var m=!e.callEvent("onEventCollision",[d,n]);return m||(d[f]=i||d[f]),m}return c}},container_autoresize:function(e){e.config.container_autoresize=!0,e.config.month_day_min_height=90,e.config.min_grid_size=25,e.config.min_map_size=400;var i=e._pre_render_events,t=!0,r=0,d=0;e._pre_render_events=function(l,h){if(!e.config.container_autoresize||!t)return i.apply(this,arguments);var v=this.xy.bar_height,u=this._colsS.heights,f=this._colsS.heights=[0,0,0,0,0,0,0],c=this._els.dhx_cal_data[0];if(l=this._table_view?this._pre_render_events_table(l,h):this._pre_render_events_line(l,h),this._table_view)if(h)this._colsS.heights=u;else{var p=c.firstChild;const E=p.querySelectorAll(".dhx_cal_month_row");if(E){for(var m=0;mthis._colsS.height-this.xy.month_head_height){var g=E[m].querySelectorAll(".dhx_cal_month_cell"),y=this._colsS.height-this.xy.month_head_height;1*this.config.max_month_events!==this.config.max_month_events||f[m]<=this.config.max_month_events?y=f[m]*v:(this.config.max_month_events+1)*v>this._colsS.height-this.xy.month_head_height&&(y=(this.config.max_month_events+1)*v),E[m].style.height=y+this.xy.month_head_height+"px";for(var x=0;xM&&(M=u.childNodes[T].offsetHeight);f=M}else f=Math.max(u.offsetHeight-1,u.scrollHeight);if(c=="month")e.config.month_day_min_height&&!l&&(f=u.querySelectorAll(".dhx_cal_month_row").length*e.config.month_day_min_height),l&&(u.style.height=f+"px");else if(c=="year")f=190*e.config.year_y;else if(c=="agenda"){if(f=0,u.childNodes&&u.childNodes.length)for(var p=0;py&&(y=m)}f=3*y}else if(c=="map"){f=0;var D=u.querySelectorAll(".dhx_map_line");for(p=0;p0){var f=document.cookie.indexOf(u);if(f!=-1){f+=u.length;var c=document.cookie.indexOf(";",f);return c==-1&&(c=document.cookie.length),document.cookie.substring(f,c)}}return""}(o);if(l){e._min_date||(e._min_date=_),(l=unescape(l).split("@"))[0]=this._helpers.parseDate(l[0]);var h=this.isViewExists(l[1])?l[1]:s;return _=isNaN(+l[0])?_:l[0],window.setTimeout(function(){e.$destroyed||e.setCurrentView(_,h)},1),!1}}return!0}),e.attachEvent("onViewChange",function(d,n){var s,_,a=i(e),o=escape(this._helpers.formatDate(n)+"@"+d);_=a+"="+o+((s="expires=Sun, 31 Jan 9999 22:00:00 GMT")?"; "+s:""),document.cookie=_});var r=e._load;e._load=function(){var d=arguments;if(e._date)r.apply(this,d);else{var n=this;window.setTimeout(function(){r.apply(n,d)},1)}}},daytimeline:function(e){_e("Day Timeline",e.assert)},drag_between:function(e){_e("Drag Between",e.assert)},editors:function(e){e.form_blocks.combo={render:function(i){i.cached_options||(i.cached_options={});var t="";return t+="
"},set_value:function(i,t,r,d){(function(){u();var v=e.attachEvent("onAfterLightbox",function(){u(),e.detachEvent(v)});function u(){if(i._combo&&i._combo.DOMParent){var f=i._combo;f.unload?f.unload():f.destructor&&f.destructor(),f.DOMParent=f.DOMelem=null}}})(),window.dhx_globalImgPath=d.image_path||"/",i._combo=new dhtmlXCombo(i,d.name,i.offsetWidth-8),d.onchange&&i._combo.attachEvent("onChange",d.onchange),d.options_height&&i._combo.setOptionHeight(d.options_height);var n=i._combo;if(n.enableFilteringMode(d.filtering,d.script_path||null,!!d.cache),d.script_path){var s=r[d.map_to];s?d.cached_options[s]?(n.addOption(s,d.cached_options[s]),n.disable(1),n.selectOption(0),n.disable(0)):e.ajax.get(d.script_path+"?id="+s+"&uid="+e.uid(),function(v){var u,f=v.xmlDoc.responseText;try{u=JSON.parse(f).options[0].text}catch{u=e.ajax.xpath("//option",v.xmlDoc)[0].childNodes[0].nodeValue}d.cached_options[s]=u,n.addOption(s,u),n.disable(1),n.selectOption(0),n.disable(0)}):n.setComboValue("")}else{for(var _=[],a=0;a`;for(var r=0;r "+i.options[r].label+""}return t+=""},set_value:function(i,t,r,d){for(var n=i.getElementsByTagName("input"),s=0;s':""},set_value:function(i,t,r,d){i=e._lightbox.querySelector(`#${d.id}`);var n=e.uid(),s=d.checked_value!==void 0?t==d.checked_value:!!t;i.className+=" dhx_cal_checkbox";var _="",a="";if(e.config.wide_form?(i.innerHTML=a,i.nextSibling.innerHTML=_):i.innerHTML=_+a,d.handler){var o=i.getElementsByTagName("input")[0];if(o.$_eventAttached)return;o.$_eventAttached=!0,e.event(o,"click",d.handler)}},get_value:function(i,t,r){var d=(i=e._lightbox.querySelector(`#${r.id}`)).getElementsByTagName("input")[0];return d||(d=i.nextSibling.getElementsByTagName("input")[0]),d.checked?r.checked_value||!0:r.unchecked_value||!1},focus:function(i){}}},expand:function(e){e.ext.fullscreen={toggleIcon:null},e.expand=function(){if(e.callEvent("onBeforeExpand",[])){var i=e._obj;do i._position=i.style.position||"",i.style.position="static";while((i=i.parentNode)&&i.style);(i=e._obj).style.position="absolute",i._width=i.style.width,i._height=i.style.height,i.style.width=i.style.height="100%",i.style.top=i.style.left="0px";var t=document.body;t.scrollTop=0,(t=t.parentNode)&&(t.scrollTop=0),document.body._overflow=document.body.style.overflow||"",document.body.style.overflow="hidden",e._maximize(),e.callEvent("onExpand",[])}},e.collapse=function(){if(e.callEvent("onBeforeCollapse",[])){var i=e._obj;do i.style.position=i._position;while((i=i.parentNode)&&i.style);(i=e._obj).style.width=i._width,i.style.height=i._height,document.body.style.overflow=document.body._overflow,e._maximize(),e.callEvent("onCollapse",[])}},e.attachEvent("onTemplatesReady",function(){var i=document.createElement("div");i.className="dhx_expand_icon",e.ext.fullscreen.toggleIcon=i,i.innerHTML=` @@ -43,16 +55,20 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`)},t.exportToPNG=function(){ - `,e._obj.appendChild(h),e.event(h,"click",function(){e.expanded?e.collapse():e.expand()})}),e._maximize=function(){this.expanded=!this.expanded,this.expanded?this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded"):this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded");for(var h=["left","top"],a=0;a400))try{s=JSON.parse(n.xmlDoc.responseText)}catch{}o(s)})},r._plain_export_copy=function(i,_){var o={};for(var t in i)o[t]=i[t];return o.start_date=_(o.start_date),o.end_date=_(o.end_date),o.$text=this.templates.event_text(i.start_date,i.end_date,i),o},r._serialize_plain=function(i,_){var o;i=i||r.date.date_to_str("%Y%m%dT%H%i%s",!0),o=_&&_.start&&_.end?r.getEvents(_.start,_.end):r.getEvents();for(var t=[],n=0;n",document.body.appendChild(i)}return this._hidden_export_form},r._get_export_size=function(i,_,o,t,n,s,c){t=parseInt(t)/25.4||4;var u={A5:{x:148,y:210},A4:{x:210,y:297},A3:{x:297,y:420},A2:{x:420,y:594},A1:{x:594,y:841},A0:{x:841,y:1189}},v=a("dhx_cal_data",this).x,m={y:a("dhx_cal_data",this).y+a("dhx_cal_header",this).y+a("dhx_multi_day",this).y};return m.x=i==="full"?v:Math.floor((_==="landscape"?u[i].y:u[i].x)*t),c&&(m.x*=parseFloat(c.x)||1,m.y*=parseFloat(c.y)||1),m},r._export_html=function(i){var _,o,t,n=(_=void 0,o=void 0,(t=d())&&(o=t.scrollable,_=t.smart_rendering),{nav_height:r.xy.nav_height,scroll_width:r.xy.scroll_width,style_width:r._obj.style.width,style_height:r._obj.style.height,timeline_scrollable:o,timeline_smart_rendering:_}),s=r._get_export_size(i.format,i.orientation,i.zoom,i.dpi,i.header,i.footer,i.scales),c="";try{(function(u,v){r._obj.style.width=u.x+"px",r._obj.style.height=u.y+"px",r.xy.nav_height=0,r.xy.scroll_width=0;var m=d();(v.timeline_scrollable||v.timeline_smart_rendering)&&(m.scrollable=!1,m.smart_rendering=!1)})(s,n),r.setCurrentView(),c=r._obj.innerHTML}catch(u){console.error(u)}finally{(function(u){r.xy.scroll_width=u.scroll_width,r.xy.nav_height=u.nav_height,r._obj.style.width=u.style_width,r._obj.style.height=u.style_height;var v=d();(u.timeline_scrollable||u.timeline_smart_rendering)&&(v.scrollable=u.timeline_scrollable,v.smart_rendering=u.timeline_smart_rendering)})(n),r.setCurrentView()}return c}}(e)})()},grid_view:function(e){q("Grid",e.assert)},html_templates:function(e){e.attachEvent("onTemplatesReady",function(){for(var h=document.body.getElementsByTagName("DIV"),a=0;a=96&&d.keyCode<=105&&(d.keyCode-=48);var i=String.fromCharCode(d.keyCode);return i&&(d.keyCode=i.toLowerCase().charCodeAt(0)),d},getHashFromEvent:function(r){return this.getHash(this.getCommandFromEvent(r))},getHash:function(r){var d=[];for(var i in r.modifiers)r.modifiers[i]&&d.push(i);return d.push(r.keyCode),d.join(this.junctionChar)},getExpressions:function(r){return r.split(this.junctionChar)},getWords:function(r){return r.split(this.combinationChar)},trim:function(r){return r.replace(/\s/g,"")},junctionChar:",",combinationChar:"+",commandKeys:{shift:16,alt:18,ctrl:17,meta:!0},specialKeys:{backspace:8,tab:9,enter:13,esc:27,space:32,up:38,down:40,left:37,right:39,home:36,end:35,pageup:33,pagedown:34,delete:46,insert:45,plus:107,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123}}}(e),function(a){a.$keyboardNavigation.EventHandler={_handlers:null,findHandler:function(r){this._handlers||(this._handlers={});var d=a.$keyboardNavigation.shortcuts.getHash(r);return this._handlers[d]},doAction:function(r,d){var i=this.findHandler(r);i&&(i.call(this,d),d.preventDefault?d.preventDefault():d.returnValue=!1)},bind:function(r,d){this._handlers||(this._handlers={});for(var i=a.$keyboardNavigation.shortcuts,_=i.parse(r),o=0;o<_.length;o++)this._handlers[i.getHash(_[o])]=d},unbind:function(r){for(var d=a.$keyboardNavigation.shortcuts,i=d.parse(r),_=0;_=_.length-1?0:t+1])return i.focus(),d.preventDefault(),!0;return!1}}(e),function(a){a.$keyboardNavigation.marker={clear:function(){for(var r=a.$container.querySelectorAll(".dhx_focus_slot"),d=0;d=0;t--)if(_[t].offsetWidth)return _[t];return null},addDataAttributes:function(r,d,i,_){for(var o=a.date.date_to_str(a.config.api_date),t=o(d),n=o(i),s=0;sa._max_date.valueOf()&&(s=new Date(a._max_date)),!_._trace_x)return t;for(var c=0;c<_._trace_x.length&&!a._is_column_visible(_._trace_x[c]);c++);if(c==_._trace_x.length)return t;var u=o[i];if(!(nr))return t;var v=this.createElement();let m,l;function f(b,k){k.setDate(1),k.setFullYear(b.getFullYear()),k.setMonth(b.getMonth()),k.setDate(b.getDate())}if(a.getView().days){const b=new Date(r);f(a._min_date,b);const k=new Date(d);f(a._min_date,k),m=a._timeline_getX({start_date:b},!1,_),l=a._timeline_getX({start_date:k},!1,_)}else m=a._timeline_getX({start_date:r},!1,_),l=a._timeline_getX({start_date:d},!1,_);var g=_._section_height[i]-1||_.dy-1,p=0;a._isRender("cell")&&(p=u.offsetTop,m+=_.dx,l+=_.dx,u=a.$container.querySelector(".dhx_cal_data"));var y=Math.max(1,l-m-1);let w="left";return a.config.rtl&&(w="right"),v.style.cssText=`height:${g}px; ${w}:${m}px; width:${y}px; top:${p}px;`,u&&(u.appendChild(v),t.push(v)),t},renderMonthCell:function(r){for(var d=a.$container.querySelectorAll(".dhx_month_head"),i=[],_=0;_1?_=a.locate_holder_day(r)+c:(_=c,s.size&&_>s.position+s.size&&(_=0))}if(!(t=a.locate_holder(_))||t.querySelector(".dhx_scale_hour"))return document.createElement("div");var u=Math.max(60*r.getHours()+r.getMinutes(),60*n.first_hour),v=Math.min(60*d.getHours()+d.getMinutes(),60*n.last_hour);if(!v&&a.date.day_start(new Date(d)).valueOf()>a.date.day_start(new Date(r)).valueOf()&&(v=60*n.last_hour),v<=u)return[];var m=this.createElement(),l=a.config.hour_size_px*n.last_hour+1,f=36e5;return m.style.top=Math.round((60*u*1e3-a.config.first_hour*f)*a.config.hour_size_px/f)%l+"px",m.style.lineHeight=m.style.height=Math.max(Math.round(60*(v-u)*1e3*a.config.hour_size_px/f)%l,1)+"px",m.style.width="100%",t.appendChild(m),o.push(m),o[0]}}}(e),function(a){a.$keyboardNavigation.SchedulerNode=function(){},a.$keyboardNavigation.SchedulerNode.prototype=a._compose(a.$keyboardNavigation.EventHandler,{getDefaultNode:function(){var r=new a.$keyboardNavigation.TimeSlot;return r.isValid()||(r=r.fallback()),r},_modes:{month:"month",year:"year",dayColumns:"dayColumns",timeline:"timeline",units:"units",weekAgenda:"weekAgenda",list:"list"},getMode:function(){var r=a.getState().mode;return a.matrix&&a.matrix[r]?this._modes.timeline:a._props&&a._props[r]?this._modes.units:r=="month"?this._modes.month:r=="year"?this._modes.year:r=="week_agenda"?this._modes.weekAgenda:r=="map"||r=="agenda"||a._grid&&a["grid_"+r]?this._modes.list:this._modes.dayColumns},focus:function(){a.focus()},blur:function(){},disable:function(){a.$container.setAttribute("tabindex","0")},enable:function(){a.$container&&a.$container.removeAttribute("tabindex")},isEnabled:function(){return a.$container.hasAttribute("tabindex")},_compareEvents:function(r,d){return r.start_date.valueOf()==d.start_date.valueOf()?r.id>d.id?1:-1:r.start_date.valueOf()>d.start_date.valueOf()?1:-1},_pickEvent:function(r,d,i,_){var o=a.getState();r=new Date(Math.max(o.min_date.valueOf(),r.valueOf())),d=new Date(Math.min(o.max_date.valueOf(),d.valueOf()));var t=a.getEvents(r,d);t.sort(this._compareEvents),_&&(t=t.reverse());for(var n=!!i,s=0;s=this.getNodes().length&&(r=0),this.moveTo(new a.$keyboardNavigation.HeaderCell(r))},down:function(){this.moveTo(new a.$keyboardNavigation.TimeSlot)},enter:function(){var r=this.getNode();r&&r.click()}}}),a.$keyboardNavigation.HeaderCell.prototype.bindAll(a.$keyboardNavigation.HeaderCell.prototype.keys)}(e),function(a){a.$keyboardNavigation.Event=function(r){if(this.eventId=null,a.getEvent(r)){var d=a.getEvent(r);this.start=new Date(d.start_date),this.end=new Date(d.end_date),this.section=this._getSection(d),this.eventId=r}},a.$keyboardNavigation.Event.prototype=a._compose(a.$keyboardNavigation.KeyNavNode,{_getNodes:function(){return Array.prototype.slice.call(a.$container.querySelectorAll("["+a.config.event_attribute+"]"))},_modes:a.$keyboardNavigation.SchedulerNode.prototype._modes,getMode:a.$keyboardNavigation.SchedulerNode.prototype.getMode,_handlers:null,isValid:function(){return!(!a.getEvent(this.eventId)||!this.getNode())},fallback:function(){var r=this._getNodes()[0],d=null;if(r&&a._locate_event(r)){var i=a._locate_event(r);d=new a.$keyboardNavigation.Event(i)}else d=new a.$keyboardNavigation.TimeSlot;return d},isScrolledIntoView:function(r){var d=r.getBoundingClientRect(),i=a.$container.querySelector(".dhx_cal_data").getBoundingClientRect();return!(d.bottomi.bottom)},getNode:function(){var r="["+a.config.event_attribute+"='"+this.eventId+"']",d=a.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);if(d)return d;if(a.isMultisectionEvent&&a.isMultisectionEvent(a.getEvent(this.eventId))){for(var i=a.$container.querySelectorAll(r),_=0;_d.max_date.valueOf()||r.end_date.valueOf()<=d.min_date.valueOf())&&a.setCurrentView(r.start_date);var i=this.getNode();this.isScrolledIntoView(i)?a.$keyboardNavigation.dispatcher.keepScrollPosition((function(){a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)}).bind(this)):a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},_getSection:function(r){var d=null,i=a.getState().mode;return a.matrix&&a.matrix[i]?d=r[a.matrix[a.getState().mode].y_property]:a._props&&a._props[i]&&(d=r[a._props[i].map_to]),d},_moveToSlot:function(r){var d=a.getEvent(this.eventId);if(d){var i=this._getSection(d),_=new a.$keyboardNavigation.TimeSlot(d.start_date,null,i);this.moveTo(_.nextSlot(_,r))}else this.moveTo(new a.$keyboardNavigation.TimeSlot)},keys:{left:function(){this._moveToSlot("left")},right:function(){this._moveToSlot("right")},down:function(){this.getMode()==this._modes.list?a.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this._moveToSlot("down")},space:function(){var r=this.getNode();r&&r.click?r.click():this.moveTo(new a.$keyboardNavigation.TimeSlot)},up:function(){this.getMode()==this._modes.list?a.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this._moveToSlot("up")},delete:function(){a.getEvent(this.eventId)?a._click.buttons.delete(this.eventId):this.moveTo(new a.$keyboardNavigation.TimeSlot)},enter:function(){a.getEvent(this.eventId)?a.showLightbox(this.eventId):this.moveTo(new a.$keyboardNavigation.TimeSlot)}}}),a.$keyboardNavigation.Event.prototype.bindAll(a.$keyboardNavigation.Event.prototype.keys)}(e),function(a){a.$keyboardNavigation.TimeSlot=function(r,d,i,_){var o=a.getState(),t=a.matrix&&a.matrix[o.mode];r||(r=this.getDefaultDate()),d||(d=t?a.date.add(r,t.x_step,t.x_unit):a.date.add(r,a.config.key_nav_step,"minute")),this.section=i||this._getDefaultSection(),this.start_date=new Date(r),this.end_date=new Date(d),this.movingDate=_||null},a.$keyboardNavigation.TimeSlot.prototype=a._compose(a.$keyboardNavigation.KeyNavNode,{_handlers:null,getDefaultDate:function(){var r,d=a.getState(),i=new Date(d.date);i.setSeconds(0),i.setMilliseconds(0);var _=new Date;_.setSeconds(0),_.setMilliseconds(0);var o=a.matrix&&a.matrix[d.mode],t=!1;if(i.valueOf()===_.valueOf()&&(t=!0),o)t?(o.x_unit==="day"?(_.setHours(0),_.setMinutes(0)):o.x_unit==="hour"&&_.setMinutes(0),r=_):r=a.date[o.name+"_start"](new Date(d.date)),r=this.findVisibleColumn(r);else if(r=new Date(a.getState().min_date),t&&(r=_),r=this.findVisibleColumn(r),t||r.setHours(a.config.first_hour),!a._table_view){var n=a.$container.querySelector(".dhx_cal_data");n.scrollTop&&r.setHours(a.config.first_hour+Math.ceil(n.scrollTop/a.config.hour_size_px))}return r},clone:function(r){return new a.$keyboardNavigation.TimeSlot(r.start_date,r.end_date,r.section,r.movingDate)},_getMultisectionView:function(){var r,d=a.getState();return a._props&&a._props[d.mode]?r=a._props[d.mode]:a.matrix&&a.matrix[d.mode]&&(r=a.matrix[d.mode]),r},_getDefaultSection:function(){var r=null;return this._getMultisectionView()&&!r&&(r=this._getNextSection()),r},_getNextSection:function(r,d){var i=this._getMultisectionView(),_=i.order[r],o=_;(o=_!==void 0?_+d:i.size&&i.position?i.position:0)<0&&(o=0);var t=i.options||i.y_unit;return o>=t.length&&(o=t.length-1),t[o]?t[o].key:null},isValid:function(){var r=a.getState();if(this.start_date.valueOf()=r.max_date.valueOf()||!this.isVisible(this.start_date,this.end_date))return!1;var d=this._getMultisectionView();return!d||d.order[this.section]!==void 0},fallback:function(){var r=new a.$keyboardNavigation.TimeSlot;return r.isValid()?r:new a.$keyboardNavigation.DataArea},getNodes:function(){return Array.prototype.slice.call(a.$container.querySelectorAll(".dhx_focus_slot"))},getNode:function(){return this.getNodes()[0]},focus:function(){this.section&&a.getView()&&a.getView().smart_rendering&&a.getView().scrollTo&&!a.$container.querySelector(`[data-section-id="${this.section}"]`)&&a.getView().scrollTo({section:this.section}),a.$keyboardNavigation.marker.render(this.start_date,this.end_date,this.section),a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this),a.$keyboardNavigation._pasteDate=this.start_date,a.$keyboardNavigation._pasteSection=this.section},blur:function(){a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this),a.$keyboardNavigation.marker.clear()},_modes:a.$keyboardNavigation.SchedulerNode.prototype._modes,_getMode:a.$keyboardNavigation.SchedulerNode.prototype.getMode,addMonthDate:function(r,d,i){var _;switch(d){case"up":_=a.date.add(r,-1,"week");break;case"down":_=a.date.add(r,1,"week");break;case"left":_=a.date.day_start(a.date.add(r,-1,"day")),_=this.findVisibleColumn(_,-1);break;case"right":_=a.date.day_start(a.date.add(r,1,"day")),_=this.findVisibleColumn(_,1);break;default:_=a.date.day_start(new Date(r))}var o=a.getState();return(r.valueOf()=o.max_date.valueOf())&&(_=new Date(o.min_date)),_},nextMonthSlot:function(r,d,i){var _,o;return(_=this.addMonthDate(r.start_date,d,i)).setHours(a.config.first_hour),(o=new Date(_)).setHours(a.config.last_hour),{start_date:_,end_date:o}},_alignTimeSlot:function(r,d,i,_){for(var o=new Date(d);o.valueOf()r.valueOf()&&(o=a.date.add(o,-_,i)),o},nextTimelineSlot:function(r,d,i){var _=a.getState(),o=a.matrix[_.mode],t=this._alignTimeSlot(r.start_date,a.date[o.name+"_start"](new Date(r.start_date)),o.x_unit,o.x_step),n=this._alignTimeSlot(r.end_date,a.date[o.name+"_start"](new Date(r.end_date)),o.x_unit,o.x_step);n.valueOf()<=t.valueOf()&&(n=a.date.add(t,o.x_step,o.x_unit));var s=this.clone(r);switch(s.start_date=t,s.end_date=n,s.section=r.section||this._getNextSection(),d){case"up":s.section=this._getNextSection(r.section,-1);break;case"down":s.section=this._getNextSection(r.section,1);break;case"left":s.start_date=this.findVisibleColumn(a.date.add(s.start_date,-o.x_step,o.x_unit),-1),s.end_date=a.date.add(s.start_date,o.x_step,o.x_unit);break;case"right":s.start_date=this.findVisibleColumn(a.date.add(s.start_date,o.x_step,o.x_unit),1),s.end_date=a.date.add(s.start_date,o.x_step,o.x_unit)}return(s.start_date.valueOf()<_.min_date.valueOf()||s.start_date.valueOf()>=_.max_date.valueOf())&&(i&&s.start_date.valueOf()>=_.max_date.valueOf()?s.start_date=new Date(_.max_date):(s.start_date=a.date[_.mode+"_start"](a.date.add(_.date,d=="left"?-1:1,_.mode)),s.end_date=a.date.add(s.start_date,o.x_step,o.x_unit))),s},nextUnitsSlot:function(r,d,i){var _=this.clone(r);_.section=r.section||this._getNextSection();var o=r.section||this._getNextSection(),t=a.getState(),n=a._props[t.mode];switch(d){case"left":o=this._getNextSection(r.section,-1);var s=n.size?n.size-1:n.options.length;n.days>1&&n.order[o]==s-1&&a.date.add(r.start_date,-1,"day").valueOf()>=t.min_date.valueOf()&&(_=this.nextDaySlot(r,d,i));break;case"right":o=this._getNextSection(r.section,1),n.days>1&&!n.order[o]&&a.date.add(r.start_date,1,"day").valueOf()=o||!d&&!i&&(!_&&t==24||_==t)},isInVisibleDayTime:function(r,d){return this.isBeforeLastHour(r,d)&&this.isAfterFirstHour(r,d)},nextDaySlot:function(r,d,i){var _,o,t=a.config.key_nav_step,n=this._alignTimeSlot(r.start_date,a.date.day_start(new Date(r.start_date)),"minute",t),s=r.start_date;switch(d){case"up":if(_=a.date.add(n,-t,"minute"),!this.isInVisibleDayTime(_,!0)&&(!i||this.isInVisibleDayTime(s,!0))){var c=!0;i&&a.date.date_part(new Date(_)).valueOf()!=a.date.date_part(new Date(s)).valueOf()&&(c=!1),c&&(_=this.findVisibleColumn(a.date.add(r.start_date,-1,"day"),-1)),_.setHours(a.config.last_hour),_.setMinutes(0),_=a.date.add(_,-t,"minute")}o=a.date.add(_,t,"minute");break;case"down":_=a.date.add(n,t,"minute");var u=i?_:a.date.add(_,t,"minute");this.isInVisibleDayTime(u,!1)||i&&!this.isInVisibleDayTime(s,!1)||(i?(c=!0,a.date.date_part(new Date(s)).valueOf()==s.valueOf()&&(c=!1),c&&(_=this.findVisibleColumn(a.date.add(r.start_date,1,"day"),1)),_.setHours(a.config.first_hour),_.setMinutes(0),_=a.date.add(_,t,"minute")):((_=this.findVisibleColumn(a.date.add(r.start_date,1,"day"),1)).setHours(a.config.first_hour),_.setMinutes(0))),o=a.date.add(_,t,"minute");break;case"left":_=this._moveDate(r.start_date,-1),o=this._moveDate(r.end_date,-1);break;case"right":_=this._moveDate(r.start_date,1),o=this._moveDate(r.end_date,1);break;default:_=n,o=a.date.add(_,t,"minute")}return{start_date:_,end_date:o}},nextWeekAgendaSlot:function(r,d){var i,_,o=a.getState();switch(d){case"down":case"left":i=a.date.day_start(a.date.add(r.start_date,-1,"day")),i=this.findVisibleColumn(i,-1);break;case"up":case"right":i=a.date.day_start(a.date.add(r.start_date,1,"day")),i=this.findVisibleColumn(i,1);break;default:i=a.date.day_start(r.start_date)}return(r.start_date.valueOf()=o.max_date.valueOf())&&(i=new Date(o.min_date)),(_=new Date(i)).setHours(a.config.last_hour),{start_date:i,end_date:_}},nextAgendaSlot:function(r,d){return{start_date:r.start_date,end_date:r.end_date}},isDateVisible:function(r){if(!a._ignores_detected)return!0;var d,i=a.matrix&&a.matrix[a.getState().mode];return d=i?a._get_date_index(i,r):a.locate_holder_day(r),!a._ignores[d]},findVisibleColumn:function(r,d){var i=r;d=d||1;for(var _=a.getState();!this.isDateVisible(i)&&(d>0&&i.valueOf()<=_.max_date.valueOf()||d<0&&i.valueOf()>=_.min_date.valueOf());)i=this.nextDateColumn(i,d);return i},nextDateColumn:function(r,d){d=d||1;var i=a.matrix&&a.matrix[a.getState().mode];return i?a.date.add(r,d*i.x_step,i.x_unit):a.date.day_start(a.date.add(r,d,"day"))},isVisible:function(r,d){if(!a._ignores_detected)return!0;for(var i=new Date(r);i.valueOf()=o.end_date.valueOf()&&(o=this.nextSlot(o,d,i)),a.$keyboardNavigation.TimeSlot.prototype.clone(o)},extendSlot:function(r,d){var i;switch(this._getMode()){case this._modes.units:i=d=="left"||d=="right"?this.nextUnitsSlot(r,d):this.extendUnitsSlot(r,d);break;case this._modes.timeline:i=d=="down"||d=="up"?this.nextTimelineSlot(r,d):this.extendTimelineSlot(r,d);break;case this._modes.year:case this._modes.month:i=this.extendMonthSlot(r,d);break;case this._modes.dayColumns:i=this.extendDaySlot(r,d);break;case this._modes.weekAgenda:i=this.extendWeekAgendaSlot(r,d);break;default:i=r}var _=a.getState();return i.start_date.valueOf()<_.min_date.valueOf()&&(i.start_date=this.findVisibleColumn(_.min_date),i.start_date.setHours(a.config.first_hour)),i.end_date.valueOf()>_.max_date.valueOf()&&(i.end_date=this.findVisibleColumn(_.max_date,-1)),a.$keyboardNavigation.TimeSlot.prototype.clone(i)},extendTimelineSlot:function(r,d){return this.extendGenericSlot({left:"start_date",right:"end_date"},r,d,"timeline")},extendWeekAgendaSlot:function(r,d){return this.extendGenericSlot({left:"start_date",right:"end_date"},r,d,"weekAgenda")},extendGenericSlot:function(r,d,i,_){var o,t=d.movingDate;if(t||(t=r[i]),!t||!r[i])return d;if(!i)return a.$keyboardNavigation.TimeSlot.prototype.clone(d);(o=this.nextSlot({start_date:d[t],section:d.section},i,_,!0)).start_date.valueOf()==d.start_date.valueOf()&&(o=this.nextSlot({start_date:o.start_date,section:o.section},i,_,!0)),o.movingDate=t;var n=this.extendSlotDates(d,o,o.movingDate);return n.end_date.valueOf()<=n.start_date.valueOf()&&(o.movingDate=o.movingDate=="end_date"?"start_date":"end_date"),n=this.extendSlotDates(d,o,o.movingDate),o.start_date=n.start_date,o.end_date=n.end_date,o},extendSlotDates:function(r,d,i){var _={start_date:null,end_date:null};return i=="start_date"?(_.start_date=d.start_date,_.end_date=r.end_date):(_.start_date=r.start_date,_.end_date=d.start_date),_},extendMonthSlot:function(r,d){return(r=this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},r,d,"month")).start_date.setHours(a.config.first_hour),r.end_date=a.date.add(r.end_date,-1,"day"),r.end_date.setHours(a.config.last_hour),r},extendUnitsSlot:function(r,d){var i;switch(d){case"down":case"up":i=this.extendDaySlot(r,d);break;default:i=r}return i.section=r.section,i},extendDaySlot:function(r,d){return this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},r,d,"dayColumns")},scrollSlot:function(r){var d=a.getState(),i=this.nextSlot(this,r);(i.start_date.valueOf()=d.max_date.valueOf())&&a.setCurrentView(new Date(i.start_date)),this.moveTo(i)},keys:{left:function(){this.scrollSlot("left")},right:function(){this.scrollSlot("right")},down:function(){this._getMode()==this._modes.list?a.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this.scrollSlot("down")},up:function(){this._getMode()==this._modes.list?a.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this.scrollSlot("up")},"shift+down":function(){this.moveTo(this.extendSlot(this,"down"))},"shift+up":function(){this.moveTo(this.extendSlot(this,"up"))},"shift+right":function(){this.moveTo(this.extendSlot(this,"right"))},"shift+left":function(){this.moveTo(this.extendSlot(this,"left"))},enter:function(){var r={start_date:new Date(this.start_date),end_date:new Date(this.end_date)},d=a.getState().mode;a.matrix&&a.matrix[d]?r[a.matrix[a.getState().mode].y_property]=this.section:a._props&&a._props[d]&&(r[a._props[d].map_to]=this.section),a.addEventNow(r)}}}),a.$keyboardNavigation.TimeSlot.prototype.bindAll(a.$keyboardNavigation.TimeSlot.prototype.keys)}(e),function(a){a.$keyboardNavigation.MinicalButton=function(r,d){this.container=r,this.index=d||0},a.$keyboardNavigation.MinicalButton.prototype=a._compose(a.$keyboardNavigation.KeyNavNode,{isValid:function(){return!!this.container.offsetWidth},fallback:function(){var r=new a.$keyboardNavigation.TimeSlot;return r.isValid()?r:new a.$keyboardNavigation.DataArea},focus:function(){a.$keyboardNavigation.dispatcher.globalNode.disable(),this.container.removeAttribute("tabindex"),a.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){this.container.setAttribute("tabindex","0"),a.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},getNode:function(){return this.index?this.container.querySelector(".dhx_cal_next_button"):this.container.querySelector(".dhx_cal_prev_button")},keys:{right:function(r){this.moveTo(new a.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},left:function(r){this.moveTo(new a.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},down:function(){var r=new a.$keyboardNavigation.MinicalCell(this.container,0,0);r&&!r.isValid()&&(r=r.fallback()),this.moveTo(r)},enter:function(r){this.getNode().click()}}}),a.$keyboardNavigation.MinicalButton.prototype.bindAll(a.$keyboardNavigation.MinicalButton.prototype.keys)}(e),function(a){a.$keyboardNavigation.MinicalCell=function(r,d,i){this.container=r,this.row=d||0,this.col=i||0},a.$keyboardNavigation.MinicalCell.prototype=a._compose(a.$keyboardNavigation.KeyNavNode,{isValid:function(){var r=this._getGrid();return!(!r[this.row]||!r[this.row][this.col])},fallback:function(){var r=this.row,d=this.col,i=this._getGrid();i[r]||(r=0);var _=!0;if(r>i.length/2&&(_=!1),!i[r]){var o=new a.$keyboardNavigation.TimeSlot;return o.isValid()?o:new a.$keyboardNavigation.DataArea}if(_){for(var t=d;i[r]&&t-1||s.indexOf("dhx_before")>-1||s.indexOf("dhx_scale_ignore")>-1)&&(n=!1),d[i][o]=n}}return d},keys:{right:function(r){var d=this._getGrid(),i=this.row,_=this.col+1;d[i]&&d[i][_]||(d[i+1]?(i+=1,_=0):_=this.col);var o=new a.$keyboardNavigation.MinicalCell(this.container,i,_);o.isValid()||(o=o.fallback()),this.moveTo(o)},left:function(r){var d=this._getGrid(),i=this.row,_=this.col-1;d[i]&&d[i][_]||(_=d[i-1]?d[i-=1].length-1:this.col);var o=new a.$keyboardNavigation.MinicalCell(this.container,i,_);o.isValid()||(o=o.fallback()),this.moveTo(o)},down:function(){var r=this._getGrid(),d=this.row+1,i=this.col;r[d]&&r[d][i]||(d=this.row);var _=new a.$keyboardNavigation.MinicalCell(this.container,d,i);_.isValid()||(_=_.fallback()),this.moveTo(_)},up:function(){var r=this._getGrid(),d=this.row-1,i=this.col;if(r[d]&&r[d][i]){var _=new a.$keyboardNavigation.MinicalCell(this.container,d,i);_.isValid()||(_=_.fallback()),this.moveTo(_)}else{var o=0;this.col>r[this.row].length/2&&(o=1),this.moveTo(new a.$keyboardNavigation.MinicalButton(this.container,o))}},enter:function(r){this.getNode().querySelector(".dhx_month_head").click()}}}),a.$keyboardNavigation.MinicalCell.prototype.bindAll(a.$keyboardNavigation.MinicalCell.prototype.keys)}(e),function(a){a.$keyboardNavigation.DataArea=function(r){this.index=r||0},a.$keyboardNavigation.DataArea.prototype=a._compose(a.$keyboardNavigation.KeyNavNode,{getNode:function(r){return a.$container.querySelector(".dhx_cal_data")},_handlers:null,isValid:function(){return!0},fallback:function(){return this},keys:{"up,down,right,left":function(){this.moveTo(new a.$keyboardNavigation.TimeSlot)}}}),a.$keyboardNavigation.DataArea.prototype.bindAll(a.$keyboardNavigation.DataArea.prototype.keys)}(e),rt(e),function(a){a.$keyboardNavigation.dispatcher={isActive:!1,activeNode:null,globalNode:new a.$keyboardNavigation.SchedulerNode,keepScrollPosition:function(r){var d,i,_=a.$container.querySelector(".dhx_timeline_scrollable_data");_||(_=a.$container.querySelector(".dhx_cal_data")),_&&(d=_.scrollTop,i=_.scrollLeft),r(),_&&(_.scrollTop=d,_.scrollLeft=i)},enable:function(){if(a.$container){this.isActive=!0;var r=this;this.keepScrollPosition(function(){r.globalNode.enable(),r.setActiveNode(r.getActiveNode())})}},disable:function(){this.isActive=!1,this.globalNode.disable()},isEnabled:function(){return!!this.isActive},getDefaultNode:function(){return this.globalNode.getDefaultNode()},setDefaultNode:function(){this.setActiveNode(this.getDefaultNode())},getActiveNode:function(){var r=this.activeNode;return r&&!r.isValid()&&(r=r.fallback()),r},focusGlobalNode:function(){this.blurNode(this.globalNode),this.focusNode(this.globalNode)},setActiveNode:function(r){r&&r.isValid()&&(this.activeNode&&this.activeNode.compareTo(r)||this.isEnabled()&&(this.blurNode(this.activeNode),this.activeNode=r,this.focusNode(this.activeNode)))},focusNode:function(r){r&&r.focus&&(r.focus(),r.getNode&&document.activeElement!=r.getNode()&&this.setActiveNode(new a.$keyboardNavigation.DataArea))},blurNode:function(r){r&&r.blur&&r.blur()},getInlineEditor:function(r){var d=a.$container.querySelector(".dhx_cal_editor["+a.config.event_attribute+"='"+r+"'] textarea");return d&&d.offsetWidth?d:null},keyDownHandler:function(r){if(!r.defaultPrevented){var d=this.getActiveNode();if((!a.$keyboardNavigation.isModal()||d&&d.container&&a.utils.dom.locateCss({target:d.container},"dhx_minical_popup",!1))&&(!a.getState().editor_id||!this.getInlineEditor(a.getState().editor_id))&&this.isEnabled()){r=r||window.event;var i=this.globalNode,_=a.$keyboardNavigation.shortcuts.getCommandFromEvent(r);d?d.findHandler(_)?d.doAction(_,r):i.findHandler(_)&&i.doAction(_,r):this.setDefaultNode()}}},_timeout:null,delay:function(r,d){clearTimeout(this._timeout),this._timeout=setTimeout(r,d||1)}}}(e),ot(e),function(){st(e),function(o){o.$keyboardNavigation._minicalendars=[],o.$keyboardNavigation.isMinical=function(t){for(var n=o.$keyboardNavigation._minicalendars,s=0;s=e.config.collision_limit}),e.addEvent=function(a,r,d,i,_){var o=a;arguments.length!=1&&((o=_||{}).start_date=a,o.end_date=r,o.text=d,o.id=i,o.layer=this.defaultLayer),o.id=o.id||e.uid(),o.text=o.text||"",typeof o.start_date=="string"&&(o.start_date=this.templates.api_date(o.start_date)),typeof o.end_date=="string"&&(o.end_date=this.templates.api_date(o.end_date)),o._timed=this.isOneDayEvent(o);var t=!this._events[o.id];this._events[o.id]=o,this.event_updated(o),this._loading||this.callEvent(t?"onEventAdded":"onEventChanged",[o.id,o])},this._evs_layer={};for(var h=0;ho.getHours()&&(o.setHours(t),a=o.valueOf()),r=a+_}i.start_date=i.start_date||o,i.end_date=i.end_date||new Date(r),i.text=i.text||this.locale.labels.new_event,i.id=this._drag_id=this.uid(),i.layer=this.defaultLayer,this._drag_mode="new-size",this._loading=!0,this.addEvent(i),this.callEvent("onEventCreated",[this._drag_id,d]),this._loading=!1,this._drag_event={},this._on_mouse_up(d)},e._t_render_view_data=function(a){if(this.config.multi_day&&!this._table_view){for(var r=[],d=[],i=0;i';return k+='
 
',k+='
'+t+"
",k+='
'+n+"
",k+='',u.innerHTML=k,u.style.zIndex=100,u.firstChild},e.render_event_bar=function(a){var r=this._els.dhx_cal_data[0],d=this._colsS[a._sday],i=this._colsS[a._eday];i==d&&(i=this._colsS[a._eday+1]);var _=this.xy.bar_height,o=this._colsS.heights[a._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+a._sorder*_,t=document.createElement("div"),n=a._timed?"dhx_cal_event_clear":"dhx_cal_event_line",s=e.templates["event_class_"+a.layer]?e.templates["event_class_"+a.layer](a.start_date,a.end_date,a):e.templates.event_class(a.start_date,a.end_date,a);s&&(n=n+" "+s);var c='
';a._timed&&(c+=e.templates["event_bar_date_"+a.layer]?e.templates["event_bar_date_"+a.layer](a.start_date,a.end_date,a):e.templates.event_bar_date(a.start_date,a.end_date,a)),c+=e.templates["event_bar_text_"+a.layer]?e.templates["event_bar_text_"+a.layer](a.start_date,a.end_date,a):e.templates.event_bar_text(a.start_date,a.end_date,a)+"
)",c+="",t.innerHTML=c,this._rendered.push(t.firstChild),r.appendChild(t.firstChild)},e.render_event=function(a){var r=e.xy.menu_width;if(e.getLayer(a.layer).noMenu&&(r=0),!(a._sday<0)){var d=e.locate_holder(a._sday);if(d){var i=60*a.start_date.getHours()+a.start_date.getMinutes(),_=60*a.end_date.getHours()+a.end_date.getMinutes()||60*e.config.last_hour,o=Math.round((60*i*1e3-60*this.config.first_hour*60*1e3)*this.config.hour_size_px/36e5)%(24*this.config.hour_size_px)+1,t=Math.max(e.xy.min_event_height,(_-i)*this.config.hour_size_px/60)+1,n=Math.floor((d.clientWidth-r)/a._count),s=a._sorder*n+1;a._inner||(n*=a._count-a._sorder);var c=this._render_v_bar(a.id,r+s,o,n,t,a._text_style,e.templates.event_header(a.start_date,a.end_date,a),e.templates.event_text(a.start_date,a.end_date,a));if(this._rendered.push(c),d.appendChild(c),s=s+parseInt(d.style.left,10)+r,o+=this._dy_shift,c.style.zIndex=this._layers_zindex[a.layer],this._edit_id==a.id){c.style.zIndex=parseInt(c.style.zIndex)+1;var u=c.style.zIndex;n=Math.max(n-4,e.xy.editor_width),(c=document.createElement("div")).setAttribute("event_id",a.id),c.setAttribute(this.config.event_attribute,a.id),this.set_xy(c,n,t-20,s,o+14),c.className="dhx_cal_editor",c.style.zIndex=u;var v=document.createElement("div");this.set_xy(v,n-6,t-26),v.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;",v.style.zIndex=u,c.appendChild(v),this._els.dhx_cal_data[0].appendChild(c),this._rendered.push(c),v.innerHTML="",this._editor=v.firstChild,this._editor.addEventListener("keypress",function(p){if(p.shiftKey)return!0;var y=p.keyCode;y==e.keys.edit_save&&e.editStop(!0),y==e.keys.edit_cancel&&e.editStop(!1)}),this._editor.addEventListener("selectstart",function(p){return p.cancelBubble=!0,!0}),v.firstChild.focus(),this._els.dhx_cal_data[0].scrollLeft=0,v.firstChild.select()}if(this._select_id==a.id){c.style.zIndex=parseInt(c.style.zIndex)+1;for(var m=this.config["icons_"+(this._edit_id==a.id?"edit":"select")],l="",f=0;f";var g=this._render_v_bar(a.id,s-r+1,o,r,20*m.length+26,"","
",l,!0);g.style.left=s-r+1,g.style.zIndex=c.style.zIndex,this._els.dhx_cal_data[0].appendChild(g),this._rendered.push(g)}}}},e.filter_agenda=function(a,r){var d=e.getLayer(r.layer);return d&&d.visible}})},limit:function(e){e.config.limit_start=null,e.config.limit_end=null,e.config.limit_view=!1,e.config.check_limits=!0,e.config.mark_now=!0,e.config.display_marked_timespans=!0,e.config.overwrite_marked_timespans=!0,e._temp_limit_scope=function(){var h=null,a="dhx_time_block",r="default",d=function(o,t,n){var s=typeof o=="object"?o:{days:o};return s.type=a,s.css="",t&&(n&&(s.sections=n),s=function(c,u,v){return u instanceof Date&&v instanceof Date?(c.start_date=u,c.end_date=v):(c.days=u,c.zones=v),c}(s,o,t)),s};e.blockTime=function(o,t,n){var s=d(o,t,n);return e.addMarkedTimespan(s)},e.unblockTime=function(o,t,n){var s=d(o,t=t||"fullday",n);return e.deleteMarkedTimespan(s)},e.attachEvent("onBeforeViewChange",function(o,t,n,s){function c(u,v){var m=e.config.limit_start,l=e.config.limit_end,f=e.date.add(u,1,v);return u.valueOf()>l.valueOf()||f<=m.valueOf()}return!e.config.limit_view||!c(s=s||t,n=n||o)||t.valueOf()==s.valueOf()||(setTimeout(function(){if(e.$destroyed)return!0;var u=c(t,n)?e.config.limit_start:t;e.setCurrentView(c(u,n)?null:u,n)},1),!1)}),e.checkInMarkedTimespan=function(o,t,n){t=t||r;for(var s=!0,c=new Date(o.start_date.valueOf()),u=e.date.add(c,1,"day"),v=e._marked_timespans;cu||o.end_date.getDate()!=c.getDate()?1440:e._get_zone_minutes(o.end_date),y=l[f],w=l[f+1];if(yg&&!(s=typeof n=="function"&&n(o,g,p,y,w)))break}}return!s};var i=e.checkLimitViolation=function(o){if(!o||!e.config.check_limits)return!0;var t=e,n=t.config,s=[];if(o.rec_type)for(var c=e.getRecDates(o),u=0;u=n.limit_start.valueOf()&&v.end_date.valueOf()<=n.limit_end.valueOf())&&(f=!e.checkInMarkedTimespan(v,a,function(g,p,y,w,b){var k=!0;return p<=b&&p>=w&&((b==1440||y<=b)&&(k=!1),g._timed&&t._drag_id&&t._drag_mode=="new-size"?(g.start_date.setHours(0),g.start_date.setMinutes(b)):k=!1),(y>=w&&y<=b||pb)&&(g._timed&&t._drag_id&&t._drag_mode=="new-size"?(g.end_date.setHours(0),g.end_date.setMinutes(w)):k=!1),k})),f||(f=t.checkEvent("onLimitViolation")?t.callEvent("onLimitViolation",[v.id,v]):f),m=m&&f}return m||(t._drag_id=null,t._drag_mode=null),m};function _(o,t,n,s,c){var u=e,v=[],m={_props:"map_to",matrix:"y_property"};for(var l in m){var f=m[l];if(u[l])for(var g in u[l]){var p=u[l][g][f];o[p]&&(v=u._add_timespan_zones(v,e._get_blocked_zones(t[g],o[p],n,s,c)))}}return v=u._add_timespan_zones(v,e._get_blocked_zones(t,"global",n,s,c))}e._get_blocked_zones=function(o,t,n,s,c){var u=[];if(o&&o[t])for(var v=o[t],m=this._get_relevant_blocked_zones(n,s,v,c),l=0;l=e.config.limit_end.valueOf()&&(t.start_date=this.date.add(e.config.limit_end,-1,"day")),t.end_date=e.config.limit_end.valueOf()&&(t.end_date=this.date.add(e.config.limit_end,-1,"day")),t.start_date.valueOf()>=t.end_date.valueOf()&&(t.end_date=this.date.add(t.start_date,this.config.event_duration||this.config.time_step,"minute")),t._timed=this.isOneDayEvent(t)),!0}),e.attachEvent("onEventChanged",function(o){if(!o)return!0;var t=e.getEvent(o);if(!i(t)){if(!h)return!1;t.start_date=h[0],t.end_date=h[1],t._timed=this.isOneDayEvent(t)}return!0}),e.attachEvent("onBeforeEventChanged",function(o,t,n){return i(o)}),e.attachEvent("onBeforeEventCreated",function(o){var t=e.getActionData(o).date,n={_timed:!0,start_date:t,end_date:e.date.add(t,e.config.time_step,"minute")};return i(n)}),e.attachEvent("onViewChange",function(){e._mark_now()}),e.attachEvent("onAfterSchedulerResize",function(){return window.setTimeout(function(){if(e.$destroyed)return!0;e._mark_now()},1),!0}),e.attachEvent("onTemplatesReady",function(){e._mark_now_timer=window.setInterval(function(){e._is_initialized()&&e._mark_now()},6e4)}),e.attachEvent("onDestroy",function(){clearInterval(e._mark_now_timer)}),e._mark_now=function(o){var t="dhx_now_time";this._els[t]||(this._els[t]=[]);var n=e._currentDate(),s=this.config;if(e._remove_mark_now(),!o&&s.mark_now&&nthis._min_date&&n.getHours()>=s.first_hour&&n.getHours()1?(m.size&&m.options.length&&(o=(m.position+o)/m.options.length*m.size),u=o,v=o+l):v=(u=0)+l;for(var f=[],g=u;go.start_date||o.days!==void 0&&o.zones)&&!o.type)return t;o.zones=="fullday"&&(o.zones=[0,1440]),o.zones&&o.invert_zones&&(o.zones=e.invertZones(o.zones)),o.id=e.uid(),o.css=o.css||"",o.type=o.type||r;var v=o.sections;if(v){for(var m in v)if(v.hasOwnProperty(m)){var l=v[m];for(l instanceof Array||(l=[l]),c=0;cw?e._get_zone_minutes(p):0,D=y>b||y.getDate()!=w.getDate()?1440:e._get_zone_minutes(y);k.zones=[E,D],t.push(k),w=b,b=e.date.add(b,1,"day")}else g.days instanceof Date&&(g.days=e.date.date_part(g.days).valueOf()),g.zones=o.zones.slice(),t.push(g)}return t},e._get_dates_by_index=function(o,t,n){var s=[];t=e.date.date_part(new Date(t||e._min_date)),n=new Date(n||e._max_date);for(var c=t.getDay(),u=o-c>=0?o-c:7-t.getDay()+o,v=e.date.add(t,u,"day");v+l&&+u<=+l))return s;n=l.getDay()}var f=u.getDay();f>n?n=7-(f-n):n-=f}var g=o.zones,p=e._get_css_classes_by_config(o);if(e._table_view&&e._mode=="month"){var y=[],w=[];if(t)y.push(t),w.push(n);else{w=m?[m]:e._get_dates_by_index(n);for(var b=0;b1?S=S*(N.size||N.options.length)+M:(S=M,N.size&&S>N.position+N.size&&(S=0))}for(t=t||e.locate_holder(S),b=0;b-1||(t.push.apply(t,e._on_scale_add_marker(v,s)),s=e.date.add(s,1,"day"))}}return t},e.markTimespan=function(o){if(!this._els)throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.");var t=!1;this._els.dhx_cal_data||(e.get_elements(),t=!0);var n=e._marked_timespans_ids,s=e._marked_timespans_types,c=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(o);var u=e._mark_timespans();return t&&(e._els=[]),e._marked_timespans_ids=n,e._marked_timespans_types=s,e._marked_timespans=c,u},e.unmarkTimespan=function(o){if(o)for(var t=0;tu&&l<=u||l=c)n[s]=Math.min(c,l),n[s+1]=Math.max(u,f),s-=2;else{if(!v)continue;var g=c>l?0:2;n.splice(s+g,0,l,f)}t.splice(m--,2);break}return n},e._subtract_timespan_zones=function(o,t){for(var n=o.slice(),s=0;sc&&m=m&&u<=l&&n.splice(s,2),cl&&n.splice(f?s+2:s,f?0:2,l,u),s-=2;break}}return n},e.invertZones=function(o){return e._subtract_timespan_zones([0,1440],o.slice())},e._delete_marked_timespan_by_id=function(o){var t=e._marked_timespans_ids[o];if(t){for(var n=0;n1){var p=Math.round((t-e._min_date)/864e5),y=l.size||f.length;t=e.date.add(e._min_date,Math.floor(p/y),"day"),t=e.date.date_part(t)}else t=e.date.date_part(new Date(this._date));if(n=t.getDay(),s=t.valueOf(),u[c]&&u[c][g.key]){var w=u[c][g.key],b=e._get_types_to_render(w[n],w[s]);v.push.apply(v,e._get_configs_to_render(b))}}var k=u.global;if(e.config.overwrite_marked_timespans){var E=k[s]||k[n];v.push.apply(v,e._get_configs_to_render(E))}else k[s]&&v.push.apply(v,e._get_configs_to_render(k[s])),k[n]&&v.push.apply(v,e._get_configs_to_render(k[n]));for(var D=0;D"+r.text+"

"+(r.event_location||"")+"

"+e.templates.marker_date(h)+" - "+e.templates.marker_date(a)+""},e.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:e._date,end_date:e.date.add(e._date,e.config.time_step,"minute")})},e.templates.map_time=function(h,a,r){return e.config.rtl&&!r._timed?e.templates.day_date(a)+" – "+e.templates.day_date(h):r._timed?this.day_date(r.start_date,r.end_date,r)+" "+this.event_date(h):e.templates.day_date(h)+" – "+e.templates.day_date(a)},e.templates.map_text=function(h,a,r){return r.text},e.date.map_start=function(h){return h},e.date.add_map=function(h,a,r){return new Date(h.valueOf())},e.templates.map_date=function(h,a,r){return""},e._latLngUpdate=!1,e.attachEvent("onSchedulerReady",function(){e._isMapPositionSet=!1;const h=document.createElement("div");h.className="dhx_map",h.id="dhx_gmap",h.style.display="none",e._obj.appendChild(h),e._els.dhx_gmap=[],e._els.dhx_gmap.push(h),o("dhx_gmap");const a={zoom:e.config.map_initial_zoom||10,center:e.config.map_initial_position,mapTypeId:e.config.map_type||google.maps.MapTypeId.ROADMAP},r=new google.maps.Map(document.getElementById("dhx_gmap"),a);r.disableDefaultUI=!1,r.disableDoubleClickZoom=!e.config.readonly,google.maps.event.addListener(r,"dblclick",function(u){const v=e.ext.mapView.geocoder;if(!e.config.readonly&&e.config.dblclick_create){var m=u.latLng;v.geocode({latLng:m},function(l,f){f==google.maps.GeocoderStatus.OK&&(m=l[0].geometry.location,e.addEventNow({lat:m.lat(),lng:m.lng(),event_location:l[0].formatted_address,start_date:e._date,end_date:e.date.add(e._date,e.config.time_step,"minute")}))})}});var d={content:""};e.config.map_infowindow_max_width&&(d.maxWidth=e.config.map_infowindow_max_width),e.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(d),_infowindows_content:[],_initialization_count:-1,_obj:r},e.ext.mapView.geocoder=new google.maps.Geocoder,e.ext.mapView.map=r,e.ext.mapView.points=e.map._points,e.ext.mapView.markers=e.map._markers,e.ext.mapView.infoWindow=e.map._infowindow,e.config.map_resolve_user_location&&navigator.geolocation&&(e._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(u){var v=new google.maps.LatLng(u.coords.latitude,u.coords.longitude);r.setCenter(v),r.setZoom(e.config.map_zoom_after_resolve||10),e.map._infowindow.setContent(e.locale.labels.marker_geo_success),e.map._infowindow.position=r.getCenter(),e.map._infowindow.open(r),e._isMapPositionSet=!0},function(){e.map._infowindow.setContent(e.locale.labels.marker_geo_fail),e.map._infowindow.setPosition(r.getCenter()),e.map._infowindow.open(r),e._isMapPositionSet=!0})),google.maps.event.addListener(r,"resize",function(u){h.style.zIndex="5",r.setZoom(r.getZoom())}),google.maps.event.addListener(r,"tilesloaded",function(u){h.style.zIndex="5"}),h.style.display="none";const i=e.render_data;function _(){var u=e.get_visible_events();u.sort(function(E,D){return E.start_date.valueOf()==D.start_date.valueOf()?E.id>D.id?1:-1:E.start_date>D.start_date?1:-1});for(var v="
",m=0;m
"+e.templates.map_time(l.start_date,l.end_date,l)+"
",v+=`
+ `,e._obj.appendChild(i),e.event(i,"click",function(){e.expanded?e.collapse():e.expand()})}),e._maximize=function(){this.expanded=!this.expanded,this.expanded?this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded"):this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded");for(var i=["left","top"],t=0;t400))try{l=JSON.parse(o.xmlDoc.responseText)}catch{}_(l)})},r._plain_export_copy=function(n,s){var _={};for(var a in n)_[a]=n[a];return _.start_date=s(_.start_date),_.end_date=s(_.end_date),_.$text=this.templates.event_text(n.start_date,n.end_date,n),_},r._serialize_plain=function(n,s){var _;n=n||r.date.date_to_str("%Y%m%dT%H%i%s",!0),_=s&&s.start&&s.end?r.getEvents(s.start,s.end):r.getEvents();for(var a=[],o=0;o<_.length;o++)a[o]=this._plain_export_copy(_[o],n);return a},r._serialize_columns=function(){return[{id:"start_date",header:"Start Date",width:30},{id:"end_date",header:"End Date",width:30},{id:"$text",header:"Text",width:100}]},r._send_to_export=function(n,s){if(n.version||(n.version=r.version),n.skin||(n.skin=r.skin),n.callback)return r._ajax_to_export(n,s,n.callback);var _=this._create_hidden_form();_.firstChild.action=n.server||"https://export.dhtmlx.com/scheduler",_.firstChild.childNodes[0].value=JSON.stringify(n),_.firstChild.childNodes[1].value=s,_.firstChild.submit()},r._create_hidden_form=function(){if(!this._hidden_export_form){var n=this._hidden_export_form=document.createElement("div");n.style.display="none",n.innerHTML="
",document.body.appendChild(n)}return this._hidden_export_form},r._get_export_size=function(n,s,_,a,o,l,h){a=parseInt(a)/25.4||4;var v={A5:{x:148,y:210},A4:{x:210,y:297},A3:{x:297,y:420},A2:{x:420,y:594},A1:{x:594,y:841},A0:{x:841,y:1189}},u=t("dhx_cal_data",this).x,f={y:t("dhx_cal_data",this).y+t("dhx_cal_header",this).y+t("dhx_multi_day",this).y};return f.x=n==="full"?u:Math.floor((s==="landscape"?v[n].y:v[n].x)*a),h&&(f.x*=parseFloat(h.x)||1,f.y*=parseFloat(h.y)||1),f},r._export_html=function(n){var s,_,a,o=(s=void 0,_=void 0,(a=d())&&(_=a.scrollable,s=a.smart_rendering),{nav_height:r.xy.nav_height,scroll_width:r.xy.scroll_width,style_width:r._obj.style.width,style_height:r._obj.style.height,timeline_scrollable:_,timeline_smart_rendering:s}),l=r._get_export_size(n.format,n.orientation,n.zoom,n.dpi,n.header,n.footer,n.scales),h="";try{(function(v,u){r._obj.style.width=v.x+"px",r._obj.style.height=v.y+"px",r.xy.nav_height=0,r.xy.scroll_width=0;var f=d();(u.timeline_scrollable||u.timeline_smart_rendering)&&(f.scrollable=!1,f.smart_rendering=!1)})(l,o),r.setCurrentView(),h=r._obj.innerHTML}catch(v){console.error(v)}finally{(function(v){r.xy.scroll_width=v.scroll_width,r.xy.nav_height=v.nav_height,r._obj.style.width=v.style_width,r._obj.style.height=v.style_height;var u=d();(v.timeline_scrollable||v.timeline_smart_rendering)&&(u.scrollable=v.timeline_scrollable,u.smart_rendering=v.timeline_smart_rendering)})(o),r.setCurrentView()}return h}}(e)})()},grid_view:function(e){_e("Grid",e.assert)},html_templates:function(e){e.attachEvent("onTemplatesReady",function(){for(var i=document.body.getElementsByTagName("DIV"),t=0;t=96&&d.keyCode<=105&&(d.keyCode-=48);var n=String.fromCharCode(d.keyCode);return n&&(d.keyCode=n.toLowerCase().charCodeAt(0)),d},getHashFromEvent:function(r){return this.getHash(this.getCommandFromEvent(r))},getHash:function(r){var d=[];for(var n in r.modifiers)r.modifiers[n]&&d.push(n);return d.push(r.keyCode),d.join(this.junctionChar)},getExpressions:function(r){return r.split(this.junctionChar)},getWords:function(r){return r.split(this.combinationChar)},trim:function(r){return r.replace(/\s/g,"")},junctionChar:",",combinationChar:"+",commandKeys:{shift:16,alt:18,ctrl:17,meta:!0},specialKeys:{backspace:8,tab:9,enter:13,esc:27,space:32,up:38,down:40,left:37,right:39,home:36,end:35,pageup:33,pagedown:34,delete:46,insert:45,plus:107,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123}}}(e),function(t){t.$keyboardNavigation.EventHandler={_handlers:null,findHandler:function(r){this._handlers||(this._handlers={});var d=t.$keyboardNavigation.shortcuts.getHash(r);return this._handlers[d]},doAction:function(r,d){var n=this.findHandler(r);n&&(n.call(this,d),d.preventDefault?d.preventDefault():d.returnValue=!1)},bind:function(r,d){this._handlers||(this._handlers={});for(var n=t.$keyboardNavigation.shortcuts,s=n.parse(r),_=0;_=s.length-1?0:a+1])return n.focus(),d.preventDefault(),!0;return!1}}(e),function(t){t.$keyboardNavigation.marker={clear:function(){for(var r=t.$container.querySelectorAll(".dhx_focus_slot"),d=0;d=0;a--)if(s[a].offsetWidth)return s[a];return null},addDataAttributes:function(r,d,n,s){for(var _=t.date.date_to_str(t.config.api_date),a=_(d),o=_(n),l=0;lt._max_date.valueOf()&&(l=new Date(t._max_date)),!s._trace_x)return a;for(var h=0;hr))return a;var u=this.createElement();let f,c;function p(b,k){k.setDate(1),k.setFullYear(b.getFullYear()),k.setMonth(b.getMonth()),k.setDate(b.getDate())}if(t.getView().days){const b=new Date(r);p(t._min_date,b);const k=new Date(d);p(t._min_date,k),f=t._timeline_getX({start_date:b},!1,s),c=t._timeline_getX({start_date:k},!1,s)}else f=t._timeline_getX({start_date:r},!1,s),c=t._timeline_getX({start_date:d},!1,s);var m=s._section_height[n]-1||s.dy-1,g=0;t._isRender("cell")&&(g=v.offsetTop,f+=s.dx,c+=s.dx,v=t.$container.querySelector(".dhx_cal_data"));var y=Math.max(1,c-f-1);let x="left";return t.config.rtl&&(x="right"),u.style.cssText=`height:${m}px; ${x}:${f}px; width:${y}px; top:${g}px;`,v&&(v.appendChild(u),a.push(u)),a},renderMonthCell:function(r){for(var d=t.$container.querySelectorAll(".dhx_month_head"),n=[],s=0;s1?s=t.locate_holder_day(r)+h:(s=h,l.size&&s>l.position+l.size&&(s=0))}if(!(a=t.locate_holder(s))||a.querySelector(".dhx_scale_hour"))return document.createElement("div");var v=Math.max(60*r.getHours()+r.getMinutes(),60*o.first_hour),u=Math.min(60*d.getHours()+d.getMinutes(),60*o.last_hour);if(!u&&t.date.day_start(new Date(d)).valueOf()>t.date.day_start(new Date(r)).valueOf()&&(u=60*o.last_hour),u<=v)return[];var f=this.createElement(),c=t.config.hour_size_px*o.last_hour+1,p=36e5;return f.style.top=Math.round((60*v*1e3-t.config.first_hour*p)*t.config.hour_size_px/p)%c+"px",f.style.lineHeight=f.style.height=Math.max(Math.round(60*(u-v)*1e3*t.config.hour_size_px/p)%c,1)+"px",f.style.width="100%",a.appendChild(f),_.push(f),_[0]}}}(e),function(t){t.$keyboardNavigation.SchedulerNode=function(){},t.$keyboardNavigation.SchedulerNode.prototype=t._compose(t.$keyboardNavigation.EventHandler,{getDefaultNode:function(){var r=new t.$keyboardNavigation.TimeSlot;return r.isValid()||(r=r.fallback()),r},_modes:{month:"month",year:"year",dayColumns:"dayColumns",timeline:"timeline",units:"units",weekAgenda:"weekAgenda",list:"list"},getMode:function(){var r=t.getState().mode;return t.matrix&&t.matrix[r]?this._modes.timeline:t._props&&t._props[r]?this._modes.units:r=="month"?this._modes.month:r=="year"?this._modes.year:r=="week_agenda"?this._modes.weekAgenda:r=="map"||r=="agenda"||t._grid&&t["grid_"+r]?this._modes.list:this._modes.dayColumns},focus:function(){t.focus()},blur:function(){},disable:function(){t.$container.setAttribute("tabindex","0")},enable:function(){t.$container&&t.$container.removeAttribute("tabindex")},isEnabled:function(){return t.$container.hasAttribute("tabindex")},_compareEvents:function(r,d){return r.start_date.valueOf()==d.start_date.valueOf()?r.id>d.id?1:-1:r.start_date.valueOf()>d.start_date.valueOf()?1:-1},_pickEvent:function(r,d,n,s){var _=t.getState();r=new Date(Math.max(_.min_date.valueOf(),r.valueOf())),d=new Date(Math.min(_.max_date.valueOf(),d.valueOf()));var a=t.getEvents(r,d);a.sort(this._compareEvents),s&&(a=a.reverse());for(var o=!!n,l=0;l=this.getNodes().length&&(r=0),this.moveTo(new t.$keyboardNavigation.HeaderCell(r))},down:function(){this.moveTo(new t.$keyboardNavigation.TimeSlot)},enter:function(){var r=this.getNode();r&&r.click()}}}),t.$keyboardNavigation.HeaderCell.prototype.bindAll(t.$keyboardNavigation.HeaderCell.prototype.keys)}(e),function(t){t.$keyboardNavigation.Event=function(r){if(this.eventId=null,t.getEvent(r)){var d=t.getEvent(r);this.start=new Date(d.start_date),this.end=new Date(d.end_date),this.section=this._getSection(d),this.eventId=r}},t.$keyboardNavigation.Event.prototype=t._compose(t.$keyboardNavigation.KeyNavNode,{_getNodes:function(){return Array.prototype.slice.call(t.$container.querySelectorAll("["+t.config.event_attribute+"]"))},_modes:t.$keyboardNavigation.SchedulerNode.prototype._modes,getMode:t.$keyboardNavigation.SchedulerNode.prototype.getMode,_handlers:null,isValid:function(){return!(!t.getEvent(this.eventId)||!this.getNode())},fallback:function(){var r=this._getNodes()[0],d=null;if(r&&t._locate_event(r)){var n=t._locate_event(r);d=new t.$keyboardNavigation.Event(n)}else d=new t.$keyboardNavigation.TimeSlot;return d},isScrolledIntoView:function(r){var d=r.getBoundingClientRect(),n=t.$container.querySelector(".dhx_cal_data").getBoundingClientRect();return!(d.bottomn.bottom)},getNode:function(){var r="["+t.config.event_attribute+"='"+this.eventId+"']",d=t.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);if(d)return d;if(t.isMultisectionEvent&&t.isMultisectionEvent(t.getEvent(this.eventId))){for(var n=t.$container.querySelectorAll(r),s=0;sd.max_date.valueOf()||r.end_date.valueOf()<=d.min_date.valueOf())&&t.setCurrentView(r.start_date);var n=this.getNode();this.isScrolledIntoView(n)?t.$keyboardNavigation.dispatcher.keepScrollPosition((function(){t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)}).bind(this)):t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},_getSection:function(r){var d=null,n=t.getState().mode;return t.matrix&&t.matrix[n]?d=r[t.matrix[t.getState().mode].y_property]:t._props&&t._props[n]&&(d=r[t._props[n].map_to]),d},_moveToSlot:function(r){var d=t.getEvent(this.eventId);if(d){var n=this._getSection(d),s=new t.$keyboardNavigation.TimeSlot(d.start_date,null,n);this.moveTo(s.nextSlot(s,r))}else this.moveTo(new t.$keyboardNavigation.TimeSlot)},keys:{left:function(){this._moveToSlot("left")},right:function(){this._moveToSlot("right")},down:function(){this.getMode()==this._modes.list?t.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this._moveToSlot("down")},space:function(){var r=this.getNode();r&&r.click?r.click():this.moveTo(new t.$keyboardNavigation.TimeSlot)},up:function(){this.getMode()==this._modes.list?t.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this._moveToSlot("up")},delete:function(){t.getEvent(this.eventId)?t._click.buttons.delete(this.eventId):this.moveTo(new t.$keyboardNavigation.TimeSlot)},enter:function(){t.getEvent(this.eventId)?t.showLightbox(this.eventId):this.moveTo(new t.$keyboardNavigation.TimeSlot)}}}),t.$keyboardNavigation.Event.prototype.bindAll(t.$keyboardNavigation.Event.prototype.keys)}(e),function(t){t.$keyboardNavigation.TimeSlot=function(r,d,n,s){var _=t.getState(),a=t.matrix&&t.matrix[_.mode];r||(r=this.getDefaultDate()),d||(d=a?t.date.add(r,a.x_step,a.x_unit):t.date.add(r,t.config.key_nav_step,"minute")),this.section=n||this._getDefaultSection(),this.start_date=new Date(r),this.end_date=new Date(d),this.movingDate=s||null},t.$keyboardNavigation.TimeSlot.prototype=t._compose(t.$keyboardNavigation.KeyNavNode,{_handlers:null,getDefaultDate:function(){var r,d=t.getState(),n=new Date(d.date);n.setSeconds(0),n.setMilliseconds(0);var s=new Date;s.setSeconds(0),s.setMilliseconds(0);var _=t.matrix&&t.matrix[d.mode],a=!1;if(n.valueOf()===s.valueOf()&&(a=!0),_)a?(_.x_unit==="day"?(s.setHours(0),s.setMinutes(0)):_.x_unit==="hour"&&s.setMinutes(0),r=s):r=t.date[_.name+"_start"](new Date(d.date)),r=this.findVisibleColumn(r);else if(r=new Date(t.getState().min_date),a&&(r=s),r=this.findVisibleColumn(r),a||r.setHours(t.config.first_hour),!t._table_view){var o=t.$container.querySelector(".dhx_cal_data");o.scrollTop&&r.setHours(t.config.first_hour+Math.ceil(o.scrollTop/t.config.hour_size_px))}return r},clone:function(r){return new t.$keyboardNavigation.TimeSlot(r.start_date,r.end_date,r.section,r.movingDate)},_getMultisectionView:function(){var r,d=t.getState();return t._props&&t._props[d.mode]?r=t._props[d.mode]:t.matrix&&t.matrix[d.mode]&&(r=t.matrix[d.mode]),r},_getDefaultSection:function(){var r=null;return this._getMultisectionView()&&!r&&(r=this._getNextSection()),r},_getNextSection:function(r,d){var n=this._getMultisectionView(),s=n.order[r],_=s;(_=s!==void 0?s+d:n.size&&n.position?n.position:0)<0&&(_=0);var a=n.options||n.y_unit;return _>=a.length&&(_=a.length-1),a[_]?a[_].key:null},isValid:function(){var r=t.getState();if(this.start_date.valueOf()=r.max_date.valueOf()||!this.isVisible(this.start_date,this.end_date))return!1;var d=this._getMultisectionView();return!d||d.order[this.section]!==void 0},fallback:function(){var r=new t.$keyboardNavigation.TimeSlot;return r.isValid()?r:new t.$keyboardNavigation.DataArea},getNodes:function(){return Array.prototype.slice.call(t.$container.querySelectorAll(".dhx_focus_slot"))},getNode:function(){return this.getNodes()[0]},focus:function(){this.section&&t.getView()&&t.getView().smart_rendering&&t.getView().scrollTo&&!t.$container.querySelector(`[data-section-id="${this.section}"]`)&&t.getView().scrollTo({section:this.section}),t.$keyboardNavigation.marker.render(this.start_date,this.end_date,this.section),t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this),t.$keyboardNavigation._pasteDate=this.start_date,t.$keyboardNavigation._pasteSection=this.section},blur:function(){t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this),t.$keyboardNavigation.marker.clear()},_modes:t.$keyboardNavigation.SchedulerNode.prototype._modes,_getMode:t.$keyboardNavigation.SchedulerNode.prototype.getMode,addMonthDate:function(r,d,n){var s;switch(d){case"up":s=t.date.add(r,-1,"week");break;case"down":s=t.date.add(r,1,"week");break;case"left":s=t.date.day_start(t.date.add(r,-1,"day")),s=this.findVisibleColumn(s,-1);break;case"right":s=t.date.day_start(t.date.add(r,1,"day")),s=this.findVisibleColumn(s,1);break;default:s=t.date.day_start(new Date(r))}var _=t.getState();return(r.valueOf()<_.min_date.valueOf()||!n&&r.valueOf()>=_.max_date.valueOf())&&(s=new Date(_.min_date)),s},nextMonthSlot:function(r,d,n){var s,_;return(s=this.addMonthDate(r.start_date,d,n)).setHours(t.config.first_hour),(_=new Date(s)).setHours(t.config.last_hour),{start_date:s,end_date:_}},_alignTimeSlot:function(r,d,n,s){for(var _=new Date(d);_.valueOf()r.valueOf()&&(_=t.date.add(_,-s,n)),_},nextTimelineSlot:function(r,d,n){var s=t.getState(),_=t.matrix[s.mode],a=this._alignTimeSlot(r.start_date,t.date[_.name+"_start"](new Date(r.start_date)),_.x_unit,_.x_step),o=this._alignTimeSlot(r.end_date,t.date[_.name+"_start"](new Date(r.end_date)),_.x_unit,_.x_step);o.valueOf()<=a.valueOf()&&(o=t.date.add(a,_.x_step,_.x_unit));var l=this.clone(r);switch(l.start_date=a,l.end_date=o,l.section=r.section||this._getNextSection(),d){case"up":l.section=this._getNextSection(r.section,-1);break;case"down":l.section=this._getNextSection(r.section,1);break;case"left":l.start_date=this.findVisibleColumn(t.date.add(l.start_date,-_.x_step,_.x_unit),-1),l.end_date=t.date.add(l.start_date,_.x_step,_.x_unit);break;case"right":l.start_date=this.findVisibleColumn(t.date.add(l.start_date,_.x_step,_.x_unit),1),l.end_date=t.date.add(l.start_date,_.x_step,_.x_unit)}return(l.start_date.valueOf()=s.max_date.valueOf())&&(n&&l.start_date.valueOf()>=s.max_date.valueOf()?l.start_date=new Date(s.max_date):(l.start_date=t.date[s.mode+"_start"](t.date.add(s.date,d=="left"?-1:1,s.mode)),l.end_date=t.date.add(l.start_date,_.x_step,_.x_unit))),l},nextUnitsSlot:function(r,d,n){var s=this.clone(r);s.section=r.section||this._getNextSection();var _=r.section||this._getNextSection(),a=t.getState(),o=t._props[a.mode];switch(d){case"left":_=this._getNextSection(r.section,-1);var l=o.size?o.size-1:o.options.length;o.days>1&&o.order[_]==l-1&&t.date.add(r.start_date,-1,"day").valueOf()>=a.min_date.valueOf()&&(s=this.nextDaySlot(r,d,n));break;case"right":_=this._getNextSection(r.section,1),o.days>1&&!o.order[_]&&t.date.add(r.start_date,1,"day").valueOf()=_||!d&&!n&&(!s&&a==24||s==a)},isInVisibleDayTime:function(r,d){return this.isBeforeLastHour(r,d)&&this.isAfterFirstHour(r,d)},nextDaySlot:function(r,d,n){var s,_,a=t.config.key_nav_step,o=this._alignTimeSlot(r.start_date,t.date.day_start(new Date(r.start_date)),"minute",a),l=r.start_date;switch(d){case"up":if(s=t.date.add(o,-a,"minute"),!this.isInVisibleDayTime(s,!0)&&(!n||this.isInVisibleDayTime(l,!0))){var h=!0;n&&t.date.date_part(new Date(s)).valueOf()!=t.date.date_part(new Date(l)).valueOf()&&(h=!1),h&&(s=this.findVisibleColumn(t.date.add(r.start_date,-1,"day"),-1)),s.setHours(t.config.last_hour),s.setMinutes(0),s=t.date.add(s,-a,"minute")}_=t.date.add(s,a,"minute");break;case"down":s=t.date.add(o,a,"minute");var v=n?s:t.date.add(s,a,"minute");this.isInVisibleDayTime(v,!1)||n&&!this.isInVisibleDayTime(l,!1)||(n?(h=!0,t.date.date_part(new Date(l)).valueOf()==l.valueOf()&&(h=!1),h&&(s=this.findVisibleColumn(t.date.add(r.start_date,1,"day"),1)),s.setHours(t.config.first_hour),s.setMinutes(0),s=t.date.add(s,a,"minute")):((s=this.findVisibleColumn(t.date.add(r.start_date,1,"day"),1)).setHours(t.config.first_hour),s.setMinutes(0))),_=t.date.add(s,a,"minute");break;case"left":s=this._moveDate(r.start_date,-1),_=this._moveDate(r.end_date,-1);break;case"right":s=this._moveDate(r.start_date,1),_=this._moveDate(r.end_date,1);break;default:s=o,_=t.date.add(s,a,"minute")}return{start_date:s,end_date:_}},nextWeekAgendaSlot:function(r,d){var n,s,_=t.getState();switch(d){case"down":case"left":n=t.date.day_start(t.date.add(r.start_date,-1,"day")),n=this.findVisibleColumn(n,-1);break;case"up":case"right":n=t.date.day_start(t.date.add(r.start_date,1,"day")),n=this.findVisibleColumn(n,1);break;default:n=t.date.day_start(r.start_date)}return(r.start_date.valueOf()<_.min_date.valueOf()||r.start_date.valueOf()>=_.max_date.valueOf())&&(n=new Date(_.min_date)),(s=new Date(n)).setHours(t.config.last_hour),{start_date:n,end_date:s}},nextAgendaSlot:function(r,d){return{start_date:r.start_date,end_date:r.end_date}},isDateVisible:function(r){if(!t._ignores_detected)return!0;var d,n=t.matrix&&t.matrix[t.getState().mode];return d=n?t._get_date_index(n,r):t.locate_holder_day(r),!t._ignores[d]},findVisibleColumn:function(r,d){var n=r;d=d||1;for(var s=t.getState();!this.isDateVisible(n)&&(d>0&&n.valueOf()<=s.max_date.valueOf()||d<0&&n.valueOf()>=s.min_date.valueOf());)n=this.nextDateColumn(n,d);return n},nextDateColumn:function(r,d){d=d||1;var n=t.matrix&&t.matrix[t.getState().mode];return n?t.date.add(r,d*n.x_step,n.x_unit):t.date.day_start(t.date.add(r,d,"day"))},isVisible:function(r,d){if(!t._ignores_detected)return!0;for(var n=new Date(r);n.valueOf()=_.end_date.valueOf()&&(_=this.nextSlot(_,d,n)),t.$keyboardNavigation.TimeSlot.prototype.clone(_)},extendSlot:function(r,d){var n;switch(this._getMode()){case this._modes.units:n=d=="left"||d=="right"?this.nextUnitsSlot(r,d):this.extendUnitsSlot(r,d);break;case this._modes.timeline:n=d=="down"||d=="up"?this.nextTimelineSlot(r,d):this.extendTimelineSlot(r,d);break;case this._modes.year:case this._modes.month:n=this.extendMonthSlot(r,d);break;case this._modes.dayColumns:n=this.extendDaySlot(r,d);break;case this._modes.weekAgenda:n=this.extendWeekAgendaSlot(r,d);break;default:n=r}var s=t.getState();return n.start_date.valueOf()s.max_date.valueOf()&&(n.end_date=this.findVisibleColumn(s.max_date,-1)),t.$keyboardNavigation.TimeSlot.prototype.clone(n)},extendTimelineSlot:function(r,d){return this.extendGenericSlot({left:"start_date",right:"end_date"},r,d,"timeline")},extendWeekAgendaSlot:function(r,d){return this.extendGenericSlot({left:"start_date",right:"end_date"},r,d,"weekAgenda")},extendGenericSlot:function(r,d,n,s){var _,a=d.movingDate;if(a||(a=r[n]),!a||!r[n])return d;if(!n)return t.$keyboardNavigation.TimeSlot.prototype.clone(d);(_=this.nextSlot({start_date:d[a],section:d.section},n,s,!0)).start_date.valueOf()==d.start_date.valueOf()&&(_=this.nextSlot({start_date:_.start_date,section:_.section},n,s,!0)),_.movingDate=a;var o=this.extendSlotDates(d,_,_.movingDate);return o.end_date.valueOf()<=o.start_date.valueOf()&&(_.movingDate=_.movingDate=="end_date"?"start_date":"end_date"),o=this.extendSlotDates(d,_,_.movingDate),_.start_date=o.start_date,_.end_date=o.end_date,_},extendSlotDates:function(r,d,n){var s={start_date:null,end_date:null};return n=="start_date"?(s.start_date=d.start_date,s.end_date=r.end_date):(s.start_date=r.start_date,s.end_date=d.start_date),s},extendMonthSlot:function(r,d){return(r=this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},r,d,"month")).start_date.setHours(t.config.first_hour),r.end_date=t.date.add(r.end_date,-1,"day"),r.end_date.setHours(t.config.last_hour),r},extendUnitsSlot:function(r,d){var n;switch(d){case"down":case"up":n=this.extendDaySlot(r,d);break;default:n=r}return n.section=r.section,n},extendDaySlot:function(r,d){return this.extendGenericSlot({up:"start_date",down:"end_date",left:"start_date",right:"end_date"},r,d,"dayColumns")},scrollSlot:function(r){var d=t.getState(),n=this.nextSlot(this,r);(n.start_date.valueOf()=d.max_date.valueOf())&&t.setCurrentView(new Date(n.start_date)),this.moveTo(n)},keys:{left:function(){this.scrollSlot("left")},right:function(){this.scrollSlot("right")},down:function(){this._getMode()==this._modes.list?t.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler():this.scrollSlot("down")},up:function(){this._getMode()==this._modes.list?t.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler():this.scrollSlot("up")},"shift+down":function(){this.moveTo(this.extendSlot(this,"down"))},"shift+up":function(){this.moveTo(this.extendSlot(this,"up"))},"shift+right":function(){this.moveTo(this.extendSlot(this,"right"))},"shift+left":function(){this.moveTo(this.extendSlot(this,"left"))},enter:function(){var r={start_date:new Date(this.start_date),end_date:new Date(this.end_date)},d=t.getState().mode;t.matrix&&t.matrix[d]?r[t.matrix[t.getState().mode].y_property]=this.section:t._props&&t._props[d]&&(r[t._props[d].map_to]=this.section),t.addEventNow(r)}}}),t.$keyboardNavigation.TimeSlot.prototype.bindAll(t.$keyboardNavigation.TimeSlot.prototype.keys)}(e),function(t){t.$keyboardNavigation.MinicalButton=function(r,d){this.container=r,this.index=d||0},t.$keyboardNavigation.MinicalButton.prototype=t._compose(t.$keyboardNavigation.KeyNavNode,{isValid:function(){return!!this.container.offsetWidth},fallback:function(){var r=new t.$keyboardNavigation.TimeSlot;return r.isValid()?r:new t.$keyboardNavigation.DataArea},focus:function(){t.$keyboardNavigation.dispatcher.globalNode.disable(),this.container.removeAttribute("tabindex"),t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this)},blur:function(){this.container.setAttribute("tabindex","0"),t.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this)},getNode:function(){return this.index?this.container.querySelector(".dhx_cal_next_button"):this.container.querySelector(".dhx_cal_prev_button")},keys:{right:function(r){this.moveTo(new t.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},left:function(r){this.moveTo(new t.$keyboardNavigation.MinicalButton(this.container,this.index?0:1))},down:function(){var r=new t.$keyboardNavigation.MinicalCell(this.container,0,0);r&&!r.isValid()&&(r=r.fallback()),this.moveTo(r)},enter:function(r){this.getNode().click()}}}),t.$keyboardNavigation.MinicalButton.prototype.bindAll(t.$keyboardNavigation.MinicalButton.prototype.keys)}(e),function(t){t.$keyboardNavigation.MinicalCell=function(r,d,n){this.container=r,this.row=d||0,this.col=n||0},t.$keyboardNavigation.MinicalCell.prototype=t._compose(t.$keyboardNavigation.KeyNavNode,{isValid:function(){var r=this._getGrid();return!(!r[this.row]||!r[this.row][this.col])},fallback:function(){var r=this.row,d=this.col,n=this._getGrid();n[r]||(r=0);var s=!0;if(r>n.length/2&&(s=!1),!n[r]){var _=new t.$keyboardNavigation.TimeSlot;return _.isValid()?_:new t.$keyboardNavigation.DataArea}if(s){for(var a=d;n[r]&&a-1||l.indexOf("dhx_before")>-1||l.indexOf("dhx_scale_ignore")>-1)&&(o=!1),d[n][_]=o}}return d},keys:{right:function(r){var d=this._getGrid(),n=this.row,s=this.col+1;d[n]&&d[n][s]||(d[n+1]?(n+=1,s=0):s=this.col);var _=new t.$keyboardNavigation.MinicalCell(this.container,n,s);_.isValid()||(_=_.fallback()),this.moveTo(_)},left:function(r){var d=this._getGrid(),n=this.row,s=this.col-1;d[n]&&d[n][s]||(s=d[n-1]?d[n-=1].length-1:this.col);var _=new t.$keyboardNavigation.MinicalCell(this.container,n,s);_.isValid()||(_=_.fallback()),this.moveTo(_)},down:function(){var r=this._getGrid(),d=this.row+1,n=this.col;r[d]&&r[d][n]||(d=this.row);var s=new t.$keyboardNavigation.MinicalCell(this.container,d,n);s.isValid()||(s=s.fallback()),this.moveTo(s)},up:function(){var r=this._getGrid(),d=this.row-1,n=this.col;if(r[d]&&r[d][n]){var s=new t.$keyboardNavigation.MinicalCell(this.container,d,n);s.isValid()||(s=s.fallback()),this.moveTo(s)}else{var _=0;this.col>r[this.row].length/2&&(_=1),this.moveTo(new t.$keyboardNavigation.MinicalButton(this.container,_))}},enter:function(r){this.getNode().querySelector(".dhx_month_head").click()}}}),t.$keyboardNavigation.MinicalCell.prototype.bindAll(t.$keyboardNavigation.MinicalCell.prototype.keys)}(e),function(t){t.$keyboardNavigation.DataArea=function(r){this.index=r||0},t.$keyboardNavigation.DataArea.prototype=t._compose(t.$keyboardNavigation.KeyNavNode,{getNode:function(r){return t.$container.querySelector(".dhx_cal_data")},_handlers:null,isValid:function(){return!0},fallback:function(){return this},keys:{"up,down,right,left":function(){this.moveTo(new t.$keyboardNavigation.TimeSlot)}}}),t.$keyboardNavigation.DataArea.prototype.bindAll(t.$keyboardNavigation.DataArea.prototype.keys)}(e),Ma(e),function(t){t.$keyboardNavigation.dispatcher={isActive:!1,activeNode:null,globalNode:new t.$keyboardNavigation.SchedulerNode,keepScrollPosition:function(r){var d,n,s=t.$container.querySelector(".dhx_timeline_scrollable_data");s||(s=t.$container.querySelector(".dhx_cal_data")),s&&(d=s.scrollTop,n=s.scrollLeft),r(),s&&(s.scrollTop=d,s.scrollLeft=n)},enable:function(){if(t.$container){this.isActive=!0;var r=this;this.keepScrollPosition(function(){r.globalNode.enable(),r.setActiveNode(r.getActiveNode())})}},disable:function(){this.isActive=!1,this.globalNode.disable()},isEnabled:function(){return!!this.isActive},getDefaultNode:function(){return this.globalNode.getDefaultNode()},setDefaultNode:function(){this.setActiveNode(this.getDefaultNode())},getActiveNode:function(){var r=this.activeNode;return r&&!r.isValid()&&(r=r.fallback()),r},focusGlobalNode:function(){this.blurNode(this.globalNode),this.focusNode(this.globalNode)},setActiveNode:function(r){r&&r.isValid()&&(this.activeNode&&this.activeNode.compareTo(r)||this.isEnabled()&&(this.blurNode(this.activeNode),this.activeNode=r,this.focusNode(this.activeNode)))},focusNode:function(r){r&&r.focus&&(r.focus(),r.getNode&&document.activeElement!=r.getNode()&&this.setActiveNode(new t.$keyboardNavigation.DataArea))},blurNode:function(r){r&&r.blur&&r.blur()},getInlineEditor:function(r){var d=t.$container.querySelector(".dhx_cal_editor["+t.config.event_attribute+"='"+r+"'] textarea");return d&&d.offsetWidth?d:null},keyDownHandler:function(r){if(!r.defaultPrevented){var d=this.getActiveNode();if((!t.$keyboardNavigation.isModal()||d&&d.container&&t.utils.dom.locateCss({target:d.container},"dhx_minical_popup",!1))&&(!t.getState().editor_id||!this.getInlineEditor(t.getState().editor_id))&&this.isEnabled()){r=r||window.event;var n=this.globalNode,s=t.$keyboardNavigation.shortcuts.getCommandFromEvent(r);d?d.findHandler(s)?d.doAction(s,r):n.findHandler(s)&&n.doAction(s,r):this.setDefaultNode()}}},_timeout:null,delay:function(r,d){clearTimeout(this._timeout),this._timeout=setTimeout(r,d||1)}}}(e),Ta(e),function(){Aa(e),function(_){_.$keyboardNavigation._minicalendars=[],_.$keyboardNavigation.isMinical=function(a){for(var o=_.$keyboardNavigation._minicalendars,l=0;l=e.config.collision_limit}),e.addEvent=function(t,r,d,n,s){var _=t;arguments.length!=1&&((_=s||{}).start_date=t,_.end_date=r,_.text=d,_.id=n,_.layer=this.defaultLayer),_.id=_.id||e.uid(),_.text=_.text||"",typeof _.start_date=="string"&&(_.start_date=this.templates.api_date(_.start_date)),typeof _.end_date=="string"&&(_.end_date=this.templates.api_date(_.end_date)),_._timed=this.isOneDayEvent(_);var a=!this._events[_.id];this._events[_.id]=_,this.event_updated(_),this._loading||this.callEvent(a?"onEventAdded":"onEventChanged",[_.id,_])},this._evs_layer={};for(var i=0;i_.getHours()&&(_.setHours(a),t=_.valueOf()),r=t+s}n.start_date=n.start_date||_,n.end_date=n.end_date||new Date(r),n.text=n.text||this.locale.labels.new_event,n.id=this._drag_id=this.uid(),n.layer=this.defaultLayer,this._drag_mode="new-size",this._loading=!0,this.addEvent(n),this.callEvent("onEventCreated",[this._drag_id,d]),this._loading=!1,this._drag_event={},this._on_mouse_up(d)},e._t_render_view_data=function(t){if(this.config.multi_day&&!this._table_view){for(var r=[],d=[],n=0;n';return k+='
 
',k+='
'+a+"
",k+='
'+o+"
",k+='
',v.innerHTML=k,v.style.zIndex=100,v.firstChild},e.render_event_bar=function(t){var r=this._els.dhx_cal_data[0],d=this._colsS[t._sday],n=this._colsS[t._eday];n==d&&(n=this._colsS[t._eday+1]);var s=this.xy.bar_height,_=this._colsS.heights[t._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+t._sorder*s,a=document.createElement("div"),o=t._timed?"dhx_cal_event_clear":"dhx_cal_event_line",l=e.templates["event_class_"+t.layer]?e.templates["event_class_"+t.layer](t.start_date,t.end_date,t):e.templates.event_class(t.start_date,t.end_date,t);l&&(o=o+" "+l);var h='
';t._timed&&(h+=e.templates["event_bar_date_"+t.layer]?e.templates["event_bar_date_"+t.layer](t.start_date,t.end_date,t):e.templates.event_bar_date(t.start_date,t.end_date,t)),h+=e.templates["event_bar_text_"+t.layer]?e.templates["event_bar_text_"+t.layer](t.start_date,t.end_date,t):e.templates.event_bar_text(t.start_date,t.end_date,t)+"
)",h+="
",a.innerHTML=h,this._rendered.push(a.firstChild),r.appendChild(a.firstChild)},e.render_event=function(t){var r=e.xy.menu_width;if(e.getLayer(t.layer).noMenu&&(r=0),!(t._sday<0)){var d=e.locate_holder(t._sday);if(d){var n=60*t.start_date.getHours()+t.start_date.getMinutes(),s=60*t.end_date.getHours()+t.end_date.getMinutes()||60*e.config.last_hour,_=Math.round((60*n*1e3-60*this.config.first_hour*60*1e3)*this.config.hour_size_px/36e5)%(24*this.config.hour_size_px)+1,a=Math.max(e.xy.min_event_height,(s-n)*this.config.hour_size_px/60)+1,o=Math.floor((d.clientWidth-r)/t._count),l=t._sorder*o+1;t._inner||(o*=t._count-t._sorder);var h=this._render_v_bar(t.id,r+l,_,o,a,t._text_style,e.templates.event_header(t.start_date,t.end_date,t),e.templates.event_text(t.start_date,t.end_date,t));if(this._rendered.push(h),d.appendChild(h),l=l+parseInt(d.style.left,10)+r,_+=this._dy_shift,h.style.zIndex=this._layers_zindex[t.layer],this._edit_id==t.id){h.style.zIndex=parseInt(h.style.zIndex)+1;var v=h.style.zIndex;o=Math.max(o-4,e.xy.editor_width),(h=document.createElement("div")).setAttribute("event_id",t.id),h.setAttribute(this.config.event_attribute,t.id),this.set_xy(h,o,a-20,l,_+14),h.className="dhx_cal_editor",h.style.zIndex=v;var u=document.createElement("div");this.set_xy(u,o-6,a-26),u.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;",u.style.zIndex=v,h.appendChild(u),this._els.dhx_cal_data[0].appendChild(h),this._rendered.push(h),u.innerHTML="",this._editor=u.firstChild,this._editor.addEventListener("keypress",function(g){if(g.shiftKey)return!0;var y=g.keyCode;y==e.keys.edit_save&&e.editStop(!0),y==e.keys.edit_cancel&&e.editStop(!1)}),this._editor.addEventListener("selectstart",function(g){return g.cancelBubble=!0,!0}),u.firstChild.focus(),this._els.dhx_cal_data[0].scrollLeft=0,u.firstChild.select()}if(this._select_id==t.id){h.style.zIndex=parseInt(h.style.zIndex)+1;for(var f=this.config["icons_"+(this._edit_id==t.id?"edit":"select")],c="",p=0;p";var m=this._render_v_bar(t.id,l-r+1,_,r,20*f.length+26,"","
",c,!0);m.style.left=l-r+1,m.style.zIndex=h.style.zIndex,this._els.dhx_cal_data[0].appendChild(m),this._rendered.push(m)}}}},e.filter_agenda=function(t,r){var d=e.getLayer(r.layer);return d&&d.visible}})},limit:function(e){e.config.limit_start=null,e.config.limit_end=null,e.config.limit_view=!1,e.config.check_limits=!0,e._temp_limit_scope=function(){var i=null;e.attachEvent("onBeforeViewChange",function(t,r,d,n){function s(_,a){var o=e.config.limit_start,l=e.config.limit_end,h=e.date.add(_,1,a);return _.valueOf()>l.valueOf()||h<=o.valueOf()}return!e.config.limit_view||!s(n=n||r,d=d||t)||r.valueOf()==n.valueOf()||(setTimeout(function(){if(e.$destroyed)return!0;var _=s(r,d)?e.config.limit_start:r;e.setCurrentView(s(_,d)?null:_,d)},1),!1)}),e.attachEvent("onMouseDown",function(t){return t!="dhx_time_block"}),e.attachEvent("onBeforeDrag",function(t){return!t||e.checkLimitViolation(e.getEvent(t))}),e.attachEvent("onClick",function(t,r){return e.checkLimitViolation(e.getEvent(t))}),e.attachEvent("onBeforeLightbox",function(t){var r=e.getEvent(t);return i=[r.start_date,r.end_date],e.checkLimitViolation(r)}),e.attachEvent("onEventSave",function(t,r,d){if(!r.start_date||!r.end_date){var n=e.getEvent(t);r.start_date=new Date(n.start_date),r.end_date=new Date(n.end_date)}if(r.rec_type){var s=e._lame_clone(r);return e._roll_back_dates(s),e.checkLimitViolation(s)}return e.checkLimitViolation(r)}),e.attachEvent("onEventAdded",function(t){if(!t)return!0;var r=e.getEvent(t);return!e.checkLimitViolation(r)&&e.config.limit_start&&e.config.limit_end&&(r.start_date=e.config.limit_end.valueOf()&&(r.start_date=this.date.add(e.config.limit_end,-1,"day")),r.end_date=e.config.limit_end.valueOf()&&(r.end_date=this.date.add(e.config.limit_end,-1,"day")),r.start_date.valueOf()>=r.end_date.valueOf()&&(r.end_date=this.date.add(r.start_date,this.config.event_duration||this.config.time_step,"minute")),r._timed=this.isOneDayEvent(r)),!0}),e.attachEvent("onEventChanged",function(t){if(!t)return!0;var r=e.getEvent(t);if(!e.checkLimitViolation(r)){if(!i)return!1;r.start_date=i[0],r.end_date=i[1],r._timed=this.isOneDayEvent(r)}return!0}),e.attachEvent("onBeforeEventChanged",function(t,r,d){return e.checkLimitViolation(t)}),e.attachEvent("onBeforeEventCreated",function(t){var r=e.getActionData(t).date,d={_timed:!0,start_date:r,end_date:e.date.add(r,e.config.time_step,"minute")};return e.checkLimitViolation(d)}),e.attachEvent("onViewChange",function(){e._mark_now()}),e.attachEvent("onAfterSchedulerResize",function(){return window.setTimeout(function(){if(e.$destroyed)return!0;e._mark_now()},1),!0}),e.attachEvent("onTemplatesReady",function(){e._mark_now_timer=window.setInterval(function(){e._is_initialized()&&e._mark_now()},6e4)}),e.attachEvent("onDestroy",function(){clearInterval(e._mark_now_timer)})},e._temp_limit_scope()},map_view:function(e){let i=null,t=[];const r={googleMap:new Ca(e),openStreetMaps:new Oa(e),mapbox:new La(e)};function d(s){i=s.ext.mapView.createAdapter(),t.push(e.attachEvent("onEventSave",function(_,a,o){let l=e.getEvent(_);return l&&l.event_location!=a.event_location&&(e._eventLocationChanged=!0),!0}),e.attachEvent("onEventChanged",(_,a)=>{const{start_date:o,end_date:l}=a,{min_date:h,max_date:v}=e.getState();return o.valueOf()h.valueOf()&&i&&(e.config.map_settings.resolve_event_location&&a.event_location&&!e._latLngUpdate?n(a,i):i.updateEventMarker(a)),e._latLngUpdate=!1,!0}),e.attachEvent("onEventIdChange",function(_,a){let o=e.getEvent(a);i==null||i.removeEventMarker(_),i==null||i.addEventMarker(o)}),e.attachEvent("onEventAdded",(_,a)=>{const{start_date:o,end_date:l}=a,{min_date:h,max_date:v}=e.getState();o.valueOf()h.valueOf()&&i&&(e.config.map_settings.resolve_event_location&&a.event_location&&e._eventLocationChanged?(n(a,i),e._eventLocationChanged=!1):(i.addEventMarker(a),i.onEventClick(a)))}),e.attachEvent("onClick",function(_,a){const o=e.getEvent(_);return i&&o&&i.onEventClick(o),!1}),e.attachEvent("onBeforeEventDelete",(_,a)=>(i&&i.removeEventMarker(_),!0)))}async function n(s,_){let a=await _.resolveAddress(s.event_location);return s.lat=a.lat,s.lng=a.lng,_.removeEventMarker(String(s.id)),_.addEventMarker(s),s}e.ext||(e.ext={}),e.ext.mapView={createAdapter:function(){return r[e.config.map_view_provider]},createMarker:function(s){return new google.maps.Marker(s)},currentAdapter:null,adapters:r},e._latLngUpdate=!1,e._eventLocationChanged=!1,e.config.map_view_provider="googleMap",e.config.map_settings={initial_position:{lat:48.724,lng:8.215},error_position:{lat:15,lng:15},initial_zoom:1,zoom_after_resolve:15,info_window_max_width:300,resolve_user_location:!0,resolve_event_location:!0,view_provider:"googleMap"},e.config.map_initial_position&&(e.config.map_settings.initial_position={lat:e.config.map_initial_position.lat(),lng:e.config.map_initial_position.lng()}),e.config.map_error_position&&(e.config.map_settings.error_position={lat:e.config.map_error_position.lat(),lng:e.config.map_error_position.lng()}),e.xy.map_date_width=188,e.xy.map_icon_width=25,e.xy.map_description_width=400,e.date.add_map=function(s,_,a){return new Date(s.valueOf())},e.templates.map_date=function(s,_,a){return""},e.templates.map_time=function(s,_,a){return e.config.rtl&&!a._timed?e.templates.day_date(_)+" – "+e.templates.day_date(s):a._timed?this.day_date(a.start_date,a.end_date,a)+" "+this.event_date(s):e.templates.day_date(s)+" – "+e.templates.day_date(_)},e.templates.map_text=function(s,_,a){return a.text},e.templates.map_info_content=function(s){return`
Event's text: ${s.text} +
Location: ${s.event_location}
+
Starts: ${e.templates.tooltip_date_format(s.start_date)}
+
Ends: ${e.templates.tooltip_date_format(s.end_date)}
+
`},e.date.map_start=function(s){return s},e.dblclick_dhx_map_area=function(s){let _=s.target.closest(`[${e.config.event_attribute}]`);if(_){let a=_.getAttribute(`${e.config.event_attribute}`);e.showLightbox(a)}this.config.readonly||!this.config.dblclick_create||_||this.addEventNow({start_date:e.config.map_start,end_date:e.date.add(e.config.map_start,e.config.time_step,"minute")})},e.attachEvent("onSchedulerReady",function(){e.config.map_initial_zoom!==void 0&&(e.config.map_settings.initial_zoom=e.config.map_initial_zoom),e.config.map_zoom_after_resolve!==void 0&&(e.config.map_settings.zoom_after_resolve=e.config.map_zoom_after_resolve),e.config.map_infowindow_max_width!==void 0&&(e.config.map_settings.info_window_max_width=e.config.map_infowindow_max_width),e.config.map_resolve_user_location!==void 0&&(e.config.map_settings.resolve_user_location=e.config.map_resolve_user_location),e.config.map_view_provider!==void 0&&(e.config.map_settings.view_provider=e.config.map_view_provider),e.config.map_type!==void 0&&(e.config.map_settings.type=e.config.map_type),e.config.map_resolve_event_location!==void 0&&(e.config.map_settings.resolve_event_location=e.config.map_resolve_event_location),e.ext.mapView.currentAdapter=e.config.map_view_provider;let s=document.createElement("div");s.className="mapContainer",s.id="mapContainer",s.style.display="none",s.style.zIndex="1",e._obj.appendChild(s);const _=e.render_data;function a(){let l=e.get_visible_events();l.sort(function(f,c){return f.start_date.valueOf()==c.start_date.valueOf()?f.id>c.id?1:-1:f.start_date>c.start_date?1:-1});let h="
";for(let f=0;f
"+e.templates.map_time(c.start_date,c.end_date,c)+"
",h+=`
-
`,v+="
"+e.templates.map_text(l.start_date,l.end_date,l)+"
"}v+="
",e._els.dhx_cal_data[0].scrollTop=0,e._els.dhx_cal_data[0].innerHTML=v;var b=e._els.dhx_cal_data[0].firstChild.childNodes,k=e._getNavDateElement();for(k&&(k.innerHTML=e.templates[e._mode+"_date"](e._min_date,e._max_date,e._mode)),e._rendered=[],m=0;m
"+p.date+"
"+p.description+"
",e._table_view=!0,e.set_sizes()}}(u),u){(function(){e._selected_event_id=null,e.map._infowindow.close();var g=e.map._markers;for(var p in g)g.hasOwnProperty(p)&&(g[p].setMap(null),delete e.map._markers[p],e.map._infowindows_content[p]&&delete e.map._infowindows_content[p])})(),_(),m.style.display="block",o("dhx_gmap"),v=e.map._obj.getCenter();for(var l=e.get_visible_events(),f=0;fe._min_date||v.start_datee._max_date||v.start_date.valueOf()>=e._min_date&&v.end_date.valueOf()<=e._max_date?(e.map._markers[u]&&e.map._markers[u].setMap(null),s(v)):(e._selected_event_id=null,e.map._infowindow.close(),e.map._markers[u]&&e.map._markers[u].setMap(null)),!0}),e.attachEvent("onEventIdChange",function(u,v){var m=e.getEvent(v);return(m.start_datee._min_date||m.start_datee._max_date||m.start_date.valueOf()>=e._min_date&&m.end_date.valueOf()<=e._max_date)&&(e.map._markers[u]&&(e.map._markers[u].setMap(null),delete e.map._markers[u]),e.map._infowindows_content[u]&&delete e.map._infowindows_content[u],s(m)),!0}),e.attachEvent("onEventAdded",function(u,v){return e._dataprocessor||(v.start_datee._min_date||v.start_datee._max_date||v.start_date.valueOf()>=e._min_date&&v.end_date.valueOf()<=e._max_date)&&(e.map._markers[u]&&e.map._markers[u].setMap(null),s(v)),!0}),e.attachEvent("onBeforeEventDelete",function(u,v){return e.map._markers[u]&&e.map._markers[u].setMap(null),e._selected_event_id=null,e.map._infowindow.close(),!0}),e._event_resolve_delay=1500,e.attachEvent("onEventLoading",function(u){return e.config.map_resolve_event_location&&u.event_location&&!u.lat&&!u.lng&&(e._event_resolve_delay+=1500,function(v,m,l,f){setTimeout(function(){if(e.$destroyed)return!0;var g=v.apply(m,l);return v=m=l=null,g},f||1)}(c,this,[u],e._event_resolve_delay)),!0}),e.attachEvent("onEventCancel",function(u,v){return v&&(e.map._markers[u]&&e.map._markers[u].setMap(null),e.map._infowindow.close()),!0})})},minical:function(e){const h=e._createDomEventScope();e.config.minicalendar={mark_events:!0},e._synced_minicalendars=[],e.renderCalendar=function(a,r,d){var i=null,_=a.date||e._currentDate();if(typeof _=="string"&&(_=this.templates.api_date(_)),r)i=this._render_calendar(r.parentNode,_,a,r),e.unmarkCalendar(i);else{var o=a.container,t=a.position;if(typeof o=="string"&&(o=document.getElementById(o)),typeof t=="string"&&(t=document.getElementById(t)),t&&t.left===void 0&&t.right===void 0){var n=e.$domHelpers.getOffset(t);t={top:n.top+t.offsetHeight,left:n.left}}o||(o=e._get_def_cont(t)),(i=this._render_calendar(o,_,a)).$_eventAttached||(i.$_eventAttached=!0,h.attach(i,"click",(function(p){var y=p.target||p.srcElement,w=e.$domHelpers;if(w.closest(y,".dhx_month_head")&&!w.closest(y,".dhx_after")&&!w.closest(y,".dhx_before")){var b=w.closest(y,"[data-cell-date]").getAttribute("data-cell-date"),k=e.templates.parse_date(b);e.unmarkCalendar(this),e.markCalendar(this,k,"dhx_calendar_click"),this._last_date=k,this.conf.handler&&this.conf.handler.call(e,k,this)}}).bind(i)))}if(e.config.minicalendar.mark_events)for(var s=e.date.month_start(_),c=e.date.add(s,1,"month"),u=this.getEvents(s,c),v=this["filter_"+this._mode],m={},l=0;l=c.valueOf())););}}return this._markCalendarCurrentDate(i),i.conf=a,a.sync&&!d&&this._synced_minicalendars.push(i),i.conf._on_xle_handler||(i.conf._on_xle_handler=e.attachEvent("onXLE",function(){e.updateCalendar(i,i.conf.date)})),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&i.setAttribute("role","application"),i},e._get_def_cont=function(a){return this._def_count||(this._def_count=document.createElement("div"),this._def_count.className="dhx_minical_popup",e.event(this._def_count,"click",function(r){r.cancelBubble=!0}),document.body.appendChild(this._def_count)),a.left&&(this._def_count.style.left=a.left+"px"),a.right&&(this._def_count.style.right=a.right+"px"),a.top&&(this._def_count.style.top=a.top+"px"),a.bottom&&(this._def_count.style.bottom=a.bottom+"px"),this._def_count._created=new Date,this._def_count},e._locateCalendar=function(a,r){if(typeof r=="string"&&(r=e.templates.api_date(r)),+r>+a._max_date||+r<+a._min_date)return null;for(var d=a.querySelector(".dhx_year_body").childNodes[0],i=0,_=new Date(a._min_date);+this.date.add(_,1,"week")<=+r;)_=this.date.add(_,1,"week"),i++;var o=e.config.start_on_monday,t=(r.getDay()||(o?7:0))-(o?1:0);const n=d.querySelector(`.dhx_cal_month_row:nth-child(${i+1}) .dhx_cal_month_cell:nth-child(${t+1})`);return n?n.firstChild:null},e.markCalendar=function(a,r,d){var i=this._locateCalendar(a,r);i&&(i.className+=" "+d)},e.unmarkCalendar=function(a,r,d){if(d=d||"dhx_calendar_click",r=r||a._last_date){var i=this._locateCalendar(a,r);i&&(i.className=(i.className||"").replace(RegExp(d,"g")))}},e._week_template=function(a){for(var r=a||250,d=0,i=document.createElement("div"),_=this.date.week_start(e._currentDate()),o=0;o<7;o++)this._cols[o]=Math.floor(r/(7-o)),this._render_x_header(o,d,_,i),_=this.date.add(_,1,"day"),r-=this._cols[o],d+=this._cols[o];return i.lastChild.className+=" dhx_scale_bar_last",i},e.updateCalendar=function(a,r){a.conf.date=r,this.renderCalendar(a.conf,a,!0)},e._mini_cal_arrows=[" "," "],e._render_calendar=function(a,r,d,i){var _=e.templates,o=this._cols;this._cols=[];var t=this._mode;this._mode="calendar";var n=this._colsS;this._colsS={height:0};var s=new Date(this._min_date),c=new Date(this._max_date),u=new Date(e._date),v=_.month_day,m=this._ignores_detected;this._ignores_detected=0,_.month_day=_.calendar_date,r=this.date.month_start(r);var l,f=this._week_template(a.offsetWidth-1-this.config.minicalendar.padding);i?l=i:(l=document.createElement("div")).className="dhx_cal_container dhx_mini_calendar",l.setAttribute("date",this._helpers.formatDate(r)),l.innerHTML="
":"'>")+"
"+(f?f.innerHTML:"")+"
";var g=l.querySelector(".dhx_year_month"),p=l.querySelector(".dhx_year_week"),y=l.querySelector(".dhx_year_body");if(g.innerHTML=this.templates.calendar_month(r),d.navigation)for(var w=function(H,V){var z=e.date.add(H._date,V,"month");e.updateCalendar(H,z),e._date.getMonth()==H._date.getMonth()&&e._date.getFullYear()==H._date.getFullYear()&&e._markCalendarCurrentDate(H)},b=["dhx_cal_prev_button","dhx_cal_next_button"],k=["left:1px;top:4px;position:absolute;","left:auto; right:1px;top:4px;position:absolute;"],E=[-1,1],D=function(H){return function(){if(d.sync)for(var V=e._synced_minicalendars,z=0;z500)&&(a=this._def_count.firstChild),a&&(h.detachAll(),a.innerHTML="",a.parentNode&&a.parentNode.removeChild(a),this._def_count&&(this._def_count.style.top="-1000px"),a.conf&&a.conf._on_xle_handler&&e.detachEvent(a.conf._on_xle_handler))},e.isCalendarVisible=function(){return!!(this._def_count&&parseInt(this._def_count.style.top,10)>0)&&this._def_count},e.attachEvent("onTemplatesReady",function(){e.event(document.body,"click",function(){e.destroyCalendar()})},{once:!0}),e.form_blocks.calendar_time={render:function(a){var r="",d=e.config,i=this.date.date_part(e._currentDate()),_=1440,o=0;d.limit_time_select&&(o=60*d.first_hour,_=60*d.last_hour+1),i.setHours(o/60),a._time_values=[],r+=" ")+"  –  "+r+""},set_value:function(a,r,d,i){var _,o,t=a.getElementsByTagName("input"),n=a.getElementsByTagName("select"),s=function(g,p,y){e.event(g,"click",function(){e.destroyCalendar(null,!0),e.renderCalendar({position:g,date:new Date(this._date),navigation:!0,handler:function(w){g.value=e.templates.calendar_time(w),g._date=new Date(w),e.destroyCalendar(),e.config.event_duration&&e.config.auto_end_date&&y===0&&m()}})})};if(e.config.full_day){if(!a._full_day){var c="";e.config.wide_form||(c=a.previousSibling.innerHTML+c),a.previousSibling.innerHTML=c,a._full_day=!0}var u=a.previousSibling.getElementsByTagName("input")[0],v=e.date.time_part(d.start_date)===0&&e.date.time_part(d.end_date)===0;u.checked=v,n[0].disabled=u.checked,n[1].disabled=u.checked,u.$_eventAttached||(u.$_eventAttached=!0,e.event(u,"click",function(){if(u.checked===!0){var g={};e.form_blocks.calendar_time.get_value(a,g),_=e.date.date_part(g.start_date),(+(o=e.date.date_part(g.end_date))==+_||+o>=+_&&(d.end_date.getHours()!==0||d.end_date.getMinutes()!==0))&&(o=e.date.add(o,1,"day"))}var p=_||d.start_date,y=o||d.end_date;l(t[0],p),l(t[1],y),n[0].value=60*p.getHours()+p.getMinutes(),n[1].value=60*y.getHours()+y.getMinutes(),n[0].disabled=u.checked,n[1].disabled=u.checked}))}if(e.config.event_duration&&e.config.auto_end_date){var m=function(){e.config.auto_end_date&&e.config.event_duration&&(_=e.date.add(t[0]._date,n[0].value,"minute"),o=new Date(_.getTime()+60*e.config.event_duration*1e3),t[1].value=e.templates.calendar_time(o),t[1]._date=e.date.date_part(new Date(o)),n[1].value=60*o.getHours()+o.getMinutes())};n[0].$_eventAttached||n[0].addEventListener("change",m)}function l(g,p,y){s(g,p,y),g.value=e.templates.calendar_time(p),g._date=e.date.date_part(new Date(p))}function f(g){for(var p=i._time_values,y=60*g.getHours()+g.getMinutes(),w=y,b=!1,k=0;k=t.valueOf()))for(var n=d;n.valueOf()n&&e.markCalendar(a,n,"dhx_calendar_click"),n=e.date.add(n,1,"day")},e.attachEvent("onEventCancel",function(){e.destroyCalendar(null,!0)}),e.attachEvent("onDestroy",function(){e.destroyCalendar()})},monthheight:function(e){e.attachEvent("onTemplatesReady",function(){e.xy.scroll_width=0;var h=e.render_view_data;e.render_view_data=function(){var r=this._els.dhx_cal_data[0];r.firstChild._h_fix=!0,h.apply(e,arguments);var d=parseInt(r.style.height);r.style.height="1px",r.style.height=r.scrollHeight+"px",this._obj.style.height=this._obj.clientHeight+r.scrollHeight-d+"px"};var a=e._reset_month_scale;e._reset_month_scale=function(r,d,i,_){var o={clientHeight:100};a.apply(e,[o,d,i,_]),r.innerHTML=o.innerHTML}})},multisection:function(e){q("Multisection",e.assert)},multiselect:function(e){e.form_blocks.multiselect={render:function(h){var a="dhx_multi_select_control dhx_multi_select_"+h.name;h.vertical&&(a+=" dhx_multi_select_control_vertical");for(var r="
",d=0;d"+h.options[d].label+"";return r+="
"},set_value:function(h,a,r,d){for(var i=h.getElementsByTagName("input"),_=0;_]*>","g"),d=new RegExp("]*>","g");function i(b){return b.replace(d,` -`).replace(r,"")}function _(b,k){b=parseFloat(b),k=parseFloat(k),isNaN(k)||(b-=k);var E=t(b);return b=b-E.width+E.cols*h,isNaN(b)?"auto":100*b/h}function o(b,k,E){b=parseFloat(b),k=parseFloat(k),!isNaN(k)&&E&&(b-=k);var D=t(b);return b=b-D.width+D.cols*h,isNaN(b)?"auto":100*b/(h-(isNaN(k)?0:k))}function t(b){for(var k=0,E=e._els.dhx_cal_header[0].childNodes,D=E[1]?E[1].childNodes:E[0].childNodes,x=0;xN))break;b-=N+1,k+=N+1}return{width:k,cols:x}}function n(b){return b=parseFloat(b),isNaN(b)?"auto":100*b/a}function s(b,k){return(window.getComputedStyle?window.getComputedStyle(b,null)[k]:b.currentStyle?b.currentStyle[k]:null)||""}function c(b,k){for(var E=parseInt(b.style.left,10),D=0;DE)return D;return k}function v(b){return b?"":""}function m(b,k,E,D){var x="<"+b+" profile='"+k+"'";return E&&(x+=" header='"+E+"'"),D&&(x+=" footer='"+D+"'"),x+=">"}function l(){var b="",k=e._mode;if(e.matrix&&e.matrix[e._mode]&&(k=e.matrix[e._mode].render=="cell"?"matrix":"timeline"),b+="",e._mode=="week_agenda")for(var E=e._els.dhx_cal_data[0].getElementsByTagName("DIV"),D=0;D"+i(E[D].innerHTML)+"");else if(e._mode=="agenda"||e._mode=="map")b+=""+i((E=e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML)+""+i(E[1].innerHTML)+"";else if(e._mode=="year")for(E=e._els.dhx_cal_data[0].childNodes,D=0;D",b+=g(E[D].querySelector(".dhx_year_week").childNodes),b+=f(E[D].querySelector(".dhx_year_body")),b+="";else{b+="",b+=g(E=e._els.dhx_cal_header[0].childNodes),b+="";var x=e._els.dhx_cal_data[0];if(e.matrix&&e.matrix[e._mode]){for(b+="",D=0;D";b+="",a=x.firstChild.rows[0].cells[0].offsetHeight}else if(x.firstChild.tagName=="TABLE")b+=f(x);else{for(x=x.childNodes[x.childNodes.length-1];x.className.indexOf("dhx_scale_holder")==-1;)x=x.previousSibling;for(x=x.childNodes,b+="",D=0;D";b+="",a=x[0].offsetHeight}}return b+=""}function f(b){for(var k="",E=b.querySelectorAll("tr"),D=0;D",a=S[0].offsetHeight}return k}function g(b){var k,E="";e.matrix&&e.matrix[e._mode]&&(e.matrix[e._mode].second_scale&&(k=b[1].childNodes),b=b[0].childNodes);for(var D=0;D";if(h=b[0].offsetWidth,k){var x=0,S=b[0].offsetWidth,N=1;for(D=0;D",(x+=k[D].offsetWidth)>=S&&(S+=b[N]?b[N].offsetWidth:0,N++),h=k[0].offsetWidth}return E}function p(b){var k="",E=e._rendered,D=e.matrix&&e.matrix[e._mode];if(e._mode=="agenda"||e._mode=="map")for(var x=0;x";else if(e._mode=="week_agenda")for(x=0;x"+i(E[x].innerHTML)+"";else if(e._mode=="year")for(E=e.get_visible_events(),x=0;x",(S=e.date.add(S,1,"day")).valueOf()>=e._max_date.valueOf())break}}else if(D&&D.render=="cell")for(E=e._els.dhx_cal_data[0].getElementsByTagName("TD"),x=0;x";else for(x=0;x",z=="event"?(k+="
",A=b?s(E[x].childNodes[2],"color"):"",k+=""):(A=b?s(E[x],"color"):"",k+=""),k+=""}}}}return k}function y(b,k,E,D,x,S){var N=!1;D=="fullcolor"&&(N=!0,D="color"),D=D||"color";var M,A="";if(b){var C=e._date,T=e._mode;k=e.date[E+"_start"](k),k=e.date["get_"+E+"_end"]?e.date["get_"+E+"_end"](k):e.date.add(k,1,E),A=m("pages",D,x,S);for(var O=new Date(b);+O<+k;O=this.date.add(O,1,E))this.setCurrentView(O,E),A+=((M="page")?"<"+M+">":"")+l().replace("–","-")+p(N)+v("page");A+=v("pages"),this.setCurrentView(C,T)}else A=m("data",D,x,S)+l().replace("–","-")+p(N)+v("data");return A}function w(b,k,E,D,x,S,N){(function(M,A){var C=e.uid(),T=document.createElement("div");T.style.display="none",document.body.appendChild(T),T.innerHTML='
',document.getElementById(C).firstChild.value=encodeURIComponent(M),document.getElementById(C).submit(),T.parentNode.removeChild(T)})(typeof x=="object"?function(M){for(var A="",C=0;Cwindow.innerWidth&&(i=window.innerWidth-r),i=Math.max(0,i),a.style.left=i+"px",a.style.top=h.top-(h.dy?d:-h.height)+"px"}else{const _=e.$container.querySelector(".dhx_cal_data").offsetTop;a.style.top=_+20+"px",h.dx==1?(a.style.right="auto",a.style.left=-r+"px",setTimeout(function(){a.style.left="-10px"},1)):(a.style.left="auto",a.style.right=-r+"px",setTimeout(function(){a.style.right="-10px"},1)),a.className=a.className.replace(" dhx_qi_left","").replace(" dhx_qi_right","")+" dhx_qi_"+(h.dx==1?"left":"right")}},e.attachEvent("onTemplatesReady",function(){if(e.hideQuickInfo(),this._quick_info_box){var h=this._quick_info_box;h.parentNode&&h.parentNode.removeChild(h),this._quick_info_box=null}}),e._quick_info_onscroll_handler=function(h){e.hideQuickInfo()},e._init_quick_info=function(){if(!this._quick_info_box){var h=this._quick_info_box=document.createElement("div");this._waiAria.quickInfoAttr(h),h.className="dhx_cal_quick_info",e.$testmode&&(h.className+=" dhx_no_animate"),e.config.rtl&&(h.className+=" dhx_quick_info_rtl");var a=` + `,h+="
"+e.templates.map_text(c.start_date,c.end_date,c)+"
"}h+="
",e._els.dhx_cal_data[0].scrollTop=0,e._els.dhx_cal_data[0].innerHTML=h;let v=e._els.dhx_cal_data[0].firstChild.childNodes,u=e._getNavDateElement();u&&(u.innerHTML=e.templates[e._mode+"_date"](e._min_date,e._max_date,e._mode)),e._rendered=[];for(let f=0;fi==null?void 0:i.addEventMarker(u)))}},e.map_view=function(l){e._els.dhx_cal_data[0].style.width=e.xy.map_date_width+e.xy.map_description_width+1+"px",e._min_date=e.config.map_start||e._currentDate(),e._max_date=e.config.map_end||e.date.add(e._currentDate(),1,"year"),e._table_view=!0,function(f){if(f){const c=e.locale.labels;e._els.dhx_cal_header[0].innerHTML="
"+c.date+"
"+c.description+"
",e._table_view=!0,e.set_sizes()}}(l);let h=document.getElementById("mapContainer");var v,u;(function(f){let c=document.getElementById(f);if(c){const p=e.$container.querySelector(".dhx_cal_navline").offsetHeight;let m=e.$container.querySelector(".dhx_cal_data").offsetHeight+e.$container.querySelector(".dhx_cal_header").offsetHeight;m<0&&(m=0);let g=e._x-e.xy.map_date_width-e.xy.map_description_width-1;g<0&&(g=0),c.style.height=m+"px",c.style.width=g+"px",c.style.position="absolute",c.style.top=p+"px",e.config.rtl?c.style.marginRight=e.xy.map_date_width+e.xy.map_description_width+1+"px":c.style.marginLeft=e.xy.map_date_width+e.xy.map_description_width+1+"px",c.style.marginTop=e.xy.nav_height+2+"px"}})("mapContainer"),l&&h?(s.style.display="block",a(),e.config.map_view_provider==e.ext.mapView.currentAdapter?(i==null||i.destroy(h),d(e),i==null||i.initialize(h,e.config.map_settings)):(i==null||i.destroy(h),d(e),i==null||i.initialize(h,e.config.map_settings),e.ext.mapView.currentAdapter=e.config.map_view_provider),i&&(v=e.config.map_settings,u=i,v.resolve_user_location?navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(f){u.setView(f.coords.latitude,f.coords.longitude,v.zoom_after_resolve||v.initial_zoom)}):u.setView(v.initial_position.lat,v.initial_position.lng,v.initial_zoom))):(s.style.display="none",e._els.dhx_cal_data[0].style.width="100%",i&&h&&(i.destroy(h),i=null,e.ext.mapView.currentAdapter=e.config.map_view_provider),t.forEach(f=>e.detachEvent(f)),t=[])},e.attachEvent("onLocationError",function(l){return alert("Location can't be found"),google.maps.LatLng(51.47784,-.001492)});let o=async function(l){if(i){const h=await i.resolveAddress(l.event_location);h.lat&&h.lng?(l.lat=+h.lat,l.lng=+h.lng):(e.callEvent("onLocationError",[l.id]),l.lng=e.config.map_settings.error_position.lng,l.lat=e.config.map_settings.error_position.lat),e._latLngUpdate=!0,e.callEvent("onEventChanged",[l.id,l])}};e._event_resolve_delay=1500,e.attachEvent("onEventLoading",function(l){return l.lat&&l.lng&&(l.lat=+l.lat,l.lng=+l.lng),e.config.map_settings.resolve_event_location&&l.event_location&&!l.lat&&!l.lng&&(e._event_resolve_delay+=1500,function(h,v,u,f){setTimeout(function(){if(e.$destroyed)return!0;let c=h.apply(v,u);return h=v=u=null,c},f||1)}(o,this,[l],e._event_resolve_delay)),!0})})},minical:function(e){const i=e._createDomEventScope();e.config.minicalendar={mark_events:!0},e._synced_minicalendars=[],e.renderCalendar=function(t,r,d){var n=null,s=t.date||e._currentDate();if(typeof s=="string"&&(s=this.templates.api_date(s)),r)n=this._render_calendar(r.parentNode,s,t,r),e.unmarkCalendar(n);else{var _=t.container,a=t.position;if(typeof _=="string"&&(_=document.getElementById(_)),typeof a=="string"&&(a=document.getElementById(a)),a&&a.left===void 0&&a.right===void 0){var o=e.$domHelpers.getOffset(a);a={top:o.top+a.offsetHeight,left:o.left}}_||(_=e._get_def_cont(a)),(n=this._render_calendar(_,s,t)).$_eventAttached||(n.$_eventAttached=!0,i.attach(n,"click",(function(g){var y=g.target||g.srcElement,x=e.$domHelpers;if(x.closest(y,".dhx_month_head")&&!x.closest(y,".dhx_after")&&!x.closest(y,".dhx_before")){var b=x.closest(y,"[data-cell-date]").getAttribute("data-cell-date"),k=e.templates.parse_date(b);e.unmarkCalendar(this),e.markCalendar(this,k,"dhx_calendar_click"),this._last_date=k,this.conf.handler&&this.conf.handler.call(e,k,this)}}).bind(n)))}if(e.config.minicalendar.mark_events)for(var l=e.date.month_start(s),h=e.date.add(l,1,"month"),v=this.getEvents(l,h),u=this["filter_"+this._mode],f={},c=0;c=h.valueOf())););}}return this._markCalendarCurrentDate(n),n.conf=t,t.sync&&!d&&this._synced_minicalendars.push(n),n.conf._on_xle_handler||(n.conf._on_xle_handler=e.attachEvent("onXLE",function(){e.updateCalendar(n,n.conf.date)})),this.config.wai_aria_attributes&&this.config.wai_aria_application_role&&n.setAttribute("role","application"),n},e._get_def_cont=function(t){return this._def_count||(this._def_count=document.createElement("div"),this._def_count.className="dhx_minical_popup",e.event(this._def_count,"click",function(r){r.cancelBubble=!0}),document.body.appendChild(this._def_count)),t.left&&(this._def_count.style.left=t.left+"px"),t.right&&(this._def_count.style.right=t.right+"px"),t.top&&(this._def_count.style.top=t.top+"px"),t.bottom&&(this._def_count.style.bottom=t.bottom+"px"),this._def_count._created=new Date,this._def_count},e._locateCalendar=function(t,r){if(typeof r=="string"&&(r=e.templates.api_date(r)),+r>+t._max_date||+r<+t._min_date)return null;for(var d=t.querySelector(".dhx_year_body").childNodes[0],n=0,s=new Date(t._min_date);+this.date.add(s,1,"week")<=+r;)s=this.date.add(s,1,"week"),n++;var _=e.config.start_on_monday,a=(r.getDay()||(_?7:0))-(_?1:0);const o=d.querySelector(`.dhx_cal_month_row:nth-child(${n+1}) .dhx_cal_month_cell:nth-child(${a+1})`);return o?o.firstChild:null},e.markCalendar=function(t,r,d){var n=this._locateCalendar(t,r);n&&(n.className+=" "+d)},e.unmarkCalendar=function(t,r,d){if(d=d||"dhx_calendar_click",r=r||t._last_date){var n=this._locateCalendar(t,r);n&&(n.className=(n.className||"").replace(RegExp(d,"g")))}},e._week_template=function(t){for(var r=t||250,d=0,n=document.createElement("div"),s=this.date.week_start(e._currentDate()),_=0;_<7;_++)this._cols[_]=Math.floor(r/(7-_)),this._render_x_header(_,d,s,n),s=this.date.add(s,1,"day"),r-=this._cols[_],d+=this._cols[_];return n.lastChild.className+=" dhx_scale_bar_last",n},e.updateCalendar=function(t,r){t.conf.date=r,this.renderCalendar(t.conf,t,!0)},e._mini_cal_arrows=[" "," "],e._render_calendar=function(t,r,d,n){var s=e.templates,_=this._cols;this._cols=[];var a=this._mode;this._mode="calendar";var o=this._colsS;this._colsS={height:0};var l=new Date(this._min_date),h=new Date(this._max_date),v=new Date(e._date),u=s.month_day,f=this._ignores_detected;this._ignores_detected=0,s.month_day=s.calendar_date,r=this.date.month_start(r);var c,p=this._week_template(t.offsetWidth-1-this.config.minicalendar.padding);n?c=n:(c=document.createElement("div")).className="dhx_cal_container dhx_mini_calendar",c.setAttribute("date",this._helpers.formatDate(r)),c.innerHTML="
":"'>")+"
"+(p?p.innerHTML:"")+"
";var m=c.querySelector(".dhx_year_month"),g=c.querySelector(".dhx_year_week"),y=c.querySelector(".dhx_year_body");if(m.innerHTML=this.templates.calendar_month(r),d.navigation)for(var x=function(z,K){var U=e.date.add(z._date,K,"month");e.updateCalendar(z,U),e._date.getMonth()==z._date.getMonth()&&e._date.getFullYear()==z._date.getFullYear()&&e._markCalendarCurrentDate(z)},b=["dhx_cal_prev_button","dhx_cal_next_button"],k=["left:1px;top:4px;position:absolute;","left:auto; right:1px;top:4px;position:absolute;"],E=[-1,1],D=function(z){return function(){if(d.sync)for(var K=e._synced_minicalendars,U=0;U500)&&(t=this._def_count.firstChild),t&&(i.detachAll(),t.innerHTML="",t.parentNode&&t.parentNode.removeChild(t),this._def_count&&(this._def_count.style.top="-1000px"),t.conf&&t.conf._on_xle_handler&&e.detachEvent(t.conf._on_xle_handler))},e.isCalendarVisible=function(){return!!(this._def_count&&parseInt(this._def_count.style.top,10)>0)&&this._def_count},e.attachEvent("onTemplatesReady",function(){e.event(document.body,"click",function(){e.destroyCalendar()})},{once:!0}),e.form_blocks.calendar_time={render:function(t){var r="",d=e.config,n=this.date.date_part(e._currentDate()),s=1440,_=0;d.limit_time_select&&(_=60*d.first_hour,s=60*d.last_hour+1),n.setHours(_/60),t._time_values=[],r+=" ")+"  –  "+r+""},set_value:function(t,r,d,n){var s,_,a=t.getElementsByTagName("input"),o=t.getElementsByTagName("select"),l=function(m,g,y){e.event(m,"click",function(){e.destroyCalendar(null,!0),e.renderCalendar({position:m,date:new Date(this._date),navigation:!0,handler:function(x){m.value=e.templates.calendar_time(x),m._date=new Date(x),e.destroyCalendar(),e.config.event_duration&&e.config.auto_end_date&&y===0&&f()}})})};if(e.config.full_day){if(!t._full_day){var h="";e.config.wide_form||(h=t.previousSibling.innerHTML+h),t.previousSibling.innerHTML=h,t._full_day=!0}var v=t.previousSibling.getElementsByTagName("input")[0],u=e.date.time_part(d.start_date)===0&&e.date.time_part(d.end_date)===0;v.checked=u,o[0].disabled=v.checked,o[1].disabled=v.checked,v.$_eventAttached||(v.$_eventAttached=!0,e.event(v,"click",function(){if(v.checked===!0){var m={};e.form_blocks.calendar_time.get_value(t,m),s=e.date.date_part(m.start_date),(+(_=e.date.date_part(m.end_date))==+s||+_>=+s&&(d.end_date.getHours()!==0||d.end_date.getMinutes()!==0))&&(_=e.date.add(_,1,"day"))}var g=s||d.start_date,y=_||d.end_date;c(a[0],g),c(a[1],y),o[0].value=60*g.getHours()+g.getMinutes(),o[1].value=60*y.getHours()+y.getMinutes(),o[0].disabled=v.checked,o[1].disabled=v.checked}))}if(e.config.event_duration&&e.config.auto_end_date){var f=function(){e.config.auto_end_date&&e.config.event_duration&&(s=e.date.add(a[0]._date,o[0].value,"minute"),_=new Date(s.getTime()+60*e.config.event_duration*1e3),a[1].value=e.templates.calendar_time(_),a[1]._date=e.date.date_part(new Date(_)),o[1].value=60*_.getHours()+_.getMinutes())};o[0].$_eventAttached||o[0].addEventListener("change",f)}function c(m,g,y){l(m,g,y),m.value=e.templates.calendar_time(g),m._date=e.date.date_part(new Date(g))}function p(m){for(var g=n._time_values,y=60*m.getHours()+m.getMinutes(),x=y,b=!1,k=0;k=a.valueOf()))for(var o=d;o.valueOf()o&&e.markCalendar(t,o,"dhx_calendar_click"),o=e.date.add(o,1,"day")},e.attachEvent("onEventCancel",function(){e.destroyCalendar(null,!0)}),e.attachEvent("onDestroy",function(){e.destroyCalendar()})},monthheight:function(e){e.attachEvent("onTemplatesReady",function(){e.xy.scroll_width=0;var i=e.render_view_data;e.render_view_data=function(){var r=this._els.dhx_cal_data[0];r.firstChild._h_fix=!0,i.apply(e,arguments);var d=parseInt(r.style.height);r.style.height="1px",r.style.height=r.scrollHeight+"px",this._obj.style.height=this._obj.clientHeight+r.scrollHeight-d+"px"};var t=e._reset_month_scale;e._reset_month_scale=function(r,d,n,s){var _={clientHeight:100};t.apply(e,[_,d,n,s]),r.innerHTML=_.innerHTML}})},multisection:function(e){_e("Multisection",e.assert)},multiselect:function(e){e.form_blocks.multiselect={render:function(i){var t="dhx_multi_select_control dhx_multi_select_"+i.name;i.vertical&&(t+=" dhx_multi_select_control_vertical");for(var r="
",d=0;d"+i.options[d].label+"";return r+="
"},set_value:function(i,t,r,d){for(var n=i.getElementsByTagName("input"),s=0;s]*>","g"),d=new RegExp("]*>","g");function n(b){return b.replace(d,` +`).replace(r,"")}function s(b,k){b=parseFloat(b),k=parseFloat(k),isNaN(k)||(b-=k);var E=a(b);return b=b-E.width+E.cols*i,isNaN(b)?"auto":100*b/i}function _(b,k,E){b=parseFloat(b),k=parseFloat(k),!isNaN(k)&&E&&(b-=k);var D=a(b);return b=b-D.width+D.cols*i,isNaN(b)?"auto":100*b/(i-(isNaN(k)?0:k))}function a(b){for(var k=0,E=e._els.dhx_cal_header[0].childNodes,D=E[1]?E[1].childNodes:E[0].childNodes,w=0;wN))break;b-=N+1,k+=N+1}return{width:k,cols:w}}function o(b){return b=parseFloat(b),isNaN(b)?"auto":100*b/t}function l(b,k){return(window.getComputedStyle?window.getComputedStyle(b,null)[k]:b.currentStyle?b.currentStyle[k]:null)||""}function h(b,k){for(var E=parseInt(b.style.left,10),D=0;DE)return D;return k}function u(b){return b?"":""}function f(b,k,E,D){var w="<"+b+" profile='"+k+"'";return E&&(w+=" header='"+E+"'"),D&&(w+=" footer='"+D+"'"),w+=">"}function c(){var b="",k=e._mode;if(e.matrix&&e.matrix[e._mode]&&(k=e.matrix[e._mode].render=="cell"?"matrix":"timeline"),b+="",e._mode=="week_agenda")for(var E=e._els.dhx_cal_data[0].getElementsByTagName("DIV"),D=0;D"+n(E[D].innerHTML)+"");else if(e._mode=="agenda"||e._mode=="map")b+=""+n((E=e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML)+""+n(E[1].innerHTML)+"";else if(e._mode=="year")for(E=e._els.dhx_cal_data[0].childNodes,D=0;D",b+=m(E[D].querySelector(".dhx_year_week").childNodes),b+=p(E[D].querySelector(".dhx_year_body")),b+="";else{b+="",b+=m(E=e._els.dhx_cal_header[0].childNodes),b+="";var w=e._els.dhx_cal_data[0];if(e.matrix&&e.matrix[e._mode]){for(b+="",D=0;D";b+="",t=w.firstChild.rows[0].cells[0].offsetHeight}else if(w.firstChild.tagName=="TABLE")b+=p(w);else{for(w=w.childNodes[w.childNodes.length-1];w.className.indexOf("dhx_scale_holder")==-1;)w=w.previousSibling;for(w=w.childNodes,b+="",D=0;D";b+="",t=w[0].offsetHeight}}return b+=""}function p(b){for(var k="",E=b.querySelectorAll("tr"),D=0;D",t=S[0].offsetHeight}return k}function m(b){var k,E="";e.matrix&&e.matrix[e._mode]&&(e.matrix[e._mode].second_scale&&(k=b[1].childNodes),b=b[0].childNodes);for(var D=0;D";if(i=b[0].offsetWidth,k){var w=0,S=b[0].offsetWidth,N=1;for(D=0;D",(w+=k[D].offsetWidth)>=S&&(S+=b[N]?b[N].offsetWidth:0,N++),i=k[0].offsetWidth}return E}function g(b){var k="",E=e._rendered,D=e.matrix&&e.matrix[e._mode];if(e._mode=="agenda"||e._mode=="map")for(var w=0;w";else if(e._mode=="week_agenda")for(w=0;w"+n(E[w].innerHTML)+"";else if(e._mode=="year")for(E=e.get_visible_events(),w=0;w",(S=e.date.add(S,1,"day")).valueOf()>=e._max_date.valueOf())break}}else if(D&&D.render=="cell")for(E=e._els.dhx_cal_data[0].getElementsByTagName("TD"),w=0;w";else for(w=0;w",U=="event"?(k+="
",T=b?l(E[w].childNodes[2],"color"):"",k+=""):(T=b?l(E[w],"color"):"",k+=""),k+=""}}}}return k}function y(b,k,E,D,w,S){var N=!1;D=="fullcolor"&&(N=!0,D="color"),D=D||"color";var M,T="";if(b){var A=e._date,H=e._mode;k=e.date[E+"_start"](k),k=e.date["get_"+E+"_end"]?e.date["get_"+E+"_end"](k):e.date.add(k,1,E),T=f("pages",D,w,S);for(var $=new Date(b);+$<+k;$=this.date.add($,1,E))this.setCurrentView($,E),T+=((M="page")?"<"+M+">":"")+c().replace("–","-")+g(N)+u("page");T+=u("pages"),this.setCurrentView(A,H)}else T=f("data",D,w,S)+c().replace("–","-")+g(N)+u("data");return T}function x(b,k,E,D,w,S,N){(function(M,T){var A=e.uid(),H=document.createElement("div");H.style.display="none",document.body.appendChild(H),H.innerHTML='
',document.getElementById(A).firstChild.value=encodeURIComponent(M),document.getElementById(A).submit(),H.parentNode.removeChild(H)})(typeof w=="object"?function(M){for(var T="",A=0;Ae._x/2?1:0,dy:s+d.offsetHeight/2>e._y/2?1:0,width:d.offsetWidth,height:d.offsetHeight}:0}e.attachEvent("onSchedulerReady",function(){const d=e.$container;d._$quickInfoHandler||(d._$quickInfoHandler=!0,e.event(d,"mousedown",function(n){const s=n.target.closest(`[${e.config.event_attribute}]`);s&&(i={id:s.getAttribute(e.config.event_attribute),position:r(s)})}),e.attachEvent("onDestroy",()=>{delete d._$quickInfoHandler}))}),e.attachEvent("onClick",function(d){if(e.config.show_quick_info)return e.showQuickInfo(d),!0}),function(){for(var d=["onEmptyClick","onViewChange","onLightbox","onBeforeEventDelete","onBeforeDrag"],n=function(){return e.hideQuickInfo(!0),!0},s=0;swindow.innerWidth&&(a=window.innerWidth-s),a=Math.max(0,a),n.style.left=a+"px",n.style.top=d.top-(d.dy?_:-d.height)+"px"}else{const o=e.$container.querySelector(".dhx_cal_data").offsetTop;n.style.top=o+20+"px",d.dx==1?(n.style.right="auto",n.style.left=-s+"px",setTimeout(function(){n.style.left="-10px"},1)):(n.style.left="auto",n.style.right=-s+"px",setTimeout(function(){n.style.right="-10px"},1)),n.className=n.className.replace(" dhx_qi_left","").replace(" dhx_qi_right","")+" dhx_qi_"+(d.dx==1?"left":"right")}n.ontransitionend=()=>{t(n),n.ontransitionend=null},setTimeout(()=>{t(n)},1)},e.attachEvent("onTemplatesReady",function(){if(e.hideQuickInfo(),this._quick_info_box){var d=this._quick_info_box;d.parentNode&&d.parentNode.removeChild(d),this._quick_info_box=null}}),e._quick_info_onscroll_handler=function(d){e.hideQuickInfo()},e._init_quick_info=function(){if(!this._quick_info_box){var d=this._quick_info_box=document.createElement("div");this._waiAria.quickInfoAttr(d),d.className="dhx_cal_quick_info",e.$testmode&&(d.className+=" dhx_no_animate"),e.config.rtl&&(d.className+=" dhx_quick_info_rtl");var n=`
@@ -61,16 +77,86 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`)},t.exportToPNG=function(){
-
`;a+='
';for(var r=e.config.icons_select,d=0;d -
${e.locale.labels[r[d]]}
`;a+="",h.innerHTML=a,e.event(h,"click",function(i){e._qi_button_click(i.target||i.srcElement)}),e.config.quick_info_detached&&(e._detachDomEvent(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler),e.event(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler))}return this._quick_info_box},e._qi_button_click=function(h){var a=e._quick_info_box;if(h&&h!=a)if(h.closest(".dhx_cal_qi_close_btn"))e.hideQuickInfo();else{var r=e._getClassName(h);if(r.indexOf("_icon")!=-1){var d=e._quick_info_box_id;e._click.buttons[r.split(" ")[1].replace("icon_","")](d)}else e._qi_button_click(h.parentNode)}},e._get_event_counter_part=function(h){for(var a=e.getRenderedEvent(h),r=0,d=0,i=a;i&&i!=e._obj;)r+=i.offsetLeft,d+=i.offsetTop-i.scrollTop,i=i.offsetParent;return i?{left:r,top:d,dx:r+a.offsetWidth/2>e._x/2?1:0,dy:d+a.offsetHeight/2>e._y/2?1:0,width:a.offsetWidth,height:a.offsetHeight}:0},e._fill_quick_data=function(h){var a=e.getEvent(h),r=e._quick_info_box;e._quick_info_box_id=h;var d={content:e.templates.quick_info_title(a.start_date,a.end_date,a),date:e.templates.quick_info_date(a.start_date,a.end_date,a)};r.querySelector(".dhx_cal_qi_tcontent").innerHTML=`${d.content}`,r.querySelector(".dhx_cal_qi_tdate").innerHTML=d.date,e._waiAria.quickInfoHeader(r,[d.content,d.date].join(" "));var i=r.querySelector(".dhx_cal_qi_content");const _=e.templates.quick_info_content(a.start_date,a.end_date,a);_?(i.classList.remove("dhx_hidden"),i.innerHTML=_):i.classList.add("dhx_hidden")}},readonly:function(e){e.attachEvent("onTemplatesReady",function(){var h;e.form_blocks.recurring&&(h=e.form_blocks.recurring.set_value);var a=e.config.buttons_left.slice(),r=e.config.buttons_right.slice();function d(o,t,n,s){for(var c=t.getElementsByTagName(o),u=n.getElementsByTagName(o),v=u.length-1;v>=0;v--)if(n=u[v],s){var m=document.createElement("span");m.className="dhx_text_disabled",m.innerHTML=s(c[v]),n.parentNode.insertBefore(m,n),n.parentNode.removeChild(n)}else n.disabled=!0,t.checked&&(n.checked=!0)}e.attachEvent("onBeforeLightbox",function(o){this.config.readonly_form||this.getEvent(o).readonly?this.config.readonly_active=!0:(this.config.readonly_active=!1,e.config.buttons_left=a.slice(),e.config.buttons_right=r.slice(),e.form_blocks.recurring&&(e.form_blocks.recurring.set_value=h));var t=this.config.lightbox.sections;if(this.config.readonly_active){for(var n=0;n
'+n.repeat_text_occurences_count+'
'},_ds:{},_get_form_node:function(i,_,o){var t=i[_];if(!t)return null;if(t.nodeName)return t;if(t.length){for(var n=0;ns)return i.setDate(i.getDate()+1*_[c]-s-(t?o:n));this.transpose_day_week(i,_,o+t,null,o)},e.transpose_type=function(i){var _="transpose_"+i;if(!this.date[_]){var o=i.split("_"),t="add_"+i,n=this.transponse_size[o[0]]*o[1];if(o[0]=="day"||o[0]=="week"){var s=null;if(o[4]&&(s=o[4].split(","),e.config.start_on_monday)){for(var c=0;c0&&u.setDate(u.getDate()+m*n),s&&e.transpose_day_week(u,s,1,n),u},this.date[t]=function(u,v){var m=new Date(u.valueOf());if(s)for(var l=0;l=0&&(u.setDate(1),u.setMonth(u.getMonth()+l*n)),e.date[t](u,0,m)},this.date[t]=function(u,v,m,l){if(l?l++:l=1,l>12)return null;var f=new Date(u.valueOf());f.setDate(1),f.setMonth(f.getMonth()+v*n);var g=f.getMonth(),p=f.getFullYear();f.setDate(m.start_date.getDate()),o[3]&&e.date.day_week(f,o[2],o[3]);var y=e.config.recurring_overflow_instances;return f.getMonth()!=g&&y!="none"&&(f=y==="lastDay"?new Date(p,g+1,0,f.getHours(),f.getMinutes(),f.getSeconds(),f.getMilliseconds()):e.date[t](new Date(p,g+1,0),v||1,m,l)),f})}},e.repeat_date=function(i,_,o,t,n,s){t=t||this._min_date,n=n||this._max_date;var c=s||-1,u=new Date(i.start_date.valueOf()),v=u.getHours(),m=0;for(!i.rec_pattern&&i.rec_type&&(i.rec_pattern=i.rec_type.split("#")[0]),this.transpose_type(i.rec_pattern),u=e.date["transpose_"+i.rec_pattern](u,t,i);u&&(u0?new Date(t.valueOf()+1e3*o.event_length-60*s*1e3):new Date(_.valueOf()-60*s*1e3):new Date(n.valueOf())},e.getRecDates=function(i,_){var o=typeof i=="object"?i:e.getEvent(i),t=[];if(_=_||100,!o.rec_type)return[{start_date:o.start_date,end_date:o.end_date}];if(o.rec_type=="none")return[];e.repeat_date(o,t,!0,o.start_date,o.end_date,_);for(var n=[],s=0;si)if(n.rec_pattern){if(n.rec_pattern=="none")continue;var s=[];this.repeat_date(n,s,!0,i,_);for(var c=0;ci&&!this._rec_markers[s[c].id]&&o.push(s[c])}else this._is_virtual_event(n.id)||o.push(n)}return o},e.config.repeat_date="%m.%d.%Y",e.config.lightbox.sections=[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}],e._copy_dummy=function(i){var _=new Date(this.start_date),o=new Date(this.end_date);this.start_date=_,this.end_date=o,this.event_length=this.event_pid=this.rec_pattern=this.rec_type=null},e.config.include_end_by=!1,e.config.lightbox_recurring="ask",e.attachEvent("onClearAll",function(){e._rec_markers={},e._rec_markers_pull={},e._rec_temp=[]})},serialize:function(e){const h=se(e);e.data_attributes=function(){var a=[],r=e._helpers.formatDate,d=h();for(var i in d){var _=d[i];for(var o in _)o.substr(0,1)!="_"&&a.push([o,o=="start_date"||o=="end_date"?r:null]);break}return a},e.toXML=function(a){var r=[],d=this.data_attributes(),i=h();for(var _ in i){var o=i[_];r.push("");for(var t=0;t");r.push("")}return(a||"")+""+r.join(` -`)+""},e._serialize_json_value=function(a){return a===null||typeof a=="boolean"?a=""+a:(a||a===0||(a=""),a='"'+a.toString().replace(/\n/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'),a},e.toJSON=function(){return JSON.stringify(this.serialize())},e.toICal=function(a){var r=e.date.date_to_str("%Y%m%dT%H%i%s"),d=e.date.date_to_str("%Y%m%d"),i=[],_=h();for(var o in _){var t=_[o];i.push("BEGIN:VEVENT"),t._timed&&(t.start_date.getHours()||t.start_date.getMinutes())?i.push("DTSTART:"+r(t.start_date)):i.push("DTSTART:"+d(t.start_date)),t._timed&&(t.end_date.getHours()||t.end_date.getMinutes())?i.push("DTEND:"+r(t.end_date)):i.push("DTEND:"+d(t.end_date)),i.push("SUMMARY:"+t.text),i.push("END:VEVENT")}return`BEGIN:VCALENDAR +
`;n+='
';for(var s=e.config.icons_select,_=0;_ +
${e.locale.labels[s[_]]}
`;n+="",d.innerHTML=n,e.event(d,"click",function(a){e._qi_button_click(a.target||a.srcElement)}),e.config.quick_info_detached&&(e._detachDomEvent(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler),e.event(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler))}return this._quick_info_box},e._qi_button_click=function(d){var n=e._quick_info_box;if(d&&d!=n)if(d.closest(".dhx_cal_qi_close_btn"))e.hideQuickInfo();else{var s=e._getClassName(d);if(s.indexOf("_icon")!=-1){var _=e._quick_info_box_id;e._click.buttons[s.split(" ")[1].replace("icon_","")](_)}else e._qi_button_click(d.parentNode)}},e._get_event_counter_part=function(d){return r(e.getRenderedEvent(d))},e._fill_quick_data=function(d){var n=e.getEvent(d),s=e._quick_info_box;e._quick_info_box_id=d;var _={content:e.templates.quick_info_title(n.start_date,n.end_date,n),date:e.templates.quick_info_date(n.start_date,n.end_date,n)};s.querySelector(".dhx_cal_qi_tcontent").innerHTML=`${_.content}`,s.querySelector(".dhx_cal_qi_tdate").innerHTML=_.date,e._waiAria.quickInfoHeader(s,[_.content,_.date].join(" "));var a=s.querySelector(".dhx_cal_qi_content");const o=e.templates.quick_info_content(n.start_date,n.end_date,n);o?(a.classList.remove("dhx_hidden"),a.innerHTML=o):a.classList.add("dhx_hidden")}},readonly:function(e){e.attachEvent("onTemplatesReady",function(){var i;e.form_blocks.recurring&&(i=e.form_blocks.recurring.set_value);var t=e.config.buttons_left.slice(),r=e.config.buttons_right.slice();function d(_,a,o,l){for(var h=a.getElementsByTagName(_),v=o.getElementsByTagName(_),u=v.length-1;u>=0;u--)if(o=v[u],l){var f=document.createElement("span");f.className="dhx_text_disabled",f.innerHTML=l(h[u]),o.parentNode.insertBefore(f,o),o.parentNode.removeChild(o)}else o.disabled=!0,a.checked&&(o.checked=!0)}e.attachEvent("onBeforeLightbox",function(_){this.config.readonly_form||this.getEvent(_).readonly?this.config.readonly_active=!0:(this.config.readonly_active=!1,e.config.buttons_left=t.slice(),e.config.buttons_right=r.slice(),e.form_blocks.recurring&&(e.form_blocks.recurring.set_value=i));var a=this.config.lightbox.sections;if(this.config.readonly_active){for(var o=0;o{const S=new Date(w);return S.setHours(u.start_date.getHours()),S.setMinutes(u.start_date.getMinutes()),S.setSeconds(u.start_date.getSeconds()),S});let E=0;const D=u.duration;for(let w=0;w=g);w++){const S=k[w];let N=x[S.valueOf()];if(N){if(N.deleted)continue;E++,f.push(N)}else{const M=e._copy_event(u);if(M.text=u.text,M.start_date=S,M.id=u.id+"#"+Math.ceil(S.valueOf()),M.end_date=new Date(S.valueOf()+1e3*D),M.end_date=e._fix_daylight_saving_date(M.start_date,M.end_date,u,S,M.end_date),M._timed=e.isOneDayEvent(M),!M._timed&&!e._table_view&&!e.config.multi_day)continue;f.push(M),c||(e._events[M.id]=M,e._rec_temp.push(M)),E++}}},e._fix_daylight_saving_date=function(u,f,c,p,m){var g=u.getTimezoneOffset()-f.getTimezoneOffset();return g?g>0?new Date(p.valueOf()+1e3*c.duration-60*g*1e3):new Date(f.valueOf()-60*g*1e3):new Date(m.valueOf())},e.getRecDates=function(u,f){var c=typeof u=="object"?u:e.getEvent(u),p=[];if(f=f||100,!t(c))return[{start_date:c.start_date,end_date:c.end_date}];if(c.deleted)return[];e.repeat_date(c,p,!0,c.start_date,c.end_date,f);for(var m=[],g=0;gu){var y=[];this.repeat_date(g,y,!0,u,f,void 0,p),y.forEach(function(x){x.start_dateu&&c.push(x)})}else u||f||c.push(g);else this._is_virtual_event(g.id)||c.push(g)}return c},e._copy_dummy=function(u){var f=new Date(this.start_date),c=new Date(this.end_date);this.start_date=f,this.end_date=c,this.duration=this.rrule=null},e.config.include_end_by=!1,e.config.lightbox_recurring="ask",e.config.recurring_workdays=[C.MO.weekday,C.TU.weekday,C.WE.weekday,C.TH.weekday,C.FR.weekday],e.config.repeat_date="%m.%d.%Y",e.config.lightbox.sections=[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type"},{name:"time",height:72,type:"time",map_to:"auto"}],e.attachEvent("onClearAll",function(){e._rec_markers={},e._rec_markers_pull={},e._rec_temp=[]});const _={0:"SU",1:"MO",2:"TU",3:"WE",4:"TH",5:"FR",6:"SA"},a={0:1,1:2,2:3,3:4,4:5,5:6,6:0};function o(u){switch(u){case 1:case 31:return`${u}st`;case 2:return`${u}nd`;case 3:return`${u}rd`;default:return`${u}th`}}e.templates.repeat_monthly_date=function(u,f){return`Every ${o(u.getDate())}`},e.templates.repeat_monthly_weekday=function(u,f){const c=s(u);return`Every ${o(c.dayNumber)} ${e.locale.date.day_full[c.dayOfWeek]}`},e.templates.repeat_yearly_month_date=function(u,f){const c=u.getDate(),p=e.locale.date.month_full[u.getMonth()];return`Every ${o(c)} day of ${p}`},e.templates.repeat_yearly_month_weekday=function(u,f){const c=s(u),p=e.locale.date.month_full[u.getMonth()];return`Every ${o(c.dayNumber)} ${e.locale.date.day_full[c.dayOfWeek]} of ${p}`};const l={MONTHLY:function(u){return{rrule:{freq:C.MONTHLY,interval:1,bymonthday:u.start.getDate()},until:new Date(9999,1,1)}},WEEKLY:function(u){let f=u.start.getDay()-1;return f==-1&&(f=6),{rrule:{freq:C.WEEKLY,interval:1,byweekday:[f]},until:new Date(9999,1,1)}},DAILY:function(u){return{rrule:{freq:C.DAILY,interval:1},until:new Date(9999,1,1)}},YEARLY:function(u){return{rrule:{freq:C.YEARLY,bymonth:u.start.getMonth()+1,interval:1,bymonthday:u.start.getDate()},until:new Date(9999,1,1)}},WORKDAYS:function(u){return{rrule:{freq:C.WEEKLY,interval:1,byweekday:e.config.recurring_workdays},until:new Date(9999,1,1)}},CUSTOM:function(u,f){const c={},p=f.querySelector('[name="repeat_interval_unit"]').value,m=Math.max(1,f.querySelector('[name="repeat_interval_value"]').value),g=f.querySelector('[name="dhx_custom_month_option"]').value,y=f.querySelector('[name="dhx_custom_year_option"]').value;let x,b;switch(c.interval=m,p){case"DAILY":c.freq=C.DAILY;break;case"WEEKLY":c.freq=C.WEEKLY,x=[],f.querySelectorAll('.dhx_form_repeat_custom_week [name="week_day"]').forEach(D=>{D.checked&&x.push(D.value)}),c.byweekday=x.map(D=>{switch(D){case"MO":return C.MO.weekday;case"TU":return C.TU.weekday;case"WE":return C.WE.weekday;case"TH":return C.TH.weekday;case"FR":return C.FR.weekday;case"SA":return C.SA.weekday;case"SU":return C.SU.weekday}});break;case"MONTHLY":c.freq=C.MONTHLY,g==="month_date"?c.bymonthday=u.start.getDate():(b=u.start.getDay()-1,b==-1&&(b=6),c.byweekday=[b],c.bysetpos=s(u.start).dayNumber);break;case"YEARLY":c.freq=C.YEARLY,c.bymonth=u.start.getMonth()+1,y=="month_date"?c.bymonthday=u.start.getDate():(b=u.start.getDay()-1,b==-1&&(b=6),c.byweekday=[b],c.bysetpos=s(u.start).dayNumber)}let k=new Date(9999,1,1);const E=f.querySelector('[name="dhx_custom_repeat_ends"]');return E==="ON"?k=f.querySelector('[name="dhx_form_repeat_ends_ondate"]').value:E==="AFTER"&&(c.count=Math.max(1,f.querySelector('[name="dhx_form_repeat_ends_after"]').value)),{rrule:c,until:k}},NEVER:function(){}};function h(u,f,c){(function(p,m){p.querySelector("[name='repeat_interval_value']").value=(m?m.interval:1)||1})(u,f),function(p,m,g){if(p.querySelector("[name='repeat_interval_value']").value=(m?m.interval:1)||1,p.querySelectorAll(".dhx_form_repeat_custom_week input").forEach(y=>y.checked=!1),m&&m.byweekday)m.byweekday.forEach(y=>{const x=a[y.weekday],b=_[x];p.querySelector(`.dhx_form_repeat_custom_week input[value="${b}"]`).checked=!0});else{const y=_[g.start_date.getDay()];p.querySelector(`.dhx_form_repeat_custom_week input[value="${y}"]`).checked=!0}}(u,f,c),function(p,m,g){p.querySelector("[name='repeat_interval_value']").value=(m?m.interval:1)||1;const y=p.querySelector('.dhx_form_repeat_custom_month [value="month_date"]'),x=p.querySelector('.dhx_form_repeat_custom_month [value="month_nth_weekday"]');y.innerText=e.templates.repeat_monthly_date(g.start_date,g),x.innerText=e.templates.repeat_monthly_weekday(g.start_date,g),m&&(!m.bysetpos||m.byweekday&&m.byweekday.length)?p.querySelector('[name="dhx_custom_month_option"]').value="month_nth_weekday":p.querySelector('[name="dhx_custom_month_option"]').value="month_date"}(u,f,c),function(p,m,g){const y=p.querySelector('.dhx_form_repeat_custom_year [value="month_date"]'),x=p.querySelector('.dhx_form_repeat_custom_year [value="month_nth_weekday"]');y.innerText=e.templates.repeat_yearly_month_date(g.start_date,g),x.innerText=e.templates.repeat_yearly_month_weekday(g.start_date,g),m&&(!m.bysetpos||m.byweekday&&m.byweekday.length)?p.querySelector('[name="dhx_custom_year_option"]').value="month_nth_weekday":p.querySelector('[name="dhx_custom_year_option"]').value="month_date"}(u,f,c),function(p,m,g){const y=p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_after"]'),x=p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_ondate"]'),b=p.querySelector("[name='dhx_custom_repeat_ends']");y.value=1;let k=e.date.date_to_str("%Y-%m-%d");e.config.repeat_date_of_end||(e.config.repeat_date_of_end=k(e.date.add(e._currentDate(),30,"day"))),x.value=e.config.repeat_date_of_end,m&&m.count?(b.value="AFTER",y.value=m.count):g._end_date&&g._end_date.getFullYear()!==9999?(b.value="ON",x.value=k(g._end_date)):b.value="NEVER",b.dispatchEvent(new Event("change"))}(u,f,c)}function v(u){for(let f=0;f +
+ +
+
+
+ + +
+ +
+
+ + + + + + + +
+ +
+ +
+ +
+ +
+
+ +
+
${f.repeat_ends}
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+ `},_init_set_value:function(u,f,c){function p(g){g.classList.add("dhx_hidden")}function m(g){g.classList.remove("dhx_hidden")}e.form_blocks.recurring._ds={start:c.start_date,end:c.end_date},u.querySelector(".dhx_form_repeat_pattern select").addEventListener("change",function(){(function(g){const y=u.querySelector(".dhx_form_repeat_custom");g==="CUSTOM"?m(y):p(y)})(this.value)}),u.querySelector(".dhx_form_repeat_custom_interval [name='repeat_interval_unit']").addEventListener("change",function(){(function(g){const y={weekly:u.querySelector(".dhx_form_repeat_custom_week"),monthly:u.querySelector(".dhx_form_repeat_custom_month"),yearly:u.querySelector(".dhx_form_repeat_custom_year")};switch(g){case"DAILY":p(y.weekly),p(y.monthly),p(y.yearly);break;case"WEEKLY":m(y.weekly),p(y.monthly),p(y.yearly);break;case"MONTHLY":p(y.weekly),m(y.monthly),p(y.yearly);break;case"YEARLY":p(y.weekly),p(y.monthly),m(y.yearly)}})(this.value)}),u.querySelector(".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']").addEventListener("change",function(){(function(g){const y={after:u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after"),on:u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on")};switch(g){case"NEVER":p(y.after),p(y.on);break;case"AFTER":m(y.after),p(y.on);break;case"ON":p(y.after),m(y.on)}})(this.value)}),e._lightbox._rec_init_done=!0},button_click:function(){},set_value:function(u,f,c){let p=e.form_blocks.recurring;e._lightbox._rec_init_done||p._init_set_value(u,f,c),u.open=!c.rrule,u.blocked=this._is_modified_occurence(c);let m=p._ds;if(m.start=c.start_date,m.end=c._end_date,c.rrule){const g=Ne(c.rrule);h(u,g.origOptions,c);const y=function(x,b){const k=x.options,E=k.until||b;return k.count||E&&E.getFullYear()!==9999?"CUSTOM":k.freq!==C.DAILY||k.interval!==1||k.byweekday?k.freq!==C.WEEKLY||k.interval!==1||k.byweekday?k.freq!==C.MONTHLY||k.interval!==1||k.bysetpos?k.freq!==C.YEARLY||k.interval!==1||k.bysetpos?k.freq===C.DAILY&&k.byweekday&&k.byweekday.length===e.config.recurring_workdays.length&&k.byweekday.includes(C.MO)&&k.byweekday.includes(C.TU)&&k.byweekday.includes(C.WE)&&k.byweekday.includes(C.TH)&&k.byweekday.includes(C.FR)?"WORKDAYS":"CUSTOM":"YEARLY":"MONTHLY":"WEEKLY":"DAILY"}(g,c._end_date);if(u.querySelector(".dhx_form_repeat_pattern select").value=y,y==="CUSTOM"){let x;switch(g.origOptions.freq){case C.DAILY:x="DAILY";break;case C.WEEKLY:x="WEEKLY";break;case C.MONTHLY:x="MONTHLY";break;case C.YEARLY:x="YEARLY"}x&&(u.querySelector('[name="repeat_interval_unit"]').value=x,u.querySelector('[name="repeat_interval_unit"]').dispatchEvent(new Event("change")))}}else h(u,null,c),u.querySelector(".dhx_form_repeat_pattern select").value="NEVER";u.querySelector(".dhx_form_repeat_pattern select").dispatchEvent(new Event("change"))},get_value:function(u,f){if(u.blocked||u.querySelector(".dhx_form_repeat_pattern select").value==="NEVER")f.rrule=f.rrule="",f._end_date=f.end_date;else{let c=e.form_blocks.recurring._ds,p={};(function(){let y=e.formSection("time");if(y||(y=v("time")),y||(y=v("calendar_time")),!y)throw new Error(["Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.","You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. ",'In the latter case, make sure the control is named "time":',"","scheduler.config.lightbox.sections = [",'{name:"time", height:72, type:"YOU CONTROL", map_to:"auto" }];'].join(` +`));return y})().getValue(p),c.start=p.start_date;const m=u.querySelector(".dhx_form_repeat_pattern select").value,g=l[m](c,u);f.rrule=new C(g.rrule).toString().replace("RRULE:",""),c.end=g.until,f.duration=Math.floor((p.end_date-p.start_date)/1e3),c._start?(f.start_date=new Date(c.start),f._start_date=new Date(c.start),c._start=!1):f._start_date=null,f._end_date=c.end}return f.rrule},focus:function(u){}}},recurring_legacy:function(e){function i(){var n=e.formSection("recurring");if(n||(n=t("recurring")),!n)throw new Error(["Can't locate the Recurring form section.","Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox ",'and that the recurring control has name "recurring":',"","scheduler.config.lightbox.sections = [",' {name:"recurring", ... }',"];"].join(` +`));return n}function t(n){for(var s=0;s
'+o.repeat_text_occurences_count+'
'},_ds:{},_get_form_node:function(n,s,_){var a=n[s];if(!a)return null;if(a.nodeName)return a;if(a.length){for(var o=0;ol)return n.setDate(n.getDate()+1*s[h]-l-(a?_:o));this.transpose_day_week(n,s,_+a,null,_)},e.transpose_type=function(n){var s="transpose_"+n;if(!this.date[s]){var _=n.split("_"),a="add_"+n,o=this.transponse_size[_[0]]*_[1];if(_[0]=="day"||_[0]=="week"){var l=null;if(_[4]&&(l=_[4].split(","),e.config.start_on_monday)){for(var h=0;h0&&v.setDate(v.getDate()+f*o),l&&e.transpose_day_week(v,l,1,o),v},this.date[a]=function(v,u){var f=new Date(v.valueOf());if(l)for(var c=0;c=0&&(v.setDate(1),v.setMonth(v.getMonth()+c*o)),e.date[a](v,0,f)},this.date[a]=function(v,u,f,c){if(c?c++:c=1,c>12)return null;var p=new Date(v.valueOf());p.setDate(1),p.setMonth(p.getMonth()+u*o);var m=p.getMonth(),g=p.getFullYear();p.setDate(f.start_date.getDate()),_[3]&&e.date.day_week(p,_[2],_[3]);var y=e.config.recurring_overflow_instances;return p.getMonth()!=m&&y!="none"&&(p=y==="lastDay"?new Date(g,m+1,0,p.getHours(),p.getMinutes(),p.getSeconds(),p.getMilliseconds()):e.date[a](new Date(g,m+1,0),u||1,f,c)),p})}},e.repeat_date=function(n,s,_,a,o,l){a=a||this._min_date,o=o||this._max_date;var h=l||-1,v=new Date(n.start_date.valueOf()),u=v.getHours(),f=0;for(!n.rec_pattern&&n.rec_type&&(n.rec_pattern=n.rec_type.split("#")[0]),this.transpose_type(n.rec_pattern),v=e.date["transpose_"+n.rec_pattern](v,a,n);v&&(v0?new Date(a.valueOf()+1e3*_.event_length-60*l*1e3):new Date(s.valueOf()-60*l*1e3):new Date(o.valueOf())},e.getRecDates=function(n,s){var _=typeof n=="object"?n:e.getEvent(n),a=[];if(s=s||100,!_.rec_type)return[{start_date:_.start_date,end_date:_.end_date}];if(_.rec_type=="none")return[];e.repeat_date(_,a,!0,_.start_date,_.end_date,s);for(var o=[],l=0;ln)if(o.rec_pattern){if(o.rec_pattern=="none")continue;var l=[];this.repeat_date(o,l,!0,n,s);for(var h=0;hn&&!this._rec_markers[l[h].id]&&_.push(l[h])}else this._is_virtual_event(o.id)||_.push(o)}return _},e.config.repeat_date="%m.%d.%Y",e.config.lightbox.sections=[{name:"description",map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}],e._copy_dummy=function(n){var s=new Date(this.start_date),_=new Date(this.end_date);this.start_date=s,this.end_date=_,this.event_length=this.event_pid=this.rec_pattern=this.rec_type=null},e.config.include_end_by=!1,e.config.lightbox_recurring="ask",e.attachEvent("onClearAll",function(){e._rec_markers={},e._rec_markers_pull={},e._rec_temp=[]})},serialize:function(e){const i=tt(e);e.data_attributes=function(){var t=[],r=e._helpers.formatDate,d=i();for(var n in d){var s=d[n];for(var _ in s)_.substr(0,1)!="_"&&t.push([_,_=="start_date"||_=="end_date"?r:null]);break}return t},e.toXML=function(t){var r=[],d=this.data_attributes(),n=i();for(var s in n){var _=n[s];r.push("");for(var a=0;a");r.push("")}return(t||"")+""+r.join(` +`)+""},e._serialize_json_value=function(t){return t===null||typeof t=="boolean"?t=""+t:(t||t===0||(t=""),t='"'+t.toString().replace(/\n/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'),t},e.toJSON=function(){return JSON.stringify(this.serialize())},e.toICal=function(t){var r=e.date.date_to_str("%Y%m%dT%H%i%s"),d=e.date.date_to_str("%Y%m%d"),n=[],s=i();for(var _ in s){var a=s[_];n.push("BEGIN:VEVENT"),a._timed&&(a.start_date.getHours()||a.start_date.getMinutes())?n.push("DTSTART:"+r(a.start_date)):n.push("DTSTART:"+d(a.start_date)),a._timed&&(a.end_date.getHours()||a.end_date.getMinutes())?n.push("DTEND:"+r(a.end_date)):n.push("DTEND:"+d(a.end_date)),n.push("SUMMARY:"+a.text),n.push("END:VEVENT")}return`BEGIN:VCALENDAR VERSION:2.0 PRODID:-//dhtmlXScheduler//NONSGML v2.2//EN -DESCRIPTION:`+(a||"")+` -`+i.join(` +DESCRIPTION:`+(t||"")+` +`+n.join(` `)+` -END:VCALENDAR`}},timeline:function(e){q("Timeline",e.assert)},tooltip:function(e){e.config.tooltip_timeout=30,e.config.tooltip_offset_y=20,e.config.tooltip_offset_x=10,e.config.tooltip_hide_timeout=30;const h=new _t(e);e.ext.tooltips=h,e.attachEvent("onSchedulerReady",function(){h.tooltipFor({selector:"["+e.config.event_attribute+"]",html:a=>{if(e._mobile&&!e.config.touch_tooltip)return;const r=e._locate_event(a.target);if(e.getEvent(r)){const d=e.getEvent(r);return e.templates.tooltip_text(d.start_date,d.end_date,d)}return null},global:!1})}),e.attachEvent("onDestroy",function(){h.destructor()}),e.attachEvent("onLightbox",function(){h.hideTooltip()}),e.attachEvent("onBeforeDrag",function(){return h.hideTooltip(),!0}),e.attachEvent("onEventDeleted",function(){return h.hideTooltip(),!0})},treetimeline:function(e){q("Tree Timeline",e.assert)},units:function(e){q("Units",e.assert)},url:function(e){e._get_url_nav=function(){for(var h={},a=(document.location.hash||"").replace("#","").split(","),r=0;r",v+="
"+(u[m]._timed?this.templates.event_date(u[m].start_date):"")+"
",v+="
 
",v+=this.templates.year_tooltip(u[m].start_date,u[m].end_date,u[m])+""}}this._tooltip.style.display="",this._tooltip.style.top="0px",document.body.offsetWidth-t.left-this._tooltip.offsetWidth<0?this._tooltip.style.left=t.left-this._tooltip.offsetWidth+"px":this._tooltip.style.left=t.left+s.offsetWidth+"px",this._tooltip.date=o,this._tooltip.innerHTML=v,document.body.offsetHeight-t.top-this._tooltip.offsetHeight<0?this._tooltip.style.top=t.top-this._tooltip.offsetHeight+s.offsetHeight+"px":this._tooltip.style.top=t.top+"px"},e._year_view_tooltip_handler=function(o){if(h()){var t=o.target||o.srcElement;t.tagName.toLowerCase()=="a"&&(t=t.parentNode),e._getClassName(t).indexOf("dhx_year_event")!=-1?e._showToolTip(e.templates.parse_date(t.getAttribute("data-year-date")),e.$domHelpers.getOffset(t),o,t):e._hideToolTip()}},e._init_year_tooltip=function(){e._detachDomEvent(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler),e.event(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler)},e._get_year_cell=function(o){for(var t=e.templates.format_date(o),n=this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date="${t}"]`),s=0;s=this._max_date.valueOf())return},e.year_view=function(o){if(e.set_sizes(),e._table_view=o,!this._load_mode||!this._load())if(o){if(e._init_year_tooltip(),e._reset_year_scale(),e._load_mode&&e._load())return void(e._render_wait=!0);e.render_view_data()}else e._hideToolTip()},e._reset_year_scale=function(){this._cols=[],this._colsS={};var o=[],t=this._els.dhx_cal_data[0],n=this.config;t.scrollTop=0,t.innerHTML="",Math.floor((parseInt(t.style.height)-e.xy.year_top)/n.year_y);var s=document.createElement("div"),c=this.date.week_start(e._currentDate());this._process_ignores(c,7,"day",1);for(var u=0;u<7;u++)this._ignores&&this._ignores[u]||(this._cols[u]="var(--dhx-scheduler-datepicker-cell-size)",this._render_x_header(u,0,c,s)),c=this.date.add(c,1,"day");for(s.lastChild.className+=" dhx_scale_bar_last",u=0;u
"+s.innerHTML+"
";var p=l.querySelector(".dhx_year_month"),y=l.querySelector(".dhx_year_grid"),w=l.querySelector(".dhx_year_body"),b=e.uid();this._waiAria.yearHeader(p,b),this._waiAria.yearGrid(y,b),p.innerHTML=this.templates.year_month(v);var k=this.date.week_start(v);this._reset_month_scale(w,v,k,6);for(var E=w.querySelectorAll("td"),D=0;D${this.templates.year_month(s)} -
`;const l=m.querySelector(".dhx_year_grid"),f=e._createDatePicker(null,{date:s,minWeeks:6});f._renderDayGrid(l),f.destructor(),n.appendChild(m),s=this.date.add(s,1,"month")}o.appendChild(n);let c=this.date.add(t,1,"year");c.valueOf()!=this.date.week_start(new Date(c)).valueOf()&&(c=this.date.week_start(new Date(c)),c=this.date.add(c,1,"week")),this._max_date=c;var u=this._getNavDateElement();u&&(u.innerHTML=this.templates[this._mode+"_date"](t,c,this._mode))};var i=e.getActionData;e.getActionData=function(o){return h()?{date:a(o.target),section:null}:i.apply(e,arguments)};var _=e._locate_event;e._locate_event=function(o){var t=_.apply(e,arguments);if(!t){var n=a(o);if(!n)return null;var s=e.getEvents(n,e.date.add(n,1,"day"));if(!s.length)return null;t=s[0].id}return t},e.attachEvent("onDestroy",function(){e._hideToolTip()})}},Q=new class{constructor(e){this._seed=0,this._schedulerPlugins=[],this._bundledExtensions=e,this._extensionsManager=new it(e)}plugin(e){this._schedulerPlugins.push(e),P.scheduler&&e(P.scheduler)}getSchedulerInstance(e){for(var h=nt(this._extensionsManager),a=0;a{if(e._mobile&&!e.config.touch_tooltip)return;const r=e._locate_event(t.target);if(e.getEvent(r)){const d=e.getEvent(r);return e.templates.tooltip_text(d.start_date,d.end_date,d)}return null},global:!1})}),e.attachEvent("onDestroy",function(){i.destructor()}),e.attachEvent("onLightbox",function(){i.hideTooltip()}),e.attachEvent("onBeforeDrag",function(){return i.hideTooltip(),!0}),e.attachEvent("onEventDeleted",function(){return i.hideTooltip(),!0})},treetimeline:function(e){_e("Tree Timeline",e.assert)},units:function(e){_e("Units",e.assert)},url:function(e){e._get_url_nav=function(){for(var i={},t=(document.location.hash||"").replace("#","").split(","),r=0;r",u+="
"+(v[f]._timed?this.templates.event_date(v[f].start_date):"")+"
",u+="
 
",u+=this.templates.year_tooltip(v[f].start_date,v[f].end_date,v[f])+""}}this._tooltip.style.display="",this._tooltip.style.top="0px",document.body.offsetWidth-a.left-this._tooltip.offsetWidth<0?this._tooltip.style.left=a.left-this._tooltip.offsetWidth+"px":this._tooltip.style.left=a.left+l.offsetWidth+"px",this._tooltip.date=_,this._tooltip.innerHTML=u,document.body.offsetHeight-a.top-this._tooltip.offsetHeight<0?this._tooltip.style.top=a.top-this._tooltip.offsetHeight+l.offsetHeight+"px":this._tooltip.style.top=a.top+"px"},e._year_view_tooltip_handler=function(_){if(i()){var a=_.target||_.srcElement;a.tagName.toLowerCase()=="a"&&(a=a.parentNode),e._getClassName(a).indexOf("dhx_year_event")!=-1?e._showToolTip(e.templates.parse_date(a.getAttribute("data-year-date")),e.$domHelpers.getOffset(a),_,a):e._hideToolTip()}},e._init_year_tooltip=function(){e._detachDomEvent(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler),e.event(e._els.dhx_cal_data[0],"mouseover",e._year_view_tooltip_handler)},e._get_year_cell=function(_){for(var a=e.templates.format_date(_),o=this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date="${a}"]`),l=0;l=this._max_date.valueOf())return},e.year_view=function(_){if(e.set_sizes(),e._table_view=_,!this._load_mode||!this._load())if(_){if(e._init_year_tooltip(),e._reset_year_scale(),e._load_mode&&e._load())return void(e._render_wait=!0);e.render_view_data()}else e._hideToolTip()},e._reset_year_scale=function(){this._cols=[],this._colsS={};var _=[],a=this._els.dhx_cal_data[0],o=this.config;a.scrollTop=0,a.innerHTML="",Math.floor((parseInt(a.style.height)-e.xy.year_top)/o.year_y);var l=document.createElement("div"),h=this.date.week_start(e._currentDate());this._process_ignores(h,7,"day",1);for(var v=0;v<7;v++)this._ignores&&this._ignores[v]||(this._cols[v]="var(--dhx-scheduler-datepicker-cell-size)",this._render_x_header(v,0,h,l)),h=this.date.add(h,1,"day");for(l.lastChild.className+=" dhx_scale_bar_last",v=0;v
"+l.innerHTML+"
";var g=c.querySelector(".dhx_year_month"),y=c.querySelector(".dhx_year_grid"),x=c.querySelector(".dhx_year_body"),b=e.uid();this._waiAria.yearHeader(g,b),this._waiAria.yearGrid(y,b),g.innerHTML=this.templates.year_month(u);var k=this.date.week_start(u);this._reset_month_scale(x,u,k,6);for(var E=x.querySelectorAll("td"),D=0;D${this.templates.year_month(l)} +
`;const c=f.querySelector(".dhx_year_grid"),p=e._createDatePicker(null,{date:l,minWeeks:6});p._renderDayGrid(c),p.destructor(),o.appendChild(f),l=this.date.add(l,1,"month")}_.appendChild(o);let h=this.date.add(a,1,"year");h.valueOf()!=this.date.week_start(new Date(h)).valueOf()&&(h=this.date.week_start(new Date(h)),h=this.date.add(h,1,"week")),this._max_date=h;var v=this._getNavDateElement();v&&(v.innerHTML=this.templates[this._mode+"_date"](a,h,this._mode))};var n=e.getActionData;e.getActionData=function(_){return i()?{date:t(_.target),section:null}:n.apply(e,arguments)};var s=e._locate_event;e._locate_event=function(_){var a=s.apply(e,arguments);if(!a){var o=t(_);if(!o)return null;var l=e.getEvents(o,e.date.add(o,1,"day"));if(!l.length)return null;a=l[0].id}return a},e.attachEvent("onDestroy",function(){e._hideToolTip()})}},Je=new class{constructor(e){this._seed=0,this._schedulerPlugins=[],this._bundledExtensions=e,this._extensionsManager=new Na(e)}plugin(e){this._schedulerPlugins.push(e),G.scheduler&&e(G.scheduler)}getSchedulerInstance(e){for(var i=Sa(this._extensionsManager),t=0;t= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function () {\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\n\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.getState=function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n};\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\t\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\r\n\tvar html = '
';\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\t\thtml+=\"
\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\nscheduler.config.mark_now = true;\r\nscheduler.config.display_marked_timespans = true;\r\nscheduler.config.overwrite_marked_timespans = true;\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tvar blocker = scheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif (event.rec_type) {\r\n\t\t\tvar dates = scheduler.getRecDates(event);\r\n\t\t\tfor(var i=0; i < dates.length; i++){\r\n\t\t\t\tvar ev = scheduler._copy_event(event);\r\n\t\t\t\tscheduler._lame_copy(ev, dates[i]);\r\n\t\t\t\tevs.push(ev);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!blocker(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn blocker(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn blocker(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\tscheduler._mark_now = function(hide) {\r\n\t\t// day, week, units views\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tif (!this._els[dhx_now_time]) {\r\n\t\t\tthis._els[dhx_now_time] = [];\r\n\t\t}\r\n\t\tvar now = scheduler._currentDate();\r\n\t\tvar cfg = this.config;\r\n\t\tscheduler._remove_mark_now(); // delete previous marks if they exist\r\n\t\tif (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i\" + ev.text + \"

\" + (ev.event_location || '') + \"

\" + scheduler.templates.marker_date(start) + \" - \" + scheduler.templates.marker_date(end) + \"\";\r\n};\r\nscheduler.dblclick_dhx_map_area = function() {\r\n\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler._date,\r\n\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t});\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\n\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\n\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\n\r\nscheduler._latLngUpdate = false; // flag for not displaying event second time in case of coordinates update\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\tscheduler._isMapPositionSet = false; // if user actual (geolocation) position was set on the map\r\n\r\n\tconst gmap = document.createElement('div');\r\n\tgmap.className = 'dhx_map';\r\n\tgmap.id = 'dhx_gmap';\r\n\tgmap.style.display = \"none\";\r\n\r\n\tscheduler._obj.appendChild(gmap);\r\n\r\n\tscheduler._els.dhx_gmap = [];\r\n\tscheduler._els.dhx_gmap.push(gmap);\r\n\r\n\t_setMapSize('dhx_gmap');\r\n\r\n\tconst mapOptions = {\r\n\t\tzoom: scheduler.config.map_initial_zoom || 10,\r\n\t\tcenter: scheduler.config.map_initial_position,\r\n\t\tmapTypeId: scheduler.config.map_type || google.maps.MapTypeId.ROADMAP\r\n\t};\r\n\tconst map = new google.maps.Map(document.getElementById('dhx_gmap'), mapOptions);\r\n\tmap.disableDefaultUI = false;\r\n\tmap.disableDoubleClickZoom = !scheduler.config.readonly;\r\n\r\n\tgoogle.maps.event.addListener(map, \"dblclick\", function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\r\n\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\tvar point = event.latLng;\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'latLng': point },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\tstart_date: scheduler._date,\r\n\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n\r\n\tvar infoWindowOptions = {\r\n\t\tcontent: ''\r\n\t};\r\n\r\n\tif (scheduler.config.map_infowindow_max_width) {\r\n\t\tinfoWindowOptions.maxWidth = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\r\n\tscheduler.map = {\r\n\t\t_points: [],\r\n\t\t_markers: [],\r\n\t\t_infowindow: new google.maps.InfoWindow(infoWindowOptions),\r\n\t\t_infowindows_content: [],\r\n\t\t_initialization_count: -1,\r\n\t\t_obj: map\r\n\t};\r\n\r\n\tscheduler.ext.mapView.geocoder = new google.maps.Geocoder();\r\n\tscheduler.ext.mapView.map = map;\r\n\tscheduler.ext.mapView.points = scheduler.map._points;\r\n\tscheduler.ext.mapView.markers = scheduler.map._markers;\r\n\tscheduler.ext.mapView.infoWindow = scheduler.map._infowindow;\r\n\r\n\tif (scheduler.config.map_resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tif (!scheduler._isMapPositionSet) {\r\n\t\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\t\tvar _userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\r\n\t\t\t\t\tmap.setCenter(_userLocation);\r\n\t\t\t\t\tmap.setZoom(scheduler.config.map_zoom_after_resolve || 10);\r\n\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);\r\n\t\t\t\t\tscheduler.map._infowindow.position = map.getCenter();\r\n\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\r\n\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t},\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setPosition(map.getCenter());\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\t\t\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tgoogle.maps.event.addListener(map, \"resize\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t\tmap.setZoom(map.getZoom());\r\n\r\n\t});\r\n\tgoogle.maps.event.addListener(map, \"tilesloaded\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t});\r\n\r\n\tgmap.style.display = 'none'; // property was changed after attaching map\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i], false, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clear_map_tab() {\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\tvar markers = scheduler.map._markers;\r\n\t\tfor (var key in markers) {\r\n\t\t\tif (markers.hasOwnProperty(key)) {\r\n\t\t\t\tmarkers[key].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[key];\r\n\t\t\t\tif (scheduler.map._infowindows_content[key])\r\n\t\t\t\t\tdelete scheduler.map._infowindows_content[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tvar ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tvar html = \"
\";\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar ev = events[i];\r\n\t\t\tvar event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tvar ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tvar ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tvar t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (var i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tvar map = document.getElementById(elem_id);\r\n\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\tvar height = scheduler._y - nav_height;\r\n\t\tif (height < 0)\r\n\t\t\theight = 0;\r\n\t\tvar width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\tif (width < 0)\r\n\t\t\twidth = 0;\r\n\t\tmap.style.height = height + 'px';\r\n\t\tmap.style.width = width + 'px';\r\n\t\tmap.style.position = \"absolute\";\r\n\t\tmap.style.top = nav_height + \"px\";\r\n\t\tif (scheduler.config.rtl) {\r\n\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t} else {\r\n\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t}\r\n\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t}\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler.map._initialization_count++;\r\n\t\tvar gmap = scheduler._els.dhx_gmap[0];\r\n\t\tvar temp_center;\r\n\t\t//scheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\r\n\t\tif (mode) { //map tab activated\r\n\t\t\tclear_map_tab();\r\n\t\t\tfill_map_tab();\r\n\t\t\tgmap.style.display = 'block';\r\n\r\n\t\t\t// need to resize block every time window is resized\r\n\t\t\t_setMapSize('dhx_gmap');\r\n\t\t\ttemp_center = scheduler.map._obj.getCenter();\r\n\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else { //map tab de-activated\r\n\t\t\tgmap.style.display = 'none';\r\n\t\t}\r\n\t\tgoogle.maps.event.trigger(scheduler.map._obj, 'resize');\r\n\r\n\t\tif (scheduler.map._initialization_count === 0 && temp_center) { // if tab is activated for the first time need to fix position\r\n\t\t\tscheduler.map._obj.setCenter(temp_center);\r\n\t\t}\r\n\r\n\t\tif (scheduler._selected_event_id) {\r\n\t\t\tselectEvent(scheduler._selected_event_id);\r\n\t\t}\r\n\t};\r\n\r\n\tvar selectEvent = function(event_id) {\r\n\t\tscheduler.map._obj.setCenter(scheduler.map._points[event_id]);\r\n\t\tscheduler.callEvent(\"onClick\", [event_id]);\r\n\t};\r\n\r\n\tvar showAddress = function(event, setCenter, performClick) { // what if event have incorrect position from the start?\r\n\t\tvar point = scheduler.config.map_error_position;\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tpoint = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t}\r\n\t\tvar message = scheduler.templates.marker_text(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._new_event) {\r\n\r\n\t\t\tscheduler.map._infowindows_content[event.id] = message;\r\n\r\n\t\t\tif (scheduler.map._markers[event.id])\r\n\t\t\t\tscheduler.map._markers[event.id].setMap(null);\r\n\r\n\t\t\tscheduler.map._markers[event.id] = scheduler.ext.mapView.createMarker({\r\n\t\t\t\tposition: point,\r\n\t\t\t\tmap: scheduler.map._obj\r\n\t\t\t});\r\n\r\n\t\t\tgoogle.maps.event.addListener(scheduler.map._markers[event.id], 'click', function() {\r\n\t\t\t\tscheduler.map._infowindow.setContent(scheduler.map._infowindows_content[event.id]);\r\n\t\t\t\tscheduler.map._infowindow.open(scheduler.map._obj, scheduler.map._markers[event.id]);\r\n\t\t\t\tscheduler._selected_event_id = event.id;\r\n\t\t\t\tscheduler.render_data();\r\n\t\t\t});\r\n\t\t\tscheduler.map._points[event.id] = point;\r\n\r\n\t\t\tif (setCenter) scheduler.map._obj.setCenter(scheduler.map._points[event.id]);\r\n\t\t\tif (performClick) scheduler.callEvent(\"onClick\", [event.id]);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onClick\", function(id, domEvent) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tscheduler._selected_event_id = id;\r\n\t\t\tfor (var i = 0; i < scheduler._rendered.length; i++) {\r\n\t\t\t\tscheduler._rendered[i].className = 'dhx_map_line';\r\n\t\t\t\tif (scheduler._rendered[i].getAttribute(scheduler.config.event_attribute) == id) {\r\n\t\t\t\t\tscheduler._rendered[i].className += \" highlight\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._points[id] && scheduler.map._markers[id]) {\r\n\t\t\t\tscheduler.map._obj.setCenter(scheduler.map._points[id]); // was panTo\r\n\t\t\t\tgoogle.maps.event.trigger(scheduler.map._markers[id], 'click');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tvar _displayEventOnMap = function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\r\n\t\t\t\t\tscheduler._selected_event_id = event.id;\r\n\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t\tshowAddress(event, true, true);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tshowAddress(event, true, true);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _updateEventLocation = function(event) { // update lat and lng in database\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tvar ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\t\tif (!this._latLngUpdate) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t} else { // event no longer should be displayed on the map view\r\n\t\t\t\tscheduler._selected_event_id = null;\r\n\t\t\t\tscheduler.map._infowindow.close();\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis._latLngUpdate = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_event_id, new_event_id) {\r\n\t\tvar event = scheduler.getEvent(new_event_id);\r\n\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\tif (scheduler.map._markers[old_event_id]) {\r\n\t\t\t\tscheduler.map._markers[old_event_id].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[old_event_id];\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._infowindows_content[old_event_id])\r\n\t\t\t\tdelete scheduler.map._infowindows_content[old_event_id];\r\n\t\t\t_displayEventOnMap(event);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id, event) {\r\n\t\tif (!scheduler._dataprocessor) {\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\t/* Test/example\r\n\t scheduler.attachEvent(\"onLocationError\", function(event_id,event_object){\r\n\t return new google.maps.LatLng(8, 8);\r\n\t });\r\n\t */\r\n\r\n\tscheduler.attachEvent(\"onBeforeEventDelete\", function(id, event) {\r\n\t\tif (scheduler.map._markers[id]) {\r\n\t\t\tscheduler.map._markers[id].setMap(null); // if new event is deleted tab != map then it doesn't have marker yet\r\n\t\t}\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (scheduler.config.map_resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventCancel\", function(id, is_new) {\r\n\t\tif (is_new) {\r\n\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\tscheduler.map._infowindow.close();\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\r\n\tvar node = domEv;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tvar dx = (left + domEv.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tvar dy = (top + domEv.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:domEv.offsetWidth, height:domEv.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+loc.repeat_text_week_count+'
'+\r\n\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\tloc.select_year_day2+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t''+loc.repeat_text_occurences_count+'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_month_head = function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;"],"names":["global$1","window","global","extend","scheduler","div","className","element","document","createElement","split","forEach","cssClass","classList","add","itemTypes","rows_container","row","view","config","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","date","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","event","isCalendarVisible","destroyCalendar","renderCalendar","position","this","getState","navigation","handler","calendar","setCurrentView","html_element","renderElement","renderer","rows","cols","css","width","value","style","height","html","innerHTML","align","justifyContent","prepareConfig","renderLayout","items","fragment","createDocumentFragment","Array","isArray","i","length","next","appendChild","_init_nav_bar","navBar","$container","querySelector","_update_nav_bar","previousHeight","container","heightChanged","newHeight","xy","nav_height","unset_actions","_els","get_elements","set_actions","display","isAttachedNode","root","body","parentNode","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","listenWindowResize","resizeDelay","oldSize","clearTimeout","setTimeout","$destroyed","a","b","newSize","triggerSchedulerResize","$root","callEvent","updateView","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","contentWindow","removeChild","EventHost","constructor","_silent_mode","listeners","_silentStart","_silentEnd","createEventStorage","obj","handlers","index","eventStorage","combinedResult","handlerResult","apply","arguments","addEvent","settings","e","handlerId","id","once","originalHandler","removeEvent","clear","makeEventable","eventHost","attachEvent","eventName","toLowerCase","thisObject","bind","attachAll","callback","name","eventArguments","handlerName","concat","checkEvent","detachEvent","list","eventId","detachAllEvents","defaultDomEvents","el","addEventListener","eventRemove","removeEventListener","domEvents","eventScope","attach","capture","push","detach","splice","detachAll","staticArray","slice","undefined","createEventScope","_eventRemoveAll","_createDomEventScope","_trim","str","String","prototype","trim","replace","_isDate","getFullYear","getMonth","getDate","_isObject","uidSeed","Date","now","isDate","utils","uid","mixin","target","source","force","f","copy","object","result","pop","Function","toString","call","Number","Boolean","varType","Object","hasOwnProperty","defined","delay","timeout","timer","$cancelTimeout","$pending","args","$execute","getClassName","node","baseVal","indexOf","locateCss","classname","strict","trg","srcElement","ind","left","charAt","right","isVisible","visibility","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","isNaN","getAttribute","hasHref","area","nodeName","loLowerCase","isEnabled","input","select","textarea","hasAttribute","isShadowDomSupported","head","createShadowRoot","attachShadow","getRootNode","ShadowRoot","host","dom_helpers","getAbsoluteLeft","htmlObject","getOffset","getAbsoluteTop","top","getOffsetSum","elem","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetRect","box","getBoundingClientRect","test","navigator","userAgent","dummy","dummyBox","docElem","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","Math","round","closest","selector","insertAfter","newNode","referenceNode","nextSibling","insertBefore","remove","isChildOf","child","parent","contains","getFocusableNodes","nodes","querySelectorAll","join","nodesArray","$position","sort","hasShadowParent","getActiveElement","activeElement","shadowRoot","getSelection","focusNode","getRelativeEventPosition","ev","d","bottom","y","x","clientX","clientY","getTargetNode","tagName","composedPath","getNodePosition","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isIE","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialize$1","data","key","serialized","encodeURIComponent","JSON","stringify","generateStringToDate","format","utc","splt","mask","match","code","csp_str_to_date","set","temp","locale","month_short_hash","month_full_hash","UTC","cspEnabled","useCsp","csp","init","s","month_short","t","month_full","date_part","old","setHours","setMinutes","setSeconds","setMilliseconds","getHours","setTime","getTime","time_part","valueOf","getTimezoneOffset","week_start","shift","getDay","start_on_monday","month_start","setDate","year_start","setMonth","day_start","_add_days","inc","ndate","rest","hours","mode","setYear","to_fixed","num","date_to_str","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","getUTCHours","getUTCMinutes","getMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","parseYMD","parseMDY","parseDMY","dateString","parse_exact_format","datestr","nday","first_thursday","year_number","ordinal_date","floor","convert_to_utc","getSerializator","res","_events","_loaded","_load","url","from","_load_url","to","prevent_cache","_date","_load_mode","lf","templates","load_format","_min_date","cache_line","_max_date","temp_to","ajax","get","ajaxCallback","response","on_load","_parsers","xml","canParse","xhr","responseXML","firstChild","xmlDoc","parse","responseText","topElement","xmltop","loader","csrfToken","dhtmlx","security_key","opts","xpath","arr","serverList","itms","j","attrs","attributes","label","k","attr","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","text","evs","_init_event","json","err","events","dhx_security","collections","collections_loaded","collection","option","option_key","ical","RegExp","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","parse_date","dh","dm","utcMark","dy","dn","dd","server_utc","error","foundParser","parser","_process","status","_process_loading","_loading","_not_render","_render_wait","render_view_data","_after_call","_tagvalue","start_date","_init_date","end_date","_helpers","parseDate","getSerializableData","createSerializator","serialize","dataset","allEvents","exportedEvent","exportValue","rawValue","xml_format","format_date","type","load","setLoadMode","array","childNodes","show_loading","_x","_y","_obj","_init_touch_events","touch","MSStream","platform","maxTouchPoints","scroll_width","_mobile","touchEventsSupported","createEvent","_touch_events","touches","pageX","pageY","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","names","accessor","ignore","tracker","drag_mode","scroll_mode","action_mode","dblclicktime","attachTouchEvent","_is_lightbox_open","passive","drag_cancel","_hide_global_tip","_on_mouse_up","_temp_touch_block","_drag_id","_drag_mode","_drag_pos","_pointerDragId","acc","dnd","timeline","matrix","_mode","original_render","drag_id","getEvent","property","y_property","getEvents","_sorder","_count","render_data","_on_mouse_move","preventDefault","cancelBubble","_update_global_tip","abs","fake_event","pointerId","_click","dhx_cal_data","_on_dbl_click","_block_next_stop","touch_drag","actTask","_locate_event","fakeTask","sourceTask","_ignore_next_click","_getClassName","previousSibling","_on_mouse_down","for_rendered","_rendered","touch_tip","_show_global_tip","updateEvent","touch_swipe_dates","s_ev","e_ev","step","max_dy","scrollable","dx","dhx_cal_next_button","dhx_cal_prev_button","toptip","_global_tip","time","_timed","event_header","day_date","labels","drag_to_create","drag_to_move","calculatedMaterial","cachedBorderBoxValue","checkIfBorderBoxStyling","_is_material_skin","probe","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","flatSkinHourScale","min","_addThemeClass","skin","_skin_settings","use_select_menu_space","wide_form","hour_size_px","displayed_event_color","displayed_event_text_color","_skin_xy","lightbox_additional_height","bar_height","_build_skin_info","clearInterval","monitorIntervalId","setInterval","csstheme","setSkin","styles","themeVar","themeName","isCssVarTheme","cssValues","oldMaterialTheme","links","getElementsByTagName","href","_theme_info","theme","cssVarTheme","values","themeVariables","_configure","col","_skin_init","render","hour_scale","hour_date","_old_month_day","month_day","old_month_day","_currentDate","dhx_cal_today_button","tab","header","tabs","specialTabs","map","tabName","find","filter","firstTab","reverse","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_new_event","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","deleteEvent","_add_rec_marker","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","updateMode","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","message","boxAttribute","_dhx_msg_cfg","usercall","modalBox","hide","modal_key","which","keyCode","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","_waiAria","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","title","content","message_ok","message_cancel","buttons","btn","getElementById","hidden","focus","alertPopup","confirmPopup","boxPopup","box_params","params","expire","focusable","messageInfoAttr","timers","pull","seed","hideAll","popups","alert","confirm","modalbox","setTransactionMode","total","headers","payload","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","val","_columns","getSyncState","enableDataNames","enablePartialDataSend","_changed","setUpdateMode","master","rowId","state","findRow","existing","getUserData","set_invalid","is_invalid","markRow","sendData","_methods","details","getActionByState","checkBeforeUpdate","editStop","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","stack","keys","pref","_applyPayload","urlSeparator","dataToSend","self","queryParams","ids","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","method","preprocessedData","_cleanupItemBeforeSend","action","query","_onResolvedCreateUpdate","tag","resultState","setRequestHeader","sid","tid","afterUpdateCallback","routerMode","actionPromise","create","delete","update","then","Error","catch","valid","_forEachUpdatedRow","_getAllData","out","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","_is_virtual_event","_set_event_text_style","r","cssText","event_updated","rec_type","rec_pattern","_dp_change_event_id","new_id","changeEventId","_dp_hook_delete","setDp","_dp","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","func","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","destructor","processedData","updatedItem","output","_prepareDataItem","item","processedItem","formatDate","dataItem","ar","day_tab","week_tab","month_tab","new_event","icon_save","icon_cancel","icon_details","icon_edit","icon_delete","confirm_closing","confirm_deleting","section_description","section_time","full_day","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","prev","year","month","day","hour","minute","be","agenda_tab","description","year_tab","week_agenda_tab","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","month_for_recurring","day_for_recurring","ca","cn","cs","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","direction","newDate","setFullYear","setState","_toggleMode","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","maxDate","labelFormat","dayElement","max","weeks","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","currDate","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","commonViews","agenda","grid","unit","week_agenda","anythingElse","requiredExtensions","limit","_commonErrorMessages","unknownView","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","addMarkedTimespan","exportToPNG","exportToPDF","common","extend$l","_detachDomEvent","_init_once","scheduler_resize_listener","layout","hasSchedulerMarkup","console","wai_aria_application_role","views","_props","_grid","viewName","log","rtl","_scroll","init_templates","set_sizes","$initialized","min_event_height","scale_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","edit_save","edit_cancel","functor","scale_x","_table_view","materialScalePlaceholder","set_xy","_lightbox","_setLbPosition","_data_width","prepareValue","prepared","els","class_name","attr_value","labelAttr","domEventsScope","getDaysDifference","startDate","endDate","start","differenceInDays","_select_id","_close_not_saved","unselect","previousSelection","min_date","max_date","editor_id","_edit_id","lightbox_id","_lightbox_id","select_id","expanded","readonly","getActionData","icon","def_step","dhx_cal_tab","deprecated_name","substring","c","_dhtmlx_confirm","title_confirm_deleting","edit","save","showLightbox","form","addEventNow","end","base","duration","event_duration","time_step","start_hour","first_hour","_drag_event","src","dblclick_create","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_cols","_ignores","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","_colsS","$domHelpers","dataArea","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","title_confirm_closing","positive_closing","_correct_shift","back","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","has_moved","_correct_drag_start_date","len","_start_correction","_end_correction","last_hour","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","maxY","precisePos","minDate","preciseDate","cursor","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","getView","_allow_dnd","update_render","sx","update_view","drag_event_body","_lame_clone","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","moved","_dhx_changed","is_new","edit_on_create","details_on_create","isOneDayEvent","_lame_copy","_trigger_dyn_loading","_reset_ignores","_reset_scale","isViewExists","_set_aria_buttons_attrs","buttonGroups","group","headerButtonsAttributes","icon_form","oldClass","newClass","multidayScroll","dhx_multi_day","prev_scroll","preserve_scroll","_dy_shift","headerToggleState","_render_x_header","offset_top","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","count","count_n","_get_timeunit_start","_get_view_end","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","scales","cls","firstHalf","slotDate","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","_getNavDateElement","drag_resize","drag_move","_scales","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","totalWidth","col_length","offset","hiddenWidth","c2","cloneNode","cc","hourScaleAttr","scroll_hour","now_date","n","preserve","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","cellBody","bf1","getLabel","sections","lightbox","map_to","options","updateCollection","list_name","resetLightbox","hideCover","cache","n_ev","section","_focus","endColumnIndex","eventLength","startColumnIndex","_get_date_index","last_column","check","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","days","end_slot","fd","start_slot","_get_section_property","_is_initialized","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","setAttributes","role","isActive","getHeaderCellAttr","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","agendaDetailsBtnString","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","buttonLabel","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","dom","assert","show_errors","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","$","counter","methods","Promise","clearAll","createConfig","async","serializeRequestParams","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","xpathExp","docObj","selectNodes","first","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","readyState","filePath","open","toUpperCase","send","$ajax","default_date","month_date","load_date","week_date","date_format","api_date","day_column_padding","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_display","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","quick_info_detached","drag_highlight","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","ajax_error","delay_render","timeline_swap_resize","event_attribute","$initial","xml_date","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","clear_view","extra_data","silent","setEvent","hash","create_getter","create_setter","is_visible_events","clear_event","evFirstHour","evLastHour","lastHour","checkEndDate","get_visible_events","only_timed","filter_event","_is_main_area_event","hold","full","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","_get_event_bar_pos","widt","x2","_pre_render_events","containers","render_event_bar","max_evs","max_month_events","locate_holder","real","render_event","_get_first_visible_cell","cells","hb","h_old","_pre_render_events_table","_pre_render_events_line","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","weekCellIndex","locate_holder_day","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","zIndex","color","setProperty","tplClass","_editor","shiftKey","ariaAttr","icons","icons_str","currentIcon","textColor","highlightEventPosition","contentA","contentB","_","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","section_delimiter","getSectionTop","posFromDate","_smartRenderingEnabled","restoreOriginalColors","scrollTo","_append_drag_marker","m","scale","lastChild","_update_marker_position","size","getLightboxRoot","cspEnvironment","salesforceEnvironment","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","cfg","dt","last","limit_time_select","p","selectBoxClass","range","start_year","end_year","year_range","g","tdate","_time_values","ariaAttrs","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","block","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","inputBlock","fallback","inputId","old_id","getRootView","hooks","didInsert","cmp","skins","jQuery","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","oldDate","oldMode","updateFlags","lazy_updateView","ars","createDataProcessor","tMode","batchUpdate","dhtmlxError","catchError","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","ext","activePlugins","plugins","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","treetimeline","daytimeline","outerdrag","legacy","extensionList","plugin","getExtension","ExtensionsManager","_extensions","attaches","attachScheduler","_genStr","attachObject","vs","av","sched","schedId","setSizes","_viewRestore","notImplemented","modals","modalsStack","isModal","afterPopup","trapFocus","currentTarget","$keyboardNavigation","_keyNavMessagePopup","focusElement","backupFocus","key_nav_legacy","_temp_key_scope","key_nav","_pasteDate","_pasteSection","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","dispatcher","copyEvent","_make_pasted_event","event_pid","event_length","multisection","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","ctrlKey","metaKey","_buffer_event","_key_nav_copy_paste","getActiveNode","new_ev","scheduler_handlers","attachSchedulerHandlers","waitCall","keyDownHandler","focusHandler","keepScrollPosition","focusGlobalNode","enable","reFocusActiveNode","activeNode","isValid","MinicalButton","MinicalCell","mousedownHandler","dataAreaClick","listOfScales","some","Event","TimeSlot","nextSlot","setActiveNode","removeAttribute","evNode","prevState","lastStart","lastEnd","lastSection","getNode","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","_getViewPort","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","clone","delayShow","utils.default","setContent","show","tooltip_timeout","tooltip_hide_timeout","gplExtensions","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","_agendaScrollTop","agenda_area","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","l","rowAttr","dateHeader","descriptionHeader","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","eventStart","renderDay","calendarEvent","dates","selectedId","all_timed_month","is_event_short","_safe_copy","proto","isPrototypeOf","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","before","_setTempSection","event_id","collision_limit","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","second","evs_dates","getRecDates","tevs","concurrent","checked_mode","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","year_y","cur_height","week_agenda_scale_height","eventsContainer","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","cookie_param","old_load","drag_between","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","selected_id","addOption","disable","selectOption","setComboValue","all_options","single_option","getIndexByValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","o","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","getTimeline","orientation","dpi","zoom","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","info","_plain_export_copy","$text","_create_hidden_form","submit","_hidden_export_form","_get_export_size","footer","A5","A4","A3","A2","A1","A0","dataX","cSize","parseFloat","smartRendering","initialSizes","smart_rendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","grid_view","html_templates","all","getScope","scopes","minicalButton","minicalDate","SchedulerNode","DataArea","timeSlot","searchMap","key_nav_step","addShortcut","shortcut","scope","scopeObject","getShortcutHandler","commands","shortcuts","findHandler","removeShortcut","unbind","disp","setDefaultNode","_compose","parts","createCommand","modifiers","alt","ctrl","meta","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","doAction","returnValue","bindAll","initKeys","nextItem","currentFocus","currentIndex","divs","renderMultiple","currentStart","currentEnd","_modes","_getMode","units","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","areas","round_position","blocks","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","tempStart","tempEnd","_timeline_getX","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","inner_index","all_hours_height","hour_ms","lineHeight","getDefaultNode","getMode","blur","_compareEvents","_pickEvent","startId","nextEventHandler","nextEvent","currEvent","visibleDates","nextEv","prevEventHandler","HeaderCell","getNodes","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","defaultCell","_getSection","_getNodes","eventNode","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","_moveToSlot","slot","movingDate","getDefaultDate","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","timeslot","_getMultisectionView","_getNextSection","sectionId","nextIndex","defaultSlot","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","minutes","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","globalNode","_getGrid","_getNode","enabled","newRow","newCol","blurNode","editor","defaultPrevented","schedulerNode","_timeout","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","cellIndex","td","renderMinical","cal","added","destroyMinical","_def_count","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_start","limit_end","limit_view","check_limits","mark_now","display_marked_timespans","overwrite_marked_timespans","_temp_limit_scope","dhx_time_block","default_timespan_type","get_resulting_options","zones","blockTime","unblockTime","deleteMarkedTimespan","om","od","nm","nd","isBlocked","date_end","resetDate","checkInMarkedTimespan","timespan_type","on_overlap","temp_start_date","temp_end_date","timespans","_marked_timespans","day_value","getZones","_get_zone_minutes","eventEnd","markerStart","markerEnd","blocker","checkLimitViolation","complete_res","allow","day_index","linker","_add_timespan_zones","_get_blocked_zones","timeline_zones","blocked_timeline_zones","_get_relevant_blocked_zones","resultZones","is_new_event","data_copy","native_object","_mark_now","_mark_now_timer","dhx_now_time","_remove_mark_now","_append_mark_now","zone_start","start_index","end_index","units_l","r_divs","t_day","t_div","_render_marked_timespan","_prepare_timespan_options","r_configs","temp_configs","t_days","cloned_config","invert_zones","invertZones","view_key","t_config","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","start_day","delta","t_date","_get_css_classes_by_config","css_classes","_get_block_by_config","date_to_display","min_day","sday","block_proto","_mark_timespans","_on_scale_add_marker","markTimespan","configuration","rebuild_els","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","unmarkTimespan","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","_subtract_timespan_zones","is_modified","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","types","typedConfig","_get_types_to_render","specific","types_to_render","_get_configs_to_render","_get_unit_index","day_ind","unitsPerDay","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","map_view","mapView","geocoder","points","markers","infoWindow","createMarker","google","maps","Marker","map_date_width","map_icon_width","map_description_width","map_resolve_event_location","map_resolve_user_location","map_initial_position","LatLng","map_error_position","map_infowindow_max_width","map_type","MapTypeId","ROADMAP","map_zoom_after_resolve","marker_geo_success","marker_geo_fail","marker_date","marker_text","event_location","dblclick_dhx_map_area","map_time","map_text","map_start","add_map","map_date","_latLngUpdate","_isMapPositionSet","gmap","dhx_gmap","_setMapSize","mapOptions","map_initial_zoom","center","mapTypeId","Map","disableDefaultUI","disableDoubleClickZoom","addListener","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","lat","lng","formatted_address","infoWindowOptions","maxWidth","_points","_markers","_infowindow","InfoWindow","_infowindows_content","_initialization_count","Geocoder","geolocation","getCurrentPosition","_userLocation","coords","latitude","longitude","setCenter","setZoom","getCenter","setPosition","getZoom","fill_map_tab","_selected_event_id","ariaButtonAttr","elem_id","marginRight","marginLeft","marginTop","showAddress","temp_center","map_end","close","setMap","trigger","selectEvent","performClick","_displayEventOnMap","address","language","_updateEventLocation","old_event_id","new_event_id","_event_resolve_delay","ret","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","_render_calendar","unmarkCalendar","cont","tpos","_get_def_cont","$dom","dateAttribute","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","calendars","arrow","dayHeaders","dayCells","inputs","selects","inp","number","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","monthheight","old_s","multiselect","_result","_children","_mark_inputs","_ids","delimiter","script_url","divLoading","multisource","mvc","update_timer","use_id","sanitize","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","last_event","dragger","dhtmlDragAndDropObject","stopDrag","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_end","xml_top","profile","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","to_pdf","objects","getPDFData","toPDF","toPDFRange","quick_info","show_quick_info","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","_quick_info_onscroll_handler","$testmode","_qi_button_click","domEv","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","txt_replace","txts","txtt","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","originalForm","readonlyForm","_lightbox_r","getRecurringSection","getFirstSectionOfType","clearMilliseconds","old_add_event","occurrence_timestamp_in_utc","recurring_workdays","_get_node","_outer_html","outerHTML","rec","loc","repeat_date_of_end","_ds","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","_init_set_value","_end_date","str_date_format","repeat_date","date_str","register_els","inps","formatter","change_current_view","set_end_rule","_get_repeat_code","get_rcode","repeat","str_date","include_end_by","transpose_type","get_numeric_value","repeat_precise","_start","start_exists","transpose_day_week","set_rcode","_set_repeat_code","dispatchEvent","MouseEvent","elements","_rec_init_done","rf","blocked","_is_modified_occurence","_toggle_block","actual_dates","timeControl","getTimeSection","_start_date","_get_button","_get_form","backgroundPosition","_rec_markers","_rec_markers_pull","_pid_time","_get_rec_marker","ch","_get_rec_markers","_rec_temp","ev_id","_ignore_call","tev","_pid_changed","nid","nev","sub","isEventFound","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","old_update_event","transponse_size","day_week","originalMonth","newMonth","cor","cor2","cday","transposeRecurring","recurringParts","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","getMilliseconds","non_render","maxCount","startHour","visibleCount","_fix_daylight_saving_date","ted","recurrings","sev","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","hideTooltip","s2d","d2s","select_event","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_month_head","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","yearStart","datepicker","locateEvent","factory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","addCalendar","$dhx"],"mappings":"qOAUA,MAAAA,EAPqB,OAAXC,OAAW,IACNA,OAEAC,OCNA,SAASC,GAAOC,EAAAA,CAE/B,SAASC,EAAIC,EACZ,CAAA,IAAIC,EAAUC,SAASC,cAAc,KAAA,EAKrC,OAJeH,GAAa,IAAII,MAAM,GAC9BC,EAAAA,QAAQ,SAASC,EAAAA,CACxBL,EAAQM,UAAUC,IAAIF,CAAAA,CACxB,GACQL,CACR,CACA,IAAIQ,EAAY,CACfC,eAAgB,UACf,CAAA,OAAOX,EAAI,+BAAA,CACX,EACDY,IAAK,UACJ,CAA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I,YAAYlH,EAAOo+F,EAAWphF,OAAOhd,CAAAA,CAAAA,EAI9Co+F,EAAW5pF,QACbrW,EAAU8zD,KAAKE,UAAUisC,EAAW5pF,MAGlC1S,EAAAA,MAAMC,QAAQq8F,EAAWpT,SAC3BoT,GAAAA,EAAWpT,UAAUtsF,QAAQ,SAAS+B,EAAAA,CACrCtC,EAAUqgG,YAAY/9F,CAC1B,CAAA,CAAA,EAGK29F,EAAW17F,UACbvE,EAAU4W,KAAKqpF,EAAW17F,SAAAA,EAE1BvE,EAAU4W,KAAAA,EAGRqpF,EAAW5qF,OACH4qF,OAAAA,EAAW5qF,MAAS,SAC7BrV,EAAUqiB,KAAK49E,EAAW5qF,IAE1BrV,EAAAA,EAAUgd,MAAMijF,EAAW5qF,IAG7B,EAAA,CAAA,EDxFmCynD,EAE/B98D,EAAAA,EAAY2/F,EAAQ5sC,qBAAAA,EACpBD,GAAY,CACjBuC,OAAQr1D,EAAUmJ,KAAKw2F,EAAQtqC,OAAQsqC,CAAAA,CAAAA,EAGxC9/F,OAAOG,UAAYA,EACnBH,OAAOizD,UAAYA,GAEfjzD,OAAOygG,OACVzgG,OAAOygG,KAAO,IAGfzgG,OAAOygG,KAAKtgG,UAAYA,EACxBH,OAAOygG,KAAKxtC,UAAYA"} \ No newline at end of file +{"version":3,"file":"dhtmlxscheduler.js","sources":["../sources/global.js","../sources/plugins/drag_highlight_pos.js","../sources/plugins/limit.js","../sources/plugins/batch_update.js","../sources/plugins/index.js","../sources/plugins/undo_delete.js","../sources/core/utils/utils.js","../sources/core/nav_bar.js","../sources/core/scheduler_resize_listener.js","../sources/utils/eventable.js","../sources/core/utils/event.js","../sources/core/common.js","../sources/core/utils/scoped_event.js","../sources/core/utils/dom_helpers.js","../sources/utils/env.js","../sources/core/common/url_serialize.js","../sources/core/base.js","../sources/core/common/get_serializable_events.js","../sources/core/load.js","../sources/core/loaders/xml.js","../sources/core/loaders/json.js","../sources/core/loaders/ical.js","../sources/core/touch.js","../sources/core/skins.js","../sources/core/dataprocessor/dataprocessor_hooks.js","../sources/core/dataprocessor/dataprocessor.js","../sources/core/message.js","../sources/locale/locale_ar.js","../sources/locale/locale_be.js","../sources/locale/locale_ca.js","../sources/locale/locale_cn.js","../sources/locale/locale_cs.js","../sources/locale/locale_da.js","../sources/locale/locale_de.js","../sources/locale/locale_el.js","../sources/locale/locale_en.js","../sources/locale/locale_es.js","../sources/locale/locale_fi.js","../sources/locale/locale_fr.js","../sources/locale/locale_he.js","../sources/locale/locale_hu.js","../sources/locale/locale_id.js","../sources/locale/locale_it.js","../sources/locale/locale_jp.js","../sources/locale/locale_manager.js","../sources/locale/locale_nb.js","../sources/locale/locale_nl.js","../sources/locale/locale_no.js","../sources/locale/locale_pl.js","../sources/locale/locale_pt.js","../sources/locale/locale_ro.js","../sources/locale/locale_ru.js","../sources/locale/locale_si.js","../sources/locale/locale_sk.js","../sources/locale/locale_sv.js","../sources/locale/locale_tr.js","../sources/locale/locale_ua.js","../sources/core/datepicker.js","../sources/scheduler_factory_method.js","../sources/core/state.js","../sources/core/common_errors.js","../sources/core/scheduler.js","../sources/core/wai_aria.js","../sources/core/common/assert.js","../sources/core/jquery.js","../sources/core/destructor.js","../sources/core/utils/ajax.js","../sources/core/config.js","../sources/core/event.js","../sources/core/event_highlight.js","../sources/core/lightbox.js","../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../sources/core/delay_render.js","../sources/core/connector.js","../sources/locale/index.js","../sources/ext/extension_manager.js","../sources/dhtmlx_hook.js","../sources/ext/restricted_extensions/not_implemented_extension.js","../sources/ext/keyboard_navigation/modals.js","../sources/ext/keyboard_navigation/key_nav_legacy.js","../sources/ext/keyboard_navigation/scheduler_handlers.js","../sources/ext/map_view/gMapAdapter.ts","../sources/ext/map_view/osmMapAdapter.ts","../sources/ext/map_view/mapboxAdapter.ts","../node_modules/rrule/dist/esm/weekday.js","../node_modules/rrule/dist/esm/helpers.js","../node_modules/rrule/dist/esm/dateutil.js","../node_modules/rrule/dist/esm/iterresult.js","../node_modules/rrule/node_modules/tslib/tslib.es6.mjs","../node_modules/rrule/dist/esm/callbackiterresult.js","../node_modules/rrule/dist/esm/types.js","../node_modules/rrule/dist/esm/nlp/i18n.js","../node_modules/rrule/dist/esm/nlp/totext.js","../node_modules/rrule/dist/esm/nlp/parsetext.js","../node_modules/rrule/dist/esm/nlp/index.js","../node_modules/rrule/dist/esm/datetime.js","../node_modules/rrule/dist/esm/parseoptions.js","../node_modules/rrule/dist/esm/parsestring.js","../node_modules/rrule/dist/esm/datewithzone.js","../node_modules/rrule/dist/esm/optionstostring.js","../node_modules/rrule/dist/esm/cache.js","../node_modules/rrule/dist/esm/masks.js","../node_modules/rrule/dist/esm/iterinfo/yearinfo.js","../node_modules/rrule/dist/esm/iterinfo/index.js","../node_modules/rrule/dist/esm/iterinfo/monthinfo.js","../node_modules/rrule/dist/esm/iterinfo/easter.js","../node_modules/rrule/dist/esm/iter/poslist.js","../node_modules/rrule/dist/esm/iter/index.js","../node_modules/rrule/dist/esm/rrule.js","../node_modules/rrule/dist/esm/rrulestr.js","../node_modules/rrule/dist/esm/rruleset.js","../node_modules/rrule/dist/esm/iterset.js","../sources/ext/tooltip/tooltip.ts","../sources/ext/tooltip/tooltipManager.ts","../sources/ext/extensions_gpl.js","../sources/ext/active_links.js","../sources/ext/agenda_legacy_view.js","../sources/ext/agenda.js","../sources/ext/all_timed.js","../sources/ext/collision.js","../sources/ext/container_autoresize.js","../sources/ext/cookie.js","../sources/ext/restricted_extensions/daytimeline.js","../sources/ext/restricted_extensions/drag_between.js","../sources/ext/editors.js","../sources/ext/expand.js","../sources/ext/export_api/index.js","../sources/ext/restricted_extensions/grid_view.js","../sources/ext/html_templates.js","../sources/ext/key_nav.js","../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../sources/ext/keyboard_navigation/common/eventhandler.js","../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../sources/ext/keyboard_navigation/marker.js","../sources/ext/keyboard_navigation/elements/scheduler_node.js","../sources/ext/keyboard_navigation/elements/nav_node.js","../sources/ext/keyboard_navigation/elements/header_cell.js","../sources/ext/keyboard_navigation/elements/event.js","../sources/ext/keyboard_navigation/elements/time_slot.js","../sources/ext/keyboard_navigation/elements/minical_button.js","../sources/ext/keyboard_navigation/elements/minical_cell.js","../sources/ext/keyboard_navigation/elements/data_area.js","../sources/ext/keyboard_navigation/core.js","../sources/ext/keyboard_navigation/minical_handlers.js","../sources/ext/layer.js","../sources/ext/limit.js","../sources/ext/map_view/index.ts","../sources/ext/minical.js","../sources/ext/monthheight.js","../sources/ext/restricted_extensions/multisection.js","../sources/ext/multiselect.js","../sources/ext/multisource.js","../sources/ext/mvc.js","../sources/ext/outerdrag.js","../sources/ext/pdf.js","../sources/ext/quick_info.js","../sources/ext/readonly.js","../sources/ext/recurring.js","../sources/ext/recurring_legacy.js","../sources/ext/serialize.js","../sources/ext/restricted_extensions/timeline.js","../sources/ext/tooltip/index.ts","../sources/ext/restricted_extensions/treetimeline.js","../sources/ext/restricted_extensions/units.js","../sources/ext/url.js","../sources/ext/restricted_extensions/week_agenda.js","../sources/ext/wp.js","../sources/ext/year_view.js","../sources/dhtmlxscheduler.gpl.js","../sources/scheduler_factory.js"],"sourcesContent":["\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function dragHighlightPos(scheduler){\r\n let dndMarkers = [];\r\n let dragStarted = false;\r\n let eventNode = null;\r\n let event = null;\r\n\r\n function isEnabled() { \r\n return scheduler.config.drag_highlight && scheduler.markTimespan;\r\n }\r\n\r\n function checkViewName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj){\r\n return viewObj.layout;\r\n }\r\n return viewName;\r\n }\r\n\r\n function checkSectionPropertyName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj.y_property){\r\n return viewObj.y_property;\r\n }\r\n if(viewObj.map_to){\r\n return viewObj.map_to;\r\n }\r\n }\r\n\r\n function setRequiredStylesToMarker(eventNode, layout){\r\n switch (layout) {\r\n case \"month\":\r\n eventNode.style.top = \"\";\r\n eventNode.style.left = \"\";\r\n break;\r\n case \"timeline\":\r\n eventNode.style.left = \"\";\r\n eventNode.style.marginLeft = \"1px\";\r\n break;\r\n default:\r\n eventNode.style.top = \"\";\r\n break;\r\n }\r\n }\r\n \r\n function createMarkerConfig(configSettings){\r\n const { event, layout, viewName, sectionId, eventNode } = configSettings;\r\n setRequiredStylesToMarker(eventNode, layout);\r\n const sections = {};\r\n let markerObject = {\r\n start_date: event.start_date,\r\n end_date: event.end_date,\r\n css: \"dhx_scheduler_dnd_marker\",\r\n html: eventNode\r\n };\r\n if (layout == \"timeline\" || layout == \"month\" ){\r\n // we need to set end date less than 24 hours of the views to avoid receiving multiple marktimespans\r\n markerObject = {...markerObject, end_date: scheduler.date.add(event.start_date, 1, 'minute')};\r\n }\r\n if (sectionId){\r\n sections[viewName] = sectionId;\r\n markerObject.sections = sections;\r\n }\r\n return markerObject;\r\n }\r\n\r\n function createViewMarker(settings){\r\n const { layout } = settings;\r\n let markerConfigs;\r\n switch (layout) {\r\n case \"month\": \r\n markerConfigs = getMonthViewMarkers(settings);\r\n break;\r\n case 'timeline':\r\n case 'units':\r\n markerConfigs = getTimelineAndUnitsViewMarkers(settings);\r\n break;\r\n default: \r\n markerConfigs = getColumnViewMarkers(settings);\r\n break;\r\n }\r\n markerConfigs.forEach((cfg) => {\r\n dndMarkers.push(scheduler.markTimespan(cfg));\r\n });\r\n }\r\n\r\n function getColumnViewMarkers(settings){\r\n const {event, layout, viewName, sectionId} = settings;\r\n let columnViewMarkersArray = [];\r\n let eventNodes = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);\r\n if(eventNodes){\r\n for (let i = 0; i < eventNodes.length; i++) {\r\n let eventNodeClone = eventNodes[i].cloneNode(true);\r\n let startDate = new Date(+eventNodeClone.getAttribute(\"data-bar-start\"));\r\n let endDate = new Date(+eventNodeClone.getAttribute(\"data-bar-end\"));\r\n let dates = {start_date: startDate, end_date: endDate};\r\n const configSettings = {\r\n event: dates, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode:eventNodeClone\r\n };\r\n columnViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\t\r\n }\r\n return columnViewMarkersArray;\r\n }\r\n\r\n function getMonthViewMarkers(settings){\r\n let monthViewMarkersArray = [];\r\n const {event, layout, viewName, sectionId} = settings;\r\n const weekDates = [];\r\n let currDate = new Date(event.start_date);\r\n while(currDate.valueOf() < event.end_date.valueOf()){\r\n let obj = {start_date: currDate};\r\n weekDates.push(obj);\r\n currDate = scheduler.date.week_start(scheduler.date.add(currDate, 1, \"week\"));\r\n }\r\n let cells = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']`);\r\n for (let i = 0; i < cells.length; i++) {\r\n const configSettings = {\r\n event: weekDates[i], \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode: cells[i].cloneNode(true)\r\n };\r\n monthViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n return monthViewMarkersArray;\r\n }\r\n\r\n function getTimelineAndUnitsViewMarkers(settings){\r\n let unitMarkersArray = [];\r\n const {event, layout, viewName, eventNode} = settings;\r\n let sectionPropertyName = checkSectionPropertyName(viewName);\r\n if (scheduler.config.multisection && sectionPropertyName){\r\n const sections = String(event[sectionPropertyName]).split(scheduler.config.section_delimiter);\r\n const formatedSections = sections.map(element => String(element));\r\n const elems = [];\r\n for (let i = 0; i < formatedSections.length; i++) {\r\n elems[i] = eventNode.cloneNode(true);\r\n const configSettings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId: formatedSections[i],\r\n eventNode: elems[i]\r\n };\r\n unitMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n }\r\n return unitMarkersArray;\r\n }\r\n \r\n scheduler.attachEvent(\"onBeforeDrag\", function (id, mode, e){\r\n if (isEnabled()) {\r\n dragStarted = true;\r\n event = scheduler.getEvent(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n // to avoid incorrect eventNode and marker creation when scheduler.config.cascade_event_display included\r\n if (layout == \"units\" && scheduler.config.cascade_event_display ) {\r\n scheduler.unselect(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n scheduler.attachEvent(\"onEventDrag\", function (id, mode, e){\r\n if(dragStarted && isEnabled()){\r\n dragStarted = false;// insert element only once after dnd start\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n const sectionId = scheduler.getActionData(e).section;\r\n if (event) {\r\n const settings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode\r\n };\r\n createViewMarker(settings);\r\n }\r\n }\r\n });\r\n\r\n scheduler.attachEvent(\"onDragEnd\", function(id, mode, e){\r\n for (let i = 0; i < dndMarkers.length; i++) {\r\n scheduler.unmarkTimespan(dndMarkers[i]);\r\n }\r\n dndMarkers = [];\r\n eventNode = null;\r\n event = null;\r\n });\r\n}","export default function limitPlugin(scheduler){\r\n\r\n\r\n\tscheduler.config.mark_now = true;\r\n\tscheduler.config.display_marked_timespans = true;\r\n\tscheduler.config.overwrite_marked_timespans = true;\r\n\r\n\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tscheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif ((event.rec_type && event._end_date) || (event.rrule)) {\r\n\t\t\tconst seriesEnd = event._end_date || event.end_date;\r\n\t\t\t// GS-2482 need to take into account that a part of recurring events might be outside the limits\r\n\t\t\tif ((c.limit_start && c.limit_end)) {\r\n\t\t\t\tvar recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event.start_date.valueOf() <= c.limit_end.valueOf();\r\n\t\t\t\treturn recEventInLimits;\r\n\t\t\t} else return true;\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i {\r\n\t\t\tif(date){\r\n\t\t\t\tcalls.setModeDate.date = date;\r\n\t\t\t}\r\n\t\t\tif(mode){\r\n\t\t\t\tcalls.setModeDate.mode = mode;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar methods = {\r\n\t\t\trender:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tsetCurrentView:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tupdateView:(date, mode) => {calls.needUpdateView = true; rememberModeDate(date, mode);},\r\n\t\t\trender_data:() => calls.needRender = true,\r\n\t\t\trender_view_data:(evs) => { \r\n\t\t\t\tif(evs && evs.length){\r\n\t\t\t\t\tevs.forEach((e) => calls.repaintEvents[e.id] = true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcalls.needRender = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\tisActive = false;\r\n\t\tif(!noRedraw){\r\n\t\t\tif(calls.needRender){\r\n\t\t\t\tscheduler.render(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else if(calls.needUpdateView){\r\n\t\t\t\tscheduler.updateView(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else{\r\n\t\t\t\tfor(const i in calls.repaintEvents){\r\n\t\t\t\t\tscheduler.updateEvent(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default function(scheduler){\r\n\tscheduler.batchUpdate = createMethod(scheduler);\r\n}","import dragHighlightPos from \"./drag_highlight_pos\";\r\nimport undoDelete from \"./undo_delete\";\r\nimport limit from \"./limit\";\r\nimport batchUpdate from \"./batch_update\";\r\n\r\nexport default function initPlugins(scheduler){\r\n undoDelete(scheduler);\r\n dragHighlightPos(scheduler);\r\n limit(scheduler);\r\n batchUpdate(scheduler);\r\n}","export default function undoDelete(scheduler) {\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tlet deletedEvent = scheduler.copy(ev);\r\n\t\tif (scheduler.config.undo_deleted && !scheduler.getState().new_event) {\r\n\t\t\tscheduler.message({\r\n\t\t\t\ttext: `
\r\n Event deleted\r\n \r\n
`,\r\n\t\t\t\texpire: 10000,\r\n\t\t\t\ttype: \"popup_after_delete\",\r\n\t\t\t\tcallback: function (e) {\r\n\t\t\t\t\tlet undoBtn = e.target.closest(\r\n\t\t\t\t\t\t`[data-deleted-event-id=\"${ev.id}\"]`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (undoBtn) {\r\n\t\t\t\t\t\tscheduler.addEvent(deletedEvent);\r\n\t\t\t\t\t\tscheduler.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function (e) {\r\n if(text.callback) {\r\n text.callback.call(this, e);\r\n }\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id, callback) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id, callback: callback};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"يومي\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"أسبوعي\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"شهري\",\r\n\t\trepeat_radio_year: \"سنوي\",\r\n\t\trepeat_radio_day_type: \"كل\",\r\n\t\trepeat_text_day_count: \"يوم\",\r\n\t\trepeat_radio_day_type2: \"كل يوم عمل\",\r\n\t\trepeat_week: \" تكرار كل\",\r\n\t\trepeat_text_week_count: \"أسبوع في الأيام التالية:\",\r\n\t\trepeat_radio_month_type: \"تكرار\",\r\n\t\trepeat_radio_month_start: \"في\",\r\n\t\trepeat_text_month_day: \"يوم كل\",\r\n\t\trepeat_text_month_count: \"شهر\",\r\n\t\trepeat_text_month_count2_before: \"كل\",\r\n\t\trepeat_text_month_count2_after: \"شهر\",\r\n\t\trepeat_year_label: \"في\",\r\n\t\tselect_year_day2: \"من\",\r\n\t\trepeat_text_year_day: \"يوم\",\r\n\t\tselect_year_month: \"شهر\",\r\n\t\trepeat_radio_end: \"بدون تاريخ انتهاء\",\r\n\t\trepeat_text_occurences_count: \"تكرارات\",\r\n\t\trepeat_radio_end2: \"بعد\",\r\n\t\trepeat_radio_end3: \"ينتهي في\",\r\n\r\n\t\trepeat_never: \"أبداً\",\r\n\t\trepeat_daily: \"كل يوم\",\r\n\t\trepeat_workdays: \"كل يوم عمل\",\r\n\t\trepeat_weekly: \"كل أسبوع\",\r\n\t\trepeat_monthly: \"كل شهر\",\r\n\t\trepeat_yearly: \"كل سنة\",\r\n\t\trepeat_custom: \"تخصيص\",\r\n\t\trepeat_freq_day: \"يوم\",\r\n\t\trepeat_freq_week: \"أسبوع\",\r\n\t\trepeat_freq_month: \"شهر\",\r\n\t\trepeat_freq_year: \"سنة\",\r\n\t\trepeat_on_date: \"في التاريخ\",\r\n\t\trepeat_ends: \"ينتهي\",\r\n\r\n\t\tmonth_for_recurring: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_for_recurring: [\"الأحد\", \"الإثنين\", \"الثلاثاء\", \"الأربعاء\", \"الخميس\", \"الجمعة\", \"السبت\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\r\n\t\trepeat_never: \"Ніколі\",\r\n\t\trepeat_daily: \"Кожны дзень\",\r\n\t\trepeat_workdays: \"Кожны працоўны дзень\",\r\n\t\trepeat_weekly: \"Кожны тыдзень\",\r\n\t\trepeat_monthly: \"Кожны месяц\",\r\n\t\trepeat_yearly: \"Кожны год\",\r\n\t\trepeat_custom: \"Наладжвальны\",\r\n\t\trepeat_freq_day: \"Дзень\",\r\n\t\trepeat_freq_week: \"Тыдзень\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Заканчваецца\",\r\n\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diari\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Setmanal\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mensual\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada dia laborable\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"setmana els dies següents:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada\",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"de\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sense data de finalització\",\r\n\t\trepeat_text_occurences_count: \"ocurrències\",\r\n\t\trepeat_radio_end2: \"Després\",\r\n\t\trepeat_radio_end3: \"Finalitzar el\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Cada dia\",\r\n\t\trepeat_workdays: \"Cada dia laborable\",\r\n\t\trepeat_weekly: \"Cada setmana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada any\",\r\n\t\trepeat_custom: \"Personalitzat\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Setmana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Any\",\r\n\t\trepeat_on_date: \"En la data\",\r\n\t\trepeat_ends: \"Finalitza\",\r\n\r\n\t\tmonth_for_recurring: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tday_for_recurring: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"]\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\t\r\n\t\trepeat_never: \"从不\",\r\n\t\trepeat_daily: \"每天\",\r\n\t\trepeat_workdays: \"每个工作日\",\r\n\t\trepeat_weekly: \"每周\",\r\n\t\trepeat_monthly: \"每月\",\r\n\t\trepeat_yearly: \"每年\",\r\n\t\trepeat_custom: \"自定义\",\r\n\t\trepeat_freq_day: \"天\",\r\n\t\trepeat_freq_week: \"周\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"在日期\",\r\n\t\trepeat_ends: \"结束\",\r\n\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý den\",\r\n\t\trepeat_workdays: \"Každý pracovní den\",\r\n\t\trepeat_weekly: \"Každý týden\",\r\n\t\trepeat_monthly: \"Každý měsíc\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastní\",\r\n\t\trepeat_freq_day: \"Den\",\r\n\t\trepeat_freq_week: \"Týden\",\r\n\t\trepeat_freq_month: \"Měsíc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Končí\",\r\n\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver hverdag\",\r\n\t\trepeat_weekly: \"Hver uge\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Brugerdefineret\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uge\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\r\n\t\trepeat_never: \"Nie\",\r\n\t\trepeat_daily: \"Jeden Tag\",\r\n\t\trepeat_workdays: \"Jeden Werktag\",\r\n\t\trepeat_weekly: \"Jede Woche\",\r\n\t\trepeat_monthly: \"Jeden Monat\",\r\n\t\trepeat_yearly: \"Jedes Jahr\",\r\n\t\trepeat_custom: \"Benutzerdefiniert\",\r\n\t\trepeat_freq_day: \"Tag\",\r\n\t\trepeat_freq_week: \"Woche\",\r\n\t\trepeat_freq_month: \"Monat\",\r\n\t\trepeat_freq_year: \"Jahr\",\r\n\t\trepeat_on_date: \"Am Datum\",\r\n\t\trepeat_ends: \"Endet\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\r\n\t\trepeat_never: \"Ποτέ\",\r\n\t\trepeat_daily: \"Κάθε μέρα\",\r\n\t\trepeat_workdays: \"Κάθε εργάσιμη μέρα\",\r\n\t\trepeat_weekly: \"Κάθε εβδομάδα\",\r\n\t\trepeat_monthly: \"Κάθε μήνα\",\r\n\t\trepeat_yearly: \"Κάθε χρόνο\",\r\n\t\trepeat_custom: \"Προσαρμοσμένο\",\r\n\t\trepeat_freq_day: \"Ημέρα\",\r\n\t\trepeat_freq_week: \"Εβδομάδα\",\r\n\t\trepeat_freq_month: \"Μήνας\",\r\n\t\trepeat_freq_year: \"Χρόνος\",\r\n\t\trepeat_on_date: \"Σε ημερομηνία\",\r\n\t\trepeat_ends: \"Λήγει\",\r\n\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\r\n\t\trepeat_never: \"Never\",\r\n\t\trepeat_daily: \"Every day\",\r\n\t\trepeat_workdays: \"Every weekday\",\r\n\t\trepeat_weekly: \"Every week\",\r\n\t\trepeat_monthly: \"Every month\",\r\n\t\trepeat_yearly: \"Every year\",\r\n\t\trepeat_custom: \"Custom\",\r\n\t\trepeat_freq_day: \"Day\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Month\",\r\n\t\trepeat_freq_year: \"Year\",\r\n\t\trepeat_on_date: \"On date\",\r\n\t\trepeat_ends: \"Ends\",\r\n\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Cada día\",\r\n\t\trepeat_workdays: \"Cada día laborable\",\r\n\t\trepeat_weekly: \"Cada semana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada año\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Día\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Año\",\r\n\t\trepeat_on_date: \"En la fecha\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ei koskaan\",\r\n\t\trepeat_daily: \"Joka päivä\",\r\n\t\trepeat_workdays: \"Joka arkipäivä\",\r\n\t\trepeat_weekly: \"Joka viikko\",\r\n\t\trepeat_monthly: \"Joka kuukausi\",\r\n\t\trepeat_yearly: \"Joka vuosi\",\r\n\t\trepeat_custom: \"Mukautettu\",\r\n\t\trepeat_freq_day: \"Päivä\",\r\n\t\trepeat_freq_week: \"Viikko\",\r\n\t\trepeat_freq_month: \"Kuukausi\",\r\n\t\trepeat_freq_year: \"Vuosi\",\r\n\t\trepeat_on_date: \"Tiettynä päivänä\",\r\n\t\trepeat_ends: \"Päättyy\",\r\n\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\r\n\t\trepeat_never: \"Jamais\",\r\n\t\trepeat_daily: \"Chaque jour\",\r\n\t\trepeat_workdays: \"Chaque jour ouvrable\",\r\n\t\trepeat_weekly: \"Chaque semaine\",\r\n\t\trepeat_monthly: \"Chaque mois\",\r\n\t\trepeat_yearly: \"Chaque année\",\r\n\t\trepeat_custom: \"Personnalisé\",\r\n\t\trepeat_freq_day: \"Jour\",\r\n\t\trepeat_freq_week: \"Semaine\",\r\n\t\trepeat_freq_month: \"Mois\",\r\n\t\trepeat_freq_year: \"Année\",\r\n\t\trepeat_on_date: \"À la date\",\r\n\t\trepeat_ends: \"Se termine\",\r\n\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\r\n\t\trepeat_never: \"אף פעם\",\r\n\t\trepeat_daily: \"כל יום\",\r\n\t\trepeat_workdays: \"כל יום עבודה\",\r\n\t\trepeat_weekly: \"כל שבוע\",\r\n\t\trepeat_monthly: \"כל חודש\",\r\n\t\trepeat_yearly: \"כל שנה\",\r\n\t\trepeat_custom: \"מותאם אישית\",\r\n\t\trepeat_freq_day: \"יום\",\r\n\t\trepeat_freq_week: \"שבוע\",\r\n\t\trepeat_freq_month: \"חודש\",\r\n\t\trepeat_freq_year: \"שנה\",\r\n\t\trepeat_on_date: \"בתאריך\",\r\n\t\trepeat_ends: \"מסתיים\",\r\n\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Napi\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Heti\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Havi\",\r\n\t\trepeat_radio_year: \"Éves\",\r\n\t\trepeat_radio_day_type: \"Minden\",\r\n\t\trepeat_text_day_count: \"nap\",\r\n\t\trepeat_radio_day_type2: \"Minden munkanap\",\r\n\t\trepeat_week: \" Ismételje meg minden\",\r\n\t\trepeat_text_week_count: \"héten a következő napokon:\",\r\n\t\trepeat_radio_month_type: \"Ismétlés\",\r\n\t\trepeat_radio_month_start: \"Ekkor\",\r\n\t\trepeat_text_month_day: \"nap minden\",\r\n\t\trepeat_text_month_count: \"hónapban\",\r\n\t\trepeat_text_month_count2_before: \"minden\",\r\n\t\trepeat_text_month_count2_after: \"hónapban\",\r\n\t\trepeat_year_label: \"Ekkor\",\r\n\t\tselect_year_day2: \"-án/-én\",\r\n\t\trepeat_text_year_day: \"nap\",\r\n\t\tselect_year_month: \"hónap\",\r\n\t\trepeat_radio_end: \"Nincs befejezési dátum\",\r\n\t\trepeat_text_occurences_count: \"esemény\",\r\n\t\trepeat_radio_end2: \"Után\",\r\n\t\trepeat_radio_end3: \"Befejező dátum\",\r\n\r\n\t\trepeat_never: \"Soha\",\r\n\t\trepeat_daily: \"Minden nap\",\r\n\t\trepeat_workdays: \"Minden munkanap\",\r\n\t\trepeat_weekly: \"Minden héten\",\r\n\t\trepeat_monthly: \"Minden hónapban\",\r\n\t\trepeat_yearly: \"Minden évben\",\r\n\t\trepeat_custom: \"Egyedi\",\r\n\t\trepeat_freq_day: \"Nap\",\r\n\t\trepeat_freq_week: \"Hét\",\r\n\t\trepeat_freq_month: \"Hónap\",\r\n\t\trepeat_freq_year: \"Év\",\r\n\t\trepeat_on_date: \"Dátum szerint\",\r\n\t\trepeat_ends: \"Befejeződik\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Harian\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Mingguan\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Bulanan\",\r\n\t\trepeat_radio_year: \"Tahunan\",\r\n\t\trepeat_radio_day_type: \"Setiap\",\r\n\t\trepeat_text_day_count: \"hari\",\r\n\t\trepeat_radio_day_type2: \"Setiap hari kerja\",\r\n\t\trepeat_week: \" Ulangi setiap\",\r\n\t\trepeat_text_week_count: \"minggu pada hari berikut:\",\r\n\t\trepeat_radio_month_type: \"Ulangi\",\r\n\t\trepeat_radio_month_start: \"Pada\",\r\n\t\trepeat_text_month_day: \"hari setiap\",\r\n\t\trepeat_text_month_count: \"bulan\",\r\n\t\trepeat_text_month_count2_before: \"setiap\",\r\n\t\trepeat_text_month_count2_after: \"bulan\",\r\n\t\trepeat_year_label: \"Pada\",\r\n\t\tselect_year_day2: \"dari\",\r\n\t\trepeat_text_year_day: \"hari\",\r\n\t\tselect_year_month: \"bulan\",\r\n\t\trepeat_radio_end: \"Tanpa tanggal akhir\",\r\n\t\trepeat_text_occurences_count: \"kejadian\",\r\n\t\trepeat_radio_end2: \"Setelah\",\r\n\t\trepeat_radio_end3: \"Berakhir pada\",\r\n\r\n\t\trepeat_never: \"Tidak pernah\",\r\n\t\trepeat_daily: \"Setiap hari\",\r\n\t\trepeat_workdays: \"Setiap hari kerja\",\r\n\t\trepeat_weekly: \"Setiap minggu\",\r\n\t\trepeat_monthly: \"Setiap bulan\",\r\n\t\trepeat_yearly: \"Setiap tahun\",\r\n\t\trepeat_custom: \"Kustom\",\r\n\t\trepeat_freq_day: \"Hari\",\r\n\t\trepeat_freq_week: \"Minggu\",\r\n\t\trepeat_freq_month: \"Bulan\",\r\n\t\trepeat_freq_year: \"Tahun\",\r\n\t\trepeat_on_date: \"Pada tanggal\",\r\n\t\trepeat_ends: \"Berakhir\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Ogni giorno\",\r\n\t\trepeat_workdays: \"Ogni giorno feriale\",\r\n\t\trepeat_weekly: \"Ogni settimana\",\r\n\t\trepeat_monthly: \"Ogni mese\",\r\n\t\trepeat_yearly: \"Ogni anno\",\r\n\t\trepeat_custom: \"Personalizzato\",\r\n\t\trepeat_freq_day: \"Giorno\",\r\n\t\trepeat_freq_week: \"Settimana\",\r\n\t\trepeat_freq_month: \"Mese\",\r\n\t\trepeat_freq_year: \"Anno\",\r\n\t\trepeat_on_date: \"Alla data\",\r\n\t\trepeat_ends: \"Finisce\",\r\n\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"毎日\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"毎週\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"毎月\",\r\n\t\trepeat_radio_year: \"毎年\",\r\n\t\trepeat_radio_day_type: \"毎\",\r\n\t\trepeat_text_day_count: \"日\",\r\n\t\trepeat_radio_day_type2: \"毎営業日\",\r\n\t\trepeat_week: \" 繰り返し毎\",\r\n\t\trepeat_text_week_count: \"週 次の日:\",\r\n\t\trepeat_radio_month_type: \"繰り返し\",\r\n\t\trepeat_radio_month_start: \"オン\",\r\n\t\trepeat_text_month_day: \"日毎\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"毎\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"オン\",\r\n\t\tselect_year_day2: \"の\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"終了日なし\",\r\n\t\trepeat_text_occurences_count: \"回数\",\r\n\t\trepeat_radio_end2: \"後\",\r\n\t\trepeat_radio_end3: \"終了日まで\",\r\n\r\n\t\trepeat_never: \"決して\",\r\n\t\trepeat_daily: \"毎日\",\r\n\t\trepeat_workdays: \"毎営業日\",\r\n\t\trepeat_weekly: \"毎週\",\r\n\t\trepeat_monthly: \"毎月\",\r\n\t\trepeat_yearly: \"毎年\",\r\n\t\trepeat_custom: \"カスタム\",\r\n\t\trepeat_freq_day: \"日\",\r\n\t\trepeat_freq_week: \"週\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"日にち\",\r\n\t\trepeat_ends: \"終了\",\r\n\r\n\t\tmonth_for_recurring: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_for_recurring: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\r\n\t\trepeat_never: \"Nooit\",\r\n\t\trepeat_daily: \"Elke dag\",\r\n\t\trepeat_workdays: \"Elke werkdag\",\r\n\t\trepeat_weekly: \"Elke week\",\r\n\t\trepeat_monthly: \"Elke maand\",\r\n\t\trepeat_yearly: \"Elk jaar\",\r\n\t\trepeat_custom: \"Aangepast\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Maand\",\r\n\t\trepeat_freq_year: \"Jaar\",\r\n\t\trepeat_on_date: \"Op datum\",\r\n\t\trepeat_ends: \"Eindigt\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Ukentlig\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Hver arbeidsdag\",\r\n\t\trepeat_week: \" Gjenta hver\",\r\n\t\trepeat_text_week_count: \"uke neste dager:\",\r\n\t\trepeat_radio_month_type: \"Gjenta\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"På\",\r\n\t\tselect_year_day2: \"av\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"måned\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomster\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\trepeat_radio_end3: \"Slutt innen\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nigdy\",\r\n\t\trepeat_daily: \"Codziennie\",\r\n\t\trepeat_workdays: \"Każdy dzień roboczy\",\r\n\t\trepeat_weekly: \"Co tydzień\",\r\n\t\trepeat_monthly: \"Co miesiąc\",\r\n\t\trepeat_yearly: \"Co rok\",\r\n\t\trepeat_custom: \"Niestandardowy\",\r\n\t\trepeat_freq_day: \"Dzień\",\r\n\t\trepeat_freq_week: \"Tydzień\",\r\n\t\trepeat_freq_month: \"Miesiąc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"W dniu\",\r\n\t\trepeat_ends: \"Kończy się\",\r\n\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Todos os dias\",\r\n\t\trepeat_workdays: \"Todos os dias úteis\",\r\n\t\trepeat_weekly: \"Toda semana\",\r\n\t\trepeat_monthly: \"Todo mês\",\r\n\t\trepeat_yearly: \"Todo ano\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mês\",\r\n\t\trepeat_freq_year: \"Ano\",\r\n\t\trepeat_on_date: \"Na data\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\r\n\t\trepeat_never: \"Niciodată\",\r\n\t\trepeat_daily: \"În fiecare zi\",\r\n\t\trepeat_workdays: \"În fiecare zi lucrătoare\",\r\n\t\trepeat_weekly: \"În fiecare săptămână\",\r\n\t\trepeat_monthly: \"În fiecare lună\",\r\n\t\trepeat_yearly: \"În fiecare an\",\r\n\t\trepeat_custom: \"Personalizat\",\r\n\t\trepeat_freq_day: \"Zi\",\r\n\t\trepeat_freq_week: \"Săptămână\",\r\n\t\trepeat_freq_month: \"Lună\",\r\n\t\trepeat_freq_year: \"An\",\r\n\t\trepeat_on_date: \"La data\",\r\n\t\trepeat_ends: \"Se termină\",\r\n\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Никогда\",\r\n\t\trepeat_daily: \"Каждый день\",\r\n\t\trepeat_workdays: \"Каждый будний день\",\r\n\t\trepeat_weekly: \"Каждую неделю\",\r\n\t\trepeat_monthly: \"Каждый месяц\",\r\n\t\trepeat_yearly: \"Каждый год\",\r\n\t\trepeat_custom: \"Настроить\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Неделя\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"В дату\",\r\n\t\trepeat_ends: \"Заканчивается\",\r\n\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dnevno\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Tedensko\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mesečno\",\r\n\t\trepeat_radio_year: \"Letno\",\r\n\t\trepeat_radio_day_type: \"Vsak\",\r\n\t\trepeat_text_day_count: \"dan\",\r\n\t\trepeat_radio_day_type2: \"Vsak delovni dan\",\r\n\t\trepeat_week: \" Ponavljaj vsak\",\r\n\t\trepeat_text_week_count: \"teden na naslednje dni:\",\r\n\t\trepeat_radio_month_type: \"Ponavljaj\",\r\n\t\trepeat_radio_month_start: \"Na\",\r\n\t\trepeat_text_month_day: \"dan vsak\",\r\n\t\trepeat_text_month_count: \"mesec\",\r\n\t\trepeat_text_month_count2_before: \"vsak\",\r\n\t\trepeat_text_month_count2_after: \"mesec\",\r\n\t\trepeat_year_label: \"Na\",\r\n\t\tselect_year_day2: \"od\",\r\n\t\trepeat_text_year_day: \"dan\",\r\n\t\tselect_year_month: \"mesec\",\r\n\t\trepeat_radio_end: \"Brez končnega datuma\",\r\n\t\trepeat_text_occurences_count: \"pojavitve\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\trepeat_radio_end3: \"Končaj do\",\r\n\r\n\t\trepeat_never: \"Nikoli\",\r\n\t\trepeat_daily: \"Vsak dan\",\r\n\t\trepeat_workdays: \"Vsak delovni dan\",\r\n\t\trepeat_weekly: \"Vsak teden\",\r\n\t\trepeat_monthly: \"Vsak mesec\",\r\n\t\trepeat_yearly: \"Vsako leto\",\r\n\t\trepeat_custom: \"Po meri\",\r\n\t\trepeat_freq_day: \"Dan\",\r\n\t\trepeat_freq_week: \"Teden\",\r\n\t\trepeat_freq_month: \"Mesec\",\r\n\t\trepeat_freq_year: \"Leto\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Konča se\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý deň\",\r\n\t\trepeat_workdays: \"Každý pracovný deň\",\r\n\t\trepeat_weekly: \"Každý týždeň\",\r\n\t\trepeat_monthly: \"Každý mesiac\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastné\",\r\n\t\trepeat_freq_day: \"Deň\",\r\n\t\trepeat_freq_week: \"Týždeň\",\r\n\t\trepeat_freq_month: \"Mesiac\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na dátum\",\r\n\t\trepeat_ends: \"Koniec\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Varje dag\",\r\n\t\trepeat_workdays: \"Varje vardag\",\r\n\t\trepeat_weekly: \"Varje vecka\",\r\n\t\trepeat_monthly: \"Varje månad\",\r\n\t\trepeat_yearly: \"Varje år\",\r\n\t\trepeat_custom: \"Anpassad\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Vecka\",\r\n\t\trepeat_freq_month: \"Månad\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På datum\",\r\n\t\trepeat_ends: \"Slutar\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Günlük\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Haftalık\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Aylık\",\r\n\t\trepeat_radio_year: \"Yıllık\",\r\n\t\trepeat_radio_day_type: \"Her\",\r\n\t\trepeat_text_day_count: \"gün\",\r\n\t\trepeat_radio_day_type2: \"Her iş günü\",\r\n\t\trepeat_week: \" Tekrar her\",\r\n\t\trepeat_text_week_count: \"hafta şu günlerde:\",\r\n\t\trepeat_radio_month_type: \"Tekrar et\",\r\n\t\trepeat_radio_month_start: \"Tarihinde\",\r\n\t\trepeat_text_month_day: \"gün her\",\r\n\t\trepeat_text_month_count: \"ay\",\r\n\t\trepeat_text_month_count2_before: \"her\",\r\n\t\trepeat_text_month_count2_after: \"ay\",\r\n\t\trepeat_year_label: \"Tarihinde\",\r\n\t\tselect_year_day2: \"ayın\",\r\n\t\trepeat_text_year_day: \"günü\",\r\n\t\tselect_year_month: \"ay\",\r\n\t\trepeat_radio_end: \"Bitiş tarihi yok\",\r\n\t\trepeat_text_occurences_count: \"olay\",\r\n\t\trepeat_radio_end2: \"Sonra\",\r\n\t\trepeat_radio_end3: \"Tarihinde bitir\",\r\n\r\n\t\trepeat_never: \"Asla\",\r\n\t\trepeat_daily: \"Her gün\",\r\n\t\trepeat_workdays: \"Her iş günü\",\r\n\t\trepeat_weekly: \"Her hafta\",\r\n\t\trepeat_monthly: \"Her ay\",\r\n\t\trepeat_yearly: \"Her yıl\",\r\n\t\trepeat_custom: \"Özel\",\r\n\t\trepeat_freq_day: \"Gün\",\r\n\t\trepeat_freq_week: \"Hafta\",\r\n\t\trepeat_freq_month: \"Ay\",\r\n\t\trepeat_freq_year: \"Yıl\",\r\n\t\trepeat_on_date: \"Tarihinde\",\r\n\t\trepeat_ends: \"Biter\",\r\n\r\n\t\tmonth_for_recurring: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tday_for_recurring: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ніколи\",\r\n\t\trepeat_daily: \"Щодня\",\r\n\t\trepeat_workdays: \"Щодня в робочі дні\",\r\n\t\trepeat_weekly: \"Щотижня\",\r\n\t\trepeat_monthly: \"Щомісяця\",\r\n\t\trepeat_yearly: \"Щороку\",\r\n\t\trepeat_custom: \"Налаштоване\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Тиждень\",\r\n\t\trepeat_freq_month: \"Місяць\",\r\n\t\trepeat_freq_year: \"Рік\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Закінчується\",\r\n\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\nimport addPlugins from \"./plugins\";\r\nimport stateProvider from \"./core/state\";\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tscheduler.$stateProvider = stateProvider();\r\n\r\n\tscheduler.getState = scheduler.$stateProvider.getState;\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\taddPlugins(scheduler);\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","import utils from \"./utils/utils\";\r\n\r\nconst StateService = (function(){\r\n\tconst stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tconst provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tconst res = {};\r\n\t\t\tfor(const i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.$stateProvider.registerProvider(\"global\", (function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n}).bind(scheduler));\r\n\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\tundo_deleted: true,\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\tvar html = `
\r\n\t\t\t\t
`;\r\n\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\t\thtml+=\"
\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\ndeclare let google: any;\r\n\r\nexport class GoogleMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tprivate infoWindow: any;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tlet zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom;\r\n\t\t\t\t\tif (event.lat && event.lng){\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: event.lat, \r\n\t\t\t\t\t\t\tlng: event.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: this.settings.error_position.lat, \r\n\t\t\t\t\t\t\tlng: this.settings.error_position.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoogle.maps.event.trigger(this._markers[i].marker, 'click');\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tthis.settings = options;\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapOptions = {\r\n\t\t\tcenter: { lat: options.initial_position.lat, lng: options.initial_position.lng },\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tmapId: container.id,\r\n\t\t\tscrollwheel: true,\r\n\t\t\tmapTypeId: options.type\r\n\t\t}\r\n\t\t// we need to reuse the google map to avoid leak memory\r\n\t\tif (this.map === null) {\r\n\t\t\tthis.map = new google.maps.Map(container, mapOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet map = this.map;\r\n\t\t\tcontainer.appendChild(this.map.__gm.messageOverlay);\r\n\t\t\tcontainer.appendChild(this.map.__gm.outerContainer);\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tmap.setOptions({container: container.id});\r\n\t\t\t}, 500);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(this.map, \"dblclick\", function(event) {\r\n\t\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\r\n\t\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\t\tlet point = event.latLng;\r\n\t\t\t\tgeocoder.geocode(\r\n\t\t\t\t\t{ 'latLng': point },\r\n\t\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tgoogle.maps.event.clearInstanceListeners(window);\r\n\t\tgoogle.maps.event.clearInstanceListeners(document);\r\n\t\tgoogle.maps.event.clearInstanceListeners(container);\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\tasync addEventMarker(event: ICalendarEvent): Promise {\r\n\t\tlet config = {\r\n\t\t\ttitle: event.text,\r\n\t\t\tposition: {},\r\n\t\t\tmap: {}\r\n\t\t}\r\n\t\t\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tconfig.position = { lat: event.lat, lng: event.lng };\r\n\t\t} else {\r\n\t\t\tconfig.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }\r\n\t\t}\r\n\t\tconst { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\t\tlet marker;\r\n\t\tif (this.scheduler.ext.mapView.createMarker) {\r\n\t\t\tconfig.map = this.map;\r\n\t\t\tmarker = this.scheduler.ext.mapView.createMarker(config);\r\n\t\t} else {\r\n\t\t\tmarker = new AdvancedMarkerElement(config);\r\n\t\t\tmarker.map = this.map;\r\n\t\t}\r\n\t\tmarker.setMap(this.map);\r\n\t\t//case for markeks which were deleted with DataProcessor\r\n\t\tif (event[\"!nativeeditor_status\"] == \"true_deleted\"){\r\n\t\t\tmarker.setMap(null);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(marker, \"click\", () => {\r\n\t\t\tif (this.infoWindow) {\r\n\t\t\t\tthis.infoWindow.close();\r\n\t\t\t}\r\n\t\t\tthis.infoWindow = new google.maps.InfoWindow({maxWidth: this.settings.info_window_max_width});\r\n\t\t\tthis.infoWindow.setContent(this.scheduler.templates.map_info_content(event));\r\n\t\t\tthis.infoWindow.open({\r\n\t\t\t\tanchor: marker,\r\n\t\t\t\tmap: this.map,\r\n\t\t\t});\r\n\t\t});\r\n\t\tlet markerInfo = {event, ...config, marker};\r\n\t\tthis._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.setVisible(false);\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t\tthis._markers[i].marker.setPosition(null);\r\n\t\t\t\tthis._markers[i].marker = null;\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tthis._markers[i].position.lat = event.lat;\r\n\t\t\t\tthis._markers[i].position.lng = event.lng;\r\n\t\t\t\tthis._markers[i].text = event.text;\r\n\t\t\t\tlet latlng = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t\t\tthis._markers[i].marker.setPosition(latlng);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif (this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setCenter({\r\n\t\t\tlat: latitude, \r\n\t\t\tlng: longitude,\r\n\t\t});\r\n\t\tthis.map.setZoom(zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\tlet position: any = await new Promise((resolve) => {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'address': string },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tresolve({\r\n\t\t\t\t\t\t lat: results[0].geometry.location.lat(),\r\n\t\t\t\t\t\t lng: results[0].geometry.location.lng()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\tresolve({});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\t\treturn position;\r\n\t}\r\n\t\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let L: any\r\n\r\nexport class OpenStreetMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate _markers: any[];\r\n\tprivate settings: IMapSettings;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.openPopup();\r\n\t\t\t\t\tthis._markers[i].marker.closeTooltip();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapWrapper = document.createElement('div');\r\n\t\tmapWrapper.className = 'mapWrapper';\r\n\t\tmapWrapper.id = 'mapWrapper';\r\n\t\tmapWrapper.style.width = container.style.width;\r\n\t\tmapWrapper.style.height = container.style.height;\r\n\t\tcontainer.appendChild(mapWrapper);\r\n\r\n\t\tlet map = L.map(mapWrapper, {\r\n\t\t\tcenter: L.latLng(options.initial_position.lat, options.initial_position.lng),\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tkeyboard: false // need to set false, due to bug with moving window\r\n\t\t});\r\n\t\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);\r\n\t\tmap.on(\"dblclick\", async function(e){\r\n\t\t\tconst settings = {\r\n\t\t\t\t\"method\": \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then(response => response.json());\r\n\t\t\tif (response.address) {\r\n\t\t\t\tlet address = response.address.country;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.latlng.lat,\r\n\t\t\t\t\tlng: e.latlng.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\", response.error);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.map = map;\r\n\t\tthis.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n\t\tconst myIcon = L.icon({\r\n\t\t\ticonUrl: 'https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png',\r\n\t\t\ticonSize: [25, 41],\r\n\t\t\tshadowSize: [30, 65],\r\n\t\t\ticonAnchor: [12, 41],\r\n\t\t\tshadowAnchor: [7, 65]\r\n\t\t});\r\n\t\tlet popupConfig = {\r\n\t\t\tminWidth: 180,\r\n\t\t\tmaxWidth: this.settings.info_window_max_width,\r\n\t\t}\r\n\t\tconst markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event));\r\n\t\tconst tooltip = L.tooltip().setContent(event.text);\r\n\r\n\t\tlet markerConfig = [\r\n\t\t\tevent.lat,\r\n\t\t\tevent.lng\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tmarkerConfig = [this.settings.error_position.lat, this.settings.error_position.lng];\r\n\t\t}\r\n\t\tconst marker = L.marker(markerConfig, {\r\n\t\t\ticon: myIcon\r\n\t\t}).bindPopup(markerPopup).bindTooltip(tooltip).addTo(this.map);\r\n\t\tconst markerInfo = {event, marker};\r\n\t\tthis._markers.push(markerInfo);\t\t\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker);\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([event.lat, event.lng]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif(this._markers) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker); \r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setView([latitude, longitude], zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst settings = {\r\n\t\t\t\"method\": \"GET\",\r\n\t\t\theaders: {\r\n\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t},\r\n\t\t};\r\n\t\tlet position:any = {};\r\n\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then(response => response.json());\r\n\t\tif (response && response.length) {\r\n\t\t\tposition.lat = +response[0].lat;\r\n\t\t\tposition.lng = +response[0].lon;\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let mapboxgl: any;\r\ndeclare let MapboxGeocoder: any;\r\n\r\nexport class MapboxAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n const popup = this._markers[i].marker.getPopup();\r\n if (popup.isOpen()){\r\n popup.remove();\r\n }\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.togglePopup();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n let scheduler = this.scheduler;\r\n\r\n\t\tmapboxgl.accessToken = options.accessToken;\r\n const map = new mapboxgl.Map({\r\n container: container, \r\n center: [options.initial_position.lng, options.initial_position.lat], \r\n zoom: options.initial_zoom + 1, // problems with coordinates if zoom = 1\r\n });\r\n map.on(\"dblclick\",async function(e){\r\n\t\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${ e.lngLat.lat}.json?access_token=${options.accessToken}`).then(response => response.json());\r\n\t\t\tif (response.features){\r\n\t\t\t\tlet address = response.features[0].place_name;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.lngLat.lat,\r\n\t\t\t\t\tlng: e.lngLat.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\");\r\n\t\t\t}\r\n\t\t});\r\n this.map = map;\r\n this.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n while (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n container.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n let config = [\r\n\t\t\tevent.lng,\r\n\t\t\tevent.lat\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tconfig = [this.settings.error_position.lng, this.settings.error_position.lat];\r\n\t\t} \r\n\r\n\t\tconst popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false})\r\n .setMaxWidth(`${this.settings.info_window_max_width}px`) \r\n .setHTML(this.scheduler.templates.map_info_content(event));\r\n const marker = new mapboxgl.Marker()\r\n .setLngLat(config)\r\n .setPopup(popup)\r\n .addTo(this.map);\r\n const markerInfo = {event, marker}; \r\n this._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.remove();\r\n this._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([event.lng, event.lat]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tfor (let i = 0; i {\r\n\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then(response => response.json());\r\n\t\tlet position:any = {};\r\n\t\tif (response && response.features.length) {\r\n\t\t\tposition.lng = response.features[0].center[0];\r\n\t\t\tposition.lat = response.features[0].center[1];\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","// =============================================================================\n// Weekday\n// =============================================================================\nexport var ALL_WEEKDAYS = [\n 'MO',\n 'TU',\n 'WE',\n 'TH',\n 'FR',\n 'SA',\n 'SU',\n];\nvar Weekday = /** @class */ (function () {\n function Weekday(weekday, n) {\n if (n === 0)\n throw new Error(\"Can't create weekday with n == 0\");\n this.weekday = weekday;\n this.n = n;\n }\n Weekday.fromStr = function (str) {\n return new Weekday(ALL_WEEKDAYS.indexOf(str));\n };\n // __call__ - Cannot call the object directly, do it through\n // e.g. RRule.TH.nth(-1) instead,\n Weekday.prototype.nth = function (n) {\n return this.n === n ? this : new Weekday(this.weekday, n);\n };\n // __eq__\n Weekday.prototype.equals = function (other) {\n return this.weekday === other.weekday && this.n === other.n;\n };\n // __repr__\n Weekday.prototype.toString = function () {\n var s = ALL_WEEKDAYS[this.weekday];\n if (this.n)\n s = (this.n > 0 ? '+' : '') + String(this.n) + s;\n return s;\n };\n Weekday.prototype.getJsWeekday = function () {\n return this.weekday === 6 ? 0 : this.weekday + 1;\n };\n return Weekday;\n}());\nexport { Weekday };\n//# sourceMappingURL=weekday.js.map","// =============================================================================\n// Helper functions\n// =============================================================================\nimport { ALL_WEEKDAYS } from './weekday';\nexport var isPresent = function (value) {\n return value !== null && value !== undefined;\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isWeekdayStr = function (value) {\n return typeof value === 'string' && ALL_WEEKDAYS.includes(value);\n};\nexport var isArray = Array.isArray;\n/**\n * Simplified version of python's range()\n */\nexport var range = function (start, end) {\n if (end === void 0) { end = start; }\n if (arguments.length === 1) {\n end = start;\n start = 0;\n }\n var rang = [];\n for (var i = start; i < end; i++)\n rang.push(i);\n return rang;\n};\nexport var clone = function (array) {\n return [].concat(array);\n};\nexport var repeat = function (value, times) {\n var i = 0;\n var array = [];\n if (isArray(value)) {\n for (; i < times; i++)\n array[i] = [].concat(value);\n }\n else {\n for (; i < times; i++)\n array[i] = value;\n }\n return array;\n};\nexport var toArray = function (item) {\n if (isArray(item)) {\n return item;\n }\n return [item];\n};\nexport function padStart(item, targetLength, padString) {\n if (padString === void 0) { padString = ' '; }\n var str = String(item);\n targetLength = targetLength >> 0;\n if (str.length > targetLength) {\n return String(str);\n }\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += repeat(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(str);\n}\n/**\n * Python like split\n */\nexport var split = function (str, sep, num) {\n var splits = str.split(sep);\n return num\n ? splits.slice(0, num).concat([splits.slice(num).join(sep)])\n : splits;\n};\n/**\n * closure/goog/math/math.js:modulo\n * Copyright 2006 The Closure Library Authors.\n * The % operator in JavaScript returns the remainder of a / b, but differs from\n * some other languages in that the result will have the same sign as the\n * dividend. For example, -1 % 8 == -1, whereas in some other languages\n * (such as Python) the result would be 7. This function emulates the more\n * correct modulo behavior, which is useful for certain applications such as\n * calculating an offset index in a circular list.\n *\n * @param {number} a The dividend.\n * @param {number} b The divisor.\n * @return {number} a % b where the result is between 0 and b (either 0 <= x < b\n * or b < x <= 0, depending on the sign of b).\n */\nexport var pymod = function (a, b) {\n var r = a % b;\n // If r and b differ in sign, add b to wrap the result to the correct sign.\n return r * b < 0 ? r + b : r;\n};\n/**\n * @see: \n */\nexport var divmod = function (a, b) {\n return { div: Math.floor(a / b), mod: pymod(a, b) };\n};\nexport var empty = function (obj) {\n return !isPresent(obj) || obj.length === 0;\n};\n/**\n * Python-like boolean\n *\n * @return {Boolean} value of an object/primitive, taking into account\n * the fact that in Python an empty list's/tuple's\n * boolean value is False, whereas in JS it's true\n */\nexport var notEmpty = function (obj) {\n return !empty(obj);\n};\n/**\n * Return true if a value is in an array\n */\nexport var includes = function (arr, val) {\n return notEmpty(arr) && arr.indexOf(val) !== -1;\n};\n//# sourceMappingURL=helpers.js.map","import { padStart } from './helpers';\nexport var datetime = function (y, m, d, h, i, s) {\n if (h === void 0) { h = 0; }\n if (i === void 0) { i = 0; }\n if (s === void 0) { s = 0; }\n return new Date(Date.UTC(y, m - 1, d, h, i, s));\n};\n/**\n * General date-related utilities.\n * Also handles several incompatibilities between JavaScript and Python\n *\n */\nexport var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/**\n * Number of milliseconds of one day\n */\nexport var ONE_DAY = 1000 * 60 * 60 * 24;\n/**\n * @see: \n */\nexport var MAXYEAR = 9999;\n/**\n * Python uses 1-Jan-1 as the base for calculating ordinals but we don't\n * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,\n * therefore we use 1-Jan-1970 instead\n */\nexport var ORDINAL_BASE = datetime(1970, 1, 1);\n/**\n * Python: MO-SU: 0 - 6\n * JS: SU-SAT 0 - 6\n */\nexport var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];\n/**\n * py_date.timetuple()[7]\n */\nexport var getYearDay = function (date) {\n var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /\n ONE_DAY) + 1);\n};\nexport var isLeapYear = function (year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n};\nexport var isDate = function (value) {\n return value instanceof Date;\n};\nexport var isValidDate = function (value) {\n return isDate(value) && !isNaN(value.getTime());\n};\n/**\n * @return {Number} the date's timezone offset in ms\n */\nexport var tzOffset = function (date) {\n return date.getTimezoneOffset() * 60 * 1000;\n};\n/**\n * @see: \n */\nexport var daysBetween = function (date1, date2) {\n // The number of milliseconds in one day\n // Convert both dates to milliseconds\n var date1ms = date1.getTime();\n var date2ms = date2.getTime();\n // Calculate the difference in milliseconds\n var differencems = date1ms - date2ms;\n // Convert back to days and return\n return Math.round(differencems / ONE_DAY);\n};\n/**\n * @see: \n */\nexport var toOrdinal = function (date) {\n return daysBetween(date, ORDINAL_BASE);\n};\n/**\n * @see - \n */\nexport var fromOrdinal = function (ordinal) {\n return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);\n};\nexport var getMonthDays = function (date) {\n var month = date.getUTCMonth();\n return month === 1 && isLeapYear(date.getUTCFullYear())\n ? 29\n : MONTH_DAYS[month];\n};\n/**\n * @return {Number} python-like weekday\n */\nexport var getWeekday = function (date) {\n return PY_WEEKDAYS[date.getUTCDay()];\n};\n/**\n * @see: \n */\nexport var monthRange = function (year, month) {\n var date = datetime(year, month + 1, 1);\n return [getWeekday(date), getMonthDays(date)];\n};\n/**\n * @see: \n */\nexport var combine = function (date, time) {\n time = time || date;\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));\n};\nexport var clone = function (date) {\n var dolly = new Date(date.getTime());\n return dolly;\n};\nexport var cloneDates = function (dates) {\n var clones = [];\n for (var i = 0; i < dates.length; i++) {\n clones.push(clone(dates[i]));\n }\n return clones;\n};\n/**\n * Sorts an array of Date or Time objects\n */\nexport var sort = function (dates) {\n dates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n};\nexport var timeToUntilString = function (time, utc) {\n if (utc === void 0) { utc = true; }\n var date = new Date(time);\n return [\n padStart(date.getUTCFullYear().toString(), 4, '0'),\n padStart(date.getUTCMonth() + 1, 2, '0'),\n padStart(date.getUTCDate(), 2, '0'),\n 'T',\n padStart(date.getUTCHours(), 2, '0'),\n padStart(date.getUTCMinutes(), 2, '0'),\n padStart(date.getUTCSeconds(), 2, '0'),\n utc ? 'Z' : '',\n ].join('');\n};\nexport var untilStringToDate = function (until) {\n var re = /^(\\d{4})(\\d{2})(\\d{2})(T(\\d{2})(\\d{2})(\\d{2})Z?)?$/;\n var bits = re.exec(until);\n if (!bits)\n throw new Error(\"Invalid UNTIL value: \".concat(until));\n return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));\n};\nvar dateTZtoISO8601 = function (date, timeZone) {\n // date format for sv-SE is almost ISO8601\n var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });\n // '2023-02-07 10:41:36'\n return dateStr.replace(' ', 'T') + 'Z';\n};\nexport var dateInTimeZone = function (date, timeZone) {\n var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // Date constructor can only reliably parse dates in ISO8601 format\n var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));\n var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));\n var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();\n return new Date(date.getTime() - tzOffset);\n};\n//# sourceMappingURL=dateutil.js.map","/**\n * This class helps us to emulate python's generators, sorta.\n */\nvar IterResult = /** @class */ (function () {\n function IterResult(method, args) {\n this.minDate = null;\n this.maxDate = null;\n this._result = [];\n this.total = 0;\n this.method = method;\n this.args = args;\n if (method === 'between') {\n this.maxDate = args.inc\n ? args.before\n : new Date(args.before.getTime() - 1);\n this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1);\n }\n else if (method === 'before') {\n this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1);\n }\n else if (method === 'after') {\n this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1);\n }\n }\n /**\n * Possibly adds a date into the result.\n *\n * @param {Date} date - the date isn't necessarly added to the result\n * list (if it is too late/too early)\n * @return {Boolean} true if it makes sense to continue the iteration\n * false if we're done.\n */\n IterResult.prototype.accept = function (date) {\n ++this.total;\n var tooEarly = this.minDate && date < this.minDate;\n var tooLate = this.maxDate && date > this.maxDate;\n if (this.method === 'between') {\n if (tooEarly)\n return true;\n if (tooLate)\n return false;\n }\n else if (this.method === 'before') {\n if (tooLate)\n return false;\n }\n else if (this.method === 'after') {\n if (tooEarly)\n return true;\n this.add(date);\n return false;\n }\n return this.add(date);\n };\n /**\n *\n * @param {Date} date that is part of the result.\n * @return {Boolean} whether we are interested in more values.\n */\n IterResult.prototype.add = function (date) {\n this._result.push(date);\n return true;\n };\n /**\n * 'before' and 'after' return only one date, whereas 'all'\n * and 'between' an array.\n *\n * @return {Date,Array?}\n */\n IterResult.prototype.getValue = function () {\n var res = this._result;\n switch (this.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n case 'after':\n default:\n return (res.length ? res[res.length - 1] : null);\n }\n };\n IterResult.prototype.clone = function () {\n return new IterResult(this.method, this.args);\n };\n return IterResult;\n}());\nexport default IterResult;\n//# sourceMappingURL=iterresult.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nimport IterResult from './iterresult';\n/**\n * IterResult subclass that calls a callback function on each add,\n * and stops iterating when the callback returns false.\n */\nvar CallbackIterResult = /** @class */ (function (_super) {\n __extends(CallbackIterResult, _super);\n function CallbackIterResult(method, args, iterator) {\n var _this = _super.call(this, method, args) || this;\n _this.iterator = iterator;\n return _this;\n }\n CallbackIterResult.prototype.add = function (date) {\n if (this.iterator(date, this._result.length)) {\n this._result.push(date);\n return true;\n }\n return false;\n };\n return CallbackIterResult;\n}(IterResult));\nexport default CallbackIterResult;\n//# sourceMappingURL=callbackiterresult.js.map","export var Frequency;\n(function (Frequency) {\n Frequency[Frequency[\"YEARLY\"] = 0] = \"YEARLY\";\n Frequency[Frequency[\"MONTHLY\"] = 1] = \"MONTHLY\";\n Frequency[Frequency[\"WEEKLY\"] = 2] = \"WEEKLY\";\n Frequency[Frequency[\"DAILY\"] = 3] = \"DAILY\";\n Frequency[Frequency[\"HOURLY\"] = 4] = \"HOURLY\";\n Frequency[Frequency[\"MINUTELY\"] = 5] = \"MINUTELY\";\n Frequency[Frequency[\"SECONDLY\"] = 6] = \"SECONDLY\";\n})(Frequency || (Frequency = {}));\nexport function freqIsDailyOrGreater(freq) {\n return freq < Frequency.HOURLY;\n}\n//# sourceMappingURL=types.js.map","// =============================================================================\n// i18n\n// =============================================================================\nvar ENGLISH = {\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ],\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n tokens: {\n SKIP: /^[ \\r\\n\\t]+|^\\.$/,\n number: /^[1-9][0-9]*/,\n numberAsText: /^(one|two|three)/i,\n every: /^every/i,\n 'day(s)': /^days?/i,\n 'weekday(s)': /^weekdays?/i,\n 'week(s)': /^weeks?/i,\n 'hour(s)': /^hours?/i,\n 'minute(s)': /^minutes?/i,\n 'month(s)': /^months?/i,\n 'year(s)': /^years?/i,\n on: /^(on|in)/i,\n at: /^(at)/i,\n the: /^the/i,\n first: /^first/i,\n second: /^second/i,\n third: /^third/i,\n nth: /^([1-9][0-9]*)(\\.|th|nd|rd|st)/i,\n last: /^last/i,\n for: /^for/i,\n 'time(s)': /^times?/i,\n until: /^(un)?til/i,\n monday: /^mo(n(day)?)?/i,\n tuesday: /^tu(e(s(day)?)?)?/i,\n wednesday: /^we(d(n(esday)?)?)?/i,\n thursday: /^th(u(r(sday)?)?)?/i,\n friday: /^fr(i(day)?)?/i,\n saturday: /^sa(t(urday)?)?/i,\n sunday: /^su(n(day)?)?/i,\n january: /^jan(uary)?/i,\n february: /^feb(ruary)?/i,\n march: /^mar(ch)?/i,\n april: /^apr(il)?/i,\n may: /^may/i,\n june: /^june?/i,\n july: /^july?/i,\n august: /^aug(ust)?/i,\n september: /^sep(t(ember)?)?/i,\n october: /^oct(ober)?/i,\n november: /^nov(ember)?/i,\n december: /^dec(ember)?/i,\n comma: /^(,\\s*|(and|or)\\s*)+/i,\n },\n};\nexport default ENGLISH;\n//# sourceMappingURL=i18n.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\nimport { isArray, isNumber, isPresent } from '../helpers';\n// =============================================================================\n// Helper functions\n// =============================================================================\n/**\n * Return true if a value is in an array\n */\nvar contains = function (arr, val) {\n return arr.indexOf(val) !== -1;\n};\nvar defaultGetText = function (id) { return id.toString(); };\nvar defaultDateFormatter = function (year, month, day) { return \"\".concat(month, \" \").concat(day, \", \").concat(year); };\n/**\n *\n * @param {RRule} rrule\n * Optional:\n * @param {Function} gettext function\n * @param {Object} language definition\n * @constructor\n */\nvar ToText = /** @class */ (function () {\n function ToText(rrule, gettext, language, dateFormatter) {\n if (gettext === void 0) { gettext = defaultGetText; }\n if (language === void 0) { language = ENGLISH; }\n if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; }\n this.text = [];\n this.language = language || ENGLISH;\n this.gettext = gettext;\n this.dateFormatter = dateFormatter;\n this.rrule = rrule;\n this.options = rrule.options;\n this.origOptions = rrule.origOptions;\n if (this.origOptions.bymonthday) {\n var bymonthday = [].concat(this.options.bymonthday);\n var bynmonthday = [].concat(this.options.bynmonthday);\n bymonthday.sort(function (a, b) { return a - b; });\n bynmonthday.sort(function (a, b) { return b - a; });\n // 1, 2, 3, .., -5, -4, -3, ..\n this.bymonthday = bymonthday.concat(bynmonthday);\n if (!this.bymonthday.length)\n this.bymonthday = null;\n }\n if (isPresent(this.origOptions.byweekday)) {\n var byweekday = !isArray(this.origOptions.byweekday)\n ? [this.origOptions.byweekday]\n : this.origOptions.byweekday;\n var days = String(byweekday);\n this.byweekday = {\n allWeeks: byweekday.filter(function (weekday) {\n return !weekday.n;\n }),\n someWeeks: byweekday.filter(function (weekday) {\n return Boolean(weekday.n);\n }),\n isWeekdays: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') === -1 &&\n days.indexOf('SU') === -1,\n isEveryDay: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') !== -1 &&\n days.indexOf('SU') !== -1,\n };\n var sortWeekDays = function (a, b) {\n return a.weekday - b.weekday;\n };\n this.byweekday.allWeeks.sort(sortWeekDays);\n this.byweekday.someWeeks.sort(sortWeekDays);\n if (!this.byweekday.allWeeks.length)\n this.byweekday.allWeeks = null;\n if (!this.byweekday.someWeeks.length)\n this.byweekday.someWeeks = null;\n }\n else {\n this.byweekday = null;\n }\n }\n /**\n * Test whether the rrule can be fully converted to text.\n *\n * @param {RRule} rrule\n * @return {Boolean}\n */\n ToText.isFullyConvertible = function (rrule) {\n var canConvert = true;\n if (!(rrule.options.freq in ToText.IMPLEMENTED))\n return false;\n if (rrule.origOptions.until && rrule.origOptions.count)\n return false;\n for (var key in rrule.origOptions) {\n if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))\n return true;\n if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))\n return false;\n }\n return canConvert;\n };\n ToText.prototype.isFullyConvertible = function () {\n return ToText.isFullyConvertible(this.rrule);\n };\n /**\n * Perform the conversion. Only some of the frequencies are supported.\n * If some of the rrule's options aren't supported, they'll\n * be omitted from the output an \"(~ approximate)\" will be appended.\n *\n * @return {*}\n */\n ToText.prototype.toString = function () {\n var gettext = this.gettext;\n if (!(this.options.freq in ToText.IMPLEMENTED)) {\n return gettext('RRule error: Unable to fully convert this rrule to text');\n }\n this.text = [gettext('every')];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[RRule.FREQUENCIES[this.options.freq]]();\n if (this.options.until) {\n this.add(gettext('until'));\n var until = this.options.until;\n this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate()));\n }\n else if (this.options.count) {\n this.add(gettext('for'))\n .add(this.options.count.toString())\n .add(this.plural(this.options.count) ? gettext('times') : gettext('time'));\n }\n if (!this.isFullyConvertible())\n this.add(gettext('(~ approximate)'));\n return this.text.join('');\n };\n ToText.prototype.HOURLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour'));\n };\n ToText.prototype.MINUTELY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval)\n ? gettext('minutes')\n : gettext('minute'));\n };\n ToText.prototype.DAILY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n else if (this.origOptions.byhour) {\n this._byhour();\n }\n };\n ToText.prototype.WEEKLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week'));\n }\n if (this.byweekday && this.byweekday.isWeekdays) {\n if (this.options.interval === 1) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n }\n else if (this.byweekday && this.byweekday.isEveryDay) {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n else {\n if (this.options.interval === 1)\n this.add(gettext('week'));\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.origOptions.byhour) {\n this._byhour();\n }\n }\n };\n ToText.prototype.MONTHLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(gettext('months'));\n if (this.plural(this.options.interval))\n this.add(gettext('in'));\n }\n else {\n // this.add(gettext('MONTH'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval)\n ? gettext('months')\n : gettext('month'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n };\n ToText.prototype.YEARLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n this.add(gettext('years'));\n }\n else {\n // this.add(gettext('YEAR'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.options.byyearday) {\n this.add(gettext('on the'))\n .add(this.list(this.options.byyearday, this.nth, gettext('and')))\n .add(gettext('day'));\n }\n if (this.options.byweekno) {\n this.add(gettext('in'))\n .add(this.plural(this.options.byweekno.length)\n ? gettext('weeks')\n : gettext('week'))\n .add(this.list(this.options.byweekno, undefined, gettext('and')));\n }\n };\n ToText.prototype._bymonthday = function () {\n var gettext = this.gettext;\n if (this.byweekday && this.byweekday.allWeeks) {\n this.add(gettext('on'))\n .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')))\n .add(gettext('the'))\n .add(this.list(this.bymonthday, this.nth, gettext('or')));\n }\n else {\n this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and')));\n }\n // this.add(gettext('DAY'))\n };\n ToText.prototype._byweekday = function () {\n var gettext = this.gettext;\n if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext));\n }\n if (this.byweekday.someWeeks) {\n if (this.byweekday.allWeeks)\n this.add(gettext('and'));\n this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and')));\n }\n };\n ToText.prototype._byhour = function () {\n var gettext = this.gettext;\n this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and')));\n };\n ToText.prototype._bymonth = function () {\n this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and')));\n };\n ToText.prototype.nth = function (n) {\n n = parseInt(n.toString(), 10);\n var nth;\n var gettext = this.gettext;\n if (n === -1)\n return gettext('last');\n var npos = Math.abs(n);\n switch (npos) {\n case 1:\n case 21:\n case 31:\n nth = npos + gettext('st');\n break;\n case 2:\n case 22:\n nth = npos + gettext('nd');\n break;\n case 3:\n case 23:\n nth = npos + gettext('rd');\n break;\n default:\n nth = npos + gettext('th');\n }\n return n < 0 ? nth + ' ' + gettext('last') : nth;\n };\n ToText.prototype.monthtext = function (m) {\n return this.language.monthNames[m - 1];\n };\n ToText.prototype.weekdaytext = function (wday) {\n var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday();\n return ((wday.n ? this.nth(wday.n) + ' ' : '') +\n this.language.dayNames[weekday]);\n };\n ToText.prototype.plural = function (n) {\n return n % 100 !== 1;\n };\n ToText.prototype.add = function (s) {\n this.text.push(' ');\n this.text.push(s);\n return this;\n };\n ToText.prototype.list = function (arr, callback, finalDelim, delim) {\n var _this = this;\n if (delim === void 0) { delim = ','; }\n if (!isArray(arr)) {\n arr = [arr];\n }\n var delimJoin = function (array, delimiter, finalDelimiter) {\n var list = '';\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n if (i === array.length - 1) {\n list += ' ' + finalDelimiter + ' ';\n }\n else {\n list += delimiter + ' ';\n }\n }\n list += array[i];\n }\n return list;\n };\n callback =\n callback ||\n function (o) {\n return o.toString();\n };\n var realCallback = function (arg) {\n return callback && callback.call(_this, arg);\n };\n if (finalDelim) {\n return delimJoin(arr.map(realCallback), delim, finalDelim);\n }\n else {\n return arr.map(realCallback).join(delim + ' ');\n }\n };\n return ToText;\n}());\nexport default ToText;\n//# sourceMappingURL=totext.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\n// =============================================================================\n// Parser\n// =============================================================================\nvar Parser = /** @class */ (function () {\n function Parser(rules) {\n this.done = true;\n this.rules = rules;\n }\n Parser.prototype.start = function (text) {\n this.text = text;\n this.done = false;\n return this.nextSymbol();\n };\n Parser.prototype.isDone = function () {\n return this.done && this.symbol === null;\n };\n Parser.prototype.nextSymbol = function () {\n var best;\n var bestSymbol;\n this.symbol = null;\n this.value = null;\n do {\n if (this.done)\n return false;\n var rule = void 0;\n best = null;\n for (var name_1 in this.rules) {\n rule = this.rules[name_1];\n var match = rule.exec(this.text);\n if (match) {\n if (best === null || match[0].length > best[0].length) {\n best = match;\n bestSymbol = name_1;\n }\n }\n }\n if (best != null) {\n this.text = this.text.substr(best[0].length);\n if (this.text === '')\n this.done = true;\n }\n if (best == null) {\n this.done = true;\n this.symbol = null;\n this.value = null;\n return;\n }\n } while (bestSymbol === 'SKIP');\n this.symbol = bestSymbol;\n this.value = best;\n return true;\n };\n Parser.prototype.accept = function (name) {\n if (this.symbol === name) {\n if (this.value) {\n var v = this.value;\n this.nextSymbol();\n return v;\n }\n this.nextSymbol();\n return true;\n }\n return false;\n };\n Parser.prototype.acceptNumber = function () {\n return this.accept('number');\n };\n Parser.prototype.expect = function (name) {\n if (this.accept(name))\n return true;\n throw new Error('expected ' + name + ' but found ' + this.symbol);\n };\n return Parser;\n}());\nexport default function parseText(text, language) {\n if (language === void 0) { language = ENGLISH; }\n var options = {};\n var ttr = new Parser(language.tokens);\n if (!ttr.start(text))\n return null;\n S();\n return options;\n function S() {\n // every [n]\n ttr.expect('every');\n var n = ttr.acceptNumber();\n if (n)\n options.interval = parseInt(n[0], 10);\n if (ttr.isDone())\n throw new Error('Unexpected end');\n switch (ttr.symbol) {\n case 'day(s)':\n options.freq = RRule.DAILY;\n if (ttr.nextSymbol()) {\n AT();\n F();\n }\n break;\n // FIXME Note: every 2 weekdays != every two weeks on weekdays.\n // DAILY on weekdays is not a valid rule\n case 'weekday(s)':\n options.freq = RRule.WEEKLY;\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n ttr.nextSymbol();\n AT();\n F();\n break;\n case 'week(s)':\n options.freq = RRule.WEEKLY;\n if (ttr.nextSymbol()) {\n ON();\n AT();\n F();\n }\n break;\n case 'hour(s)':\n options.freq = RRule.HOURLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'minute(s)':\n options.freq = RRule.MINUTELY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'month(s)':\n options.freq = RRule.MONTHLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'year(s)':\n options.freq = RRule.YEARLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n options.freq = RRule.WEEKLY;\n var key = ttr.symbol\n .substr(0, 2)\n .toUpperCase();\n options.byweekday = [RRule[key]];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var wkd = decodeWKD();\n if (!wkd) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday');\n }\n options.byweekday.push(RRule[wkd]);\n ttr.nextSymbol();\n }\n AT();\n MDAYs();\n F();\n break;\n case 'january':\n case 'february':\n case 'march':\n case 'april':\n case 'may':\n case 'june':\n case 'july':\n case 'august':\n case 'september':\n case 'october':\n case 'november':\n case 'december':\n options.freq = RRule.YEARLY;\n options.bymonth = [decodeM()];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var m = decodeM();\n if (!m) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month');\n }\n options.bymonth.push(m);\n ttr.nextSymbol();\n }\n ON();\n F();\n break;\n default:\n throw new Error('Unknown symbol');\n }\n }\n function ON() {\n var on = ttr.accept('on');\n var the = ttr.accept('the');\n if (!(on || the))\n return;\n do {\n var nth = decodeNTH();\n var wkd = decodeWKD();\n var m = decodeM();\n // nth | \n if (nth) {\n // ttr.nextSymbol()\n if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd].nth(nth));\n }\n else {\n if (!options.bymonthday)\n options.bymonthday = [];\n options.bymonthday.push(nth);\n ttr.accept('day(s)');\n }\n // \n }\n else if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd]);\n }\n else if (ttr.symbol === 'weekday(s)') {\n ttr.nextSymbol();\n if (!options.byweekday) {\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n }\n }\n else if (ttr.symbol === 'week(s)') {\n ttr.nextSymbol();\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number');\n }\n options.byweekno = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.byweekno.push(parseInt(n[0], 10));\n }\n }\n else if (m) {\n ttr.nextSymbol();\n if (!options.bymonth)\n options.bymonth = [];\n options.bymonth.push(m);\n }\n else {\n return;\n }\n } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on'));\n }\n function AT() {\n var at = ttr.accept('at');\n if (!at)\n return;\n do {\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour');\n }\n options.byhour = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour');\n }\n options.byhour.push(parseInt(n[0], 10));\n }\n } while (ttr.accept('comma') || ttr.accept('at'));\n }\n function decodeM() {\n switch (ttr.symbol) {\n case 'january':\n return 1;\n case 'february':\n return 2;\n case 'march':\n return 3;\n case 'april':\n return 4;\n case 'may':\n return 5;\n case 'june':\n return 6;\n case 'july':\n return 7;\n case 'august':\n return 8;\n case 'september':\n return 9;\n case 'october':\n return 10;\n case 'november':\n return 11;\n case 'december':\n return 12;\n default:\n return false;\n }\n }\n function decodeWKD() {\n switch (ttr.symbol) {\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n return ttr.symbol.substr(0, 2).toUpperCase();\n default:\n return false;\n }\n }\n function decodeNTH() {\n switch (ttr.symbol) {\n case 'last':\n ttr.nextSymbol();\n return -1;\n case 'first':\n ttr.nextSymbol();\n return 1;\n case 'second':\n ttr.nextSymbol();\n return ttr.accept('last') ? -2 : 2;\n case 'third':\n ttr.nextSymbol();\n return ttr.accept('last') ? -3 : 3;\n case 'nth':\n var v = parseInt(ttr.value[1], 10);\n if (v < -366 || v > 366)\n throw new Error('Nth out of range: ' + v);\n ttr.nextSymbol();\n return ttr.accept('last') ? -v : v;\n default:\n return false;\n }\n }\n function MDAYs() {\n ttr.accept('on');\n ttr.accept('the');\n var nth = decodeNTH();\n if (!nth)\n return;\n options.bymonthday = [nth];\n ttr.nextSymbol();\n while (ttr.accept('comma')) {\n nth = decodeNTH();\n if (!nth) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.bymonthday.push(nth);\n ttr.nextSymbol();\n }\n }\n function F() {\n if (ttr.symbol === 'until') {\n var date = Date.parse(ttr.text);\n if (!date)\n throw new Error('Cannot parse until date:' + ttr.text);\n options.until = new Date(date);\n }\n else if (ttr.accept('for')) {\n options.count = parseInt(ttr.value[0], 10);\n ttr.expect('number');\n // ttr.expect('times')\n }\n }\n}\n//# sourceMappingURL=parsetext.js.map","import ToText from './totext';\nimport parseText from './parsetext';\nimport { RRule } from '../rrule';\nimport { Frequency } from '../types';\nimport ENGLISH from './i18n';\n/* !\n * rrule.js - Library for working with recurrence rules for calendar dates.\n * https://github.com/jakubroztocil/rrule\n *\n * Copyright 2010, Jakub Roztocil and Lars Schoning\n * Licenced under the BSD licence.\n * https://github.com/jakubroztocil/rrule/blob/master/LICENCE\n *\n */\n/**\n *\n * Implementation of RRule.fromText() and RRule::toText().\n *\n *\n * On the client side, this file needs to be included\n * when those functions are used.\n *\n */\n// =============================================================================\n// fromText\n// =============================================================================\n/**\n * Will be able to convert some of the below described rules from\n * text format to a rule object.\n *\n *\n * RULES\n *\n * Every ([n])\n * day(s)\n * | [weekday], ..., (and) [weekday]\n * | weekday(s)\n * | week(s)\n * | month(s)\n * | [month], ..., (and) [month]\n * | year(s)\n *\n *\n * Plus 0, 1, or multiple of these:\n *\n * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday]\n *\n * on [weekday], ..., (and) [weekday]\n *\n * on the [monthday], [monthday], ... (and) [monthday] (day of the month)\n *\n * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year)\n *\n *\n * Plus 0 or 1 of these:\n *\n * for [n] time(s)\n *\n * until [date]\n *\n * Plus (.)\n *\n *\n * Definitely no supported for parsing:\n *\n * (for year):\n * in week(s) [n], ..., (and) [n]\n *\n * on the [yearday], ..., (and) [n] day of the year\n * on day [yearday], ..., (and) [n]\n *\n *\n * NON-TERMINALS\n *\n * [n]: 1, 2 ..., one, two, three ..\n * [month]: January, February, March, April, May, ... December\n * [weekday]: Monday, ... Sunday\n * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ...\n * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, ..\n * [date]:\n * - [month] (0-31(,) ([year])),\n * - (the) 0-31.(1-12.([year])),\n * - (the) 0-31/(1-12/([year])),\n * - [weekday]\n *\n * [year]: 0000, 0001, ... 01, 02, ..\n *\n * Definitely not supported for parsing:\n *\n * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, ..\n *\n * @param {String} text\n * @return {Object, Boolean} the rule, or null.\n */\nvar fromText = function (text, language) {\n if (language === void 0) { language = ENGLISH; }\n return new RRule(parseText(text, language) || undefined);\n};\nvar common = [\n 'count',\n 'until',\n 'interval',\n 'byweekday',\n 'bymonthday',\n 'bymonth',\n];\nToText.IMPLEMENTED = [];\nToText.IMPLEMENTED[Frequency.HOURLY] = common;\nToText.IMPLEMENTED[Frequency.MINUTELY] = common;\nToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common);\nToText.IMPLEMENTED[Frequency.WEEKLY] = common;\nToText.IMPLEMENTED[Frequency.MONTHLY] = common;\nToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common);\n// =============================================================================\n// Export\n// =============================================================================\nvar toText = function (rrule, gettext, language, dateFormatter) {\n return new ToText(rrule, gettext, language, dateFormatter).toString();\n};\nvar isFullyConvertible = ToText.isFullyConvertible;\nexport { fromText, parseText, isFullyConvertible, toText };\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { Frequency } from './types';\nimport { pymod, divmod, empty, includes } from './helpers';\nimport { getWeekday, MAXYEAR, monthRange } from './dateutil';\nvar Time = /** @class */ (function () {\n function Time(hour, minute, second, millisecond) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond || 0;\n }\n Time.prototype.getHours = function () {\n return this.hour;\n };\n Time.prototype.getMinutes = function () {\n return this.minute;\n };\n Time.prototype.getSeconds = function () {\n return this.second;\n };\n Time.prototype.getMilliseconds = function () {\n return this.millisecond;\n };\n Time.prototype.getTime = function () {\n return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 +\n this.millisecond);\n };\n return Time;\n}());\nexport { Time };\nvar DateTime = /** @class */ (function (_super) {\n __extends(DateTime, _super);\n function DateTime(year, month, day, hour, minute, second, millisecond) {\n var _this = _super.call(this, hour, minute, second, millisecond) || this;\n _this.year = year;\n _this.month = month;\n _this.day = day;\n return _this;\n }\n DateTime.fromDate = function (date) {\n return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000);\n };\n DateTime.prototype.getWeekday = function () {\n return getWeekday(new Date(this.getTime()));\n };\n DateTime.prototype.getTime = function () {\n return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();\n };\n DateTime.prototype.getDay = function () {\n return this.day;\n };\n DateTime.prototype.getMonth = function () {\n return this.month;\n };\n DateTime.prototype.getYear = function () {\n return this.year;\n };\n DateTime.prototype.addYears = function (years) {\n this.year += years;\n };\n DateTime.prototype.addMonths = function (months) {\n this.month += months;\n if (this.month > 12) {\n var yearDiv = Math.floor(this.month / 12);\n var monthMod = pymod(this.month, 12);\n this.month = monthMod;\n this.year += yearDiv;\n if (this.month === 0) {\n this.month = 12;\n --this.year;\n }\n }\n };\n DateTime.prototype.addWeekly = function (days, wkst) {\n if (wkst > this.getWeekday()) {\n this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7;\n }\n else {\n this.day += -(this.getWeekday() - wkst) + days * 7;\n }\n this.fixDay();\n };\n DateTime.prototype.addDaily = function (days) {\n this.day += days;\n this.fixDay();\n };\n DateTime.prototype.addHours = function (hours, filtered, byhour) {\n if (filtered) {\n // Jump to one iteration before next day\n this.hour += Math.floor((23 - this.hour) / hours) * hours;\n }\n for (;;) {\n this.hour += hours;\n var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod;\n if (dayDiv) {\n this.hour = hourMod;\n this.addDaily(dayDiv);\n }\n if (empty(byhour) || includes(byhour, this.hour))\n break;\n }\n };\n DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) {\n if (filtered) {\n // Jump to one iteration before next day\n this.minute +=\n Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes;\n }\n for (;;) {\n this.minute += minutes;\n var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod;\n if (hourDiv) {\n this.minute = minuteMod;\n this.addHours(hourDiv, false, byhour);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute))) {\n break;\n }\n }\n };\n DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) {\n if (filtered) {\n // Jump to one iteration before next day\n this.second +=\n Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) /\n seconds) * seconds;\n }\n for (;;) {\n this.second += seconds;\n var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod;\n if (minuteDiv) {\n this.second = secondMod;\n this.addMinutes(minuteDiv, false, byhour, byminute);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute)) &&\n (empty(bysecond) || includes(bysecond, this.second))) {\n break;\n }\n }\n };\n DateTime.prototype.fixDay = function () {\n if (this.day <= 28) {\n return;\n }\n var daysinmonth = monthRange(this.year, this.month - 1)[1];\n if (this.day <= daysinmonth) {\n return;\n }\n while (this.day > daysinmonth) {\n this.day -= daysinmonth;\n ++this.month;\n if (this.month === 13) {\n this.month = 1;\n ++this.year;\n if (this.year > MAXYEAR) {\n return;\n }\n }\n daysinmonth = monthRange(this.year, this.month - 1)[1];\n }\n };\n DateTime.prototype.add = function (options, filtered) {\n var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n switch (freq) {\n case Frequency.YEARLY:\n return this.addYears(interval);\n case Frequency.MONTHLY:\n return this.addMonths(interval);\n case Frequency.WEEKLY:\n return this.addWeekly(interval, wkst);\n case Frequency.DAILY:\n return this.addDaily(interval);\n case Frequency.HOURLY:\n return this.addHours(interval, filtered, byhour);\n case Frequency.MINUTELY:\n return this.addMinutes(interval, filtered, byhour, byminute);\n case Frequency.SECONDLY:\n return this.addSeconds(interval, filtered, byhour, byminute, bysecond);\n }\n };\n return DateTime;\n}(Time));\nexport { DateTime };\n//# sourceMappingURL=datetime.js.map","import { __assign } from \"tslib\";\nimport { freqIsDailyOrGreater } from './types';\nimport { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr, } from './helpers';\nimport { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';\nimport { getWeekday, isDate, isValidDate } from './dateutil';\nimport { Weekday } from './weekday';\nimport { Time } from './datetime';\nexport function initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n // Shallow copy for options and origOptions and check for invalid\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!includes(defaultKeys, key))\n invalid.push(key);\n if (isDate(options[key]) && !isValidDate(options[key])) {\n invalid.push(key);\n }\n }\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign({}, options);\n}\nexport function parseOptions(options) {\n var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options));\n if (isPresent(opts.byeaster))\n opts.freq = RRule.YEARLY;\n if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) {\n throw new Error(\"Invalid frequency: \".concat(opts.freq, \" \").concat(options.freq));\n }\n if (!opts.dtstart)\n opts.dtstart = new Date(new Date().setMilliseconds(0));\n if (!isPresent(opts.wkst)) {\n opts.wkst = RRule.MO.weekday;\n }\n else if (isNumber(opts.wkst)) {\n // cool, just keep it like that\n }\n else {\n opts.wkst = opts.wkst.weekday;\n }\n if (isPresent(opts.bysetpos)) {\n if (isNumber(opts.bysetpos))\n opts.bysetpos = [opts.bysetpos];\n for (var i = 0; i < opts.bysetpos.length; i++) {\n var v = opts.bysetpos[i];\n if (v === 0 || !(v >= -366 && v <= 366)) {\n throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1');\n }\n }\n }\n if (!(Boolean(opts.byweekno) ||\n notEmpty(opts.byweekno) ||\n notEmpty(opts.byyearday) ||\n Boolean(opts.bymonthday) ||\n notEmpty(opts.bymonthday) ||\n isPresent(opts.byweekday) ||\n isPresent(opts.byeaster))) {\n switch (opts.freq) {\n case RRule.YEARLY:\n if (!opts.bymonth)\n opts.bymonth = opts.dtstart.getUTCMonth() + 1;\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.MONTHLY:\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.WEEKLY:\n opts.byweekday = [getWeekday(opts.dtstart)];\n break;\n }\n }\n // bymonth\n if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) {\n opts.bymonth = [opts.bymonth];\n }\n // byyearday\n if (isPresent(opts.byyearday) &&\n !isArray(opts.byyearday) &&\n isNumber(opts.byyearday)) {\n opts.byyearday = [opts.byyearday];\n }\n // bymonthday\n if (!isPresent(opts.bymonthday)) {\n opts.bymonthday = [];\n opts.bynmonthday = [];\n }\n else if (isArray(opts.bymonthday)) {\n var bymonthday = [];\n var bynmonthday = [];\n for (var i = 0; i < opts.bymonthday.length; i++) {\n var v = opts.bymonthday[i];\n if (v > 0) {\n bymonthday.push(v);\n }\n else if (v < 0) {\n bynmonthday.push(v);\n }\n }\n opts.bymonthday = bymonthday;\n opts.bynmonthday = bynmonthday;\n }\n else if (opts.bymonthday < 0) {\n opts.bynmonthday = [opts.bymonthday];\n opts.bymonthday = [];\n }\n else {\n opts.bynmonthday = [];\n opts.bymonthday = [opts.bymonthday];\n }\n // byweekno\n if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) {\n opts.byweekno = [opts.byweekno];\n }\n // byweekday / bynweekday\n if (!isPresent(opts.byweekday)) {\n opts.bynweekday = null;\n }\n else if (isNumber(opts.byweekday)) {\n opts.byweekday = [opts.byweekday];\n opts.bynweekday = null;\n }\n else if (isWeekdayStr(opts.byweekday)) {\n opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday];\n opts.bynweekday = null;\n }\n else if (opts.byweekday instanceof Weekday) {\n if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) {\n opts.byweekday = [opts.byweekday.weekday];\n opts.bynweekday = null;\n }\n else {\n opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]];\n opts.byweekday = null;\n }\n }\n else {\n var byweekday = [];\n var bynweekday = [];\n for (var i = 0; i < opts.byweekday.length; i++) {\n var wday = opts.byweekday[i];\n if (isNumber(wday)) {\n byweekday.push(wday);\n continue;\n }\n else if (isWeekdayStr(wday)) {\n byweekday.push(Weekday.fromStr(wday).weekday);\n continue;\n }\n if (!wday.n || opts.freq > RRule.MONTHLY) {\n byweekday.push(wday.weekday);\n }\n else {\n bynweekday.push([wday.weekday, wday.n]);\n }\n }\n opts.byweekday = notEmpty(byweekday) ? byweekday : null;\n opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null;\n }\n // byhour\n if (!isPresent(opts.byhour)) {\n opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null;\n }\n else if (isNumber(opts.byhour)) {\n opts.byhour = [opts.byhour];\n }\n // byminute\n if (!isPresent(opts.byminute)) {\n opts.byminute =\n opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null;\n }\n else if (isNumber(opts.byminute)) {\n opts.byminute = [opts.byminute];\n }\n // bysecond\n if (!isPresent(opts.bysecond)) {\n opts.bysecond =\n opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null;\n }\n else if (isNumber(opts.bysecond)) {\n opts.bysecond = [opts.bysecond];\n }\n return { parsedOptions: opts };\n}\nexport function buildTimeset(opts) {\n var millisecondModulo = opts.dtstart.getTime() % 1000;\n if (!freqIsDailyOrGreater(opts.freq)) {\n return [];\n }\n var timeset = [];\n opts.byhour.forEach(function (hour) {\n opts.byminute.forEach(function (minute) {\n opts.bysecond.forEach(function (second) {\n timeset.push(new Time(hour, minute, second, millisecondModulo));\n });\n });\n });\n return timeset;\n}\n//# sourceMappingURL=parseoptions.js.map","import { __assign } from \"tslib\";\nimport { Frequency } from './types';\nimport { Weekday } from './weekday';\nimport { untilStringToDate } from './dateutil';\nimport { Days } from './rrule';\nexport function parseString(rfcString) {\n var options = rfcString\n .split('\\n')\n .map(parseLine)\n .filter(function (x) { return x !== null; });\n return __assign(__assign({}, options[0]), options[1]);\n}\nexport function parseDtstart(line) {\n var options = {};\n var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\\s]+)/i.exec(line);\n if (!dtstartWithZone) {\n return options;\n }\n var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2];\n if (tzid) {\n options.tzid = tzid;\n }\n options.dtstart = untilStringToDate(dtstart);\n return options;\n}\nfunction parseLine(rfcString) {\n rfcString = rfcString.replace(/^\\s+|\\s+$/, '');\n if (!rfcString.length)\n return null;\n var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());\n if (!header) {\n return parseRrule(rfcString);\n }\n var key = header[1];\n switch (key.toUpperCase()) {\n case 'RRULE':\n case 'EXRULE':\n return parseRrule(rfcString);\n case 'DTSTART':\n return parseDtstart(rfcString);\n default:\n throw new Error(\"Unsupported RFC prop \".concat(key, \" in \").concat(rfcString));\n }\n}\nfunction parseRrule(line) {\n var strippedLine = line.replace(/^RRULE:/i, '');\n var options = parseDtstart(strippedLine);\n var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';');\n attrs.forEach(function (attr) {\n var _a = attr.split('='), key = _a[0], value = _a[1];\n switch (key.toUpperCase()) {\n case 'FREQ':\n options.freq = Frequency[value.toUpperCase()];\n break;\n case 'WKST':\n options.wkst = Days[value.toUpperCase()];\n break;\n case 'COUNT':\n case 'INTERVAL':\n case 'BYSETPOS':\n case 'BYMONTH':\n case 'BYMONTHDAY':\n case 'BYYEARDAY':\n case 'BYWEEKNO':\n case 'BYHOUR':\n case 'BYMINUTE':\n case 'BYSECOND':\n var num = parseNumber(value);\n var optionKey = key.toLowerCase();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n options[optionKey] = num;\n break;\n case 'BYWEEKDAY':\n case 'BYDAY':\n options.byweekday = parseWeekday(value);\n break;\n case 'DTSTART':\n case 'TZID':\n // for backwards compatibility\n var dtstart = parseDtstart(line);\n options.tzid = dtstart.tzid;\n options.dtstart = dtstart.dtstart;\n break;\n case 'UNTIL':\n options.until = untilStringToDate(value);\n break;\n case 'BYEASTER':\n options.byeaster = Number(value);\n break;\n default:\n throw new Error(\"Unknown RRULE property '\" + key + \"'\");\n }\n });\n return options;\n}\nfunction parseNumber(value) {\n if (value.indexOf(',') !== -1) {\n var values = value.split(',');\n return values.map(parseIndividualNumber);\n }\n return parseIndividualNumber(value);\n}\nfunction parseIndividualNumber(value) {\n if (/^[+-]?\\d+$/.test(value)) {\n return Number(value);\n }\n return value;\n}\nfunction parseWeekday(value) {\n var days = value.split(',');\n return days.map(function (day) {\n if (day.length === 2) {\n // MO, TU, ...\n return Days[day]; // wday instanceof Weekday\n }\n // -1MO, +3FR, 1SO, 13TU ...\n var parts = day.match(/^([+-]?\\d{1,2})([A-Z]{2})$/);\n if (!parts || parts.length < 3) {\n throw new SyntaxError(\"Invalid weekday string: \".concat(day));\n }\n var n = Number(parts[1]);\n var wdaypart = parts[2];\n var wday = Days[wdaypart].weekday;\n return new Weekday(wday, n);\n });\n}\n//# sourceMappingURL=parsestring.js.map","import { dateInTimeZone, timeToUntilString } from './dateutil';\nvar DateWithZone = /** @class */ (function () {\n function DateWithZone(date, tzid) {\n if (isNaN(date.getTime())) {\n throw new RangeError('Invalid date passed to DateWithZone');\n }\n this.date = date;\n this.tzid = tzid;\n }\n Object.defineProperty(DateWithZone.prototype, \"isUTC\", {\n get: function () {\n return !this.tzid || this.tzid.toUpperCase() === 'UTC';\n },\n enumerable: false,\n configurable: true\n });\n DateWithZone.prototype.toString = function () {\n var datestr = timeToUntilString(this.date.getTime(), this.isUTC);\n if (!this.isUTC) {\n return \";TZID=\".concat(this.tzid, \":\").concat(datestr);\n }\n return \":\".concat(datestr);\n };\n DateWithZone.prototype.getTime = function () {\n return this.date.getTime();\n };\n DateWithZone.prototype.rezonedDate = function () {\n if (this.isUTC) {\n return this.date;\n }\n return dateInTimeZone(this.date, this.tzid);\n };\n return DateWithZone;\n}());\nexport { DateWithZone };\n//# sourceMappingURL=datewithzone.js.map","import { RRule, DEFAULT_OPTIONS } from './rrule';\nimport { includes, isPresent, isArray, isNumber, toArray } from './helpers';\nimport { Weekday } from './weekday';\nimport { timeToUntilString } from './dateutil';\nimport { DateWithZone } from './datewithzone';\nexport function optionsToString(options) {\n var rrule = [];\n var dtstart = '';\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === 'tzid')\n continue;\n if (!includes(defaultKeys, keys[i]))\n continue;\n var key = keys[i].toUpperCase();\n var value = options[keys[i]];\n var outValue = '';\n if (!isPresent(value) || (isArray(value) && !value.length))\n continue;\n switch (key) {\n case 'FREQ':\n outValue = RRule.FREQUENCIES[options.freq];\n break;\n case 'WKST':\n if (isNumber(value)) {\n outValue = new Weekday(value).toString();\n }\n else {\n outValue = value.toString();\n }\n break;\n case 'BYWEEKDAY':\n /*\n NOTE: BYWEEKDAY is a special case.\n RRule() deconstructs the rule.options.byweekday array\n into an array of Weekday arguments.\n On the other hand, rule.origOptions is an array of Weekdays.\n We need to handle both cases here.\n It might be worth change RRule to keep the Weekdays.\n \n Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC)\n \n */\n key = 'BYDAY';\n outValue = toArray(value)\n .map(function (wday) {\n if (wday instanceof Weekday) {\n return wday;\n }\n if (isArray(wday)) {\n return new Weekday(wday[0], wday[1]);\n }\n return new Weekday(wday);\n })\n .toString();\n break;\n case 'DTSTART':\n dtstart = buildDtstart(value, options.tzid);\n break;\n case 'UNTIL':\n outValue = timeToUntilString(value, !options.tzid);\n break;\n default:\n if (isArray(value)) {\n var strValues = [];\n for (var j = 0; j < value.length; j++) {\n strValues[j] = String(value[j]);\n }\n outValue = strValues.toString();\n }\n else {\n outValue = String(value);\n }\n }\n if (outValue) {\n rrule.push([key, outValue]);\n }\n }\n var rules = rrule\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value.toString());\n })\n .join(';');\n var ruleString = '';\n if (rules !== '') {\n ruleString = \"RRULE:\".concat(rules);\n }\n return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\\n');\n}\nfunction buildDtstart(dtstart, tzid) {\n if (!dtstart) {\n return '';\n }\n return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString();\n}\n//# sourceMappingURL=optionstostring.js.map","import IterResult from './iterresult';\nimport { clone, cloneDates } from './dateutil';\nimport { isArray } from './helpers';\nfunction argsMatch(left, right) {\n if (Array.isArray(left)) {\n if (!Array.isArray(right))\n return false;\n if (left.length !== right.length)\n return false;\n return left.every(function (date, i) { return date.getTime() === right[i].getTime(); });\n }\n if (left instanceof Date) {\n return right instanceof Date && left.getTime() === right.getTime();\n }\n return left === right;\n}\nvar Cache = /** @class */ (function () {\n function Cache() {\n this.all = false;\n this.before = [];\n this.after = [];\n this.between = [];\n }\n /**\n * @param {String} what - all/before/after/between\n * @param {Array,Date} value - an array of dates, one date, or null\n * @param {Object?} args - _iter arguments\n */\n Cache.prototype._cacheAdd = function (what, value, args) {\n if (value) {\n value = value instanceof Date ? clone(value) : cloneDates(value);\n }\n if (what === 'all') {\n this.all = value;\n }\n else {\n args._value = value;\n this[what].push(args);\n }\n };\n /**\n * @return false - not in the cache\n * @return null - cached, but zero occurrences (before/after)\n * @return Date - cached (before/after)\n * @return [] - cached, but zero occurrences (all/between)\n * @return [Date1, DateN] - cached (all/between)\n */\n Cache.prototype._cacheGet = function (what, args) {\n var cached = false;\n var argsKeys = args ? Object.keys(args) : [];\n var findCacheDiff = function (item) {\n for (var i = 0; i < argsKeys.length; i++) {\n var key = argsKeys[i];\n if (!argsMatch(args[key], item[key])) {\n return true;\n }\n }\n return false;\n };\n var cachedObject = this[what];\n if (what === 'all') {\n cached = this.all;\n }\n else if (isArray(cachedObject)) {\n // Let's see whether we've already called the\n // 'what' method with the same 'args'\n for (var i = 0; i < cachedObject.length; i++) {\n var item = cachedObject[i];\n if (argsKeys.length && findCacheDiff(item))\n continue;\n cached = item._value;\n break;\n }\n }\n if (!cached && this.all) {\n // Not in the cache, but we already know all the occurrences,\n // so we can find the correct dates from the cached ones.\n var iterResult = new IterResult(what, args);\n for (var i = 0; i < this.all.length; i++) {\n if (!iterResult.accept(this.all[i]))\n break;\n }\n cached = iterResult.getValue();\n this._cacheAdd(what, cached, args);\n }\n return isArray(cached)\n ? cloneDates(cached)\n : cached instanceof Date\n ? clone(cached)\n : cached;\n };\n return Cache;\n}());\nexport { Cache };\n//# sourceMappingURL=cache.js.map","import { __spreadArray } from \"tslib\";\nimport { range, repeat } from './helpers';\n// =============================================================================\n// Date masks\n// =============================================================================\n// Every mask is 7 days longer to handle cross-year weekly periods.\nvar M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M28 = range(1, 29);\nvar M29 = range(1, 30);\nvar M30 = range(1, 31);\nvar M31 = range(1, 32);\nvar MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar NM28 = range(-28, 0);\nvar NM29 = range(-29, 0);\nvar NM30 = range(-30, 0);\nvar NM31 = range(-31, 0);\nvar NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];\nvar M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];\nvar WDAYMASK = (function () {\n var wdaymask = [];\n for (var i = 0; i < 55; i++)\n wdaymask = wdaymask.concat(range(7));\n return wdaymask;\n})();\nexport { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK, };\n//# sourceMappingURL=masks.js.map","import { __assign } from \"tslib\";\nimport { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';\nimport { empty, repeat, pymod, includes } from '../helpers';\nimport { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';\nexport function rebuildYear(year, options) {\n var firstyday = datetime(year, 1, 1);\n var yearlen = isLeapYear(year) ? 366 : 365;\n var nextyearlen = isLeapYear(year + 1) ? 366 : 365;\n var yearordinal = toOrdinal(firstyday);\n var yearweekday = getWeekday(firstyday);\n var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });\n if (empty(options.byweekno)) {\n return result;\n }\n result.wnomask = repeat(0, yearlen + 7);\n var firstwkst;\n var wyearlen;\n var no1wkst = (firstwkst = pymod(7 - yearweekday + options.wkst, 7));\n if (no1wkst >= 4) {\n no1wkst = 0;\n // Number of days in the year, plus the days we got\n // from last year.\n wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7);\n }\n else {\n // Number of days in the year, minus the days we\n // left in last year.\n wyearlen = yearlen - no1wkst;\n }\n var div = Math.floor(wyearlen / 7);\n var mod = pymod(wyearlen, 7);\n var numweeks = Math.floor(div + mod / 4);\n for (var j = 0; j < options.byweekno.length; j++) {\n var n = options.byweekno[j];\n if (n < 0) {\n n += numweeks + 1;\n }\n if (!(n > 0 && n <= numweeks)) {\n continue;\n }\n var i = void 0;\n if (n > 1) {\n i = no1wkst + (n - 1) * 7;\n if (no1wkst !== firstwkst) {\n i -= 7 - firstwkst;\n }\n }\n else {\n i = no1wkst;\n }\n for (var k = 0; k < 7; k++) {\n result.wnomask[i] = 1;\n i++;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n if (includes(options.byweekno, 1)) {\n // Check week number 1 of next year as well\n // orig-TODO : Check -numweeks for next year.\n var i = no1wkst + numweeks * 7;\n if (no1wkst !== firstwkst)\n i -= 7 - firstwkst;\n if (i < yearlen) {\n // If week starts in next year, we\n // don't care about it.\n for (var j = 0; j < 7; j++) {\n result.wnomask[i] = 1;\n i += 1;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n }\n if (no1wkst) {\n // Check last week number of last year as\n // well. If no1wkst is 0, either the year\n // started on week start, or week number 1\n // got days from last year, so there are no\n // days from last year's last week number in\n // this year.\n var lnumweeks = void 0;\n if (!includes(options.byweekno, -1)) {\n var lyearweekday = getWeekday(datetime(year - 1, 1, 1));\n var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);\n var lyearlen = isLeapYear(year - 1) ? 366 : 365;\n var weekst = void 0;\n if (lno1wkst >= 4) {\n lno1wkst = 0;\n weekst = lyearlen + pymod(lyearweekday - options.wkst, 7);\n }\n else {\n weekst = yearlen - no1wkst;\n }\n lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4);\n }\n else {\n lnumweeks = -1;\n }\n if (includes(options.byweekno, lnumweeks)) {\n for (var i = 0; i < no1wkst; i++)\n result.wnomask[i] = 1;\n }\n }\n return result;\n}\nfunction baseYearMasks(year) {\n var yearlen = isLeapYear(year) ? 366 : 365;\n var firstyday = datetime(year, 1, 1);\n var wday = getWeekday(firstyday);\n if (yearlen === 365) {\n return {\n mmask: M365MASK,\n mdaymask: MDAY365MASK,\n nmdaymask: NMDAY365MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M365RANGE,\n };\n }\n return {\n mmask: M366MASK,\n mdaymask: MDAY366MASK,\n nmdaymask: NMDAY366MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M366RANGE,\n };\n}\n//# sourceMappingURL=yearinfo.js.map","import { notEmpty, repeat, range, isPresent } from '../helpers';\nimport { Frequency } from '../types';\nimport { rebuildYear } from './yearinfo';\nimport { rebuildMonth } from './monthinfo';\nimport { easter } from './easter';\nimport { Time } from '../datetime';\nimport { datetime, sort, toOrdinal } from '../dateutil';\n// =============================================================================\n// Iterinfo\n// =============================================================================\nvar Iterinfo = /** @class */ (function () {\n // eslint-disable-next-line no-empty-function\n function Iterinfo(options) {\n this.options = options;\n }\n Iterinfo.prototype.rebuild = function (year, month) {\n var options = this.options;\n if (year !== this.lastyear) {\n this.yearinfo = rebuildYear(year, options);\n }\n if (notEmpty(options.bynweekday) &&\n (month !== this.lastmonth || year !== this.lastyear)) {\n var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask;\n this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options);\n }\n if (isPresent(options.byeaster)) {\n this.eastermask = easter(year, options.byeaster);\n }\n };\n Object.defineProperty(Iterinfo.prototype, \"lastyear\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastyear : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"lastmonth\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastmonth : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearlen\", {\n get: function () {\n return this.yearinfo.yearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearordinal\", {\n get: function () {\n return this.yearinfo.yearordinal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mrange\", {\n get: function () {\n return this.yearinfo.mrange;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wdaymask\", {\n get: function () {\n return this.yearinfo.wdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mmask\", {\n get: function () {\n return this.yearinfo.mmask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wnomask\", {\n get: function () {\n return this.yearinfo.wnomask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nwdaymask\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.nwdaymask : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nextyearlen\", {\n get: function () {\n return this.yearinfo.nextyearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mdaymask\", {\n get: function () {\n return this.yearinfo.mdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nmdaymask\", {\n get: function () {\n return this.yearinfo.nmdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Iterinfo.prototype.ydayset = function () {\n return [range(this.yearlen), 0, this.yearlen];\n };\n Iterinfo.prototype.mdayset = function (_, month) {\n var start = this.mrange[month - 1];\n var end = this.mrange[month];\n var set = repeat(null, this.yearlen);\n for (var i = start; i < end; i++)\n set[i] = i;\n return [set, start, end];\n };\n Iterinfo.prototype.wdayset = function (year, month, day) {\n // We need to handle cross-year weeks here.\n var set = repeat(null, this.yearlen + 7);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n var start = i;\n for (var j = 0; j < 7; j++) {\n set[i] = i;\n ++i;\n if (this.wdaymask[i] === this.options.wkst)\n break;\n }\n return [set, start, i];\n };\n Iterinfo.prototype.ddayset = function (year, month, day) {\n var set = repeat(null, this.yearlen);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n set[i] = i;\n return [set, i, i + 1];\n };\n Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) {\n var _this = this;\n var set = [];\n this.options.byminute.forEach(function (minute) {\n set = set.concat(_this.mtimeset(hour, minute, second, millisecond));\n });\n sort(set);\n return set;\n };\n Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) {\n var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });\n sort(set);\n return set;\n };\n Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) {\n return [new Time(hour, minute, second, millisecond)];\n };\n Iterinfo.prototype.getdayset = function (freq) {\n switch (freq) {\n case Frequency.YEARLY:\n return this.ydayset.bind(this);\n case Frequency.MONTHLY:\n return this.mdayset.bind(this);\n case Frequency.WEEKLY:\n return this.wdayset.bind(this);\n case Frequency.DAILY:\n return this.ddayset.bind(this);\n default:\n return this.ddayset.bind(this);\n }\n };\n Iterinfo.prototype.gettimeset = function (freq) {\n switch (freq) {\n case Frequency.HOURLY:\n return this.htimeset.bind(this);\n case Frequency.MINUTELY:\n return this.mtimeset.bind(this);\n case Frequency.SECONDLY:\n return this.stimeset.bind(this);\n }\n };\n return Iterinfo;\n}());\nexport default Iterinfo;\n//# sourceMappingURL=index.js.map","import { RRule } from '../rrule';\nimport { empty, repeat, pymod } from '../helpers';\nexport function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) {\n var result = {\n lastyear: year,\n lastmonth: month,\n nwdaymask: [],\n };\n var ranges = [];\n if (options.freq === RRule.YEARLY) {\n if (empty(options.bymonth)) {\n ranges = [[0, yearlen]];\n }\n else {\n for (var j = 0; j < options.bymonth.length; j++) {\n month = options.bymonth[j];\n ranges.push(mrange.slice(month - 1, month + 1));\n }\n }\n }\n else if (options.freq === RRule.MONTHLY) {\n ranges = [mrange.slice(month - 1, month + 1)];\n }\n if (empty(ranges)) {\n return result;\n }\n // Weekly frequency won't get here, so we may not\n // care about cross-year weekly periods.\n result.nwdaymask = repeat(0, yearlen);\n for (var j = 0; j < ranges.length; j++) {\n var rang = ranges[j];\n var first = rang[0];\n var last = rang[1] - 1;\n for (var k = 0; k < options.bynweekday.length; k++) {\n var i = void 0;\n var _a = options.bynweekday[k], wday = _a[0], n = _a[1];\n if (n < 0) {\n i = last + (n + 1) * 7;\n i -= pymod(wdaymask[i] - wday, 7);\n }\n else {\n i = first + (n - 1) * 7;\n i += pymod(7 - wdaymask[i] + wday, 7);\n }\n if (first <= i && i <= last)\n result.nwdaymask[i] = 1;\n }\n }\n return result;\n}\n//# sourceMappingURL=monthinfo.js.map","export function easter(y, offset) {\n if (offset === void 0) { offset = 0; }\n var a = y % 19;\n var b = Math.floor(y / 100);\n var c = y % 100;\n var d = Math.floor(b / 4);\n var e = b % 4;\n var f = Math.floor((b + 8) / 25);\n var g = Math.floor((b - f + 1) / 3);\n var h = Math.floor(19 * a + b - d - g + 15) % 30;\n var i = Math.floor(c / 4);\n var k = c % 4;\n var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;\n var m = Math.floor((a + 11 * h + 22 * l) / 451);\n var month = Math.floor((h + l - 7 * m + 114) / 31);\n var day = ((h + l - 7 * m + 114) % 31) + 1;\n var date = Date.UTC(y, month - 1, day + offset);\n var yearStart = Date.UTC(y, 0, 1);\n return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];\n}\n//# sourceMappingURL=easter.js.map","import { combine, fromOrdinal, sort } from '../dateutil';\nimport { pymod, isPresent, includes } from '../helpers';\nexport function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {\n var poslist = [];\n for (var j = 0; j < bysetpos.length; j++) {\n var daypos = void 0;\n var timepos = void 0;\n var pos = bysetpos[j];\n if (pos < 0) {\n daypos = Math.floor(pos / timeset.length);\n timepos = pymod(pos, timeset.length);\n }\n else {\n daypos = Math.floor((pos - 1) / timeset.length);\n timepos = pymod(pos - 1, timeset.length);\n }\n var tmp = [];\n for (var k = start; k < end; k++) {\n var val = dayset[k];\n if (!isPresent(val))\n continue;\n tmp.push(val);\n }\n var i = void 0;\n if (daypos < 0) {\n i = tmp.slice(daypos)[0];\n }\n else {\n i = tmp[daypos];\n }\n var time = timeset[timepos];\n var date = fromOrdinal(ii.yearordinal + i);\n var res = combine(date, time);\n // XXX: can this ever be in the array?\n // - compare the actual date instead?\n if (!includes(poslist, res))\n poslist.push(res);\n }\n sort(poslist);\n return poslist;\n}\n//# sourceMappingURL=poslist.js.map","import { freqIsDailyOrGreater } from '../types';\nimport { combine, fromOrdinal, MAXYEAR } from '../dateutil';\nimport Iterinfo from '../iterinfo/index';\nimport { RRule } from '../rrule';\nimport { buildTimeset } from '../parseoptions';\nimport { notEmpty, includes, isPresent } from '../helpers';\nimport { DateWithZone } from '../datewithzone';\nimport { buildPoslist } from './poslist';\nimport { DateTime } from '../datetime';\nexport function iter(iterResult, options) {\n var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;\n var count = options.count;\n if (count === 0 || interval === 0) {\n return emitResult(iterResult);\n }\n var counterDate = DateTime.fromDate(dtstart);\n var ii = new Iterinfo(options);\n ii.rebuild(counterDate.year, counterDate.month);\n var timeset = makeTimeset(ii, counterDate, options);\n for (;;) {\n var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2];\n var filtered = removeFilteredDays(dayset, start, end, ii, options);\n if (notEmpty(bysetpos)) {\n var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset);\n for (var j = 0; j < poslist.length; j++) {\n var res = poslist[j];\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n else {\n for (var j = start; j < end; j++) {\n var currentDay = dayset[j];\n if (!isPresent(currentDay)) {\n continue;\n }\n var date = fromOrdinal(ii.yearordinal + currentDay);\n for (var k = 0; k < timeset.length; k++) {\n var time = timeset[k];\n var res = combine(date, time);\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n }\n if (options.interval === 0) {\n return emitResult(iterResult);\n }\n // Handle frequency and interval\n counterDate.add(options, filtered);\n if (counterDate.year > MAXYEAR) {\n return emitResult(iterResult);\n }\n if (!freqIsDailyOrGreater(freq)) {\n timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0);\n }\n ii.rebuild(counterDate.year, counterDate.month);\n }\n}\nfunction isFiltered(ii, currentDay, options) {\n var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday;\n return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) ||\n (notEmpty(byweekno) && !ii.wnomask[currentDay]) ||\n (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) ||\n (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) ||\n (byeaster !== null && !includes(ii.eastermask, currentDay)) ||\n ((notEmpty(bymonthday) || notEmpty(bynmonthday)) &&\n !includes(bymonthday, ii.mdaymask[currentDay]) &&\n !includes(bynmonthday, ii.nmdaymask[currentDay])) ||\n (notEmpty(byyearday) &&\n ((currentDay < ii.yearlen &&\n !includes(byyearday, currentDay + 1) &&\n !includes(byyearday, -ii.yearlen + currentDay)) ||\n (currentDay >= ii.yearlen &&\n !includes(byyearday, currentDay + 1 - ii.yearlen) &&\n !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))));\n}\nfunction rezoneIfNeeded(date, options) {\n return new DateWithZone(date, options.tzid).rezonedDate();\n}\nfunction emitResult(iterResult) {\n return iterResult.getValue();\n}\nfunction removeFilteredDays(dayset, start, end, ii, options) {\n var filtered = false;\n for (var dayCounter = start; dayCounter < end; dayCounter++) {\n var currentDay = dayset[dayCounter];\n filtered = isFiltered(ii, currentDay, options);\n if (filtered)\n dayset[currentDay] = null;\n }\n return filtered;\n}\nfunction makeTimeset(ii, counterDate, options) {\n var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n if (freqIsDailyOrGreater(freq)) {\n return buildTimeset(options);\n }\n if ((freq >= RRule.HOURLY &&\n notEmpty(byhour) &&\n !includes(byhour, counterDate.hour)) ||\n (freq >= RRule.MINUTELY &&\n notEmpty(byminute) &&\n !includes(byminute, counterDate.minute)) ||\n (freq >= RRule.SECONDLY &&\n notEmpty(bysecond) &&\n !includes(bysecond, counterDate.second))) {\n return [];\n }\n return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond);\n}\n//# sourceMappingURL=index.js.map","import { isValidDate } from './dateutil';\nimport IterResult from './iterresult';\nimport CallbackIterResult from './callbackiterresult';\nimport { fromText, parseText, toText, isFullyConvertible } from './nlp/index';\nimport { Frequency, } from './types';\nimport { parseOptions, initializeOptions } from './parseoptions';\nimport { parseString } from './parsestring';\nimport { optionsToString } from './optionstostring';\nimport { Cache } from './cache';\nimport { Weekday } from './weekday';\nimport { iter } from './iter/index';\n// =============================================================================\n// RRule\n// =============================================================================\nexport var Days = {\n MO: new Weekday(0),\n TU: new Weekday(1),\n WE: new Weekday(2),\n TH: new Weekday(3),\n FR: new Weekday(4),\n SA: new Weekday(5),\n SU: new Weekday(6),\n};\nexport var DEFAULT_OPTIONS = {\n freq: Frequency.YEARLY,\n dtstart: null,\n interval: 1,\n wkst: Days.MO,\n count: null,\n until: null,\n tzid: null,\n bysetpos: null,\n bymonth: null,\n bymonthday: null,\n bynmonthday: null,\n byyearday: null,\n byweekno: null,\n byweekday: null,\n bynweekday: null,\n byhour: null,\n byminute: null,\n bysecond: null,\n byeaster: null,\n};\nexport var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n/**\n *\n * @param {Options?} options - see \n * - The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...\n * @constructor\n */\nvar RRule = /** @class */ (function () {\n function RRule(options, noCache) {\n if (options === void 0) { options = {}; }\n if (noCache === void 0) { noCache = false; }\n // RFC string\n this._cache = noCache ? null : new Cache();\n // used by toString()\n this.origOptions = initializeOptions(options);\n var parsedOptions = parseOptions(options).parsedOptions;\n this.options = parsedOptions;\n }\n RRule.parseText = function (text, language) {\n return parseText(text, language);\n };\n RRule.fromText = function (text, language) {\n return fromText(text, language);\n };\n RRule.fromString = function (str) {\n return new RRule(RRule.parseString(str) || undefined);\n };\n RRule.prototype._iter = function (iterResult) {\n return iter(iterResult, this.options);\n };\n RRule.prototype._cacheGet = function (what, args) {\n if (!this._cache)\n return false;\n return this._cache._cacheGet(what, args);\n };\n RRule.prototype._cacheAdd = function (what, value, args) {\n if (!this._cache)\n return;\n return this._cache._cacheAdd(what, value, args);\n };\n /**\n * @param {Function} iterator - optional function that will be called\n * on each date that is added. It can return false\n * to stop the iteration.\n * @return Array containing all recurrences.\n */\n RRule.prototype.all = function (iterator) {\n if (iterator) {\n return this._iter(new CallbackIterResult('all', {}, iterator));\n }\n var result = this._cacheGet('all');\n if (result === false) {\n result = this._iter(new IterResult('all', {}));\n this._cacheAdd('all', result);\n }\n return result;\n };\n /**\n * Returns all the occurrences of the rrule between after and before.\n * The inc keyword defines what happens if after and/or before are\n * themselves occurrences. With inc == True, they will be included in the\n * list, if they are found in the recurrence set.\n *\n * @return Array\n */\n RRule.prototype.between = function (after, before, inc, iterator) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(after) || !isValidDate(before)) {\n throw new Error('Invalid date passed in to RRule.between');\n }\n var args = {\n before: before,\n after: after,\n inc: inc,\n };\n if (iterator) {\n return this._iter(new CallbackIterResult('between', args, iterator));\n }\n var result = this._cacheGet('between', args);\n if (result === false) {\n result = this._iter(new IterResult('between', args));\n this._cacheAdd('between', result, args);\n }\n return result;\n };\n /**\n * Returns the last recurrence before the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.before = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.before');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('before', args);\n if (result === false) {\n result = this._iter(new IterResult('before', args));\n this._cacheAdd('before', result, args);\n }\n return result;\n };\n /**\n * Returns the first recurrence after the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.after = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.after');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('after', args);\n if (result === false) {\n result = this._iter(new IterResult('after', args));\n this._cacheAdd('after', result, args);\n }\n return result;\n };\n /**\n * Returns the number of recurrences in this set. It will have go trough\n * the whole recurrence, if this hasn't been done before.\n */\n RRule.prototype.count = function () {\n return this.all().length;\n };\n /**\n * Converts the rrule into its string representation\n *\n * @see \n * @return String\n */\n RRule.prototype.toString = function () {\n return optionsToString(this.origOptions);\n };\n /**\n * Will convert all rules described in nlp:ToText\n * to text.\n */\n RRule.prototype.toText = function (gettext, language, dateFormatter) {\n return toText(this, gettext, language, dateFormatter);\n };\n RRule.prototype.isFullyConvertibleToText = function () {\n return isFullyConvertible(this);\n };\n /**\n * @return a RRule instance with the same freq and options\n * as this one (cache is not cloned)\n */\n RRule.prototype.clone = function () {\n return new RRule(this.origOptions);\n };\n // RRule class 'constants'\n RRule.FREQUENCIES = [\n 'YEARLY',\n 'MONTHLY',\n 'WEEKLY',\n 'DAILY',\n 'HOURLY',\n 'MINUTELY',\n 'SECONDLY',\n ];\n RRule.YEARLY = Frequency.YEARLY;\n RRule.MONTHLY = Frequency.MONTHLY;\n RRule.WEEKLY = Frequency.WEEKLY;\n RRule.DAILY = Frequency.DAILY;\n RRule.HOURLY = Frequency.HOURLY;\n RRule.MINUTELY = Frequency.MINUTELY;\n RRule.SECONDLY = Frequency.SECONDLY;\n RRule.MO = Days.MO;\n RRule.TU = Days.TU;\n RRule.WE = Days.WE;\n RRule.TH = Days.TH;\n RRule.FR = Days.FR;\n RRule.SA = Days.SA;\n RRule.SU = Days.SU;\n RRule.parseString = parseString;\n RRule.optionsToString = optionsToString;\n return RRule;\n}());\nexport { RRule };\n//# sourceMappingURL=rrule.js.map","import { __assign } from \"tslib\";\nimport { RRule } from './rrule';\nimport { RRuleSet } from './rruleset';\nimport { untilStringToDate } from './dateutil';\nimport { includes, split } from './helpers';\nimport { parseString, parseDtstart } from './parsestring';\n/**\n * RRuleStr\n * To parse a set of rrule strings\n */\nvar DEFAULT_OPTIONS = {\n dtstart: null,\n cache: false,\n unfold: false,\n forceset: false,\n compatible: false,\n tzid: null,\n};\nexport function parseInput(s, options) {\n var rrulevals = [];\n var rdatevals = [];\n var exrulevals = [];\n var exdatevals = [];\n var parsedDtstart = parseDtstart(s);\n var dtstart = parsedDtstart.dtstart;\n var tzid = parsedDtstart.tzid;\n var lines = splitIntoLines(s, options.unfold);\n lines.forEach(function (line) {\n var _a;\n if (!line)\n return;\n var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value;\n switch (name.toUpperCase()) {\n case 'RRULE':\n if (parms.length) {\n throw new Error(\"unsupported RRULE parm: \".concat(parms.join(',')));\n }\n rrulevals.push(parseString(line));\n break;\n case 'RDATE':\n var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1];\n if (rdateTzid && !tzid) {\n tzid = rdateTzid;\n }\n rdatevals = rdatevals.concat(parseRDate(value, parms));\n break;\n case 'EXRULE':\n if (parms.length) {\n throw new Error(\"unsupported EXRULE parm: \".concat(parms.join(',')));\n }\n exrulevals.push(parseString(value));\n break;\n case 'EXDATE':\n exdatevals = exdatevals.concat(parseRDate(value, parms));\n break;\n case 'DTSTART':\n break;\n default:\n throw new Error('unsupported property: ' + name);\n }\n });\n return {\n dtstart: dtstart,\n tzid: tzid,\n rrulevals: rrulevals,\n rdatevals: rdatevals,\n exrulevals: exrulevals,\n exdatevals: exdatevals,\n };\n}\nfunction buildRule(s, options) {\n var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid;\n var noCache = options.cache === false;\n if (options.compatible) {\n options.forceset = true;\n options.unfold = true;\n }\n if (options.forceset ||\n rrulevals.length > 1 ||\n rdatevals.length ||\n exrulevals.length ||\n exdatevals.length) {\n var rset_1 = new RRuleSet(noCache);\n rset_1.dtstart(dtstart);\n rset_1.tzid(tzid || undefined);\n rrulevals.forEach(function (val) {\n rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n rdatevals.forEach(function (date) {\n rset_1.rdate(date);\n });\n exrulevals.forEach(function (val) {\n rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n exdatevals.forEach(function (date) {\n rset_1.exdate(date);\n });\n if (options.compatible && options.dtstart)\n rset_1.rdate(dtstart);\n return rset_1;\n }\n var val = rrulevals[0] || {};\n return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache);\n}\nexport function rrulestr(s, options) {\n if (options === void 0) { options = {}; }\n return buildRule(s, initializeOptions(options));\n}\nfunction groomRruleOptions(val, dtstart, tzid) {\n return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid });\n}\nfunction initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n keys.forEach(function (key) {\n if (!includes(defaultKeys, key))\n invalid.push(key);\n });\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign(__assign({}, DEFAULT_OPTIONS), options);\n}\nfunction extractName(line) {\n if (line.indexOf(':') === -1) {\n return {\n name: 'RRULE',\n value: line,\n };\n }\n var _a = split(line, ':', 1), name = _a[0], value = _a[1];\n return {\n name: name,\n value: value,\n };\n}\nfunction breakDownLine(line) {\n var _a = extractName(line), name = _a.name, value = _a.value;\n var parms = name.split(';');\n if (!parms)\n throw new Error('empty property name');\n return {\n name: parms[0].toUpperCase(),\n parms: parms.slice(1),\n value: value,\n };\n}\nfunction splitIntoLines(s, unfold) {\n if (unfold === void 0) { unfold = false; }\n s = s && s.trim();\n if (!s)\n throw new Error('Invalid empty string');\n // More info about 'unfold' option\n // Go head to http://www.ietf.org/rfc/rfc2445.txt\n if (!unfold) {\n return s.split(/\\s/);\n }\n var lines = s.split('\\n');\n var i = 0;\n while (i < lines.length) {\n // TODO\n var line = (lines[i] = lines[i].replace(/\\s+$/g, ''));\n if (!line) {\n lines.splice(i, 1);\n }\n else if (i > 0 && line[0] === ' ') {\n lines[i - 1] += line.slice(1);\n lines.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n return lines;\n}\nfunction validateDateParm(parms) {\n parms.forEach(function (parm) {\n if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {\n throw new Error('unsupported RDATE/EXDATE parm: ' + parm);\n }\n });\n}\nfunction parseRDate(rdateval, parms) {\n validateDateParm(parms);\n return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });\n}\n//# sourceMappingURL=rrulestr.js.map","import { __extends } from \"tslib\";\nimport { RRule } from './rrule';\nimport { sort, timeToUntilString } from './dateutil';\nimport { includes } from './helpers';\nimport { iterSet } from './iterset';\nimport { rrulestr } from './rrulestr';\nimport { optionsToString } from './optionstostring';\nfunction createGetterSetter(fieldName) {\n var _this = this;\n return function (field) {\n if (field !== undefined) {\n _this[\"_\".concat(fieldName)] = field;\n }\n if (_this[\"_\".concat(fieldName)] !== undefined) {\n return _this[\"_\".concat(fieldName)];\n }\n for (var i = 0; i < _this._rrule.length; i++) {\n var field_1 = _this._rrule[i].origOptions[fieldName];\n if (field_1) {\n return field_1;\n }\n }\n };\n}\nvar RRuleSet = /** @class */ (function (_super) {\n __extends(RRuleSet, _super);\n /**\n *\n * @param {Boolean?} noCache\n * The same stratagy as RRule on cache, default to false\n * @constructor\n */\n function RRuleSet(noCache) {\n if (noCache === void 0) { noCache = false; }\n var _this = _super.call(this, {}, noCache) || this;\n _this.dtstart = createGetterSetter.apply(_this, ['dtstart']);\n _this.tzid = createGetterSetter.apply(_this, ['tzid']);\n _this._rrule = [];\n _this._rdate = [];\n _this._exrule = [];\n _this._exdate = [];\n return _this;\n }\n RRuleSet.prototype._iter = function (iterResult) {\n return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());\n };\n /**\n * Adds an RRule to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.rrule = function (rrule) {\n _addRule(rrule, this._rrule);\n };\n /**\n * Adds an EXRULE to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.exrule = function (rrule) {\n _addRule(rrule, this._exrule);\n };\n /**\n * Adds an RDate to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.rdate = function (date) {\n _addDate(date, this._rdate);\n };\n /**\n * Adds an EXDATE to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.exdate = function (date) {\n _addDate(date, this._exdate);\n };\n /**\n * Get list of included rrules in this recurrence set.\n *\n * @return List of rrules\n */\n RRuleSet.prototype.rrules = function () {\n return this._rrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of excluded rrules in this recurrence set.\n *\n * @return List of exrules\n */\n RRuleSet.prototype.exrules = function () {\n return this._exrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of rdates\n */\n RRuleSet.prototype.rdates = function () {\n return this._rdate.map(function (e) { return new Date(e.getTime()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of exdates\n */\n RRuleSet.prototype.exdates = function () {\n return this._exdate.map(function (e) { return new Date(e.getTime()); });\n };\n RRuleSet.prototype.valueOf = function () {\n var result = [];\n if (!this._rrule.length && this._dtstart) {\n result = result.concat(optionsToString({ dtstart: this._dtstart }));\n }\n this._rrule.forEach(function (rrule) {\n result = result.concat(rrule.toString().split('\\n'));\n });\n this._exrule.forEach(function (exrule) {\n result = result.concat(exrule\n .toString()\n .split('\\n')\n .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); })\n .filter(function (line) { return !/^DTSTART/.test(line); }));\n });\n if (this._rdate.length) {\n result.push(rdatesToString('RDATE', this._rdate, this.tzid()));\n }\n if (this._exdate.length) {\n result.push(rdatesToString('EXDATE', this._exdate, this.tzid()));\n }\n return result;\n };\n /**\n * to generate recurrence field such as:\n * DTSTART:19970902T010000Z\n * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n */\n RRuleSet.prototype.toString = function () {\n return this.valueOf().join('\\n');\n };\n /**\n * Create a new RRuleSet Object completely base on current instance\n */\n RRuleSet.prototype.clone = function () {\n var rrs = new RRuleSet(!!this._cache);\n this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); });\n this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); });\n this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); });\n this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); });\n return rrs;\n };\n return RRuleSet;\n}(RRule));\nexport { RRuleSet };\nfunction _addRule(rrule, collection) {\n if (!(rrule instanceof RRule)) {\n throw new TypeError(String(rrule) + ' is not RRule instance');\n }\n if (!includes(collection.map(String), String(rrule))) {\n collection.push(rrule);\n }\n}\nfunction _addDate(date, collection) {\n if (!(date instanceof Date)) {\n throw new TypeError(String(date) + ' is not Date instance');\n }\n if (!includes(collection.map(Number), Number(date))) {\n collection.push(date);\n sort(collection);\n }\n}\nfunction rdatesToString(param, rdates, tzid) {\n var isUTC = !tzid || tzid.toUpperCase() === 'UTC';\n var header = isUTC ? \"\".concat(param, \":\") : \"\".concat(param, \";TZID=\").concat(tzid, \":\");\n var dateString = rdates\n .map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })\n .join(',');\n return \"\".concat(header).concat(dateString);\n}\n//# sourceMappingURL=rruleset.js.map","import { DateWithZone } from './datewithzone';\nimport { iter } from './iter';\nimport { sort } from './dateutil';\nexport function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {\n var _exdateHash = {};\n var _accept = iterResult.accept;\n function evalExdate(after, before) {\n _exrule.forEach(function (rrule) {\n rrule.between(after, before, true).forEach(function (date) {\n _exdateHash[Number(date)] = true;\n });\n });\n }\n _exdate.forEach(function (date) {\n var zonedDate = new DateWithZone(date, tzid).rezonedDate();\n _exdateHash[Number(zonedDate)] = true;\n });\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (isNaN(dt))\n return _accept.call(this, date);\n if (!_exdateHash[dt]) {\n evalExdate(new Date(dt - 1), new Date(dt + 1));\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n }\n return true;\n };\n if (iterResult.method === 'between') {\n evalExdate(iterResult.args.after, iterResult.args.before);\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n return true;\n };\n }\n for (var i = 0; i < _rdate.length; i++) {\n var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate();\n if (!iterResult.accept(new Date(zonedDate.getTime())))\n break;\n }\n _rrule.forEach(function (rrule) {\n iter(iterResult, rrule.options);\n });\n var res = iterResult._result;\n sort(res);\n switch (iterResult.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n return ((res.length && res[res.length - 1]) || null);\n case 'after':\n default:\n return ((res.length && res[0]) || null);\n }\n}\n//# sourceMappingURL=iterset.js.map","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport recurring_legacy from \"./recurring_legacy\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\trecurring_legacy,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\n\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onMouseDown\", function(classname) {\r\n\t\treturn !(classname == dhx_time_block);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t\tif (!id) return true;\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(id));\r\n\t});\r\n\tscheduler.attachEvent(\"onClick\", function (event_id, native_event_object){\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(event_id));\r\n });\r\n\tscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tbefore = [ev.start_date, ev.end_date];\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\r\n\t\t//lightbox may not have 'time' section\r\n\t\tif(!(data.start_date && data.end_date)){\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tdata.start_date = new Date(ev.start_date);\r\n\t\t\tdata.end_date = new Date(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif(data.rec_type){\r\n\t\t\t//_roll_back_dates modifies start_date of recurring event, need to check limits after modification\r\n\t\t\t// use a copy to keep original event unchanged\r\n\t\t\tvar data_copy = scheduler._lame_clone(data);\r\n\t\t\tscheduler._roll_back_dates(data_copy);\r\n\t\t\treturn scheduler.checkLimitViolation(data_copy);\r\n\t\t}\r\n\t\treturn scheduler.checkLimitViolation(data);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {\r\n\t\t\t//if newly created event is outside of limited time - crop it, leaving only allowed time\r\n\t\t\tif (ev.start_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.start_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn scheduler.checkLimitViolation(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\r\n};\r\nscheduler._temp_limit_scope();\r\n\r\n\r\n}","import { GoogleMapAdapter } from \"./gMapAdapter\";\r\nimport { OpenStreetMapAdapter } from \"./osmMapAdapter\";\r\nimport { MapboxAdapter } from \"./mapboxAdapter\";\r\nimport { IMapAdapter, ICalendarEvent, IMapSettings } from \"./types\";\r\n\r\ndeclare let google: any;\r\n\r\nexport default function(scheduler: any){\r\n\t\r\nlet mapAdapter: IMapAdapter | null = null;\r\nlet eventHandlerIds: number[] = [];\r\nconst adapters: { [name:string]: IMapAdapter } = {\r\n\tgoogleMap: new GoogleMapAdapter(scheduler),\r\n\topenStreetMaps: new OpenStreetMapAdapter(scheduler),\r\n\tmapbox: new MapboxAdapter(scheduler)\r\n}\r\n\r\nif(!scheduler.ext){\r\n\tscheduler.ext = {};\r\n}\r\nscheduler.ext.mapView = {\r\n\tcreateAdapter: function():IMapAdapter{\r\n\t\treturn adapters[scheduler.config.map_view_provider];\r\n\t},\r\n\tcreateMarker: function(config){\r\n\t\treturn new google.maps.Marker(config);\r\n\t},\r\n\tcurrentAdapter: null,\r\n\tadapters\r\n};\r\nscheduler._latLngUpdate = false; // flag for updating events which don't have event.lat and event.lng\r\nscheduler._eventLocationChanged = false; // flag for checking if the location of the event is changed\r\nscheduler.config.map_view_provider = \"googleMap\";\r\nscheduler.config.map_settings = {\r\n\tinitial_position: {\r\n\t lat: 48.724,\r\n\t lng: 8.215\r\n\t},\r\n\terror_position: {\r\n\t lat: 15,\r\n\t lng: 15\r\n\t},\r\n\tinitial_zoom: 1,\r\n\tzoom_after_resolve: 15,\r\n\tinfo_window_max_width: 300,\r\n\tresolve_user_location: true,\r\n\tresolve_event_location: true,\r\n\tview_provider: \"googleMap\"\r\n}\r\nif (scheduler.config.map_initial_position) {\r\n\tscheduler.config.map_settings.initial_position = {\r\n\t\tlat: scheduler.config.map_initial_position.lat(),\r\n\t\tlng: scheduler.config.map_initial_position.lng(), \r\n\t};\r\n}\r\n\r\nif (scheduler.config.map_error_position) {\r\n\tscheduler.config.map_settings.error_position = {\r\n\t\tlat: scheduler.config.map_error_position.lat(),\r\n\t\tlng: scheduler.config.map_error_position.lng(), \r\n\t};\r\n}\r\n\r\nscheduler.xy.map_date_width = 188; // date column width\r\nscheduler.xy.map_icon_width = 25; // event details icon width\r\nscheduler.xy.map_description_width = 400; // description column width\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\nscheduler.templates.map_info_content = function(event){\r\n return `
Event's text: ${event.text}\r\n\t\t\t\t
Location: ${event.event_location}
\r\n\t\t\t\t
Starts: ${scheduler.templates.tooltip_date_format(event.start_date)}
\r\n\t\t\t\t
Ends: ${scheduler.templates.tooltip_date_format(event.end_date)}
\r\n\t\t\t
`;\r\n};\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\n\r\nfunction setupMapView(scheduler) {\r\n\t// Initialization logic, possibly including creation of a new mapAdapter\r\n\tmapAdapter = scheduler.ext.mapView.createAdapter();\r\n\tattachSchedulerEvents();\r\n}\r\nasync function addEventWithLocation(event: ICalendarEvent, mapAdapter: IMapAdapter){\r\n\tlet coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\tevent.lat = coordinates.lat;\r\n\tevent.lng = coordinates.lng;\r\n\tmapAdapter.removeEventMarker(String(event.id));\r\n\tmapAdapter.addEventMarker(event);\r\n\treturn event;\r\n}\r\nfunction setUserLocation(options: IMapSettings, adapter: IMapAdapter): void{\r\n\tif (options.resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\tadapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tadapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom);\r\n\t}\r\n}\r\nscheduler.dblclick_dhx_map_area = function(e) {\r\n\tlet eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\tif (eventNode){\r\n\t\tlet eventId = eventNode.getAttribute(`${scheduler.config.event_attribute}`);\r\n\t\tscheduler.showLightbox(eventId);\r\n\t}\r\n\tif (!this.config.readonly && this.config.dblclick_create && !eventNode) {\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler.config.map_start,\r\n\t\t\tend_date: scheduler.date.add( scheduler.config.map_start, scheduler.config.time_step, \"minute\"),\r\n\t\t});\r\n\t}\t\r\n};\r\n\r\nfunction attachSchedulerEvents() { \r\n eventHandlerIds.push(\r\n\tscheduler.attachEvent(\"onEventSave\",function(id,ev,is_new){\r\n\t\tlet unmodifiedEvent = scheduler.getEvent(id);\r\n\t\tif (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) {\r\n\t\t\tscheduler._eventLocationChanged = true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}),\r\n scheduler.attachEvent(\"onEventChanged\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !scheduler._latLngUpdate ) {\r\n\t\t\t\t \taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.updateEventMarker(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._latLngUpdate = false;\r\n\t\treturn true;\r\n }),\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_id,new_id){\r\n\t\tlet newIdEvent = scheduler.getEvent(new_id);\r\n\t\tmapAdapter?.removeEventMarker(old_id);\r\n\t\tmapAdapter?.addEventMarker(newIdEvent);\r\n\t}),\r\n scheduler.attachEvent(\"onEventAdded\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n \t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && scheduler._eventLocationChanged) {\r\n\t\t\t\t\taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t\tscheduler._eventLocationChanged = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.addEventMarker(event);\r\n\t\t\t\t\tmapAdapter.onEventClick(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }),\r\n scheduler.attachEvent(\"onClick\", function (id, e){\r\n\t\tconst event = scheduler.getEvent(id);\r\n\t\tif (mapAdapter && event) mapAdapter.onEventClick(event);\r\n\t\treturn false;\r\n }),\r\n scheduler.attachEvent(\"onBeforeEventDelete\", (id, event) => {\r\n\t\tif (mapAdapter) {\r\n\t\t\tmapAdapter.removeEventMarker(id);\r\n\t\t}\r\n\t\treturn true;\r\n })\r\n );\r\n}\r\nfunction detachSchedulerEvents() {\r\n\teventHandlerIds.forEach(id => scheduler.detachEvent(id));\r\n\teventHandlerIds = [];\r\n}\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\r\n\tif(scheduler.config.map_initial_zoom !== undefined){\r\n\t\tscheduler.config.map_settings.initial_zoom = scheduler.config.map_initial_zoom;\r\n\t}\r\n\tif(scheduler.config.map_zoom_after_resolve !== undefined){\r\n\t\tscheduler.config.map_settings.zoom_after_resolve = scheduler.config.map_zoom_after_resolve;\r\n\t}\r\n\tif(scheduler.config.map_infowindow_max_width !== undefined){\r\n\t\tscheduler.config.map_settings.info_window_max_width = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\tif(scheduler.config.map_resolve_user_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_user_location = scheduler.config.map_resolve_user_location;\r\n\t}\r\n\tif(scheduler.config.map_view_provider !== undefined){\r\n\t\tscheduler.config.map_settings.view_provider = scheduler.config.map_view_provider;\r\n\t}\r\n\tif(scheduler.config.map_type !== undefined){\r\n\t\tscheduler.config.map_settings.type = scheduler.config.map_type;\r\n\t}\r\n\tif(scheduler.config.map_resolve_event_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_event_location = scheduler.config.map_resolve_event_location;\r\n\t}\r\n\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\r\n\tlet map = document.createElement('div');\r\n\tmap.className = 'mapContainer';\r\n\tmap.id = 'mapContainer';\r\n\tmap.style.display = \"none\";\r\n\tmap.style.zIndex = \"1\";\r\n\tscheduler._obj.appendChild(map);\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tlet events = scheduler.get_visible_events();\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tmapAdapter.clearEventMarkers();\r\n\t\t\t\tevents.forEach((event) => mapAdapter?.addEventMarker(event));\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\t\tlet mapContainer = document.getElementById('mapContainer');\r\n\t\t_setMapSize('mapContainer');\r\n\r\n\t\t// creating the new logic\r\n\t\tif (mode && mapContainer) {\r\n\t\t\tmap.style.display = 'block';\r\n\t\t\tfill_map_tab();\r\n\t\t\t// case to display several maps and has the opportunity to switch between them\r\n\t\t\tif (scheduler.config.map_view_provider == scheduler.ext.mapView.currentAdapter) {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t} else {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t \tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t\t}\r\n\t\t\tif(mapAdapter) {\r\n\t\t\t\tsetUserLocation(scheduler.config.map_settings, mapAdapter);\r\n\t\t\t}\t\r\n\t\t} else {\r\n\t\t\tmap.style.display = 'none';\r\n\t\t\tscheduler._els.dhx_cal_data[0].style.width = \"100%\";\r\n\t\t \tif (mapAdapter && mapContainer ) {\r\n\t\t\t\tmapAdapter.destroy(mapContainer);\r\n\t\t\t\tmapAdapter = null;\r\n\t\t\t\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t }\r\n\t\t \tdetachSchedulerEvents();\r\n\t\t}\r\n\t};\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tlet map = document.getElementById(elem_id);\r\n\t\tif (map) {\r\n\t\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\t\tlet height = scheduler.$container.querySelector(\".dhx_cal_data\").offsetHeight + scheduler.$container.querySelector(\".dhx_cal_header\").offsetHeight;\r\n\t\t\tif (height < 0)\r\n\t\t\t\theight = 0;\r\n\t\t\tlet width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\t\tif (width < 0)\r\n\t\t\t\twidth = 0;\r\n\t\t\tmap.style.height = height + 'px';\r\n\t\t\tmap.style.width = width + 'px';\r\n\t\t\tmap.style.position = \"absolute\";\r\n\t\t\tmap.style.top = nav_height + \"px\";\r\n\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t} else {\r\n\t\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t}\r\n\t\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t\t}\r\n\t}\t\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tlet events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tlet ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tlet html = \"
\";\r\n\t\tfor (let i = 0; i < events.length; i++) {\r\n\t\t\tlet ev = events[i];\r\n\t\t\tlet event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tlet bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tlet color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tlet ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tlet ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tlet dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (let i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tconst l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\t\r\n\tscheduler.attachEvent(\"onLocationError\", function (id){\r\n\t\talert(\"Location can't be found\");\r\n\t\treturn google.maps.LatLng(51.477840, -0.001492); \r\n\t\t//the coordinates of the Greenwich Royal Observatory\r\n\t})\r\n\tlet _updateEventLocation = async function(event) {\r\n\t\tif (mapAdapter){\r\n\t\t\tconst coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\t\t\tif (coordinates.lat && coordinates.lng) {\r\n\t\t\t\tevent.lat = +coordinates.lat;\r\n\t\t\t\tevent.lng = +coordinates.lng;\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\tevent.lng = scheduler.config.map_settings.error_position.lng;\r\n\t\t\t\tevent.lat = scheduler.config.map_settings.error_position.lat;\r\n\t\t\t}\r\n\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t}\r\n\t};\r\n\tlet _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tevent.lat = +event.lat;\r\n\t\t\tevent.lng = +event.lng;\r\n\t\t}\r\n\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n})\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\n\r\n\r\nlet clickedElementPosition = null;\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tconst container = scheduler.$container;\r\n\tif(container._$quickInfoHandler){\r\n\t\treturn;\r\n\t}else{\r\n\t\tcontainer._$quickInfoHandler = true;\r\n\t\t// store coordinates of clicked segment of an event\r\n\t\t// in case multi section events or multi-line month events\r\n\t\tscheduler.event(container, \"mousedown\", function(e){\r\n\t\t\tconst eventElement = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\t\t\tif (eventElement) {\r\n\t\t\t\tclickedElementPosition = {\r\n\t\t\t\t\tid: eventElement.getAttribute(scheduler.config.event_attribute),\r\n\t\t\t\t\tposition: getPositionInsideScheduler(eventElement)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.attachEvent(\"onDestroy\", () => {\r\n\t\t\tdelete container._$quickInfoHandler;\r\n\t\t});\r\n\t}\r\n});\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n\r\n\tqi.ontransitionend = () => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t\tqi.ontransitionend = null;\r\n\t};\r\n\tsetTimeout(() => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t}, 1);\r\n};\r\n\r\nfunction fitQIInsideWindow(quickInfoPopup){\r\n\tconst popupRect = quickInfoPopup.getBoundingClientRect();\r\n\tconst containerRect = scheduler.$container.getBoundingClientRect();\r\n\r\n\t// calculate the bottom offset of the Quick Info relative to the scheduler container\r\n\tconst offsetBottom = containerRect.bottom - popupRect.bottom;\r\n\r\n\t// If the popup extends outside the scheduler container, adjust its top position\r\n\tif (offsetBottom < 0) {\r\n\t\tquickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`;\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\n\r\nfunction getPositionInsideScheduler(element){\r\n\tlet left = 0;\r\n\tlet top = 0;\r\n\r\n\tlet node = element;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tlet dx = (left + element.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tlet dy = (top + element.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:element.offsetWidth, height:element.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\treturn getPositionInsideScheduler(domEv);\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","import { RRule, rrulestr } from 'rrule';\r\n\r\nexport default function (scheduler) {\r\n\r\n\tfunction clearMilliseconds(date) {\r\n\t\treturn new Date(\r\n\t\t\tdate.getFullYear(),\r\n\t\t\tdate.getMonth(),\r\n\t\t\tdate.getDate(),\r\n\t\t\tdate.getHours(),\r\n\t\t\tdate.getMinutes(),\r\n\t\t\tdate.getSeconds(),\r\n\t\t\t0\r\n\t\t);\r\n\t}\r\n\r\n\tfunction isDeletedOccurrence(event) {\r\n\t\treturn !!event.deleted;\r\n\t}\r\n\r\n\tfunction isSeries(event) {\r\n\t\treturn !!event.rrule && !event.recurring_event_id;\r\n\t}\r\n\r\n\tfunction clearRecurringProperties(event) {\r\n\t\tevent.rrule = \"\";\r\n\t\tevent.original_start = null;\r\n\t\tevent.recurring_event_id = null;\r\n\t\tevent.duration = null;\r\n\t\tevent.deleted = null;\r\n\t}\r\n\r\n\tfunction createException(ev) {\r\n\t\tlet id = ev.id.split(\"#\");\r\n\r\n\t\tlet nid = scheduler.uid();\r\n\t\tscheduler._not_render = true;\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = id[0];\r\n\r\n\t\tlet timestamp = id[1];\r\n\r\n\t\tnev.original_start = new Date(Number(timestamp));\r\n\r\n\t\tscheduler._add_rec_marker(nev, timestamp);\r\n\t\tscheduler.addEvent(nev);\r\n\t\tscheduler._not_render = false;\r\n\t}\r\n\r\n\tscheduler._rec_temp = [];\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_markers = {};\r\n\tscheduler._add_rec_marker = function (ev, time) {\r\n\t\tev._pid_time = time;\r\n\t\tthis._rec_markers[ev.id] = ev;\r\n\t\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\t\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n\t};\r\n\tscheduler._get_rec_marker = function (time, id) {\r\n\t\tlet ch = this._rec_markers_pull[id];\r\n\t\tif (ch) return ch[time];\r\n\t\treturn null;\r\n\t};\r\n\tscheduler._get_rec_markers = function (id) {\r\n\t\treturn (this._rec_markers_pull[id] || []);\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old_add_event = scheduler.addEvent;\r\n\t\tscheduler.addEvent = function (start_date, end_date, text, id, extra_data) {\r\n\t\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\r\n\t\t\t\tif (ev.start_date) {\r\n\t\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t\t}\r\n\t\t\t\tif (ev.end_date) {\r\n\t\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn ev_id;\r\n\t\t};\r\n\t})();\r\n\r\n\tscheduler.attachEvent(\"onEventLoading\", function (event) {\r\n\r\n\t\tif (event.original_start) {\r\n\t\t\tevent.original_start = scheduler.templates.parse_date(event.original_start);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function (id, new_id) {\r\n\t\tif (this._ignore_call) return;\r\n\t\tthis._ignore_call = true;\r\n\r\n\t\tif (scheduler._rec_markers[id]) {\r\n\t\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\t\tdelete scheduler._rec_markers[id];\r\n\t\t}\r\n\r\n\t\tif (scheduler._rec_markers_pull[id]) {\r\n\t\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\t\tdelete scheduler._rec_markers_pull[id];\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\t\tvar tev = this._rec_temp[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i in this._rec_markers) {\r\n\t\t\tvar tev = this._rec_markers[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\ttev._pid_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar el = scheduler._rec_markers[new_id];\r\n\t\tif (el && el._pid_changed) {\r\n\t\t\tdelete el._pid_changed;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (scheduler.$destroyed) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tdelete this._ignore_call;\r\n\t});\r\n\r\n\tfunction deleteEventFromSeries(idTimestamp, ev) {\r\n\t\tlet id = idTimestamp;\r\n\t\tidTimestamp = id.split(\"#\");\r\n\t\tlet nid = scheduler.uid();\r\n\t\tlet tid = (idTimestamp[1]) ? idTimestamp[1] : (ev._pid_time);\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = ev.recurring_event_id || idTimestamp[0];\r\n\t\tnev.original_start = new Date(Number(tid));\r\n\t\tnev.deleted = true;\r\n\t\tscheduler.addEvent(nev);\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && !isDeletedOccurrence(ev))) {\r\n\t\t\tdeleteEventFromSeries(id, ev);\r\n\t\t} else {\r\n\t\t\tif (isSeries(ev) && this._lightbox_id)\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tid = sub[i].id;\r\n\t\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tif (!this._is_virtual_event(id) && this._is_modified_occurence(ev)) {\r\n\t\t\tif (!scheduler._events[id]) {\r\n\t\t\t\tev.deleted = true;\r\n\t\t\t\tthis.setEvent(id, ev);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function (id, event) {\r\n\t\tif (this._loading) return true;\r\n\r\n\t\tvar ev = this.getEvent(id);\r\n\r\n\t\tif (this._is_virtual_event(id)) {\r\n\t\t\tcreateException(ev);\r\n\r\n\t\t} else {\r\n\t\t\tif (ev.start_date) {\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date) {\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev) && this._lightbox_id) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t\t//scheduler.recurrings.rollbackDates(ev);\r\n\t\t\t}\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\t\tvar isEventFound = false;\r\n\t\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\t\tisEventFound = true;\r\n\t\t\t}\r\n\t\t\tif (!isEventFound)\r\n\t\t\t\tthis._select_id = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\", function (id) {\r\n\t\tif (!this._loading) {\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function (id, data, is_new_event) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev))\r\n\t\t\tthis._select_id = null;\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\tclearRecurringProperties(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCancel\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev)) {\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\t\tthis.render_view_data();\r\n\t\t}\r\n\t});\r\n\tscheduler._roll_back_dates = function (ev) {\r\n\t\t//// !!!!! calc temp properties\r\n\t\tif (ev.start_date) {\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif (ev.end_date) {\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\t\tev.end_date = ev._end_date;\r\n\t\tif (ev._start_date) {\r\n\t\t\tev.start_date.setMonth(0);\r\n\t\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._is_virtual_event = function (id) {\r\n\t\treturn id.toString().indexOf(\"#\") != -1;\r\n\t};\r\n\tscheduler._is_modified_occurence = function (ev) {\r\n\t\treturn (ev.recurring_event_id && ev.recurring_event_id != \"0\");\r\n\t};\r\n\r\n\tscheduler.showLightbox_rec = scheduler.showLightbox;\r\n\tscheduler.showLightbox = function (id) {\r\n\t\tvar locale = this.locale;\r\n\t\tvar c = scheduler.config.lightbox_recurring;\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tvar pid = ev.recurring_event_id;\r\n\t\tvar isVirtual = this._is_virtual_event(id);\r\n\t\tif (isVirtual)\r\n\t\t\tpid = id.split(\"#\")[0];\r\n\r\n\t\t// show series\r\n\t\tvar showSeries = function (id) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tevent._end_date = event.end_date;\r\n\t\t\tevent.end_date = new Date(event.start_date.valueOf() + event.duration * 1000);\r\n\t\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t\t};\r\n\r\n\t\tif ((pid || pid * 1 === 0) && isSeries(ev)) {\r\n\t\t\t// direct API call on series id\r\n\t\t\treturn showSeries(id);\r\n\t\t}\r\n\t\tif (!pid || pid === '0' || ((!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual))) {\r\n\t\t\t// editing instance or non recurring event\r\n\t\t\treturn this.showLightbox_rec(id);\r\n\t\t}\r\n\t\tif (c == 'ask') {\r\n\t\t\tvar that = this;\r\n\t\t\tscheduler.modalbox({\r\n\t\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\t\twidth: \"500px\",\r\n\t\t\t\tposition: \"middle\",\r\n\t\t\t\tbuttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\t\tcallback: function (index) {\r\n\t\t\t\t\tswitch (+index) {\r\n\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tshowSeries(pid);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction groupExceptions() {\r\n\t\tconst exceptions = {};\r\n\t\tfor (const i in scheduler._events) {\r\n\t\t\tconst ev = scheduler._events[i];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tif (!exceptions[ev.recurring_event_id]) {\r\n\t\t\t\t\texceptions[ev.recurring_event_id] = {};\r\n\t\t\t\t}\r\n\t\t\t\texceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn exceptions;\r\n\t}\r\n\r\n\tscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function (only_timed) {\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\t\tdelete this._events[this._rec_temp[i].id];\r\n\t\tthis._rec_temp = [];\r\n\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tvar stack = this.get_visible_events_rec(only_timed);\r\n\t\tvar out = [];\r\n\t\tfor (var i = 0; i < stack.length; i++) {\r\n\t\t\tif (stack[i].deleted || stack[i].recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(stack[i])) {\r\n\t\t\t\tthis.repeat_date(stack[i], out, undefined, undefined, undefined, undefined, exceptions);\r\n\t\t\t} else {\r\n\t\t\t\tout.push(stack[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old = scheduler.isOneDayEvent;\r\n\t\tscheduler.isOneDayEvent = function (ev) {\r\n\t\t\tif (isSeries(ev)) return true;\r\n\t\t\treturn old.call(this, ev);\r\n\t\t};\r\n\t\tvar old_update_event = scheduler.updateEvent;\r\n\t\tscheduler.updateEvent = function (id) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\r\n\t\t\tif (ev && isSeries(ev) && !this._is_virtual_event(id)) {\r\n\t\t\t\tscheduler.update_view();\r\n\t\t\t} else {\r\n\t\t\t\told_update_event.call(this, id);\r\n\t\t\t}\r\n\t\t};\r\n\t})();\r\n\r\n\tconst toIcalString = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\r\n\tscheduler.repeat_date = function (ev, stack, non_render, from, to, maxCount, exceptions) {\r\n\t\tif (!ev.rrule) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id];\r\n\t\tif (!seriesExceptions) {\r\n\t\t\tseriesExceptions = {};\r\n\t\t}\r\n\r\n\t\tif (!from) {\r\n\t\t\tfrom = scheduler._min_date;\r\n\t\t}\r\n\t\tif (!to) {\r\n\t\t\tto = scheduler._max_date;\r\n\t\t}\r\n\r\n\t\tconst utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds()));\r\n\t\tconst parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart/*ev.start_date*/ });\r\n\r\n\t\tconst repeatedDates = parsedRRule.between(from, to).map(date => {\r\n\t\t\tconst adjustedDate = new Date(date);\r\n\t\t\tadjustedDate.setHours(ev.start_date.getHours());\r\n\t\t\tadjustedDate.setMinutes(ev.start_date.getMinutes());\r\n\t\t\tadjustedDate.setSeconds(ev.start_date.getSeconds());\r\n\t\t\treturn adjustedDate;\r\n\t\t});\r\n\t\tlet visibleCount = 0;\r\n\r\n\t\tconst eventDuration = ev.duration;\r\n\r\n\t\tfor (let i = 0; i < repeatedDates.length; i++) {\r\n\t\t\tif (maxCount && visibleCount >= maxCount) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst date = repeatedDates[i];\r\n\r\n\t\t\tlet exception = seriesExceptions[date.valueOf()];\r\n\t\t\tif (exception) {\r\n\t\t\t\tif (exception.deleted) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvisibleCount++;\r\n\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst copy = scheduler._copy_event(ev);\r\n\t\t\t\t//copy._timed = ev._timed;\r\n\t\t\t\tcopy.text = ev.text;\r\n\t\t\t\tcopy.start_date = date;\r\n\t\t\t\tcopy.id = ev.id + \"#\" + Math.ceil(date.valueOf());\r\n\t\t\t\tcopy.end_date = new Date(date.valueOf() + eventDuration * 1000);\r\n\t\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date);\r\n\t\t\t\tcopy._timed = scheduler.isOneDayEvent(copy);\r\n\r\n\r\n\r\n\t\t\t\tif (!copy._timed && !scheduler._table_view && !scheduler.config.multi_day) continue;\r\n\t\t\t\tstack.push(copy);\r\n\r\n\t\t\t\tif (!non_render) {\r\n\t\t\t\t\tscheduler._events[copy.id] = copy;\r\n\t\t\t\t\tscheduler._rec_temp.push(copy);\r\n\t\t\t\t}\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._fix_daylight_saving_date = function (start_date, end_date, ev, counter, default_date) {\r\n\t\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\t\tif (shift) {\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\t// e.g. 24h -> 23h\r\n\t\t\t\treturn new Date(counter.valueOf() + ev.duration * 1000 - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// e.g. 24h -> 25h\r\n\t\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Date(default_date.valueOf());\r\n\t};\r\n\tscheduler.getRecDates = function (id, max) {\r\n\t\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\t\tvar recurrings = [];\r\n\t\tmax = max || 100;\r\n\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\treturn [\r\n\t\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t\t];\r\n\t\t}\r\n\t\tif (ev.deleted) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\t\tvar result = [];\r\n\t\tfor (var i = 0; i < recurrings.length; i++) {\r\n\t\t\tif (!recurrings[i].deleted) {\r\n\t\t\t\tresult.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tscheduler.getEvents = function (from, to) {\r\n\t\tvar result = [];\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tfor (var a in this._events) {\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tif (from && to && ev.start_date < to && ev.end_date > from) {\r\n\t\t\t\t\tvar sev = [];\r\n\t\t\t\t\tthis.repeat_date(ev, sev, true, from, to, undefined, exceptions);\r\n\t\t\t\t\tsev.forEach(function(occurence){\r\n\t\t\t\t\t\tif (occurence.start_date < to && occurence.end_date > from) {\r\n\t\t\t\t\t\t\tresult.push(occurence);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else if(!from && !to){\r\n\t\t\t\t\tresult.push(ev);\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\r\n\t//drop secondary attributes\r\n\tscheduler._copy_dummy = function (ev) {\r\n\t\tvar start_date = new Date(this.start_date);\r\n\t\tvar end_date = new Date(this.end_date);\r\n\t\tthis.start_date = start_date;\r\n\t\tthis.end_date = end_date;\r\n\t\tthis.duration = this.rrule = null;\r\n\t};\r\n\r\n\tscheduler.config.include_end_by = false;\r\n\tscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\tscheduler.config.recurring_workdays = [RRule.MO.weekday,RRule.TU.weekday,RRule.WE.weekday,RRule.TH.weekday,RRule.FR.weekday];\r\n\tscheduler.config.repeat_date = \"%m.%d.%Y\";\r\n\tscheduler.config.lightbox.sections = [\r\n\t\t{ name: \"description\", map_to: \"text\", type: \"textarea\", focus: true },\r\n\t\t{ name: \"recurring\", type: \"recurring\", map_to: \"rec_type\" },\r\n\t\t{ name: \"time\", height: 72, type: \"time\", map_to: \"auto\" }\r\n\t];\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function () {\r\n\t\tscheduler._rec_markers = {}; //clear recurring events data\r\n\t\tscheduler._rec_markers_pull = {};\r\n\t\tscheduler._rec_temp = [];\r\n\t});\r\n\r\n\r\n\tfunction getTopLevelOption(rruleObj, untilDate) {\r\n\t\tconst options = rruleObj.options;\r\n\t\tconst until = options.until || untilDate;\r\n\r\n\t\tconst hasEndCondition = options.count || (until && until.getFullYear() !== 9999);\r\n\r\n\t\tif (hasEndCondition) {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\r\n\t\tif (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'DAILY';\r\n\t\t} else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'WEEKLY';\r\n\t\t} else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'MONTHLY';\r\n\t\t} else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'YEARLY';\r\n\t\t} else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler.config.recurring_workdays.length &&\r\n\t\t\toptions.byweekday.includes(RRule.MO) &&\r\n\t\t\toptions.byweekday.includes(RRule.TU) &&\r\n\t\t\toptions.byweekday.includes(RRule.WE) &&\r\n\t\t\toptions.byweekday.includes(RRule.TH) &&\r\n\t\t\toptions.byweekday.includes(RRule.FR)) {\r\n\t\t\treturn 'WORKDAYS';\r\n\t\t} else {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction getWeekdayOfMonth(date) {\r\n\t\tconst dayOfWeek = date.getDay();\r\n\t\tconst dayOfMonth = date.getDate();\r\n\t\tconst dayNumber = Math.ceil(dayOfMonth / 7);\r\n\t\treturn { dayOfWeek, dayNumber };\r\n\t}\r\n\r\n\r\n\tconst jsDaysToRRULEDays = {\r\n\t\t0: \"SU\",\r\n\t\t1: \"MO\",\r\n\t\t2: \"TU\",\r\n\t\t3: \"WE\",\r\n\t\t4: \"TH\",\r\n\t\t5: \"FR\",\r\n\t\t6: \"SA\"\r\n\t};\r\n\tconst RruleDayNumsToJs = {\r\n\t\t0: 1,\r\n\t\t1: 2,\r\n\t\t2: 3,\r\n\t\t3: 4,\r\n\t\t4: 5,\r\n\t\t5: 6,\r\n\t\t6: 0\r\n\t};\r\n\r\n\tfunction fillCustomDaily(node, rule) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\t}\r\n\r\n\tfunction fillCustomWeekly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`);\r\n\t\tdayCheckboxes.forEach((ch) => ch.checked = false);\r\n\t\tif (rule && rule.byweekday) {\r\n\t\t\trule.byweekday.forEach((day) => {\r\n\t\t\t\tconst dayNum = RruleDayNumsToJs[day.weekday];\r\n\t\t\t\tconst dayLabel = jsDaysToRRULEDays[dayNum];\r\n\t\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst dayLabel = jsDaysToRRULEDays[event.start_date.getDay()];\r\n\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction fillCustomMonthly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfMonth.innerText = scheduler.templates.repeat_monthly_date(event.start_date, event);\r\n\t\tnthWeekDayOfMonth.innerText = scheduler.templates.repeat_monthly_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction formatDayNumber(date){\r\n\t\tswitch (date) {\r\n\t\t\tcase 1:\r\n\t\t\tcase 31:\r\n\t\t\t\treturn `${date}st`;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn `${date}nd`;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn `${date}rd`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${date}th`;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.templates.repeat_monthly_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\treturn `Every ${formatDayNumber(date)}`;\r\n\t};\r\n\tscheduler.templates.repeat_monthly_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`;\r\n\t};\r\n\t\r\n\tscheduler.templates.repeat_yearly_month_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(date)} day of ${monthLabel}`;\r\n\t};\r\n\tscheduler.templates.repeat_yearly_month_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`;\r\n\t};\r\n\r\n\tfunction fillCustomYearly(node, rule, event) {\r\n\t\tconst dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfYear.innerText = scheduler.templates.repeat_yearly_month_date(event.start_date, event);\r\n\t\tnthWeekDayOfYear.innerText = scheduler.templates.repeat_yearly_month_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fillEndRule(node, rule, event) {\r\n\t\tconst countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_after\"]`);\r\n\t\tconst ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_ondate\"]`);\r\n\t\tconst endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`);\r\n\t\tcountInput.value = 1;\r\n\r\n\t\tlet formatter = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tondateInput.value = scheduler.config.repeat_date_of_end;\r\n\r\n\t\tif (rule && rule.count) {\r\n\t\t\tendOptionSelect.value = \"AFTER\";\r\n\t\t\tcountInput.value = rule.count;\r\n\t\t} else if (event._end_date && event._end_date.getFullYear() !== 9999) {\r\n\t\t\tendOptionSelect.value = \"ON\";\r\n\t\t\tondateInput.value = formatter(event._end_date);\r\n\t\t} else {\r\n\t\t\tendOptionSelect.value = \"NEVER\";\r\n\t\t}\r\n\t\tendOptionSelect.dispatchEvent(new Event(\"change\"));\r\n\t}\r\n\r\n\tconst getRecValue = {\r\n\t\tMONTHLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.MONTHLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWEEKLY: function (dates) {\r\n\t\t\tlet day = dates.start.getDay() - 1;\r\n\t\t\tif (day == -1) day = 6;\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: [day]\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tDAILY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.DAILY,\r\n\t\t\t\tinterval: 1\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tYEARLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.YEARLY,\r\n\t\t\t\tbymonth: dates.start.getMonth() + 1,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWORKDAYS: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: scheduler.config.recurring_workdays\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tCUSTOM: function (dates, node) {\r\n\t\t\tconst rrule = {};\r\n\t\t\tconst freq = node.querySelector(`[name=\"repeat_interval_unit\"]`).value;\r\n\t\t\tconst interval = Math.max(1, node.querySelector(`[name=\"repeat_interval_value\"]`).value);\r\n\t\t\tconst monthRepeat = node.querySelector(`[name=\"dhx_custom_month_option\"]`).value;\r\n\t\t\tconst yearRepeat = node.querySelector(`[name=\"dhx_custom_year_option\"]`).value;\r\n\r\n\t\t\trrule.interval = interval;\r\n\t\t\tlet days;\r\n\t\t\tlet day;\r\n\r\n\t\t\tswitch (freq) {\r\n\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\trrule.freq = RRule.DAILY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WEEKLY\": \r\n\t\t\t\t\trrule.freq = RRule.WEEKLY;\r\n\t\t\t\t\tdays = [];\r\n\t\t\t\t\tnode.querySelectorAll(`.dhx_form_repeat_custom_week [name=\"week_day\"]`).forEach((ch) => {\r\n\t\t\t\t\t\tif(ch.checked){\r\n\t\t\t\t\t\t\tdays.push(ch.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trrule.byweekday = days.map((day) => {\r\n\t\t\t\t\t\tswitch (day) {\r\n\t\t\t\t\t\t\tcase \"MO\":\r\n\t\t\t\t\t\t\t\treturn RRule.MO.weekday;\r\n\t\t\t\t\t\t\tcase \"TU\":\r\n\t\t\t\t\t\t\t\treturn RRule.TU.weekday;\r\n\t\t\t\t\t\t\tcase \"WE\":\r\n\t\t\t\t\t\t\t\treturn RRule.WE.weekday;\r\n\t\t\t\t\t\t\tcase \"TH\":\r\n\t\t\t\t\t\t\t\treturn RRule.TH.weekday;\r\n\t\t\t\t\t\t\tcase \"FR\":\r\n\t\t\t\t\t\t\t\treturn RRule.FR.weekday;\r\n\t\t\t\t\t\t\tcase \"SA\":\r\n\t\t\t\t\t\t\t\treturn RRule.SA.weekday;\r\n\t\t\t\t\t\t\tcase \"SU\":\r\n\t\t\t\t\t\t\t\treturn RRule.SU.weekday;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\trrule.freq = RRule.MONTHLY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (monthRepeat === \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\trrule.freq = RRule.YEARLY;\r\n\t\t\t\t\trrule.bymonth = dates.start.getMonth() + 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (yearRepeat == \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tlet until = new Date(9999, 1, 1);\r\n\t\t\tconst endRule = node.querySelector(`[name=\"dhx_custom_repeat_ends\"]`);\r\n\t\t\tif(endRule === \"ON\"){\r\n\t\t\t\tuntil = node.querySelector(`[name=\"dhx_form_repeat_ends_ondate\"]`).value;\r\n\t\t\t} else if(endRule === \"AFTER\") {\r\n\t\t\t\trrule.count = Math.max(1, node.querySelector(`[name=\"dhx_form_repeat_ends_after\"]`).value);\r\n\t\t\t}\r\n\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tNEVER: function () {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction fillInDefaults(node, rule, event) {\r\n\t\tfillCustomDaily(node, rule, event);\r\n\t\tfillCustomWeekly(node, rule, event);\r\n\t\tfillCustomMonthly(node, rule, event);\r\n\t\tfillCustomYearly(node, rule, event);\r\n\t\tfillEndRule(node, rule, event);\r\n\t}\r\n\tscheduler.form_blocks[\"recurring\"] = {\r\n\t\trender: function (sns) {\r\n\t\t\tif (sns.form) {\r\n\t\t\t\tlet rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\t\tlet form = rec._get_node(sns.form);\r\n\t\t\t\tlet html = rec._outer_html(form);\r\n\t\t\t\tform.style.display = 'none';\r\n\t\t\t\treturn html;\r\n\t\t\t}\r\n\t\t\tlet loc = scheduler.locale.labels;\r\n\r\n\t\t\treturn `
\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
${loc.repeat_ends}
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t
\r\n\t
`;\r\n\t\t},\r\n\r\n\t\r\n\t\t_init_set_value: function (node, value, event) {\r\n\t\t\tscheduler.form_blocks[\"recurring\"]._ds = { start: event.start_date, end: event.end_date };\r\n\t\t\tfunction hide(node) {\r\n\t\t\t\tnode.classList.add(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction show(node) {\r\n\t\t\t\tnode.classList.remove(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction onRepeatOptionChange(value) {\r\n\t\t\t\tconst repeat = node.querySelector(\".dhx_form_repeat_custom\");\r\n\t\t\t\tif (value === \"CUSTOM\") {\r\n\t\t\t\t\tshow(repeat);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thide(repeat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatIntervalChange(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tweekly: node.querySelector(\".dhx_form_repeat_custom_week\"),\r\n\t\t\t\t\tmonthly: node.querySelector(\".dhx_form_repeat_custom_month\"),\r\n\t\t\t\t\tyearly: node.querySelector(\".dhx_form_repeat_custom_year\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"WEEKLY\":\r\n\t\t\t\t\t\tshow(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\tshow(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\tshow(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatEndRule(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tafter: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after\"),\r\n\t\t\t\t\ton: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"NEVER\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AFTER\":\r\n\t\t\t\t\t\tshow(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ON\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\tshow(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// repeat section change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").addEventListener(\"change\", function () {\r\n\t\t\t\tonRepeatOptionChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat interval change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_custom_interval [name='repeat_interval_unit']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatIntervalChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat end rule\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatEndRule(this.value);\r\n\t\t\t});\r\n\r\n\t\t\tscheduler._lightbox._rec_init_done = true;\r\n\t\t},\r\n\t\tbutton_click: function(){},\r\n\t\tset_value: function (node, value, ev) {\r\n\t\t\tlet rf = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\t\trf._init_set_value(node, value, ev);\r\n\t\t\tnode.open = !ev.rrule;\r\n\r\n\t\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\t\tlet ds = rf._ds;\r\n\t\t\tds.start = ev.start_date;\r\n\t\t\tds.end = ev._end_date;\r\n\r\n\t\t\tif (ev.rrule) {\r\n\t\t\t\tconst rruleset = rrulestr(ev.rrule);\r\n\t\t\t\tfillInDefaults(node, rruleset.origOptions, ev);\r\n\t\t\t\tconst topOption = getTopLevelOption(rruleset, ev._end_date);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = topOption;\r\n\t\t\t\tif(topOption === \"CUSTOM\"){\r\n\t\t\t\t\tlet customFreq;\r\n\t\t\t\t\tswitch (rruleset.origOptions.freq) {\r\n\t\t\t\t\t\tcase RRule.DAILY:\r\n\t\t\t\t\t\t\tcustomFreq = \"DAILY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.WEEKLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"WEEKLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.MONTHLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"MONTHLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.YEARLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"YEARLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(customFreq){\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).value = customFreq;\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).dispatchEvent(new Event(\"change\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t//\trepeat_interval_unit\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tfillInDefaults(node, null, ev);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = \"NEVER\";\r\n\t\t\t}\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").dispatchEvent(new Event(\"change\"));\r\n\r\n\t\t},\r\n\t\tget_value: function (node, ev) {\r\n\t\t\t\r\n\t\t\tif(!node.blocked && node.querySelector(\".dhx_form_repeat_pattern select\").value !== \"NEVER\") {\r\n\t\t\t\tlet ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\t\tlet actual_dates = {};\r\n\r\n\t\t\t\tlet timeControl = getTimeSection();\r\n\r\n\t\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\t\tds.start = actual_dates.start_date;\r\n\t\t\t\tconst pattern = node.querySelector(\".dhx_form_repeat_pattern select\").value;\r\n\t\t\t\tconst recurrence = getRecValue[pattern](ds, node);\r\n\t\t\t\tev.rrule = new RRule(recurrence.rrule).toString().replace(\"RRULE:\", \"\");\r\n\t\t\t\tds.end = recurrence.until;\r\n\r\n\t\t\t\tev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1000);\r\n\r\n\t\t\t\tif (ds._start) {\r\n\t\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\t\tds._start = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._start_date = null;\r\n\r\n\t\t\t\tev._end_date = ds.end;\r\n\t\t\t}else{\r\n\t\t\t\tev.rrule = ev.rrule = \"\";\r\n\t\t\t\tev._end_date = ev.end_date;\r\n\t\t\t}\r\n\r\n\t\t\treturn ev.rrule;\r\n\t\t},\r\n\r\n\t\tfocus: function (node) {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction getTimeSection() {\r\n\t\tlet timeControl = scheduler.formSection('time');\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('time');\r\n\t\t}\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t\t}\r\n\r\n\r\n\t\tif (!timeControl) {\r\n\t\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\t\t\t\t\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\t\t\t\t\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\t\t\t\t\"\",\r\n\t\t\t\t\"scheduler.config.lightbox.sections = [\",\r\n\t\t\t\t\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n\t\t\t\t.join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\treturn timeControl;\r\n\t}\r\n\r\n\tfunction getFirstSectionOfType(type) {\r\n\t\tfor (let i = 0; i < scheduler.config.lightbox.sections.length; i++) {\r\n\t\t\tlet section = scheduler.config.lightbox.sections[i];\r\n\t\t\tif (section.type === type) {\r\n\t\t\t\treturn scheduler.formSection(section.name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = schedu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''+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\tloc.select_year_day2+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t''+loc.repeat_text_occurences_count+'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_year_grid= function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;"],"names":["global$1","window","global","dragHighlightPos","scheduler","dndMarkers","dragStarted","eventNode","event","isEnabled","config","drag_highlight","markTimespan","checkViewName","viewName","viewObj","getView","layout","createMarkerConfig","configSettings","sectionId","style","top","left","marginLeft","sections","markerObject","start_date","end_date","css","html","date","add","createViewMarker","settings","markerConfigs","monthViewMarkersArray","weekDates","currDate","Date","valueOf","obj","push","week_start","cells","$container","querySelectorAll","event_attribute","id","i","length","cloneNode","unitMarkersArray","sectionPropertyName","y_property","map_to","multisection","formatedSections","String","split","section_delimiter","map","element","elems","columnViewMarkersArray","eventNodes","eventNodeClone","getAttribute","forEach","cfg","attachEvent","mode","e","getEvent","target","closest","getState","cascade_event_display","unselect","getActionData","section","unmarkTimespan","limitPlugin","mark_now","display_marked_timespans","overwrite_marked_timespans","dhx_time_block","default_timespan_type","get_resulting_options","days","zones","options","type","getZones","ev","timespans","day_index","day_value","timespan_type","s","containers","_props","matrix","container","property","view","linker","_add_timespan_zones","_get_blocked_zones","blockTime","addMarkedTimespan","unblockTime","deleteMarkedTimespan","checkInMarkedTimespan","on_overlap","res","temp_start_date","temp_end_date","_marked_timespans","date_part","getDay","eventStart","_get_zone_minutes","eventEnd","getDate","markerStart","markerEnd","checkLimitViolation","check_limits","c","evs","rec_type","_end_date","seriesEnd","limit_start","limit_end","complete_res","p","_timed","isOneDayEvent","allow","_drag_id","_drag_mode","setHours","setMinutes","checkEvent","callEvent","timeline_zones","blocked_timeline_zones","this","_get_relevant_blocked_zones","resultZones","concat","_mark_now","hide","dhx_now_time","_els","now","_currentDate","_remove_mark_now","_max_date","_min_date","getHours","first_hour","last_hour","locate_holder_day","_append_mark_now","zone_start","_table_view","_mode","start_index","end_index","units_l","size","position","r_divs","t_day","t_div","_render_marked_timespan","els","div","parent","parentNode","removeChild","getMinutes","_prepare_timespan_options","r_configs","temp_configs","Array","t_days","slice","cloned_config","_lame_clone","apply","undefined","invert_zones","invertZones","uid","view_key","hasOwnProperty","ids","t_config","_lame_copy","k","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","index","start","end","dates","start_day","delta","t_date","_get_css_classes_by_config","css_classes","join","_get_block_by_config","block","document","createElement","innerHTML","appendChild","area","day","blocks","min_date","max_date","date_to_display","min_day","areas","d","_scales","sday","_cols","_ignores","block_proto","className","height","width","order","inner_index","locate_holder","Math","max","min","all_hours_height","hour_size_px","hour_ms","round","_mark_timespans","data","divs","_on_scale_add_marker","len","childNodes","firstChild","_getClassName","indexOf","configuration","Error","rebuild_els","get_elements","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","offset","splice","_subtract_timespan_zones","is_modified","_","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","arguments","types","t","typedConfig","_get_types_to_render","common","specific","types_to_render","_get_configs_to_render","units","unit","_get_unit_index","day_ind","unitsPerDay","floor","_date","key","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","src","dblclick_create","addEventNow","createMethod","methods","isActive","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","call","restoreMethods","batchUpdatePayload","callback","console","error","$stateProvider","registerProvider","batch_update","noRedraw","dp_mode","call_dp","_dp","updateMode","setUpdateMode","calls","setModeDate","needRender","needUpdateView","repaintEvents","rememberModeDate","render","setCurrentView","updateView","render_data","render_view_data","updateEvent","sendData","initPlugins","deletedEvent","copy","undo_deleted","new_event","message","text","expire","addEvent","limit","batchUpdate","uidSeed","isDate","getFullYear","getMonth","utils","mixin","source","force","f","object","result","isArray","pop","Function","prototype","toString","constructor","Number","Boolean","varType","Object","defined","delay","timeout","timer","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","extend","cssClass","classList","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","isCalendarVisible","destroyCalendar","renderCalendar","navigation","handler","calendar","html_element","renderElement","renderer","rows","cols","value","align","justifyContent","prepareConfig","renderLayout","items","fragment","createDocumentFragment","next","_init_nav_bar","navBar","querySelector","_update_nav_bar","previousHeight","heightChanged","newHeight","xy","nav_height","unset_actions","set_actions","display","isAttachedNode","root","body","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","listenWindowResize","resizeDelay","oldSize","$destroyed","a","b","newSize","triggerSchedulerResize","$root","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","contentWindow","EventHost","_silent_mode","listeners","_silentEnd","createEventStorage","handlers","eventStorage","combinedResult","handlerResult","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","attachAll","name","eventArguments","handlerName","detachEvent","list","eventId","detachAllEvents","defaultDomEvents","el","addEventListener","eventRemove","removeEventListener","domEvents","eventScope","attach","capture","detach","detachAll","staticArray","createEventScope","_eventRemoveAll","_createDomEventScope","_trim","str","trim","replace","_isDate","_isObject","getClassName","node","baseVal","locateCss","classname","strict","trg","srcElement","ind","charAt","right","isVisible","visibility","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","isNaN","hasHref","nodeName","loLowerCase","input","select","textarea","hasAttribute","isShadowDomSupported","head","createShadowRoot","attachShadow","getRootNode","ShadowRoot","host","dom_helpers","getAbsoluteLeft","htmlObject","getOffset","getAbsoluteTop","getOffsetSum","elem","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetRect","box","getBoundingClientRect","test","navigator","userAgent","dummy","dummyBox","docElem","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","selector","insertAfter","newNode","referenceNode","nextSibling","insertBefore","remove","isChildOf","child","contains","getFocusableNodes","nodes","nodesArray","$position","sort","hasShadowParent","getActiveElement","activeElement","shadowRoot","getSelection","focusNode","getRelativeEventPosition","bottom","y","x","clientX","clientY","getTargetNode","tagName","composedPath","getNodePosition","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isIE","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialize$1","serialized","encodeURIComponent","JSON","stringify","generateStringToDate","format","utc","splt","mask","match","code","csp_str_to_date","set","temp","locale","month_short_hash","month_full_hash","UTC","cspEnabled","useCsp","csp","init","month_short","month_full","old","setSeconds","setMilliseconds","setTime","getTime","time_part","getTimezoneOffset","shift","start_on_monday","month_start","setDate","year_start","setMonth","day_start","_add_days","inc","ndate","rest","hours","setYear","to_fixed","num","date_to_str","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","parseYMD","parseMDY","parseDMY","dateString","parse_exact_format","datestr","nday","first_thursday","year_number","ordinal_date","convert_to_utc","getSerializator","_events","_loaded","_load","url","from","_load_url","to","prevent_cache","_load_mode","lf","templates","load_format","cache_line","temp_to","ajax","get","ajaxCallback","response","on_load","_parsers","xml","canParse","xhr","responseXML","xmlDoc","parse","responseText","topElement","xmltop","loader","csrfToken","dhtmlx","security_key","opts","xpath","arr","serverList","itms","j","attrs","attributes","label","attr","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","events","dhx_security","collections","collections_loaded","collection","option","option_key","ical","RegExp","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","parse_date","dh","dm","utcMark","dy","dn","dd","server_utc","foundParser","parser","_process","status","_process_loading","_loading","_not_render","_render_wait","_after_call","_tagvalue","_init_date","_helpers","parseDate","getSerializableData","createSerializator","serialize","dataset","allEvents","exportedEvent","exportValue","rawValue","xml_format","format_date","load","setLoadMode","array","show_loading","_x","_y","_obj","_init_touch_events","touch","MSStream","platform","maxTouchPoints","scroll_width","_mobile","touchEventsSupported","createEvent","_touch_events","touches","pageX","pageY","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","names","accessor","ignore","tracker","drag_mode","scroll_mode","action_mode","dblclicktime","attachTouchEvent","_is_lightbox_open","passive","drag_cancel","_hide_global_tip","_on_mouse_up","_temp_touch_block","_drag_pos","_pointerDragId","acc","dnd","timeline","original_render","drag_id","getEvents","_sorder","_count","_on_mouse_move","preventDefault","cancelBubble","_update_global_tip","abs","fake_event","pointerId","_click","dhx_cal_data","_on_dbl_click","_block_next_stop","touch_drag","actTask","_locate_event","fakeTask","sourceTask","_ignore_next_click","previousSibling","_on_mouse_down","for_rendered","_rendered","touch_tip","_show_global_tip","touch_swipe_dates","s_ev","e_ev","step","max_dy","scrollable","dx","dhx_cal_next_button","dhx_cal_prev_button","toptip","_global_tip","time","event_header","day_date","labels","drag_to_create","drag_to_move","calculatedMaterial","cachedBorderBoxValue","checkIfBorderBoxStyling","_is_material_skin","probe","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","flatSkinHourScale","_addThemeClass","skin","_skin_settings","use_select_menu_space","wide_form","displayed_event_color","displayed_event_text_color","_skin_xy","lightbox_additional_height","bar_height","checkIfMaterialSkin","_build_skin_info","clearInterval","monitorIntervalId","setInterval","csstheme","setSkin","styles","themeVar","themeName","isCssVarTheme","cssValues","oldMaterialTheme","links","getElementsByTagName","href","_theme_info","theme","cssVarTheme","values","themeVariables","_configure","col","_skin_init","hour_scale","hour_date","_old_month_day","month_day","old_month_day","dhx_cal_today_button","tab","header","tabs","specialTabs","tabName","find","filter","firstTab","reverse","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_new_event","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","deleteEvent","_add_rec_marker","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","which","keyCode","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","_waiAria","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","title","content","message_ok","message_cancel","buttons","btn","getElementById","hidden","focus","alertPopup","confirmPopup","boxPopup","box_params","params","focusable","messageInfoAttr","timers","pull","seed","hideAll","popups","alert","confirm","modalbox","setTransactionMode","total","headers","payload","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","val","_columns","getSyncState","enableDataNames","enablePartialDataSend","_changed","master","rowId","state","findRow","existing","getUserData","set_invalid","is_invalid","markRow","_methods","details","getActionByState","checkBeforeUpdate","editStop","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","stack","keys","pref","_applyPayload","urlSeparator","dataToSend","self","queryParams","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","method","preprocessedData","_cleanupItemBeforeSend","action","query","_onResolvedCreateUpdate","tag","resultState","setRequestHeader","sid","tid","afterUpdateCallback","routerMode","actionPromise","create","delete","update","then","catch","valid","_forEachUpdatedRow","_getAllData","out","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","_is_virtual_event","_set_event_text_style","r","cssText","event_updated","rec_pattern","_dp_change_event_id","new_id","changeEventId","_dp_hook_delete","setDp","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","func","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","destructor","processedData","updatedItem","output","_prepareDataItem","item","processedItem","formatDate","dataItem","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","icon_details","icon_edit","icon_delete","confirm_closing","confirm_deleting","section_description","section_time","full_day","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","prev","year","month","hour","minute","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","repeat_never","repeat_daily","repeat_workdays","repeat_weekly","repeat_monthly","repeat_yearly","repeat_custom","repeat_freq_day","repeat_freq_week","repeat_freq_month","repeat_freq_year","repeat_on_date","repeat_ends","month_for_recurring","day_for_recurring","be","agenda_tab","description","year_tab","week_agenda_tab","ca","cn","cs","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","direction","newDate","setFullYear","setState","_toggleMode","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","maxDate","labelFormat","dayElement","weeks","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","stateProviders","internal","provider","unregisterProvider","commonViews","agenda","grid","week_agenda","anythingElse","requiredExtensions","_commonErrorMessages","unknownView","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","exportToPNG","exportToPDF","extend$l","_detachDomEvent","_init_once","scheduler_resize_listener","hasSchedulerMarkup","wai_aria_application_role","views","_grid","log","rtl","_scroll","init_templates","set_sizes","$initialized","min_event_height","scale_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","edit_save","edit_cancel","functor","scale_x","materialScalePlaceholder","set_xy","_lightbox","_setLbPosition","_data_width","prepareValue","prepared","class_name","attr_value","labelAttr","domEventsScope","getDaysDifference","startDate","endDate","differenceInDays","_select_id","_close_not_saved","previousSelection","editor_id","_edit_id","lightbox_id","_lightbox_id","select_id","expanded","readonly","icon","def_step","dhx_cal_tab","deprecated_name","substring","_dhtmlx_confirm","title_confirm_deleting","edit","save","showLightbox","form","base","duration","event_duration","time_step","start_hour","_drag_event","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","_colsS","$domHelpers","dataArea","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","title_confirm_closing","positive_closing","_correct_shift","back","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","has_moved","_correct_drag_start_date","_start_correction","_end_correction","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","maxY","precisePos","minDate","preciseDate","cursor","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","_allow_dnd","update_render","sx","update_view","drag_event_body","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","moved","_dhx_changed","is_new","edit_on_create","details_on_create","_trigger_dyn_loading","_reset_ignores","_reset_scale","isViewExists","_set_aria_buttons_attrs","buttonGroups","group","headerButtonsAttributes","icon_form","oldClass","newClass","multidayScroll","dhx_multi_day","prev_scroll","preserve_scroll","_dy_shift","headerToggleState","_render_x_header","offset_top","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","count","count_n","_get_timeunit_start","_get_view_end","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","scales","cls","firstHalf","slotDate","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","_getNavDateElement","drag_resize","drag_move","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","totalWidth","col_length","hiddenWidth","c2","cc","hourScaleAttr","scroll_hour","now_date","n","preserve","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","cellBody","bf1","getLabel","lightbox","updateCollection","list_name","resetLightbox","hideCover","cache","n_ev","_focus","endColumnIndex","eventLength","startColumnIndex","_get_date_index","last_column","check","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","end_slot","fd","start_slot","_get_section_property","_is_initialized","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","setAttributes","role","getHeaderCellAttr","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","agendaDetailsBtnString","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","buttonLabel","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","dom","assert","show_errors","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","$","counter","Promise","clearAll","createConfig","async","serializeRequestParams","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","xpathExp","docObj","selectNodes","first","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","readyState","filePath","open","toUpperCase","send","$ajax","default_date","month_date","load_date","week_date","date_format","api_date","day_column_padding","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","quick_info_detached","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","ajax_error","delay_render","timeline_swap_resize","$initial","xml_date","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","clear_view","extra_data","silent","setEvent","hash","create_getter","create_setter","is_visible_events","clear_event","evFirstHour","evLastHour","lastHour","checkEndDate","get_visible_events","only_timed","filter_event","_is_main_area_event","hold","full","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","_get_event_bar_pos","widt","x2","_pre_render_events","render_event_bar","max_evs","max_month_events","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_table","_pre_render_events_line","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","weekCellIndex","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","zIndex","color","setProperty","tplClass","_editor","shiftKey","ariaAttr","icons","icons_str","currentIcon","textColor","highlightEventPosition","contentA","contentB","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","getSectionTop","posFromDate","_smartRenderingEnabled","restoreOriginalColors","scrollTo","_append_drag_marker","m","scale","lastChild","_update_marker_position","getLightboxRoot","cspEnvironment","salesforceEnvironment","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","dt","last","limit_time_select","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","inputBlock","fallback","inputId","old_id","getRootView","hooks","didInsert","cmp","skins","jQuery","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","oldDate","oldMode","updateFlags","lazy_updateView","ars","createDataProcessor","tMode","dhtmlxError","catchError","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","addPlugins","ext","activePlugins","plugins","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","ExtensionsManager","_extensions","attaches","attachScheduler","_genStr","attachObject","vs","av","sched","schedId","setSizes","_viewRestore","notImplemented","modals","modalsStack","isModal","afterPopup","trapFocus","currentTarget","$keyboardNavigation","_keyNavMessagePopup","focusElement","backupFocus","key_nav_legacy","_temp_key_scope","key_nav","_pasteDate","_pasteSection","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","dispatcher","copyEvent","_make_pasted_event","event_pid","event_length","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","ctrlKey","metaKey","_buffer_event","_key_nav_copy_paste","getActiveNode","new_ev","scheduler_handlers","attachSchedulerHandlers","waitCall","keyDownHandler","focusHandler","keepScrollPosition","focusGlobalNode","enable","reFocusActiveNode","activeNode","isValid","MinicalButton","MinicalCell","mousedownHandler","dataAreaClick","listOfScales","some","Event","TimeSlot","nextSlot","setActiveNode","removeAttribute","evNode","prevState","lastStart","lastEnd","lastSection","getNode","GoogleMapAdapter","_markers","zoom","zoom_after_resolve","initial_zoom","lat","lng","setCenter","setZoom","error_position","google","maps","trigger","mapOptions","center","initial_position","mapId","scrollwheel","mapTypeId","Map","__gm","messageOverlay","outerContainer","setOptions","addListener","geocoder","Geocoder","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","event_location","formatted_address","clearInstanceListeners","AdvancedMarkerElement","importLibrary","mapView","createMarker","setMap","infoWindow","close","InfoWindow","maxWidth","info_window_max_width","setContent","map_info_content","anchor","markerInfo","setVisible","setPosition","latlng","LatLng","clearEventMarkers","latitude","longitude","string","address","OpenStreetMapAdapter","openPopup","closeTooltip","setView","mapWrapper","L","tileLayer","addTo","on","fetch","country","myIcon","iconUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupConfig","minWidth","markerPopup","popup","tooltip","markerConfig","bindPopup","bindTooltip","removeLayer","setLatLng","lon","MapboxAdapter","getPopup","isOpen","togglePopup","mapboxgl","accessToken","lngLat","features","place_name","Popup","focusAfterOpen","setMaxWidth","setHTML","Marker","setLngLat","setPopup","ALL_WEEKDAYS","Weekday","weekday","fromStr","nth","equals","other","getJsWeekday","isPresent","isNumber","isWeekdayStr","includes","rang","repeat","times","padStart","targetLength","padString","sep","splits","pymod","divmod","mod","empty","notEmpty","datetime","MONTH_DAYS","ONE_DAY","MAXYEAR","ORDINAL_BASE","PY_WEEKDAYS","isLeapYear","isValidDate","toOrdinal","date2","differencems","fromOrdinal","ordinal","getMonthDays","getWeekday","monthRange","combine","getMilliseconds","clone","cloneDates","clones","timeToUntilString","untilStringToDate","until","bits","dateTZtoISO8601","timeZone","IterResult","_result","before","after","accept","tooEarly","tooLate","extendStatics","setPrototypeOf","__proto__","__extends","TypeError","__","__assign","assign","__spreadArray","pack","l","SuppressedError","Frequency","CallbackIterResult","_super","iterator","_this","ENGLISH","dayNames","monthNames","tokens","SKIP","number","numberAsText","every","at","the","second","third","for","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","may","june","july","august","september","october","november","december","comma","defaultGetText","defaultDateFormatter","ToText","rrule","gettext","language","dateFormatter","origOptions","bymonthday","bynmonthday","byweekday","allWeeks","someWeeks","isWeekdays","isEveryDay","sortWeekDays","isFullyConvertible","freq","IMPLEMENTED","RRule","FREQUENCIES","plural","HOURLY","MINUTELY","DAILY","bymonth","_bymonth","_bymonthday","_byweekday","byhour","_byhour","WEEKLY","MONTHLY","YEARLY","byyearday","byweekno","weekdaytext","monthtext","npos","wday","finalDelim","delim","o","realCallback","delimiter","finalDelimiter","Parser","rules","done","nextSymbol","isDone","symbol","best","bestSymbol","name_1","v","acceptNumber","expect","parseText","ttr","AT","F","MO","TU","WE","TH","FR","ON","wkd","decodeWKD","decodeNTH","MDAYs","decodeM","S","freqIsDailyOrGreater","fromText","Time","millisecond","DateTime","fromDate","getYear","addYears","years","addMonths","yearDiv","monthMod","addWeekly","wkst","fixDay","addDaily","addHours","filtered","_a","dayDiv","hourMod","addMinutes","minutes","byminute","hourDiv","minuteMod","addSeconds","seconds","bysecond","minuteDiv","secondMod","daysinmonth","SECONDLY","initializeOptions","_i","keys_1","defaultKeys","parseOptions","DEFAULT_OPTIONS","byeaster","dtstart","bysetpos","bynweekday","parsedOptions","parseString","rfcString","parseLine","parseDtstart","line","dtstartWithZone","tzid","parseRrule","Days","parseIndividualNumber","optionKey","parts","SyntaxError","wdaypart","DateWithZone","RangeError","defineProperty","enumerable","configurable","isUTC","rezonedDate","localTimeZone","Intl","DateTimeFormat","resolvedOptions","dateInLocalTZ","tzOffset","optionsToString","outValue","buildDtstart","strValues","ruleString","argsMatch","Cache","all","between","_cacheAdd","what","_value","_cacheGet","cached","argsKeys","findCacheDiff","cachedObject","iterResult","M365MASK","M366MASK","M28","M29","M30","M31","MDAY366MASK","MDAY365MASK","NM28","NM29","NM30","NM31","NMDAY366MASK","NMDAY365MASK","M366RANGE","M365RANGE","WDAYMASK","wdaymask","rebuildYear","firstwkst","wyearlen","firstyday","yearlen","nextyearlen","yearordinal","yearweekday","mmask","mdaymask","nmdaymask","mrange","wnomask","no1wkst","numweeks","lnumweeks","lyearweekday","lno1wkst","lyearlen","weekst","Iterinfo","rebuild","lastyear","yearinfo","lastmonth","monthinfo","nwdaymask","ranges","eastermask","g","yearStart","ydayset","mdayset","wdayset","ddayset","htimeset","mtimeset","stimeset","getdayset","gettimeset","buildPoslist","timeset","ii","dayset","poslist","daypos","timepos","tmp","iter","emitResult","counterDate","millisecondModulo","removeFilteredDays","rezoneIfNeeded","currentDay","isFiltered","dayCounter","SA","SU","noCache","_cache","fromString","_iter","toText","isFullyConvertibleToText","unfold","forceset","compatible","parseInput","rrulevals","rdatevals","exrulevals","exdatevals","parsedDtstart","lines","_b","parms","rdateTzid","parseRDate","rrulestr","rset_1","RRuleSet","groomRruleOptions","rdate","exrule","exdate","rdateval","parm","createGetterSetter","fieldName","field","_rrule","field_1","_rdate","_exrule","_exdate","_exdateHash","_accept","evalExdate","zonedDate","_addRule","_addDate","rrules","exrules","rdates","exdates","_dtstart","rdatesToString","rrs","rule","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","_getViewPort","viewport","_getViewPortSize","tooltipNode","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","delayShow","utils.default","show","tooltip_timeout","tooltip_hide_timeout","gplExtensions","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","_agendaScrollTop","agenda_area","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","rowAttr","dateHeader","descriptionHeader","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","renderDay","calendarEvent","selectedId","all_timed_month","is_event_short","_safe_copy","proto","isPrototypeOf","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","_setTempSection","event_id","collision_limit","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","evs_dates","getRecDates","tevs","concurrent","checked_mode","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","year_y","cur_height","week_agenda_scale_height","eventsContainer","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","cookie_param","old_load","drag_between","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","selected_id","addOption","disable","selectOption","setComboValue","all_options","single_option","getIndexByValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","getTimeline","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","info","_plain_export_copy","$text","_create_hidden_form","submit","_hidden_export_form","_get_export_size","footer","A5","A4","A3","A2","A1","A0","dataX","cSize","parseFloat","smartRendering","initialSizes","smart_rendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","grid_view","html_templates","getScope","scopes","minicalButton","minicalDate","SchedulerNode","DataArea","timeSlot","searchMap","key_nav_step","addShortcut","shortcut","scope","scopeObject","getShortcutHandler","commands","shortcuts","findHandler","removeShortcut","unbind","disp","setDefaultNode","_compose","createCommand","modifiers","alt","ctrl","meta","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","doAction","returnValue","bindAll","initKeys","nextItem","currentFocus","currentIndex","renderMultiple","currentStart","currentEnd","_modes","_getMode","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","round_position","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","tempStart","tempEnd","_timeline_getX","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","lineHeight","getDefaultNode","getMode","blur","_compareEvents","_pickEvent","startId","nextEventHandler","nextEvent","currEvent","visibleDates","nextEv","prevEventHandler","HeaderCell","getNodes","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","defaultCell","_getSection","_getNodes","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","_moveToSlot","slot","movingDate","getDefaultDate","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","timeslot","_getMultisectionView","_getNextSection","nextIndex","defaultSlot","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","globalNode","_getGrid","_getNode","enabled","newRow","newCol","blurNode","editor","defaultPrevented","schedulerNode","_timeout","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","cellIndex","td","renderMinical","cal","added","destroyMinical","_def_count","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_view","_temp_limit_scope","om","od","nm","nd","isBlocked","date_end","resetDate","is_new_event","data_copy","native_object","_mark_now_timer","map_view","mapAdapter","eventHandlerIds","adapters","googleMap","openStreetMaps","mapbox","setupMapView","createAdapter","unmodifiedEvent","_eventLocationChanged","map_settings","resolve_event_location","_latLngUpdate","addEventWithLocation","updateEventMarker","newIdEvent","removeEventMarker","addEventMarker","onEventClick","coordinates","resolveAddress","map_view_provider","currentAdapter","resolve_user_location","view_provider","map_initial_position","map_error_position","map_date_width","map_icon_width","map_description_width","add_map","map_date","map_time","map_text","map_start","dblclick_dhx_map_area","map_initial_zoom","map_zoom_after_resolve","map_infowindow_max_width","map_resolve_user_location","map_type","map_resolve_event_location","fill_map_tab","_selected_event_id","ariaButtonAttr","map_end","mapContainer","adapter","elem_id","marginRight","marginTop","destroy","initialize","geolocation","getCurrentPosition","coords","_updateEventLocation","_event_resolve_delay","ret","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","_render_calendar","unmarkCalendar","cont","tpos","_get_def_cont","$dom","dateAttribute","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","calendars","arrow","dayHeaders","dayCells","inputs","selects","inp","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","monthheight","old_s","multiselect","_children","_mark_inputs","_ids","script_url","divLoading","multisource","mvc","update_timer","use_id","sanitize","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","last_event","dragger","dhtmlDragAndDropObject","stopDrag","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_end","xml_top","profile","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","to_pdf","objects","getPDFData","toPDF","toPDFRange","quick_info","show_quick_info","clickedElementPosition","fitQIInsideWindow","quickInfoPopup","popupRect","offsetBottom","getPositionInsideScheduler","_$quickInfoHandler","eventElement","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","ontransitionend","_quick_info_onscroll_handler","$testmode","_qi_button_click","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","txt_replace","txts","txtt","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","originalForm","readonlyForm","_lightbox_r","clearMilliseconds","isSeries","recurring_event_id","old_add_event","groupExceptions","exceptions","original_start","_rec_temp","_rec_markers_pull","_rec_markers","_pid_time","_get_rec_marker","ch","_get_rec_markers","ev_id","_ignore_call","tev","_pid_changed","_is_modified_occurence","idTimestamp","nid","nev","sub","isEventFound","_start_date","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","repeat_date","old_update_event","toIcalString","getWeekdayOfMonth","dayOfWeek","dayOfMonth","dayNumber","non_render","maxCount","seriesExceptions","utcStart","repeatedDates","adjustedDate","visibleCount","eventDuration","exception","_fix_daylight_saving_date","recurrings","sev","occurence","include_end_by","recurring_workdays","jsDaysToRRULEDays","RruleDayNumsToJs","formatDayNumber","repeat_monthly_date","repeat_monthly_weekday","nthDayOfMonth","repeat_yearly_month_date","repeat_yearly_month_weekday","getRecValue","WORKDAYS","CUSTOM","monthRepeat","yearRepeat","endRule","NEVER","fillInDefaults","dayNum","dayLabel","dateOfMonth","nthWeekDayOfMonth","dateOfYear","nthWeekDayOfYear","countInput","ondateInput","endOptionSelect","formatter","repeat_date_of_end","dispatchEvent","getFirstSectionOfType","rec","_get_node","_outer_html","loc","_init_set_value","_ds","weekly","monthly","yearly","_rec_init_done","rf","blocked","rruleset","topOption","rruleObj","untilDate","customFreq","actual_dates","timeControl","recurrence","_start","recurring_legacy","getRecurringSection","occurrence_timestamp_in_utc","outerHTML","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","str_date_format","date_str","register_els","inps","change_current_view","set_end_rule","_get_repeat_code","get_rcode","str_date","transpose_type","get_numeric_value","repeat_precise","start_exists","transpose_day_week","set_rcode","_set_repeat_code","MouseEvent","elements","_toggle_block","_get_button","_get_form","backgroundPosition","transponse_size","day_week","originalMonth","newMonth","cor","cor2","cday","transposeRecurring","recurringParts","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","startHour","ted","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","hideTooltip","s2d","d2s","select_event","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_year_grid","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","datepicker","locateEvent","factory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","addCalendar","$dhx"],"mappings":"yOAUA,MAAAA,SAPUC,OAAW,IACNA,OAEAC,OCNA,SAASC,GAAiBC,EACrC,CAAA,IAAIC,EAAa,CAAA,EACbC,KACAC,EAAY,KACZC,EAAQ,KAEZ,SAASC,GAAAA,CACL,OAAOL,EAAUM,OAAOC,gBAAkBP,EAAUQ,YACvD,CAED,SAASC,EAAcC,EAAAA,CACnB,MAAMC,EAAUX,EAAUY,QAAQF,CAAAA,EAClC,OAAGC,EACQA,EAAQE,OAEZH,CACV,CA4BD,SAASI,EAAmBC,EACxB,CAAA,KAAA,CAAMX,MAAEA,EAAKS,OAAEA,EAAMH,SAAEA,EAAQM,UAAEA,EAASb,UAAEA,CAAcY,EAAAA,GAjB9D,SAAmCZ,EAAWU,EAAAA,CAC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M8L,QAAQksG,EAAWzW,YAC3ByW,EAAWzW,UAAU/oG,QAAQ,SAASiW,GACrCja,EAAU4jH,YAAY3pG,CAC1B,CAAA,CAAA,EAGKupG,EAAWr9G,UACbnG,EAAU2oB,KAAK66F,EAAWr9G,WAE1BnG,EAAU2oB,KAAAA,EAGR66F,EAAW/zG,cACH+zG,EAAW/zG,MAAS,SAC7BzP,EAAU0yB,KAAK8wF,EAAW/zG,IAE1BzP,EAAAA,EAAU8tB,MAAM01F,EAAW/zG,MAG7B,CDxFmC24E,EAAAA,EAAAA,EAE/BpoF,GAAYkjH,GAAQjkD,uBACpBD,GAAY,CACjBsC,OAAQthE,GAAU6e,KAAKqkG,GAAQ5hD,OAAQ4hD,EAGxCrjH,CAAAA,EAAAA,OAAOG,UAAYA,GACnBH,OAAOm/D,UAAYA,GAEfn/D,OAAOgkH,OACVhkH,OAAOgkH,KAAO,IAGfhkH,OAAOgkH,KAAK7jH,UAAYA,GACxBH,OAAOgkH,KAAK7kD,UAAYA","x_google_ignoreList":[84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111]} \ No newline at end of file diff --git a/codebase/sources/dhtmlxscheduler.css b/codebase/sources/dhtmlxscheduler.css index ab13d6e..3259853 100644 --- a/codebase/sources/dhtmlxscheduler.css +++ b/codebase/sources/dhtmlxscheduler.css @@ -3,35 +3,35 @@ font-style: normal; font-weight: 300; font-display: swap; - src: url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuOKfMZg.ttf) format('truetype'); + src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuOKfMZg.ttf) format('truetype'); } @font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; - src: url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZg.ttf) format('truetype'); + src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format('truetype'); } @font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; - src: url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZg.ttf) format('truetype'); + src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf) format('truetype'); } @font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; - src: url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYMZg.ttf) format('truetype'); + src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format('truetype'); } @font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; - src: url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZg.ttf) format('truetype'); + src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf) format('truetype'); } /* default terrace theme is here */ :root { @@ -220,6 +220,9 @@ --dhx-scheduler-modal-padding: 16px; --dhx-scheduler-modal-width: 320px; --dhx-scheduler-modal-border-radius: var(--dhx-scheduler-popup-border-radius); + /* undo delete */ + --dhx-scheduler-undo-delete-background: var(--dhx-scheduler-base-colors-text-base); + --dhx-scheduler-undo-delete-color: var(--dhx-scheduler-event-color); } :root[data-scheduler-theme='dark'] { --dhx-scheduler-theme: dark; @@ -244,6 +247,7 @@ --dhx-scheduler-popup-background: #1B1B1C; --dhx-scheduler-popup-border: 1px solid #4B4B4B; --dhx-scheduler-btn-font-weight: 600; + --dhx-scheduler-undo-delete-background: var(--dhx-scheduler-popup-background); } :root[data-scheduler-theme='flat'] { --dhx-scheduler-theme: flat; @@ -496,6 +500,8 @@ --dhx-scheduler-base-colors-icons: #AAAAAA; --dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light); --dhx-scheduler-popup-background: #1B1B1C; + --dhx-scheduler-undo-delete-background: var(--dhx-scheduler-popup-background); + --dhx-scheduler-undo-delete-color: var(--dhx-scheduler-base-colors-text-base); --dhx-scheduler-popup-border: 1px solid #4B4B4B; --dhx-scheduler-font-size: 16px; --dhx-scheduler-heading-font-size: 24px; @@ -1991,6 +1997,36 @@ url("src/dhx-scheduler-icons.woff2?7d3dc8d31762f76ad3c385c23e9afbc6") format("wo .dhx_lightbox_minical .dhx_lightbox_time_select { width: 95px; } +.dhx_form_rrule { + display: flex; + flex-direction: column; + gap: 8px; +} +.dhx_form_rrule .dhx_form_repeat_custom, +.dhx_form_rrule .dhx_form_repeat_ends, +.dhx_form_rrule .dhx_form_repeat_ends_extra { + display: flex; + flex-direction: column; + gap: 8px; +} +.dhx_form_rrule .dhx_form_repeat_ends_options { + display: flex; + gap: 8px; +} +.dhx_form_rrule label { + display: inline-flex; + align-items: center; + vertical-align: top; + gap: 4px; +} +.dhx_form_rrule input[type="number"] { + width: 80px; +} +.dhx_form_rrule .dhx_form_repeat_custom_week { + display: flex; + flex-wrap: wrap; + gap: 8px; +} .dhx_scale_text_styles { font-size: var(--dhx-scheduler-caption-font-size); font-weight: var(--dhx-scheduler-caption-font-weight); @@ -2971,6 +3007,7 @@ div.dhx_timeline_label_column_header .dhx_timeline_label_content_wrapper { position: absolute; height: 100%; border-left: var(--dhx-scheduler-default-border); + top: 0; } .dhx_week_agenda_wrapper { width: 100%; @@ -3666,3 +3703,82 @@ div.dhx_modal_cover { padding-top: 4px; padding-bottom: 4px; } +/* undo delete */ +.scheduler-info.scheduler-popup_after_delete { + cursor: default ; + border-radius: var(--dhx-scheduler-border-radius); + padding: 0; + width: 225px; + --dhx-scheduler-info-background: var(--dhx-scheduler-undo-delete-background); + --dhx-scheduler-info-color: var(--dhx-scheduler-undo-delete-color); +} +.dhx_info_message { + display: flex; + justify-content: space-between; + align-items: center; + padding: 8px 12px; +} +.undo_popup_text { + text-align: center; +} +.undo_button { + background: var(--dhx-scheduler-btn-background); + color: var(--dhx-scheduler-btn-color); + border: 1px solid var(--dhx-scheduler-btn-border-color); + border-radius: var(--dhx-scheduler-border-radius); + height: var(--dhx-scheduler-control-height); + padding: var(--dhx-scheduler-btn-padding, 0 20px); + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + gap: 4px; + flex-shrink: 0; + font-weight: 500; + font-size: var(--dhx-scheduler-font-size); + font-family: var(--dhx-scheduler-font-family); + font-weight: var(--dhx-scheduler-btn-font-weight, normal); + line-height: 142%; + text-transform: var(--dhx-scheduler-btn-text-transform); + cursor: pointer; + padding: 6px 0; + --dhx-scheduler-btn-background: transparent; + --dhx-scheduler-btn-color: var(--dhx-scheduler-base-colors-primary); + --dhx-scheduler-btn-border-color: transparent; + --dhx-scheduler-btn-background-hover: transparent; + --dhx-scheduler-btn-color-hover: var(--dhx-scheduler-base-colors-primary-hover); + --dhx-scheduler-btn-border-hover: transparent; + --dhx-scheduler-btn-background-active: transparent; + --dhx-scheduler-btn-color-active: var(--dhx-scheduler-base-colors-primary-active); + --dhx-scheduler-btn-border-active: transparent; + --dhx-scheduler-btn-background-disabled: transparent; + --dhx-scheduler-btn-color-disabled: var(--dhx-scheduler-base-colors-icons); + --dhx-scheduler-btn-border-color-disabled: transparent; +} +.undo_button:hover { + background: var(--dhx-scheduler-btn-background-hover); + color: var(--dhx-scheduler-btn-color-hover); + border-color: var(--dhx-scheduler-btn-border-hover); +} +.undo_button:active { + background: var(--dhx-scheduler-btn-background-active); + color: var(--dhx-scheduler-btn-color-active); + border-color: var(--dhx-scheduler-btn-border-active); +} +.undo_button:disabled { + background: var(--dhx-scheduler-btn-background-disabled); + color: var(--dhx-scheduler-btn-color-disabled); + border-color: var(--dhx-scheduler-btn-border-disabled); +} +/* drag_highlight */ +.dhx_scheduler_month .dhx_marked_timespan.dhx_scheduler_dnd_marker { + display: block; + margin-top: -4px; +} +.dhx_marked_timespan.dhx_scheduler_dnd_marker { + justify-content: flex-start; + align-items: flex-start; +} +.dhx_scheduler_dnd_marker { + opacity: 0.5; +} diff --git a/codebase/sources/dhtmlxscheduler.es.js b/codebase/sources/dhtmlxscheduler.es.js index 63060b2..40259d7 100644 --- a/codebase/sources/dhtmlxscheduler.es.js +++ b/codebase/sources/dhtmlxscheduler.es.js @@ -25,1033 +25,2226 @@ if (typeof window !== "undefined") { globalScope = global; } const global$1 = globalScope; -function assert(scheduler2) { - return function assert2(check, message2) { - if (!check) { - if (scheduler2.config.show_errors && scheduler2.callEvent("onError", [message2]) !== false) { - if (scheduler2.message) { - scheduler2.message({ type: "error", text: message2, expire: -1 }); - } else { - console.log(message2); - } - debugger; - } +function dragHighlightPos(scheduler2) { + let dndMarkers = []; + let dragStarted = false; + let eventNode = null; + let event2 = null; + function isEnabled2() { + return scheduler2.config.drag_highlight && scheduler2.markTimespan; + } + function checkViewName(viewName) { + const viewObj = scheduler2.getView(viewName); + if (viewObj) { + return viewObj.layout; } - }; -} -function extend$n(scheduler2) { - var commonViews = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }; - var requiredExtensions = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" }; - scheduler2._commonErrorMessages = { unknownView: function(view) { - var relatedDoc = "Related docs: " + (commonViews[view] || commonViews.anythingElse); - var relatedExtension = requiredExtensions[view] ? "You're probably missing " + requiredExtensions[view] + "." : ""; - return "`" + view + "` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \n" + relatedDoc + "\n" + (relatedExtension ? relatedExtension + "\n" : ""); - }, collapsedContainer: function(div) { - return "Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \nMake sure that the container has some initial height or use different units. For example:\n
\n"; - } }; - scheduler2.createTimelineView = function() { - throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: " + requiredExtensions.timeline + "\nRelated docs: " + commonViews.timeline); - }; - scheduler2.createUnitsView = function() { - throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: " + requiredExtensions.unit + "\nRelated docs: " + commonViews.unit); - }; - scheduler2.createGridView = function() { - throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: " + requiredExtensions.grid + "\nRelated docs: " + commonViews.grid); - }; - scheduler2.addMarkedTimespan = function() { - throw new Error("scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\nRelated docs: https://docs.dhtmlx.com/scheduler/limits.html"); - }; - scheduler2.renderCalendar = function() { - throw new Error("scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\nhttps://docs.dhtmlx.com/scheduler/minicalendar.html"); - }; - scheduler2.exportToPNG = function() { - throw new Error(["scheduler.exportToPNG is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); - }; - scheduler2.exportToPDF = function() { - throw new Error(["scheduler.exportToPDF is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); - }; -} -function extend$m(scheduler2) { - scheduler2.attachEvent("onSchedulerReady", function() { - if (typeof dhtmlxError !== "undefined") { - window.dhtmlxError.catchError("LoadXML", function(a, b, c) { - var message2 = c[0].responseText; - switch (scheduler2.config.ajax_error) { - case "alert": - global$1.alert(message2); - break; - case "console": - global$1.console.log(message2); - break; - } - }); + return viewName; + } + function checkSectionPropertyName(viewName) { + const viewObj = scheduler2.getView(viewName); + if (viewObj.y_property) { + return viewObj.y_property; } - }); -} -function extend$l(scheduler2) { - function div(className) { - var element = document.createElement("div"); - var classes = (className || "").split(" "); - classes.forEach(function(cssClass) { - element.classList.add(cssClass); + if (viewObj.map_to) { + return viewObj.map_to; + } + } + function setRequiredStylesToMarker(eventNode2, layout) { + switch (layout) { + case "month": + eventNode2.style.top = ""; + eventNode2.style.left = ""; + break; + case "timeline": + eventNode2.style.left = ""; + eventNode2.style.marginLeft = "1px"; + break; + default: + eventNode2.style.top = ""; + break; + } + } + function createMarkerConfig(configSettings) { + const { event: event3, layout, viewName, sectionId, eventNode: eventNode2 } = configSettings; + setRequiredStylesToMarker(eventNode2, layout); + const sections = {}; + let markerObject = { start_date: event3.start_date, end_date: event3.end_date, css: "dhx_scheduler_dnd_marker", html: eventNode2 }; + if (layout == "timeline" || layout == "month") { + markerObject = { ...markerObject, end_date: scheduler2.date.add(event3.start_date, 1, "minute") }; + } + if (sectionId) { + sections[viewName] = sectionId; + markerObject.sections = sections; + } + return markerObject; + } + function createViewMarker(settings) { + const { layout } = settings; + let markerConfigs; + switch (layout) { + case "month": + markerConfigs = getMonthViewMarkers(settings); + break; + case "timeline": + case "units": + markerConfigs = getTimelineAndUnitsViewMarkers(settings); + break; + default: + markerConfigs = getColumnViewMarkers(settings); + break; + } + markerConfigs.forEach((cfg) => { + dndMarkers.push(scheduler2.markTimespan(cfg)); }); - return element; } - var itemTypes = { rows_container: function() { - return div("dhx_cal_navbar_rows_container"); - }, row: function() { - return div("dhx_cal_navbar_row"); - }, view: function(config) { - var element = div("dhx_cal_tab"); - element.setAttribute("name", config.view + "_tab"); - element.setAttribute("data-tab", config.view); - if (scheduler2.config.fix_tab_position) { - if (config.$firstTab) { - element.classList.add("dhx_cal_tab_first"); - } else if (config.$lastTab) { - element.classList.add("dhx_cal_tab_last"); - } else if (config.view !== "week") { - element.classList.add("dhx_cal_tab_standalone"); + function getColumnViewMarkers(settings) { + const { event: event3, layout, viewName, sectionId } = settings; + let columnViewMarkersArray = []; + let eventNodes = scheduler2.$container.querySelectorAll(`[${scheduler2.config.event_attribute}='${event3.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`); + if (eventNodes) { + for (let i = 0; i < eventNodes.length; i++) { + let eventNodeClone = eventNodes[i].cloneNode(true); + let startDate = /* @__PURE__ */ new Date(+eventNodeClone.getAttribute("data-bar-start")); + let endDate = /* @__PURE__ */ new Date(+eventNodeClone.getAttribute("data-bar-end")); + let dates = { start_date: startDate, end_date: endDate }; + const configSettings = { event: dates, layout, viewName, sectionId, eventNode: eventNodeClone }; + columnViewMarkersArray.push(createMarkerConfig(configSettings)); + } + } + return columnViewMarkersArray; + } + function getMonthViewMarkers(settings) { + let monthViewMarkersArray = []; + const { event: event3, layout, viewName, sectionId } = settings; + const weekDates = []; + let currDate = new Date(event3.start_date); + while (currDate.valueOf() < event3.end_date.valueOf()) { + let obj = { start_date: currDate }; + weekDates.push(obj); + currDate = scheduler2.date.week_start(scheduler2.date.add(currDate, 1, "week")); + } + let cells = scheduler2.$container.querySelectorAll(`[${scheduler2.config.event_attribute}='${event3.id}']`); + for (let i = 0; i < cells.length; i++) { + const configSettings = { event: weekDates[i], layout, viewName, sectionId, eventNode: cells[i].cloneNode(true) }; + monthViewMarkersArray.push(createMarkerConfig(configSettings)); + } + return monthViewMarkersArray; + } + function getTimelineAndUnitsViewMarkers(settings) { + let unitMarkersArray = []; + const { event: event3, layout, viewName, eventNode: eventNode2 } = settings; + let sectionPropertyName = checkSectionPropertyName(viewName); + if (scheduler2.config.multisection && sectionPropertyName) { + const sections = String(event3[sectionPropertyName]).split(scheduler2.config.section_delimiter); + const formatedSections = sections.map((element) => String(element)); + const elems = []; + for (let i = 0; i < formatedSections.length; i++) { + elems[i] = eventNode2.cloneNode(true); + const configSettings = { event: event3, layout, viewName, sectionId: formatedSections[i], eventNode: elems[i] }; + unitMarkersArray.push(createMarkerConfig(configSettings)); + } + } + return unitMarkersArray; + } + scheduler2.attachEvent("onBeforeDrag", function(id2, mode, e) { + if (isEnabled2()) { + dragStarted = true; + event2 = scheduler2.getEvent(id2); + eventNode = e.target.closest(`[${scheduler2.config.event_attribute}]`); + const viewName = scheduler2.getState().mode; + const layout = checkViewName(viewName); + if (layout == "units" && scheduler2.config.cascade_event_display) { + scheduler2.unselect(id2); + eventNode = e.target.closest(`[${scheduler2.config.event_attribute}]`); } - if (config.$segmentedTab) { - element.classList.add("dhx_cal_tab_segmented"); + } + return true; + }); + scheduler2.attachEvent("onEventDrag", function(id2, mode, e) { + if (dragStarted && isEnabled2()) { + dragStarted = false; + const viewName = scheduler2.getState().mode; + const layout = checkViewName(viewName); + const sectionId = scheduler2.getActionData(e).section; + if (event2) { + const settings = { event: event2, layout, viewName, sectionId, eventNode }; + createViewMarker(settings); } } - return element; - }, date: function() { - return div("dhx_cal_date"); - }, button: function(config) { - return div("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab"); - }, builtInButton: function(config) { - return div("dhx_cal_" + config.view + "_button dhx_cal_nav_button"); - }, spacer: function() { - return div("dhx_cal_line_spacer"); - }, minicalendarButton: function(config) { - var minicalendarDiv = div("dhx_minical_icon"); - if (!config.click && !minicalendarDiv.$_eventAttached) { - scheduler2.event(minicalendarDiv, "click", function() { - if (scheduler2.isCalendarVisible()) { - scheduler2.destroyCalendar(); - } else { - scheduler2.renderCalendar({ position: this, date: scheduler2.getState().date, navigation: true, handler: function(date, calendar) { - scheduler2.setCurrentView(date); - scheduler2.destroyCalendar(); - } }); + }); + scheduler2.attachEvent("onDragEnd", function(id2, mode, e) { + for (let i = 0; i < dndMarkers.length; i++) { + scheduler2.unmarkTimespan(dndMarkers[i]); + } + dndMarkers = []; + eventNode = null; + event2 = null; + }); +} +function undoDelete(scheduler2) { + scheduler2.attachEvent("onEventDeleted", function(id2, ev) { + let deletedEvent = scheduler2.copy(ev); + if (scheduler2.config.undo_deleted && !scheduler2.getState().new_event) { + scheduler2.message({ text: `
+ Event deleted + +
`, expire: 1e4, type: "popup_after_delete", callback: function(e) { + let undoBtn = e.target.closest(`[data-deleted-event-id="${ev.id}"]`); + if (undoBtn) { + scheduler2.addEvent(deletedEvent); + scheduler2.render(); } - }); + } }); } - return minicalendarDiv; - }, html_element: function(config) { - return div("dhx_cal_nav_content"); - } }; - function findRenderer(config) { - var renderer; - if (config.view) { - switch (config.view) { - case "today": - case "next": - case "prev": - renderer = itemTypes.builtInButton; - break; - case "date": - renderer = itemTypes.date; - break; - case "spacer": - renderer = itemTypes.spacer; - break; - case "button": - renderer = itemTypes.button; - break; - case "minicalendar": - renderer = itemTypes.minicalendarButton; - break; - default: - renderer = itemTypes.view; - break; + }); +} +function limitPlugin(scheduler2) { + scheduler2.config.mark_now = true; + scheduler2.config.display_marked_timespans = true; + scheduler2.config.overwrite_marked_timespans = true; + var dhx_time_block = "dhx_time_block"; + var default_timespan_type = "default"; + var fix_options = function(options, days, zones) { + if (days instanceof Date && zones instanceof Date) { + options.start_date = days; + options.end_date = zones; + } else { + options.days = days; + options.zones = zones; + } + return options; + }; + var get_resulting_options = function(days, zones, sections) { + var options = typeof days == "object" ? days : { days }; + options.type = dhx_time_block; + options.css = ""; + if (zones) { + if (sections) + options.sections = sections; + options = fix_options(options, days, zones); + } + return options; + }; + scheduler2.blockTime = function(days, zones, sections) { + var options = get_resulting_options(days, zones, sections); + return scheduler2.addMarkedTimespan(options); + }; + scheduler2.unblockTime = function(days, zones, sections) { + zones = zones || "fullday"; + var options = get_resulting_options(days, zones, sections); + return scheduler2.deleteMarkedTimespan(options); + }; + scheduler2.checkInMarkedTimespan = function(ev, timespan_type, on_overlap) { + timespan_type = timespan_type || default_timespan_type; + var res = true; + var temp_start_date = new Date(ev.start_date.valueOf()); + var temp_end_date = scheduler2.date.add(temp_start_date, 1, "day"); + var timespans = scheduler2._marked_timespans; + for (; temp_start_date < ev.end_date; temp_start_date = scheduler2.date.date_part(temp_end_date), temp_end_date = scheduler2.date.add(temp_start_date, 1, "day")) { + var day_value = +scheduler2.date.date_part(new Date(temp_start_date)); + var day_index = temp_start_date.getDay(); + var zones = getZones(ev, timespans, day_index, day_value, timespan_type); + if (zones) { + for (var i = 0; i < zones.length; i += 2) { + var eventStart = scheduler2._get_zone_minutes(temp_start_date); + var eventEnd = ev.end_date > temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ? 1440 : scheduler2._get_zone_minutes(ev.end_date); + var markerStart = zones[i]; + var markerEnd = zones[i + 1]; + if (markerStart < eventEnd && markerEnd > eventStart) { + if (typeof on_overlap == "function") { + res = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd); + } else { + res = false; + } + if (!res) + break; + } + } } - } else if (config.rows) { - renderer = itemTypes.rows_container; - } else if (config.cols) { - renderer = itemTypes.row; - } - return renderer; - } - function renderElement(config) { - var renderer = findRenderer(config); - if (!renderer) { - return; } - var element = renderer(config); - if (config.css) { - element.classList.add(config.css); + return !res; + }; + scheduler2.checkLimitViolation = function(event2) { + if (!event2) + return true; + if (!scheduler2.config.check_limits) + return true; + var s = scheduler2; + var c = s.config; + var evs = []; + if (event2.rec_type && event2._end_date || event2.rrule) { + const seriesEnd = event2._end_date || event2.end_date; + if (c.limit_start && c.limit_end) { + var recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event2.start_date.valueOf() <= c.limit_end.valueOf(); + return recEventInLimits; + } else + return true; + } else { + evs = [event2]; } - if (config.width) { - var value = config.width; - if (value === value * 1) { - value += "px"; + var complete_res = true; + for (var p = 0; p < evs.length; p++) { + var res = true; + var ev = evs[p]; + ev._timed = scheduler2.isOneDayEvent(ev); + res = c.limit_start && c.limit_end ? ev.start_date.valueOf() >= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf() : true; + if (res) { + res = !scheduler2.checkInMarkedTimespan(ev, dhx_time_block, function(event3, eventStart, eventEnd, markerStart, markerEnd) { + var allow = true; + if (eventStart <= markerEnd && eventStart >= markerStart) { + if (markerEnd == 24 * 60 || eventEnd <= markerEnd) { + allow = false; + } + if (event3._timed && s._drag_id && s._drag_mode == "new-size") { + event3.start_date.setHours(0); + event3.start_date.setMinutes(markerEnd); + } else { + allow = false; + } + } + if (eventEnd >= markerStart && eventEnd <= markerEnd || eventStart < markerStart && eventEnd > markerEnd) { + if (event3._timed && s._drag_id && s._drag_mode == "new-size") { + event3.end_date.setHours(0); + event3.end_date.setMinutes(markerStart); + } else { + allow = false; + } + } + return allow; + }); } - element.style.width = value; - } - if (config.height) { - var value = config.height; - if (value === value * 1) { - value += "px"; + if (!res) { + res = s.checkEvent("onLimitViolation") ? s.callEvent("onLimitViolation", [ev.id, ev]) : res; } - element.style.height = value; + complete_res = complete_res && res; } - if (config.click) { - scheduler2.event(element, "click", config.click); + if (!complete_res) { + s._drag_id = null; + s._drag_mode = null; } - if (config.html) { - element.innerHTML = config.html; + return complete_res; + }; + scheduler2._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type) { + var zones = []; + if (timespans && timespans[property]) { + var timeline_zones = timespans[property]; + var blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type); + for (var i = 0; i < blocked_timeline_zones.length; i++) { + zones = this._add_timespan_zones(zones, blocked_timeline_zones[i].zones); + } } - if (config.align) { - var value = ""; - if (config.align == "right") { - value = "flex-end"; - } else if (config.align == "left") { - value = "flex-start"; + return zones; + }; + scheduler2._get_relevant_blocked_zones = function(day_index, day_value, zones, timespan_type) { + var resultZones; + if (scheduler2.config.overwrite_marked_timespans) { + resultZones = zones[day_value] && zones[day_value][timespan_type] ? zones[day_value][timespan_type] : zones[day_index] && zones[day_index][timespan_type] ? zones[day_index][timespan_type] : []; + } else { + resultZones = []; + if (zones[day_value] && zones[day_value][timespan_type]) { + resultZones = resultZones.concat(zones[day_value][timespan_type]); + } + if (zones[day_index] && zones[day_index][timespan_type]) { + resultZones = resultZones.concat(zones[day_index][timespan_type]); + } + } + return resultZones; + }; + function getZones(ev, timespans, day_index, day_value, timespan_type) { + var s = scheduler2; + var zones = []; + var containers = { _props: "map_to", matrix: "y_property" }; + for (var container in containers) { + var property = containers[container]; + if (s[container]) { + for (var view in s[container]) { + var view_config = s[container][view]; + var linker = view_config[property]; + if (!ev[linker]) + continue; + zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans[view], ev[linker], day_index, day_value, timespan_type)); + } } - element.style.justifyContent = value; } - return element; + zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans, "global", day_index, day_value, timespan_type)); + return zones; } - function prepareConfig(config) { - if (typeof config === "string") { - config = { view: config }; - } - if (!config.view && !config.rows && !config.cols) { - config.view = "button"; + scheduler2._mark_now = function(hide) { + var dhx_now_time = "dhx_now_time"; + if (!this._els[dhx_now_time]) { + this._els[dhx_now_time] = []; } - return config; - } - function renderLayout(config) { - var fragment = document.createDocumentFragment(); - var items; - if (Array.isArray(config)) { - items = config; - } else { - items = [config]; + var now = scheduler2._currentDate(); + var cfg = this.config; + scheduler2._remove_mark_now(); + if (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() < cfg.last_hour) { + var day_index = this.locate_holder_day(now); + this._els[dhx_now_time] = scheduler2._append_mark_now(day_index, now); } - for (var i = 0; i < items.length; i++) { - var view = prepareConfig(items[i]); - if (view.view === "day" && items[i + 1]) { - var next = prepareConfig(items[i + 1]); - if (next.view === "week" || next.view === "month") { - view.$firstTab = true; - view.$segmentedTab = true; + }; + scheduler2._append_mark_now = function(day_index, now) { + var dhx_now_time = "dhx_now_time"; + var zone_start = scheduler2._get_zone_minutes(now); + var options = { zones: [zone_start, zone_start + 1], css: dhx_now_time, type: dhx_now_time }; + if (!this._table_view) { + if (this._props && this._props[this._mode]) { + var start_index, end_index; + var view = this._props[this._mode]; + var units_l = view.size || view.options.length; + if (view.days > 1) { + if (view.size && view.options.length) { + day_index = (view.position + day_index) / view.options.length * view.size; + } + start_index = day_index; + end_index = day_index + units_l; + } else { + start_index = 0; + end_index = start_index + units_l; } + var r_divs = []; + for (var i = start_index; i < end_index; i++) { + var t_day = i; + options.days = t_day; + var t_div = scheduler2._render_marked_timespan(options, null, t_day)[0]; + r_divs.push(t_div); + } + return r_divs; + } else { + options.days = day_index; + return scheduler2._render_marked_timespan(options, null, day_index); } - if (view.view === "week" && items[i - 1]) { - var next = prepareConfig(items[i + 1]); - if (next.view === "week" || next.view === "month") { - view.$segmentedTab = true; + } else { + if (this._mode == "month") { + options.days = +scheduler2.date.date_part(now); + return scheduler2._render_marked_timespan(options, null, null); + } + } + }; + scheduler2._remove_mark_now = function() { + var dhx_now_time = "dhx_now_time"; + var els = this._els[dhx_now_time]; + for (var i = 0; i < els.length; i++) { + var div = els[i]; + var parent = div.parentNode; + if (parent) { + parent.removeChild(div); + } + } + this._els[dhx_now_time] = []; + }; + scheduler2._marked_timespans = { global: {} }; + scheduler2._get_zone_minutes = function(date) { + return date.getHours() * 60 + date.getMinutes(); + }; + scheduler2._prepare_timespan_options = function(config) { + var r_configs = []; + var temp_configs = []; + if (config.days == "fullweek") + config.days = [0, 1, 2, 3, 4, 5, 6]; + if (config.days instanceof Array) { + var t_days = config.days.slice(); + for (var i = 0; i < t_days.length; i++) { + var cloned_config = scheduler2._lame_clone(config); + cloned_config.days = t_days[i]; + r_configs.push.apply(r_configs, scheduler2._prepare_timespan_options(cloned_config)); + } + return r_configs; + } + if (!config || !(config.start_date && config.end_date && config.end_date > config.start_date || config.days !== void 0 && config.zones) && !config.type) + return r_configs; + var min = 0; + var max = 24 * 60; + if (config.zones == "fullday") + config.zones = [min, max]; + if (config.zones && config.invert_zones) { + config.zones = scheduler2.invertZones(config.zones); + } + config.id = scheduler2.uid(); + config.css = config.css || ""; + config.type = config.type || default_timespan_type; + var sections = config.sections; + if (sections) { + for (var view_key in sections) { + if (sections.hasOwnProperty(view_key)) { + var ids = sections[view_key]; + if (!(ids instanceof Array)) + ids = [ids]; + for (var i = 0; i < ids.length; i++) { + var t_config = scheduler2._lame_copy({}, config); + t_config.sections = {}; + t_config.sections[view_key] = ids[i]; + temp_configs.push(t_config); + } } } - if (view.view === "month" && items[i - 1]) { - var next = prepareConfig(items[i - 1]); - if (next.view === "week" || next.view === "day") { - view.$lastTab = true; - view.$segmentedTab = true; + } else { + temp_configs.push(config); + } + for (var k = 0; k < temp_configs.length; k++) { + var c_config = temp_configs[k]; + var start_date = c_config.start_date; + var end_date = c_config.end_date; + if (start_date && end_date) { + var t_sd = scheduler2.date.date_part(new Date(start_date)); + var t_ed = scheduler2.date.add(t_sd, 1, "day"); + while (t_sd < end_date) { + var t_config = scheduler2._lame_copy({}, c_config); + delete t_config.start_date; + delete t_config.end_date; + t_config.days = t_sd.valueOf(); + var zone_start = start_date > t_sd ? scheduler2._get_zone_minutes(start_date) : min; + var zone_end = end_date > t_ed || end_date.getDate() != t_sd.getDate() ? max : scheduler2._get_zone_minutes(end_date); + t_config.zones = [zone_start, zone_end]; + r_configs.push(t_config); + t_sd = t_ed; + t_ed = scheduler2.date.add(t_ed, 1, "day"); } + } else { + if (c_config.days instanceof Date) + c_config.days = scheduler2.date.date_part(c_config.days).valueOf(); + c_config.zones = config.zones.slice(); + r_configs.push(c_config); + } + } + return r_configs; + }; + scheduler2._get_dates_by_index = function(index, start, end) { + var dates = []; + start = scheduler2.date.date_part(new Date(start || scheduler2._min_date)); + end = new Date(end || scheduler2._max_date); + var start_day = start.getDay(); + var delta = index - start_day >= 0 ? index - start_day : 7 - start.getDay() + index; + var t_date = scheduler2.date.add(start, delta, "day"); + for (; t_date < end; t_date = scheduler2.date.add(t_date, 1, "week")) { + dates.push(t_date); + } + return dates; + }; + scheduler2._get_css_classes_by_config = function(config) { + var css_classes = []; + if (config.type == dhx_time_block) { + css_classes.push(dhx_time_block); + if (config.css) + css_classes.push(dhx_time_block + "_reset"); + } + css_classes.push("dhx_marked_timespan", config.css); + return css_classes.join(" "); + }; + scheduler2._get_block_by_config = function(config) { + var block = document.createElement("div"); + if (config.html) { + if (typeof config.html == "string") + block.innerHTML = config.html; + else + block.appendChild(config.html); + } + return block; + }; + scheduler2._render_marked_timespan = function(options, area, day) { + var blocks = []; + var c = scheduler2.config; + var min_date = this._min_date; + var max_date = this._max_date; + var day_value = false; + if (!c.display_marked_timespans) + return blocks; + if (!day && day !== 0) { + if (options.days < 7) + day = options.days; + else { + var date_to_display = new Date(options.days); + day_value = +date_to_display; + if (!(+max_date > +date_to_display && +min_date <= +date_to_display)) + return blocks; + day = date_to_display.getDay(); } - var element = renderElement(view); - fragment.appendChild(element); - if (view.cols || view.rows) { - element.appendChild(renderLayout(view.cols || view.rows)); + var min_day = min_date.getDay(); + if (min_day > day) { + day = 7 - (min_day - day); + } else { + day = day - min_day; } } - return fragment; - } - scheduler2._init_nav_bar = function(items) { - var navBar = this.$container.querySelector(".dhx_cal_navline"); - if (!navBar) { - navBar = document.createElement("div"); - navBar.className = "dhx_cal_navline dhx_cal_navline_flex"; - scheduler2._update_nav_bar(items, navBar); - return navBar; + var zones = options.zones; + var css_classes = scheduler2._get_css_classes_by_config(options); + if (scheduler2._table_view && scheduler2._mode == "month") { + var areas = []; + var days = []; + if (!area) { + days = day_value ? [day_value] : scheduler2._get_dates_by_index(day); + for (var i = 0; i < days.length; i++) { + areas.push(this._scales[days[i]]); + } + } else { + areas.push(area); + days.push(day); + } + for (var i = 0; i < areas.length; i++) { + area = areas[i]; + day = days[i]; + var sday = this.locate_holder_day(day, false) % this._cols.length; + if (this._ignores[sday]) + continue; + var block_proto = scheduler2._get_block_by_config(options); + block_proto.className = css_classes; + block_proto.style.top = "0px"; + block_proto.style.height = "100%"; + for (var k = 0; k < zones.length; k += 2) { + var start = zones[i]; + var end = zones[i + 1]; + if (end <= start) + return []; + var block = block_proto.cloneNode(true); + block.style.left = "0px"; + block.style.width = "100%"; + area.appendChild(block); + blocks.push(block); + } + } + } else { + var index = day; + if (this._ignores[this.locate_holder_day(day, false)]) + return blocks; + if (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) { + var view = this._props[this._mode]; + index = view.order[options.sections[this._mode]]; + var inner_index = view.order[options.sections[this._mode]]; + if (!(view.days > 1)) { + index = inner_index; + if (view.size && index > view.position + view.size) { + index = 0; + } + } else { + var units_l = view.size || view.options.length; + index = index * units_l + inner_index; + } + } + area = area ? area : scheduler2.locate_holder(index); + for (var i = 0; i < zones.length; i += 2) { + var start = Math.max(zones[i], c.first_hour * 60); + var end = Math.min(zones[i + 1], c.last_hour * 60); + if (end <= start) { + if (i + 2 < zones.length) + continue; + else + return []; + } + var block = scheduler2._get_block_by_config(options); + block.className = css_classes; + var all_hours_height = this.config.hour_size_px * 24 + 1; + var hour_ms = 60 * 60 * 1e3; + block.style.top = Math.round((start * 60 * 1e3 - this.config.first_hour * hour_ms) * this.config.hour_size_px / hour_ms) % all_hours_height + "px"; + block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * this.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; + area.appendChild(block); + blocks.push(block); + } } - return navBar; + return blocks; }; - var previousHeight = null; - scheduler2._update_nav_bar = function(config, container) { - if (!config) { - return; + scheduler2._mark_timespans = function() { + var data = this._els["dhx_cal_data"][0]; + var divs = []; + if (scheduler2._table_view && scheduler2._mode == "month") { + for (var day in this._scales) { + var date = /* @__PURE__ */ new Date(+day); + divs.push.apply(divs, scheduler2._on_scale_add_marker(this._scales[day], date)); + } + } else { + var date = new Date(scheduler2._min_date); + for (var i = 0, len = data.childNodes.length; i < len; i++) { + var area = data.childNodes[i]; + if (area.firstChild && scheduler2._getClassName(area.firstChild).indexOf("dhx_scale_hour") > -1) { + continue; + } + divs.push.apply(divs, scheduler2._on_scale_add_marker(area, date)); + date = scheduler2.date.add(date, 1, "day"); + } } - var heightChanged = false; - var configChanged = false; - var newHeight = config.height || scheduler2.xy.nav_height; - if (previousHeight === null || previousHeight !== newHeight) { - heightChanged = true; + return divs; + }; + scheduler2.markTimespan = function(configuration) { + if (!this._els) { + throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`."); } - { - configChanged = true; + var rebuild_els = false; + if (!this._els["dhx_cal_data"]) { + scheduler2.get_elements(); + rebuild_els = true; } - if (heightChanged) { - scheduler2.xy.nav_height = newHeight; + var timespans_ids = scheduler2._marked_timespans_ids, timespan_types = scheduler2._marked_timespans_types, timespans = scheduler2._marked_timespans; + scheduler2.deleteMarkedTimespan(); + scheduler2.addMarkedTimespan(configuration); + var divs = scheduler2._mark_timespans(); + if (rebuild_els) + scheduler2._els = []; + scheduler2._marked_timespans_ids = timespans_ids; + scheduler2._marked_timespans_types = timespan_types; + scheduler2._marked_timespans = timespans; + return divs; + }; + scheduler2.unmarkTimespan = function(divs) { + if (!divs) + return; + for (var i = 0; i < divs.length; i++) { + var div = divs[i]; + if (div.parentNode) { + div.parentNode.removeChild(div); + } + } + }; + scheduler2._addMarkerTimespanConfig = function(config) { + var global2 = "global"; + var timespans = scheduler2._marked_timespans; + var id2 = config.id; + var ids = scheduler2._marked_timespans_ids; + if (!ids[id2]) + ids[id2] = []; + var day = config.days; + var sections = config.sections; + var type = config.type; + config.id = id2; + if (sections) { + for (var view_key in sections) { + if (sections.hasOwnProperty(view_key)) { + if (!timespans[view_key]) + timespans[view_key] = {}; + var unit_id = sections[view_key]; + var timespans_view = timespans[view_key]; + if (!timespans_view[unit_id]) + timespans_view[unit_id] = {}; + if (!timespans_view[unit_id][day]) + timespans_view[unit_id][day] = {}; + if (!timespans_view[unit_id][day][type]) { + timespans_view[unit_id][day][type] = []; + if (!scheduler2._marked_timespans_types) + scheduler2._marked_timespans_types = {}; + if (!scheduler2._marked_timespans_types[type]) + scheduler2._marked_timespans_types[type] = true; + } + var day_configs = timespans_view[unit_id][day][type]; + config._array = day_configs; + day_configs.push(config); + ids[id2].push(config); + } + } + } else { + if (!timespans[global2][day]) + timespans[global2][day] = {}; + if (!timespans[global2][day][type]) + timespans[global2][day][type] = []; + if (!scheduler2._marked_timespans_types) + scheduler2._marked_timespans_types = {}; + if (!scheduler2._marked_timespans_types[type]) + scheduler2._marked_timespans_types[type] = true; + var day_configs = timespans[global2][day][type]; + config._array = day_configs; + day_configs.push(config); + ids[id2].push(config); + } + }; + scheduler2._marked_timespans_ids = {}; + scheduler2.addMarkedTimespan = function(configuration) { + var configs = scheduler2._prepare_timespan_options(configuration); + if (!configs.length) + return; + var id2 = configs[0].id; + for (var i = 0; i < configs.length; i++) { + scheduler2._addMarkerTimespanConfig(configs[i]); } - if (configChanged) { - container.innerHTML = ""; - container.appendChild(renderLayout(config)); + return id2; + }; + scheduler2._add_timespan_zones = function(current_zones, zones) { + var resulting_zones = current_zones.slice(); + zones = zones.slice(); + if (!resulting_zones.length) + return zones; + for (var i = 0; i < resulting_zones.length; i += 2) { + var c_zone_start = resulting_zones[i]; + var c_zone_end = resulting_zones[i + 1]; + var isLast = i + 2 == resulting_zones.length; + for (var k = 0; k < zones.length; k += 2) { + var zone_start = zones[k]; + var zone_end = zones[k + 1]; + if (zone_end > c_zone_end && zone_start <= c_zone_end || zone_start < c_zone_start && zone_end >= c_zone_start) { + resulting_zones[i] = Math.min(c_zone_start, zone_start); + resulting_zones[i + 1] = Math.max(c_zone_end, zone_end); + i -= 2; + } else { + if (!isLast) + continue; + var offset = c_zone_start > zone_start ? 0 : 2; + resulting_zones.splice(i + offset, 0, zone_start, zone_end); + } + zones.splice(k--, 2); + break; + } } - if (heightChanged || configChanged) { - scheduler2.unset_actions(); - scheduler2._els = []; - scheduler2.get_elements(); - scheduler2.set_actions(); + return resulting_zones; + }; + scheduler2._subtract_timespan_zones = function(current_zones, zones) { + var resulting_zones = current_zones.slice(); + for (var i = 0; i < resulting_zones.length; i += 2) { + var c_zone_start = resulting_zones[i]; + var c_zone_end = resulting_zones[i + 1]; + for (var k = 0; k < zones.length; k += 2) { + var zone_start = zones[k]; + var zone_end = zones[k + 1]; + if (zone_end > c_zone_start && zone_start < c_zone_end) { + var is_modified = false; + if (c_zone_start >= zone_start && c_zone_end <= zone_end) { + resulting_zones.splice(i, 2); + } + if (c_zone_start < zone_start) { + resulting_zones.splice(i, 2, c_zone_start, zone_start); + is_modified = true; + } + if (c_zone_end > zone_end) { + resulting_zones.splice(is_modified ? i + 2 : i, is_modified ? 0 : 2, zone_end, c_zone_end); + } + i -= 2; + break; + } else { + continue; + } + } } - if (newHeight === 0) { - container.style.display = "none"; - } else { - container.style.display = ""; + return resulting_zones; + }; + scheduler2.invertZones = function(zones) { + return scheduler2._subtract_timespan_zones([0, 1440], zones.slice()); + }; + scheduler2._delete_marked_timespan_by_id = function(id2) { + var configs = scheduler2._marked_timespans_ids[id2]; + if (configs) { + for (var i = 0; i < configs.length; i++) { + var config = configs[i]; + var parent_array = config._array; + for (var k = 0; k < parent_array.length; k++) { + if (parent_array[k] == config) { + parent_array.splice(k, 1); + break; + } + } + } } - previousHeight = newHeight; }; -} -function extend$k(scheduler2) { - function isAttachedNode(container) { - var root = document.body; - while (container && container != root) { - container = container.parentNode; + scheduler2._delete_marked_timespan_by_config = function(config) { + var timespans = scheduler2._marked_timespans; + var sections = config.sections; + var day = config.days; + var type = config.type || default_timespan_type; + var viewspans; + if (sections) { + for (var view_key in sections) { + if (sections.hasOwnProperty(view_key) && timespans[view_key]) { + var unit_id = sections[view_key]; + if (timespans[view_key][unit_id]) { + viewspans = timespans[view_key][unit_id]; + } + } + } + } else { + viewspans = timespans.global; } - return !!(root == container); - } - function getWindowSize(window2) { - return { w: window2.innerWidth || document.documentElement.clientWidth, h: window2.innerHeight || document.documentElement.clientHeight }; - } - function equals(a, b) { - return a.w == b.w && a.h == b.h; - } - function listenWindowResize(scheduler3, window2) { - var oldSize = getWindowSize(window2); - var resizeDelay; - scheduler3.event(window2, "resize", function() { - clearTimeout(resizeDelay); - resizeDelay = setTimeout(function() { - if (!isAttachedNode(scheduler3.$container) || scheduler3.$destroyed) { - return; + if (viewspans) { + if (day !== void 0) { + if (viewspans[day] && viewspans[day][type]) { + scheduler2._addMarkerTimespanConfig(config); + scheduler2._delete_marked_timespans_list(viewspans[day][type], config); } - var newSize = getWindowSize(window2); - if (!equals(oldSize, newSize)) { - oldSize = newSize; - triggerSchedulerResize(scheduler3); + } else { + for (var d in viewspans) { + if (viewspans[d][type]) { + var dayConfig = scheduler2._lame_clone(config); + config.days = d; + scheduler2._addMarkerTimespanConfig(dayConfig); + scheduler2._delete_marked_timespans_list(viewspans[d][type], config); + } } - }, 150); - }); - } - function triggerSchedulerResize(scheduler3) { - if (scheduler3.$destroyed || !scheduler3.$root || !isAttachedNode(scheduler3.$root)) { - return; + } } - if (scheduler3.callEvent("onSchedulerResize", [])) { - scheduler3.updateView(); - scheduler3.callEvent("onAfterSchedulerResize", []); + }; + scheduler2._delete_marked_timespans_list = function(day_timespans, config) { + for (var i = 0; i < day_timespans.length; i++) { + var d_t = day_timespans[i]; + var zones = scheduler2._subtract_timespan_zones(d_t.zones, config.zones); + if (zones.length) + d_t.zones = zones; + else { + day_timespans.splice(i, 1); + i--; + var related_zones = scheduler2._marked_timespans_ids[d_t.id]; + for (var k = 0; k < related_zones.length; k++) { + if (related_zones[k] == d_t) { + related_zones.splice(k, 1); + break; + } + } + } } - } - function watchNodeResize(scheduler3) { - var previousHeight = scheduler3.$root.offsetHeight; - var previousWidth = scheduler3.$root.offsetWidth; - function lowlevelResizeWatcher() { - if (scheduler3.$destroyed) { - return; + }; + scheduler2.deleteMarkedTimespan = function(configuration) { + if (!arguments.length) { + scheduler2._marked_timespans = { global: {} }; + scheduler2._marked_timespans_ids = {}; + scheduler2._marked_timespans_types = {}; + } + if (typeof configuration != "object") { + scheduler2._delete_marked_timespan_by_id(configuration); + } else { + if (!(configuration.start_date && configuration.end_date)) { + if (configuration.days === void 0 && !configuration.type) + configuration.days = "fullweek"; + if (!configuration.zones) + configuration.zones = "fullday"; } - if (scheduler3.$root) { - if (scheduler3.$root.offsetHeight != previousHeight || scheduler3.$root.offsetWidth != previousWidth) { - triggerSchedulerResize(scheduler3); + var types = []; + if (!configuration.type) { + for (var type in scheduler2._marked_timespans_types) { + types.push(type); + } + } else { + types.push(configuration.type); + } + var configs = scheduler2._prepare_timespan_options(configuration); + for (var i = 0; i < configs.length; i++) { + var config = configs[i]; + for (var t = 0; t < types.length; t++) { + var typedConfig = scheduler2._lame_clone(config); + typedConfig.type = types[t]; + scheduler2._delete_marked_timespan_by_config(typedConfig); } - previousHeight = scheduler3.$root.offsetHeight; - previousWidth = scheduler3.$root.offsetWidth; } - setTimeout(lowlevelResizeWatcher, 200); } - lowlevelResizeWatcher(); - } - function addResizeListener(scheduler3) { - var root = scheduler3.$container; - var containerStyles = window.getComputedStyle(root); - if (containerStyles.getPropertyValue("position") == "static") { - root.style.position = "relative"; + }; + scheduler2._get_types_to_render = function(common2, specific) { + var types_to_render = common2 ? scheduler2._lame_copy({}, common2) : {}; + for (var type in specific || {}) { + if (specific.hasOwnProperty(type)) { + types_to_render[type] = specific[type]; + } } - var resizeWatcher = document.createElement("iframe"); - resizeWatcher.className = "scheduler_container_resize_watcher"; - resizeWatcher.tabIndex = -1; - if (scheduler3.config.wai_aria_attributes) { - resizeWatcher.setAttribute("role", "none"); - resizeWatcher.setAttribute("aria-hidden", true); + return types_to_render; + }; + scheduler2._get_configs_to_render = function(types) { + var configs = []; + for (var type in types) { + if (types.hasOwnProperty(type)) { + configs.push.apply(configs, types[type]); + } } - var salesforce_environment = !!window["Sfdc"] || !!window["$A"] || window["Aura"]; - if (salesforce_environment) { - watchNodeResize(scheduler3); - } else { - root.appendChild(resizeWatcher); - if (resizeWatcher.contentWindow) { - listenWindowResize(scheduler3, resizeWatcher.contentWindow); + return configs; + }; + scheduler2._on_scale_add_marker = function(area, day) { + if (scheduler2._table_view && scheduler2._mode != "month") + return; + var day_index = day.getDay(); + var day_value = day.valueOf(); + var mode = this._mode; + var timespans = scheduler2._marked_timespans; + var r_configs = []; + var divs = []; + if (this._props && this._props[mode]) { + var view = this._props[mode]; + var units = view.options; + var index = scheduler2._get_unit_index(view, day); + var unit = units[index]; + if (!(view.days > 1)) { + day = scheduler2.date.date_part(new Date(this._date)); } else { - root.removeChild(resizeWatcher); - listenWindowResize(scheduler3, window); + var dx = 24 * 60 * 60 * 1e3; + var day_ind = Math.round((day - scheduler2._min_date) / dx); + var unitsPerDay = view.size || units.length; + day = scheduler2.date.add(scheduler2._min_date, Math.floor(day_ind / unitsPerDay), "day"); + day = scheduler2.date.date_part(day); + } + day_index = day.getDay(); + day_value = day.valueOf(); + if (timespans[mode] && timespans[mode][unit.key]) { + var unit_zones = timespans[mode][unit.key]; + var unit_types = scheduler2._get_types_to_render(unit_zones[day_index], unit_zones[day_value]); + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(unit_types)); + } + } + var global_data = timespans["global"]; + if (scheduler2.config.overwrite_marked_timespans) { + var day_types = global_data[day_value] || global_data[day_index]; + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(day_types)); + } else { + if (global_data[day_value]) { + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_value])); + } + if (global_data[day_index]) { + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_index])); } } + for (var i = 0; i < r_configs.length; i++) { + divs.push.apply(divs, scheduler2._render_marked_timespan(r_configs[i], area, day)); + } + return divs; + }; + scheduler2.attachEvent("onScaleAdd", function() { + scheduler2._on_scale_add_marker.apply(scheduler2, arguments); + }); + scheduler2.dblclick_dhx_marked_timespan = function(e, src) { + scheduler2.callEvent("onScaleDblClick", [scheduler2.getActionData(e).date, src, e]); + if (scheduler2.config.dblclick_create) { + scheduler2.addEventNow(scheduler2.getActionData(e).date, null, e); + } + }; +} +function createMethod(scheduler2) { + var methods = {}; + var isActive = false; + function disableMethod(methodName, dummyMethod) { + dummyMethod = typeof dummyMethod == "function" ? dummyMethod : function() { + }; + if (!methods[methodName]) { + methods[methodName] = this[methodName]; + this[methodName] = dummyMethod; + } } - addResizeListener(scheduler2); -} -class EventHost { - constructor() { - this._silent_mode = false; - this.listeners = {}; - } - _silentStart() { - this._silent_mode = true; + function restoreMethod(methodName) { + if (methods[methodName]) { + this[methodName] = methods[methodName]; + methods[methodName] = null; + } } - _silentEnd() { - this._silent_mode = false; + function disableMethods(methodsHash) { + for (var i in methodsHash) { + disableMethod.call(this, i, methodsHash[i]); + } } -} -const createEventStorage = function(obj) { - let handlers = {}; - let index = 0; - const eventStorage = function() { - let combinedResult = true; - for (const i in handlers) { - const handlerResult = handlers[i].apply(obj, arguments); - combinedResult = combinedResult && handlerResult; + function restoreMethods() { + for (var i in methods) { + restoreMethod.call(this, i); } - return combinedResult; - }; - eventStorage.addEvent = function(handler, settings) { - if (typeof handler == "function") { - let handlerId; - if (settings && settings.id) { - handlerId = settings.id; + } + function batchUpdatePayload(callback) { + try { + callback(); + } catch (e) { + window.console.error(e); + } + } + scheduler2.$stateProvider.registerProvider("batchUpdate", function() { + return { batch_update: isActive }; + }, false); + return function batchUpdate2(callback, noRedraw) { + if (isActive) { + batchUpdatePayload(callback); + return; + } + var call_dp = this._dp && this._dp.updateMode != "off"; + var dp_mode; + if (call_dp) { + dp_mode = this._dp.updateMode; + this._dp.setUpdateMode("off"); + } + const calls = { setModeDate: { date: null, mode: null }, needRender: false, needUpdateView: false, repaintEvents: {} }; + const rememberModeDate = (date, mode) => { + if (date) { + calls.setModeDate.date = date; + } + if (mode) { + calls.setModeDate.mode = mode; + } + }; + var methods2 = { render: (date, mode) => { + calls.needRender = true; + rememberModeDate(date, mode); + }, setCurrentView: (date, mode) => { + calls.needRender = true; + rememberModeDate(date, mode); + }, updateView: (date, mode) => { + calls.needUpdateView = true; + rememberModeDate(date, mode); + }, render_data: () => calls.needRender = true, render_view_data: (evs) => { + if (evs && evs.length) { + evs.forEach((e) => calls.repaintEvents[e.id] = true); } else { - handlerId = index; - index++; + calls.needRender = true; } - if (settings && settings.once) { - const originalHandler = handler; - handler = function() { - originalHandler(); - eventStorage.removeEvent(handlerId); - }; + } }; + disableMethods.call(this, methods2); + isActive = true; + this.callEvent("onBeforeBatchUpdate", []); + batchUpdatePayload(callback); + this.callEvent("onAfterBatchUpdate", []); + restoreMethods.call(this); + isActive = false; + if (!noRedraw) { + if (calls.needRender) { + scheduler2.render(calls.setModeDate.date, calls.setModeDate.mode); + } else if (calls.needUpdateView) { + scheduler2.updateView(calls.setModeDate.date, calls.setModeDate.mode); + } else { + for (const i in calls.repaintEvents) { + scheduler2.updateEvent(i); + } } - handlers[handlerId] = handler; - return handlerId; } + if (call_dp) { + this._dp.setUpdateMode(dp_mode); + this._dp.sendData(); + } + }; +} +function batchUpdate(scheduler2) { + scheduler2.batchUpdate = createMethod(scheduler2); +} +function initPlugins(scheduler2) { + undoDelete(scheduler2); + dragHighlightPos(scheduler2); + limitPlugin(scheduler2); + batchUpdate(scheduler2); +} +var uidSeed = Date.now(); +function uid() { + return uidSeed++; +} +function isArray$1(obj) { + if (Array.isArray) { + return Array.isArray(obj); + } else { + return obj && obj.length !== void 0 && obj.pop && obj.push; + } +} +function isStringObject(obj) { + return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function String() { [native code] }"; +} +function isNumberObject(obj) { + return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Number() { [native code] }"; +} +function isBooleanObject(obj) { + return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Boolean() { [native code] }"; +} +function isDate$1(obj) { + if (obj && typeof obj === "object") { + return !!(obj.getFullYear && obj.getMonth && obj.getDate); + } else { return false; + } +} +function defined(obj) { + return typeof obj != "undefined"; +} +function delay(callback, timeout) { + var timer; + var result = function() { + result.$cancelTimeout(); + result.$pending = true; + var args = Array.prototype.slice.call(arguments); + timer = setTimeout(function() { + callback.apply(this, args); + result.$pending = false; + }, timeout); }; - eventStorage.removeEvent = function(id2) { - delete handlers[id2]; + result.$pending = false; + result.$cancelTimeout = function() { + clearTimeout(timer); + result.$pending = false; }; - eventStorage.clear = function() { - handlers = {}; + result.$execute = function() { + var args = Array.prototype.slice.call(arguments); + callback.apply(this, args); + result.$cancelTimeout(); }; - return eventStorage; -}; -function makeEventable(obj) { - const eventHost = new EventHost(); - obj.attachEvent = function(eventName, handler, settings) { - eventName = "ev_" + eventName.toLowerCase(); - if (!eventHost.listeners[eventName]) { - eventHost.listeners[eventName] = createEventStorage(this); + return result; +} +const utils = { uid, mixin: function mixin(target, source, force) { + for (var f in source) + if (target[f] === void 0 || force) + target[f] = source[f]; + return target; +}, copy: function copy(object) { + var i, result; + if (object && typeof object == "object") { + switch (true) { + case isDate$1(object): + result = new Date(object); + break; + case isArray$1(object): + result = new Array(object.length); + for (i = 0; i < object.length; i++) { + result[i] = copy(object[i]); + } + break; + case isStringObject(object): + result = new String(object); + break; + case isNumberObject(object): + result = new Number(object); + break; + case isBooleanObject(object): + result = new Boolean(object); + break; + default: + result = {}; + for (i in object) { + const varType = typeof object[i]; + if (varType === "string" || varType === "number" || varType === "boolean") { + result[i] = object[i]; + } else if (isDate$1(object[i])) { + result[i] = new Date(object[i]); + } else if (Object.prototype.hasOwnProperty.apply(object, [i])) + result[i] = copy(object[i]); + } + break; } - if (settings && settings.thisObject) { - handler = handler.bind(settings.thisObject); + } + return result || object; +}, defined, isDate: isDate$1, delay }; +const StateService = function() { + const stateProviders = {}; + function getState(name) { + const provider = stateProviders[name]; + if (provider) { + return stateProviders[name].method(); + } else { + const res = {}; + for (const i in stateProviders) { + if (!stateProviders[i].internal) + utils.mixin(res, stateProviders[i].method(), true); + } + return res; } - const innerId = eventHost.listeners[eventName].addEvent(handler, settings); - let handlerId = eventName + ":" + innerId; - if (settings && settings.id) { - handlerId = settings.id; + } + function registerProvider(name, provider, internal) { + stateProviders[name] = { method: provider, internal }; + } + function unregisterProvider(name) { + delete stateProviders[name]; + } + return { getState, registerProvider, unregisterProvider }; +}; +function assert(scheduler2) { + return function assert2(check, message2) { + if (!check) { + if (scheduler2.config.show_errors && scheduler2.callEvent("onError", [message2]) !== false) { + if (scheduler2.message) { + scheduler2.message({ type: "error", text: message2, expire: -1 }); + } else { + console.log(message2); + } + debugger; + } } - return handlerId; }; - obj.attachAll = function(callback) { - this.attachEvent("listen_all", callback); +} +function extend$n(scheduler2) { + var commonViews = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }; + var requiredExtensions = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" }; + scheduler2._commonErrorMessages = { unknownView: function(view) { + var relatedDoc = "Related docs: " + (commonViews[view] || commonViews.anythingElse); + var relatedExtension = requiredExtensions[view] ? "You're probably missing " + requiredExtensions[view] + "." : ""; + return "`" + view + "` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \n" + relatedDoc + "\n" + (relatedExtension ? relatedExtension + "\n" : ""); + }, collapsedContainer: function(div) { + return "Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \nMake sure that the container has some initial height or use different units. For example:\n
\n"; + } }; + scheduler2.createTimelineView = function() { + throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: " + requiredExtensions.timeline + "\nRelated docs: " + commonViews.timeline); }; - obj.callEvent = function(name, eventArguments) { - if (eventHost._silent_mode) - return true; - const handlerName = "ev_" + name.toLowerCase(); - const listeners = eventHost.listeners; - if (listeners["ev_listen_all"]) { - listeners["ev_listen_all"].apply(this, [name].concat(eventArguments)); - } - if (listeners[handlerName]) - return listeners[handlerName].apply(this, eventArguments); - return true; + scheduler2.createUnitsView = function() { + throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: " + requiredExtensions.unit + "\nRelated docs: " + commonViews.unit); }; - obj.checkEvent = function(name) { - const listeners = eventHost.listeners; - return !!listeners["ev_" + name.toLowerCase()]; + scheduler2.createGridView = function() { + throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: " + requiredExtensions.grid + "\nRelated docs: " + commonViews.grid); }; - obj.detachEvent = function(id2) { - if (id2) { - let listeners = eventHost.listeners; - for (const i in listeners) { - listeners[i].removeEvent(id2); - } - const list = id2.split(":"); - listeners = eventHost.listeners; - if (list.length === 2) { - const eventName = list[0]; - const eventId = list[1]; - if (listeners[eventName]) { - listeners[eventName].removeEvent(eventId); - } - } - } + scheduler2.addMarkedTimespan = function() { + throw new Error("scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\nRelated docs: https://docs.dhtmlx.com/scheduler/limits.html"); }; - obj.detachAllEvents = function() { - for (const name in eventHost.listeners) { - eventHost.listeners[name].clear(); - } + scheduler2.renderCalendar = function() { + throw new Error("scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\nhttps://docs.dhtmlx.com/scheduler/minicalendar.html"); + }; + scheduler2.exportToPNG = function() { + throw new Error(["scheduler.exportToPNG is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); + }; + scheduler2.exportToPDF = function() { + throw new Error(["scheduler.exportToPDF is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); }; } -function extend$j(scheduler2) { - makeEventable(scheduler2); - extend$l(scheduler2); - scheduler2._detachDomEvent = function(el2, event2, handler) { - if (el2.removeEventListener) { - el2.removeEventListener(event2, handler, false); - } else if (el2.detachEvent) { - el2.detachEvent("on" + event2, handler); +function extend$m(scheduler2) { + scheduler2.attachEvent("onSchedulerReady", function() { + if (typeof dhtmlxError !== "undefined") { + window.dhtmlxError.catchError("LoadXML", function(a, b, c) { + var message2 = c[0].responseText; + switch (scheduler2.config.ajax_error) { + case "alert": + global$1.alert(message2); + break; + case "console": + global$1.console.log(message2); + break; + } + }); } - }; - scheduler2._init_once = function() { - extend$k(scheduler2); - scheduler2._init_once = function() { - }; - }; - const layout = { navbar: { render: function(config) { - return scheduler2._init_nav_bar(config); - } }, header: { render: function(config) { - const element = document.createElement("div"); - element.className = "dhx_cal_header"; - return element; - } }, dataArea: { render: function(config) { - const element = document.createElement("div"); - element.className = "dhx_cal_data"; + }); +} +function extend$l(scheduler2) { + function div(className) { + var element = document.createElement("div"); + var classes = (className || "").split(" "); + classes.forEach(function(cssClass) { + element.classList.add(cssClass); + }); return element; - } }, html_element: { render: function(config) { - return config.html; - } } }; - function hasSchedulerMarkup(element) { - return !!(element.querySelector(".dhx_cal_header") && element.querySelector(".dhx_cal_data") && element.querySelector(".dhx_cal_navline")); } - function createDefaultHeader(scheduler3) { - const views = ["day", "week", "month"]; - const date = ["date"]; - const nav = ["prev", "today", "next"]; - if (scheduler3.matrix) { - for (const i in scheduler3.matrix) { - views.push(i); + var itemTypes = { rows_container: function() { + return div("dhx_cal_navbar_rows_container"); + }, row: function() { + return div("dhx_cal_navbar_row"); + }, view: function(config) { + var element = div("dhx_cal_tab"); + element.setAttribute("name", config.view + "_tab"); + element.setAttribute("data-tab", config.view); + if (scheduler2.config.fix_tab_position) { + if (config.$firstTab) { + element.classList.add("dhx_cal_tab_first"); + } else if (config.$lastTab) { + element.classList.add("dhx_cal_tab_last"); + } else if (config.view !== "week") { + element.classList.add("dhx_cal_tab_standalone"); } - } - if (scheduler3._props) { - for (const i in scheduler3._props) { - views.push(i); + if (config.$segmentedTab) { + element.classList.add("dhx_cal_tab_segmented"); } } - if (scheduler3._grid && scheduler3._grid.names) { - for (const i in scheduler3._grid.names) { - views.push(i); - } + return element; + }, date: function() { + return div("dhx_cal_date"); + }, button: function(config) { + return div("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab"); + }, builtInButton: function(config) { + return div("dhx_cal_" + config.view + "_button dhx_cal_nav_button"); + }, spacer: function() { + return div("dhx_cal_line_spacer"); + }, minicalendarButton: function(config) { + var minicalendarDiv = div("dhx_minical_icon"); + if (!config.click && !minicalendarDiv.$_eventAttached) { + scheduler2.event(minicalendarDiv, "click", function() { + if (scheduler2.isCalendarVisible()) { + scheduler2.destroyCalendar(); + } else { + scheduler2.renderCalendar({ position: this, date: scheduler2.getState().date, navigation: true, handler: function(date, calendar) { + scheduler2.setCurrentView(date); + scheduler2.destroyCalendar(); + } }); + } + }); } - const optionalViews = ["map", "agenda", "week_agenda", "year"]; - optionalViews.forEach(function(viewName) { - if (scheduler3[viewName + "_view"]) { - views.push(viewName); + return minicalendarDiv; + }, html_element: function(config) { + return div("dhx_cal_nav_content"); + } }; + function findRenderer(config) { + var renderer; + if (config.view) { + switch (config.view) { + case "today": + case "next": + case "prev": + renderer = itemTypes.builtInButton; + break; + case "date": + renderer = itemTypes.date; + break; + case "spacer": + renderer = itemTypes.spacer; + break; + case "button": + renderer = itemTypes.button; + break; + case "minicalendar": + renderer = itemTypes.minicalendarButton; + break; + default: + renderer = itemTypes.view; + break; } - }); - return views.concat(date).concat(nav); + } else if (config.rows) { + renderer = itemTypes.rows_container; + } else if (config.cols) { + renderer = itemTypes.row; + } + return renderer; } - scheduler2.init = function(id2, date, mode) { - if (this.$destroyed) { + function renderElement(config) { + var renderer = findRenderer(config); + if (!renderer) { return; } - date = date || scheduler2._currentDate(); - mode = mode || "week"; - if (this._obj) { - this.unset_actions(); + var element = renderer(config); + if (config.css) { + element.classList.add(config.css); } - this._obj = typeof id2 == "string" ? document.getElementById(id2) : id2; - this.$container = this._obj; - this.$root = this._obj; - if (!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === "100%") { - window.console.error(scheduler2._commonErrorMessages.collapsedContainer(), this.$container); + if (config.width) { + var value = config.width; + if (value === value * 1) { + value += "px"; + } + element.style.width = value; } - if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { - this.$container.setAttribute("role", "application"); + if (config.height) { + var value = config.height; + if (value === value * 1) { + value += "px"; + } + element.style.height = value; } - if (!this.config.header && !hasSchedulerMarkup(this.$container)) { - this.config.header = createDefaultHeader(this); - window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.", "Using a default header configuration: ", "scheduler.config.header = " + JSON.stringify(this.config.header, null, 2), "Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join("\n")); + if (config.click) { + scheduler2.event(element, "click", config.click); } - if (this.config.header) { - this.$container.innerHTML = ""; - this.$container.classList.add("dhx_cal_container"); - if (this.config.header.height) { - this.xy.nav_height = this.config.header.height; - } - this.$container.appendChild(layout.navbar.render(this.config.header)); - this.$container.appendChild(layout.header.render()); - this.$container.appendChild(layout.dataArea.render()); - } else { - if (!hasSchedulerMarkup(this.$container)) { - throw new Error(["Required DOM elements are missing from the scheduler container.", "Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup", "Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join("\n")); - } + if (config.html) { + element.innerHTML = config.html; } - if (this.config.rtl) - this.$container.className += " dhx_cal_container_rtl"; - if (this._skin_init) - scheduler2._skin_init(); - scheduler2.date.init(); - this._scroll = true; - this._els = []; - this.get_elements(); - this.init_templates(); - this.set_actions(); - this._init_once(); - this._init_touch_events(); - this.set_sizes(); - scheduler2.callEvent("onSchedulerReady", []); - scheduler2.$initialized = true; - this.setCurrentView(date, mode); - }; - scheduler2.xy = { min_event_height: 20, bar_height: 24, scale_width: 50, scroll_width: 18, scale_height: 20, month_scale_height: 20, menu_width: 25, margin_top: 0, margin_left: 0, editor_width: 140, month_head_height: 22, event_header_height: 14 }; - scheduler2.keys = { edit_save: 13, edit_cancel: 27 }; - scheduler2.bind = function bind(functor, object) { - if (functor.bind) - return functor.bind(object); - else - return function() { - return functor.apply(object, arguments); - }; - }; - scheduler2.set_sizes = function() { - var w = this._x = this._obj.clientWidth - this.xy.margin_left; - var scale_x = this._table_view ? 0 : this.xy.scale_width + this.xy.scroll_width; - var materialScalePlaceholder = this.$container.querySelector(".dhx_cal_scale_placeholder"); - if (scheduler2._is_material_skin()) { - if (!materialScalePlaceholder) { - materialScalePlaceholder = document.createElement("div"); - materialScalePlaceholder.className = "dhx_cal_scale_placeholder"; - this.$container.insertBefore(materialScalePlaceholder, this._els["dhx_cal_header"][0]); - } - materialScalePlaceholder.style.display = "block"; - this.set_xy(materialScalePlaceholder, w, this.xy.scale_height + 1, 0, this._els["dhx_cal_header"][0].offsetTop); - } else { - if (materialScalePlaceholder) { - materialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder); + if (config.align) { + var value = ""; + if (config.align == "right") { + value = "flex-end"; + } else if (config.align == "left") { + value = "flex-start"; } + element.style.justifyContent = value; } - if (this._lightbox) { - if (scheduler2.$container.offsetWidth < 1200) - ; - else { - this._setLbPosition(document.querySelector(".dhx_cal_light")); - } + return element; + } + function prepareConfig(config) { + if (typeof config === "string") { + config = { view: config }; } - this._data_width = w - scale_x; - this._els["dhx_cal_navline"][0].style.width = w + "px"; - const header = this._els["dhx_cal_header"][0]; - this.set_xy(header, this._data_width, this.xy.scale_height); - header.style.left = ``; - header.style.right = ``; - if (!this._table_view) { - if (this.config.rtl) { - header.style.right = `${this.xy.scale_width}px`; - } else { - header.style.left = `${this.xy.scale_width}px`; - } + if (!config.view && !config.rows && !config.cols) { + config.view = "button"; + } + return config; + } + function renderLayout(config) { + var fragment = document.createDocumentFragment(); + var items; + if (Array.isArray(config)) { + items = config; } else { - if (!this.config.rtl) { - header.style.left = `-1px`; - } else { - header.style.right = `-1px`; - } + items = [config]; } - }; - scheduler2.set_xy = function(node, w, h, x, y) { - function prepareValue(val) { - let prepared = val; - if (!isNaN(Number(prepared))) { - prepared = Math.max(0, prepared) + "px"; + for (var i = 0; i < items.length; i++) { + var view = prepareConfig(items[i]); + if (view.view === "day" && items[i + 1]) { + var next = prepareConfig(items[i + 1]); + if (next.view === "week" || next.view === "month") { + view.$firstTab = true; + view.$segmentedTab = true; + } } - return prepared; - } - var direction = "left"; - if (w !== void 0) { - node.style.width = prepareValue(w); - } - if (h !== void 0) { - node.style.height = prepareValue(h); - } - if (arguments.length > 3) { - if (x !== void 0) { - if (this.config.rtl) - direction = "right"; - node.style[direction] = x + "px"; + if (view.view === "week" && items[i - 1]) { + var next = prepareConfig(items[i + 1]); + if (next.view === "week" || next.view === "month") { + view.$segmentedTab = true; + } } - if (y !== void 0) { - node.style.top = y + "px"; + if (view.view === "month" && items[i - 1]) { + var next = prepareConfig(items[i - 1]); + if (next.view === "week" || next.view === "day") { + view.$lastTab = true; + view.$segmentedTab = true; + } } - } - }; - scheduler2.get_elements = function() { - const els = this._obj.getElementsByTagName("DIV"); - for (let i = 0; i < els.length; i++) { - let class_name = scheduler2._getClassName(els[i]); - const attr_value = els[i].getAttribute("data-tab") || els[i].getAttribute("name") || ""; - if (class_name) - class_name = class_name.split(" ")[0]; - if (!this._els[class_name]) - this._els[class_name] = []; - this._els[class_name].push(els[i]); - let label = scheduler2.locale.labels[attr_value + "_tab"] || scheduler2.locale.labels[attr_value || class_name]; - if (typeof label !== "string" && attr_value && !els[i].innerHTML) - label = attr_value.split("_")[0]; - if (label) { - this._waiAria.labelAttr(els[i], label); - els[i].innerHTML = label; + var element = renderElement(view); + fragment.appendChild(element); + if (view.cols || view.rows) { + element.appendChild(renderLayout(view.cols || view.rows)); } } - }; - const domEventsScope = scheduler2._createDomEventScope(); - scheduler2.unset_actions = function() { - domEventsScope.detachAll(); - }; - scheduler2.set_actions = function() { - for (const a in this._els) { - if (this._click[a]) { - for (let i = 0; i < this._els[a].length; i++) { - const element = this._els[a][i]; - const handler = this._click[a].bind(element); - domEventsScope.attach(element, "click", handler); - } - } + return fragment; + } + scheduler2._init_nav_bar = function(items) { + var navBar = this.$container.querySelector(".dhx_cal_navline"); + if (!navBar) { + navBar = document.createElement("div"); + navBar.className = "dhx_cal_navline dhx_cal_navline_flex"; + scheduler2._update_nav_bar(items, navBar); + return navBar; } - domEventsScope.attach(this._obj, "selectstart", function(e) { - e.preventDefault(); - return false; - }); - domEventsScope.attach(this._obj, "mousemove", function(e) { - if (!scheduler2._temp_touch_block) - scheduler2._on_mouse_move(e); - }); - domEventsScope.attach(this._obj, "mousedown", function(e) { - if (!scheduler2._ignore_next_click) - scheduler2._on_mouse_down(e); - }); - domEventsScope.attach(this._obj, "mouseup", function(e) { - if (!scheduler2._ignore_next_click) - scheduler2._on_mouse_up(e); - }); - domEventsScope.attach(this._obj, "dblclick", function(e) { - scheduler2._on_dbl_click(e); - }); - domEventsScope.attach(this._obj, "contextmenu", function(event2) { - if (scheduler2.checkEvent("onContextMenu")) { - event2.preventDefault(); - } - const returnValue = scheduler2.callEvent("onContextMenu", [scheduler2._locate_event(event2.target), event2]); - return returnValue; - }); + return navBar; }; - scheduler2.select = function(id2) { - if (this._select_id == id2) + var previousHeight = null; + scheduler2._update_nav_bar = function(config, container) { + if (!config) { return; - scheduler2._close_not_saved(); - this.editStop(false); - if (this._select_id) { - this.unselect(); } - this._select_id = id2; - this.updateEvent(id2); - this.callEvent("onEventSelected", [id2]); - }; - scheduler2.unselect = function(id2) { - if (id2 && id2 != this._select_id) { - return; + var heightChanged = false; + var configChanged = false; + var newHeight = config.height || scheduler2.xy.nav_height; + if (previousHeight === null || previousHeight !== newHeight) { + heightChanged = true; } - const previousSelection = this._select_id; - this._select_id = null; - if (previousSelection && this.getEvent(previousSelection)) { - this.updateEvent(previousSelection); + { + configChanged = true; } - this.callEvent("onEventUnselected", [previousSelection]); - }; - scheduler2.getState = function() { - return { mode: this._mode, date: new Date(this._date), min_date: new Date(this._min_date), max_date: new Date(this._max_date), editor_id: this._edit_id, lightbox_id: this._lightbox_id, new_event: this._new_event, select_id: this._select_id, expanded: this.expanded, drag_id: this._drag_id, drag_mode: this._drag_mode }; - }; - scheduler2._click = { dhx_cal_data: function(e) { - if (scheduler2._ignore_next_click) { - if (e.preventDefault) - e.preventDefault(); - e.cancelBubble = true; - scheduler2._ignore_next_click = false; - return false; + if (heightChanged) { + scheduler2.xy.nav_height = newHeight; } - const id2 = scheduler2._locate_event(e.target); - if (!id2) { - scheduler2.callEvent("onEmptyClick", [scheduler2.getActionData(e).date, e]); - } else { - if (!scheduler2.callEvent("onClick", [id2, e]) || scheduler2.config.readonly) - return; + if (configChanged) { + container.innerHTML = ""; + container.appendChild(renderLayout(config)); } - if (id2 && scheduler2.config.select) { - scheduler2.select(id2); - const icon = e.target.closest(".dhx_menu_icon"); - const mask = scheduler2._getClassName(icon); - if (mask.indexOf("_icon") != -1) - scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); + if (heightChanged || configChanged) { + scheduler2.unset_actions(); + scheduler2._els = []; + scheduler2.get_elements(); + scheduler2.set_actions(); + } + if (newHeight === 0) { + container.style.display = "none"; } else { - scheduler2._close_not_saved(); - if (scheduler2.getState().select_id && (/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500) { - scheduler2.unselect(); - } + container.style.display = ""; } - }, dhx_cal_prev_button: function() { - scheduler2._click.dhx_cal_next_button(0, -1); - }, dhx_cal_next_button: function(dummy, step) { - let def_step = 1; - if (scheduler2.config.rtl) { - step = -step; - def_step = -def_step; + previousHeight = newHeight; + }; +} +function extend$k(scheduler2) { + function isAttachedNode(container) { + var root = document.body; + while (container && container != root) { + container = container.parentNode; } - scheduler2.setCurrentView(scheduler2.date.add(scheduler2.date[scheduler2._mode + "_start"](new Date(scheduler2._date)), step || def_step, scheduler2._mode)); - }, dhx_cal_today_button: function() { - if (scheduler2.callEvent("onBeforeTodayDisplayed", [])) { - scheduler2.setCurrentView(scheduler2._currentDate()); + return !!(root == container); + } + function getWindowSize(window2) { + return { w: window2.innerWidth || document.documentElement.clientWidth, h: window2.innerHeight || document.documentElement.clientHeight }; + } + function equals(a, b) { + return a.w == b.w && a.h == b.h; + } + function listenWindowResize(scheduler3, window2) { + var oldSize = getWindowSize(window2); + var resizeDelay; + scheduler3.event(window2, "resize", function() { + clearTimeout(resizeDelay); + resizeDelay = setTimeout(function() { + if (!isAttachedNode(scheduler3.$container) || scheduler3.$destroyed) { + return; + } + var newSize = getWindowSize(window2); + if (!equals(oldSize, newSize)) { + oldSize = newSize; + triggerSchedulerResize(scheduler3); + } + }, 150); + }); + } + function triggerSchedulerResize(scheduler3) { + if (scheduler3.$destroyed || !scheduler3.$root || !isAttachedNode(scheduler3.$root)) { + return; } - }, dhx_cal_tab: function() { - const name = this.getAttribute("data-tab"); - const deprecated_name = this.getAttribute("name"); - const mode = name || deprecated_name.substring(0, deprecated_name.search("_tab")); - scheduler2.setCurrentView(scheduler2._date, mode); - }, buttons: { delete: function(id2) { - const c = scheduler2.locale.labels.confirm_deleting; - scheduler2._dhtmlx_confirm({ message: c, title: scheduler2.locale.labels.title_confirm_deleting, callback: function() { - scheduler2.deleteEvent(id2); - }, config: { ok: scheduler2.locale.labels.icon_delete } }); - }, edit: function(id2) { - scheduler2.edit(id2); - }, save: function(id2) { - scheduler2.editStop(true); - }, details: function(id2) { - scheduler2.showLightbox(id2); - }, form: function(id2) { - scheduler2.showLightbox(id2); - }, cancel: function(id2) { - scheduler2.editStop(false); - } } }; - scheduler2._dhtmlx_confirm = function({ message: message2, title, callback, config }) { - if (!message2) - return callback(); - config = config || {}; - const opts = { ...config, text: message2 }; - if (title) { - opts.title = title; + if (scheduler3.callEvent("onSchedulerResize", [])) { + scheduler3.updateView(); + scheduler3.callEvent("onAfterSchedulerResize", []); } - if (callback) { - opts.callback = function(result) { - if (result) { - callback(); + } + function watchNodeResize(scheduler3) { + var previousHeight = scheduler3.$root.offsetHeight; + var previousWidth = scheduler3.$root.offsetWidth; + function lowlevelResizeWatcher() { + if (scheduler3.$destroyed) { + return; + } + if (scheduler3.$root) { + if (scheduler3.$root.offsetHeight != previousHeight || scheduler3.$root.offsetWidth != previousWidth) { + triggerSchedulerResize(scheduler3); } - }; + previousHeight = scheduler3.$root.offsetHeight; + previousWidth = scheduler3.$root.offsetWidth; + } + setTimeout(lowlevelResizeWatcher, 200); } - scheduler2.confirm(opts); - }; - scheduler2.addEventNow = function(start, end, e) { - let base = {}; - if (scheduler2._isObject(start) && !scheduler2._isDate(start)) { - base = start; - start = null; + lowlevelResizeWatcher(); + } + function addResizeListener(scheduler3) { + var root = scheduler3.$container; + var containerStyles = window.getComputedStyle(root); + if (containerStyles.getPropertyValue("position") == "static") { + root.style.position = "relative"; } - const duration = (this.config.event_duration || this.config.time_step) * 6e4; - if (!start) - start = base.start_date || Math.round(scheduler2._currentDate().valueOf() / duration) * duration; - let start_date = new Date(start); - if (!end) { - let start_hour = this.config.first_hour; - if (start_hour > start_date.getHours()) { - start_date.setHours(start_hour); - start = start_date.valueOf(); + var resizeWatcher = document.createElement("iframe"); + resizeWatcher.className = "scheduler_container_resize_watcher"; + resizeWatcher.tabIndex = -1; + if (scheduler3.config.wai_aria_attributes) { + resizeWatcher.setAttribute("role", "none"); + resizeWatcher.setAttribute("aria-hidden", true); + } + var salesforce_environment = !!window["Sfdc"] || !!window["$A"] || window["Aura"]; + if (salesforce_environment) { + watchNodeResize(scheduler3); + } else { + root.appendChild(resizeWatcher); + if (resizeWatcher.contentWindow) { + listenWindowResize(scheduler3, resizeWatcher.contentWindow); + } else { + root.removeChild(resizeWatcher); + listenWindowResize(scheduler3, window); } - end = start.valueOf() + duration; } - let end_date = new Date(end); - if (start_date.valueOf() == end_date.valueOf()) - end_date.setTime(end_date.valueOf() + duration); - base.start_date = base.start_date || start_date; - base.end_date = base.end_date || end_date; - base.text = base.text || this.locale.labels.new_event; - base.id = this._drag_id = base.id || this.uid(); - this._drag_mode = "new-size"; - this._loading = true; - const eventId = this.addEvent(base); - this.callEvent("onEventCreated", [this._drag_id, e]); - this._loading = false; - this._drag_event = {}; - this._on_mouse_up(e); - return eventId; + } + addResizeListener(scheduler2); +} +class EventHost { + constructor() { + this._silent_mode = false; + this.listeners = {}; + } + _silentStart() { + this._silent_mode = true; + } + _silentEnd() { + this._silent_mode = false; + } +} +const createEventStorage = function(obj) { + let handlers = {}; + let index = 0; + const eventStorage = function() { + let combinedResult = true; + for (const i in handlers) { + const handlerResult = handlers[i].apply(obj, arguments); + combinedResult = combinedResult && handlerResult; + } + return combinedResult; }; - scheduler2._on_dbl_click = function(e, src) { - src = src || e.target; - if (this.config.readonly) - return; - const name = scheduler2._getClassName(src).split(" ")[0]; - switch (name) { - case "dhx_scale_holder": - case "dhx_scale_holder_now": - case "dhx_month_body": - case "dhx_wa_day_data": - if (!scheduler2.config.dblclick_create) - break; - this.addEventNow(this.getActionData(e).date, null, e); - break; - case "dhx_cal_event": - case "dhx_wa_ev_body": - case "dhx_agenda_line": - case "dhx_cal_agenda_event_line": - case "dhx_grid_event": - case "dhx_cal_event_line": - case "dhx_cal_event_clear": { - const id2 = this._locate_event(src); - if (!this.callEvent("onDblClick", [id2, e])) - return; - if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id2)._timed || !this.config.select) - this.showLightbox(id2); - else - this.edit(id2); - break; + eventStorage.addEvent = function(handler, settings) { + if (typeof handler == "function") { + let handlerId; + if (settings && settings.id) { + handlerId = settings.id; + } else { + handlerId = index; + index++; } - case "dhx_time_block": - case "dhx_cal_container": - return; - default: { - const viewHandler = this["dblclick_" + name]; - if (viewHandler) { - viewHandler.call(this, e); - } else { - if (src.parentNode && src != this) - return scheduler2._on_dbl_click(e, src.parentNode); - } - break; + if (settings && settings.once) { + const originalHandler = handler; + handler = function() { + originalHandler(); + eventStorage.removeEvent(handlerId); + }; } + handlers[handlerId] = handler; + return handlerId; } + return false; }; - scheduler2._get_column_index = function(x_pos) { - let column = 0; - if (this._cols) { - let width = 0; - let i = 0; - while (width + this._cols[i] < x_pos && i < this._cols.length) { - width += this._cols[i]; - i++; + eventStorage.removeEvent = function(id2) { + delete handlers[id2]; + }; + eventStorage.clear = function() { + handlers = {}; + }; + return eventStorage; +}; +function makeEventable(obj) { + const eventHost = new EventHost(); + obj.attachEvent = function(eventName, handler, settings) { + eventName = "ev_" + eventName.toLowerCase(); + if (!eventHost.listeners[eventName]) { + eventHost.listeners[eventName] = createEventStorage(this); + } + if (settings && settings.thisObject) { + handler = handler.bind(settings.thisObject); + } + const innerId = eventHost.listeners[eventName].addEvent(handler, settings); + let handlerId = eventName + ":" + innerId; + if (settings && settings.id) { + handlerId = settings.id; + } + return handlerId; + }; + obj.attachAll = function(callback) { + this.attachEvent("listen_all", callback); + }; + obj.callEvent = function(name, eventArguments) { + if (eventHost._silent_mode) + return true; + const handlerName = "ev_" + name.toLowerCase(); + const listeners = eventHost.listeners; + if (listeners["ev_listen_all"]) { + listeners["ev_listen_all"].apply(this, [name].concat(eventArguments)); + } + if (listeners[handlerName]) + return listeners[handlerName].apply(this, eventArguments); + return true; + }; + obj.checkEvent = function(name) { + const listeners = eventHost.listeners; + return !!listeners["ev_" + name.toLowerCase()]; + }; + obj.detachEvent = function(id2) { + if (id2) { + let listeners = eventHost.listeners; + for (const i in listeners) { + listeners[i].removeEvent(id2); } - column = i + (this._cols[i] ? (x_pos - width) / this._cols[i] : 0); - if (this._ignores) { - if (column >= this._cols.length) { - while (column >= 1 && this._ignores[Math.floor(column)]) { - column--; - } + const list = id2.split(":"); + listeners = eventHost.listeners; + if (list.length === 2) { + const eventName = list[0]; + const eventId = list[1]; + if (listeners[eventName]) { + listeners[eventName].removeEvent(eventId); } } } - return column; }; - scheduler2._week_indexes_from_pos = function(pos) { - if (!this._cols) { - return pos; + obj.detachAllEvents = function() { + for (const name in eventHost.listeners) { + eventHost.listeners[name].clear(); + } + }; +} +function extend$j(scheduler2) { + makeEventable(scheduler2); + extend$l(scheduler2); + scheduler2._detachDomEvent = function(el2, event2, handler) { + if (el2.removeEventListener) { + el2.removeEventListener(event2, handler, false); + } else if (el2.detachEvent) { + el2.detachEvent("on" + event2, handler); + } + }; + scheduler2._init_once = function() { + extend$k(scheduler2); + scheduler2._init_once = function() { + }; + }; + const layout = { navbar: { render: function(config) { + return scheduler2._init_nav_bar(config); + } }, header: { render: function(config) { + const element = document.createElement("div"); + element.className = "dhx_cal_header"; + return element; + } }, dataArea: { render: function(config) { + const element = document.createElement("div"); + element.className = "dhx_cal_data"; + return element; + } }, html_element: { render: function(config) { + return config.html; + } } }; + function hasSchedulerMarkup(element) { + return !!(element.querySelector(".dhx_cal_header") && element.querySelector(".dhx_cal_data") && element.querySelector(".dhx_cal_navline")); + } + function createDefaultHeader(scheduler3) { + const views = ["day", "week", "month"]; + const date = ["date"]; + const nav = ["prev", "today", "next"]; + if (scheduler3.matrix) { + for (const i in scheduler3.matrix) { + views.push(i); + } + } + if (scheduler3._props) { + for (const i in scheduler3._props) { + views.push(i); + } + } + if (scheduler3._grid && scheduler3._grid.names) { + for (const i in scheduler3._grid.names) { + views.push(i); + } + } + const optionalViews = ["map", "agenda", "week_agenda", "year"]; + optionalViews.forEach(function(viewName) { + if (scheduler3[viewName + "_view"]) { + views.push(viewName); + } + }); + return views.concat(date).concat(nav); + } + scheduler2.init = function(id2, date, mode) { + if (this.$destroyed) { + return; + } + date = date || scheduler2._currentDate(); + mode = mode || "week"; + if (this._obj) { + this.unset_actions(); + } + this._obj = typeof id2 == "string" ? document.getElementById(id2) : id2; + this.$container = this._obj; + this.$root = this._obj; + if (!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === "100%") { + window.console.error(scheduler2._commonErrorMessages.collapsedContainer(), this.$container); + } + if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { + this.$container.setAttribute("role", "application"); + } + if (!this.config.header && !hasSchedulerMarkup(this.$container)) { + this.config.header = createDefaultHeader(this); + window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.", "Using a default header configuration: ", "scheduler.config.header = " + JSON.stringify(this.config.header, null, 2), "Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join("\n")); + } + if (this.config.header) { + this.$container.innerHTML = ""; + this.$container.classList.add("dhx_cal_container"); + if (this.config.header.height) { + this.xy.nav_height = this.config.header.height; + } + this.$container.appendChild(layout.navbar.render(this.config.header)); + this.$container.appendChild(layout.header.render()); + this.$container.appendChild(layout.dataArea.render()); } else { - const column = this._get_column_index(pos.x); - pos.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(column) - 1)); - pos.y = Math.max(0, Math.ceil(pos.y * 60 / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step); - return pos; + if (!hasSchedulerMarkup(this.$container)) { + throw new Error(["Required DOM elements are missing from the scheduler container.", "Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup", "Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join("\n")); + } } + if (this.config.rtl) + this.$container.className += " dhx_cal_container_rtl"; + if (this._skin_init) + scheduler2._skin_init(); + scheduler2.date.init(); + this._scroll = true; + this._els = []; + this.get_elements(); + this.init_templates(); + this.set_actions(); + this._init_once(); + this._init_touch_events(); + this.set_sizes(); + scheduler2.callEvent("onSchedulerReady", []); + scheduler2.$initialized = true; + this.setCurrentView(date, mode); }; - scheduler2._mouse_coords = function(ev) { - let pos; - const body = document.body; - const documentElement = document.documentElement; - if (!this.$env.isIE && (ev.pageX || ev.pageY)) - pos = { x: ev.pageX, y: ev.pageY }; + scheduler2.xy = { min_event_height: 20, bar_height: 24, scale_width: 50, scroll_width: 18, scale_height: 20, month_scale_height: 20, menu_width: 25, margin_top: 0, margin_left: 0, editor_width: 140, month_head_height: 22, event_header_height: 14 }; + scheduler2.keys = { edit_save: 13, edit_cancel: 27 }; + scheduler2.bind = function bind(functor, object) { + if (functor.bind) + return functor.bind(object); else - pos = { x: ev.clientX + (body.scrollLeft || documentElement.scrollLeft || 0) - body.clientLeft, y: ev.clientY + (body.scrollTop || documentElement.scrollTop || 0) - body.clientTop }; - if (this.config.rtl && this._colsS) { - pos.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - pos.x; - pos.x += this.$domHelpers.getAbsoluteLeft(this._obj); - if (this._mode !== "month") { - pos.x -= this.xy.scale_width; + return function() { + return functor.apply(object, arguments); + }; + }; + scheduler2.set_sizes = function() { + var w = this._x = this._obj.clientWidth - this.xy.margin_left; + var scale_x = this._table_view ? 0 : this.xy.scale_width + this.xy.scroll_width; + var materialScalePlaceholder = this.$container.querySelector(".dhx_cal_scale_placeholder"); + if (scheduler2._is_material_skin()) { + if (!materialScalePlaceholder) { + materialScalePlaceholder = document.createElement("div"); + materialScalePlaceholder.className = "dhx_cal_scale_placeholder"; + this.$container.insertBefore(materialScalePlaceholder, this._els["dhx_cal_header"][0]); } + materialScalePlaceholder.style.display = "block"; + this.set_xy(materialScalePlaceholder, w, this.xy.scale_height + 1, 0, this._els["dhx_cal_header"][0].offsetTop); } else { - pos.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width); + if (materialScalePlaceholder) { + materialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder); + } } - const dataArea = this.$container.querySelector(".dhx_cal_data"); - pos.y -= this.$domHelpers.getAbsoluteTop(dataArea) - this._els["dhx_cal_data"][0].scrollTop; - pos.ev = ev; - const handler = this["mouse_" + this._mode]; - if (handler) { - pos = handler.call(this, pos); + if (this._lightbox) { + if (scheduler2.$container.offsetWidth < 1200) + ; + else { + this._setLbPosition(document.querySelector(".dhx_cal_light")); + } + } + this._data_width = w - scale_x; + this._els["dhx_cal_navline"][0].style.width = w + "px"; + const header = this._els["dhx_cal_header"][0]; + this.set_xy(header, this._data_width, this.xy.scale_height); + header.style.left = ``; + header.style.right = ``; + if (!this._table_view) { + if (this.config.rtl) { + header.style.right = `${this.xy.scale_width}px`; + } else { + header.style.left = `${this.xy.scale_width}px`; + } } else { - if (!this._table_view) { - pos = this._week_indexes_from_pos(pos); + if (!this.config.rtl) { + header.style.left = `-1px`; } else { - const column = this._get_column_index(pos.x); - if (!this._cols || !this._colsS) - return pos; - let dy = 0; - for (dy = 1; dy < this._colsS.heights.length; dy++) - if (this._colsS.heights[dy] > pos.y) - break; - pos.y = Math.ceil((Math.max(0, column) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step); - if (scheduler2._drag_mode || this._mode == "month") - pos.y = (Math.max(0, Math.ceil(column) - 1) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step; - if (this._drag_mode == "move") { - if (scheduler2._ignores_detected && scheduler2.config.preserve_length) { - pos._ignores = true; - if (!this._drag_event._event_length) - this._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step: 1, x_unit: "day" }); - } - } - pos.x = 0; + header.style.right = `-1px`; } } - pos.timestamp = +/* @__PURE__ */ new Date(); - return pos; }; - scheduler2._close_not_saved = function() { - if ((/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500 && scheduler2._edit_id) { - const confirmationText = scheduler2.locale.labels.confirm_closing; - scheduler2._dhtmlx_confirm({ message: confirmationText, title: scheduler2.locale.labels.title_confirm_closing, callback: function() { - scheduler2.editStop(scheduler2.config.positive_closing); - } }); - if (confirmationText) { - this._drag_id = this._drag_pos = this._drag_mode = null; + scheduler2.set_xy = function(node, w, h, x, y) { + function prepareValue(val) { + let prepared = val; + if (!isNaN(Number(prepared))) { + prepared = Math.max(0, prepared) + "px"; } + return prepared; } - }; - scheduler2._correct_shift = function(start, back) { - return start -= (new Date(scheduler2._min_date).getTimezoneOffset() - new Date(start).getTimezoneOffset()) * 6e4 * (back ? -1 : 1); - }; - scheduler2._is_pos_changed = function(old_pos, new_pos) { - function diff(old_val, new_val, acc) { - return !!(Math.abs(old_val - new_val) > acc); + var direction = "left"; + if (w !== void 0) { + node.style.width = prepareValue(w); } - if (!(old_pos && this._drag_pos)) { - return true; + if (h !== void 0) { + node.style.height = prepareValue(h); + } + if (arguments.length > 3) { + if (x !== void 0) { + if (this.config.rtl) + direction = "right"; + node.style[direction] = x + "px"; + } + if (y !== void 0) { + node.style.top = y + "px"; + } } - const delay2 = 100; - const d_pos = 5; - return !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || new_pos.timestamp - this._drag_pos.timestamp > delay2 || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos)); }; - scheduler2._correct_drag_start_date = function(start) { - let obj; - if (scheduler2.matrix) - obj = scheduler2.matrix[scheduler2._mode]; - obj = obj || { x_step: 1, x_unit: "day" }; - start = new Date(start); - let len = 1; - if (obj._start_correction || obj._end_correction) + scheduler2.get_elements = function() { + const els = this._obj.getElementsByTagName("DIV"); + for (let i = 0; i < els.length; i++) { + let class_name = scheduler2._getClassName(els[i]); + const attr_value = els[i].getAttribute("data-tab") || els[i].getAttribute("name") || ""; + if (class_name) + class_name = class_name.split(" ")[0]; + if (!this._els[class_name]) + this._els[class_name] = []; + this._els[class_name].push(els[i]); + let label = scheduler2.locale.labels[attr_value + "_tab"] || scheduler2.locale.labels[attr_value || class_name]; + if (typeof label !== "string" && attr_value && !els[i].innerHTML) + label = attr_value.split("_")[0]; + if (label) { + this._waiAria.labelAttr(els[i], label); + els[i].innerHTML = label; + } + } + }; + const domEventsScope = scheduler2._createDomEventScope(); + scheduler2.unset_actions = function() { + domEventsScope.detachAll(); + }; + scheduler2.set_actions = function() { + for (const a in this._els) { + if (this._click[a]) { + for (let i = 0; i < this._els[a].length; i++) { + const element = this._els[a][i]; + const handler = this._click[a].bind(element); + domEventsScope.attach(element, "click", handler); + } + } + } + domEventsScope.attach(this._obj, "selectstart", function(e) { + e.preventDefault(); + return false; + }); + domEventsScope.attach(this._obj, "mousemove", function(e) { + if (!scheduler2._temp_touch_block) + scheduler2._on_mouse_move(e); + }); + domEventsScope.attach(this._obj, "mousedown", function(e) { + if (!scheduler2._ignore_next_click) + scheduler2._on_mouse_down(e); + }); + domEventsScope.attach(this._obj, "mouseup", function(e) { + if (!scheduler2._ignore_next_click) + scheduler2._on_mouse_up(e); + }); + domEventsScope.attach(this._obj, "dblclick", function(e) { + scheduler2._on_dbl_click(e); + }); + domEventsScope.attach(this._obj, "contextmenu", function(event2) { + if (scheduler2.checkEvent("onContextMenu")) { + event2.preventDefault(); + } + const returnValue = scheduler2.callEvent("onContextMenu", [scheduler2._locate_event(event2.target), event2]); + return returnValue; + }); + }; + scheduler2.select = function(id2) { + if (this._select_id == id2) + return; + scheduler2._close_not_saved(); + this.editStop(false); + if (this._select_id) { + this.unselect(); + } + this._select_id = id2; + this.updateEvent(id2); + this.callEvent("onEventSelected", [id2]); + }; + scheduler2.unselect = function(id2) { + if (id2 && id2 != this._select_id) { + return; + } + const previousSelection = this._select_id; + this._select_id = null; + if (previousSelection && this.getEvent(previousSelection)) { + this.updateEvent(previousSelection); + } + this.callEvent("onEventUnselected", [previousSelection]); + }; + scheduler2.$stateProvider.registerProvider("global", (function() { + return { mode: this._mode, date: new Date(this._date), min_date: new Date(this._min_date), max_date: new Date(this._max_date), editor_id: this._edit_id, lightbox_id: this._lightbox_id, new_event: this._new_event, select_id: this._select_id, expanded: this.expanded, drag_id: this._drag_id, drag_mode: this._drag_mode }; + }).bind(scheduler2)); + scheduler2._click = { dhx_cal_data: function(e) { + if (scheduler2._ignore_next_click) { + if (e.preventDefault) + e.preventDefault(); + e.cancelBubble = true; + scheduler2._ignore_next_click = false; + return false; + } + const id2 = scheduler2._locate_event(e.target); + if (!id2) { + scheduler2.callEvent("onEmptyClick", [scheduler2.getActionData(e).date, e]); + } else { + if (!scheduler2.callEvent("onClick", [id2, e]) || scheduler2.config.readonly) + return; + } + if (id2 && scheduler2.config.select) { + scheduler2.select(id2); + const icon = e.target.closest(".dhx_menu_icon"); + const mask = scheduler2._getClassName(icon); + if (mask.indexOf("_icon") != -1) + scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); + } else { + scheduler2._close_not_saved(); + if (scheduler2.getState().select_id && (/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500) { + scheduler2.unselect(); + } + } + }, dhx_cal_prev_button: function() { + scheduler2._click.dhx_cal_next_button(0, -1); + }, dhx_cal_next_button: function(dummy, step) { + let def_step = 1; + if (scheduler2.config.rtl) { + step = -step; + def_step = -def_step; + } + scheduler2.setCurrentView(scheduler2.date.add(scheduler2.date[scheduler2._mode + "_start"](new Date(scheduler2._date)), step || def_step, scheduler2._mode)); + }, dhx_cal_today_button: function() { + if (scheduler2.callEvent("onBeforeTodayDisplayed", [])) { + scheduler2.setCurrentView(scheduler2._currentDate()); + } + }, dhx_cal_tab: function() { + const name = this.getAttribute("data-tab"); + const deprecated_name = this.getAttribute("name"); + const mode = name || deprecated_name.substring(0, deprecated_name.search("_tab")); + scheduler2.setCurrentView(scheduler2._date, mode); + }, buttons: { delete: function(id2) { + const c = scheduler2.locale.labels.confirm_deleting; + scheduler2._dhtmlx_confirm({ message: c, title: scheduler2.locale.labels.title_confirm_deleting, callback: function() { + scheduler2.deleteEvent(id2); + }, config: { ok: scheduler2.locale.labels.icon_delete } }); + }, edit: function(id2) { + scheduler2.edit(id2); + }, save: function(id2) { + scheduler2.editStop(true); + }, details: function(id2) { + scheduler2.showLightbox(id2); + }, form: function(id2) { + scheduler2.showLightbox(id2); + }, cancel: function(id2) { + scheduler2.editStop(false); + } } }; + scheduler2._dhtmlx_confirm = function({ message: message2, title, callback, config }) { + if (!message2) + return callback(); + config = config || {}; + const opts = { ...config, text: message2 }; + if (title) { + opts.title = title; + } + if (callback) { + opts.callback = function(result) { + if (result) { + callback(); + } + }; + } + scheduler2.confirm(opts); + }; + scheduler2.addEventNow = function(start, end, e) { + let base = {}; + if (scheduler2._isObject(start) && !scheduler2._isDate(start)) { + base = start; + start = null; + } + const duration = (this.config.event_duration || this.config.time_step) * 6e4; + if (!start) + start = base.start_date || Math.round(scheduler2._currentDate().valueOf() / duration) * duration; + let start_date = new Date(start); + if (!end) { + let start_hour = this.config.first_hour; + if (start_hour > start_date.getHours()) { + start_date.setHours(start_hour); + start = start_date.valueOf(); + } + end = start.valueOf() + duration; + } + let end_date = new Date(end); + if (start_date.valueOf() == end_date.valueOf()) + end_date.setTime(end_date.valueOf() + duration); + base.start_date = base.start_date || start_date; + base.end_date = base.end_date || end_date; + base.text = base.text || this.locale.labels.new_event; + base.id = this._drag_id = base.id || this.uid(); + this._drag_mode = "new-size"; + this._loading = true; + const eventId = this.addEvent(base); + this.callEvent("onEventCreated", [this._drag_id, e]); + this._loading = false; + this._drag_event = {}; + this._on_mouse_up(e); + return eventId; + }; + scheduler2._on_dbl_click = function(e, src) { + src = src || e.target; + if (this.config.readonly) + return; + const name = scheduler2._getClassName(src).split(" ")[0]; + switch (name) { + case "dhx_scale_holder": + case "dhx_scale_holder_now": + case "dhx_month_body": + case "dhx_wa_day_data": + if (!scheduler2.config.dblclick_create) + break; + this.addEventNow(this.getActionData(e).date, null, e); + break; + case "dhx_cal_event": + case "dhx_wa_ev_body": + case "dhx_agenda_line": + case "dhx_cal_agenda_event_line": + case "dhx_grid_event": + case "dhx_cal_event_line": + case "dhx_cal_event_clear": { + const id2 = this._locate_event(src); + if (!this.callEvent("onDblClick", [id2, e])) + return; + if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id2)._timed || !this.config.select) + this.showLightbox(id2); + else + this.edit(id2); + break; + } + case "dhx_time_block": + case "dhx_cal_container": + return; + default: { + const viewHandler = this["dblclick_" + name]; + if (viewHandler) { + viewHandler.call(this, e); + } else { + if (src.parentNode && src != this) + return scheduler2._on_dbl_click(e, src.parentNode); + } + break; + } + } + }; + scheduler2._get_column_index = function(x_pos) { + let column = 0; + if (this._cols) { + let width = 0; + let i = 0; + while (width + this._cols[i] < x_pos && i < this._cols.length) { + width += this._cols[i]; + i++; + } + column = i + (this._cols[i] ? (x_pos - width) / this._cols[i] : 0); + if (this._ignores) { + if (column >= this._cols.length) { + while (column >= 1 && this._ignores[Math.floor(column)]) { + column--; + } + } + } + } + return column; + }; + scheduler2._week_indexes_from_pos = function(pos) { + if (!this._cols) { + return pos; + } else { + const column = this._get_column_index(pos.x); + pos.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(column) - 1)); + pos.y = Math.max(0, Math.ceil(pos.y * 60 / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step); + return pos; + } + }; + scheduler2._mouse_coords = function(ev) { + let pos; + const body = document.body; + const documentElement = document.documentElement; + if (!this.$env.isIE && (ev.pageX || ev.pageY)) + pos = { x: ev.pageX, y: ev.pageY }; + else + pos = { x: ev.clientX + (body.scrollLeft || documentElement.scrollLeft || 0) - body.clientLeft, y: ev.clientY + (body.scrollTop || documentElement.scrollTop || 0) - body.clientTop }; + if (this.config.rtl && this._colsS) { + pos.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - pos.x; + pos.x += this.$domHelpers.getAbsoluteLeft(this._obj); + if (this._mode !== "month") { + pos.x -= this.xy.scale_width; + } + } else { + pos.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width); + } + const dataArea = this.$container.querySelector(".dhx_cal_data"); + pos.y -= this.$domHelpers.getAbsoluteTop(dataArea) - this._els["dhx_cal_data"][0].scrollTop; + pos.ev = ev; + const handler = this["mouse_" + this._mode]; + if (handler) { + pos = handler.call(this, pos); + } else { + if (!this._table_view) { + pos = this._week_indexes_from_pos(pos); + } else { + const column = this._get_column_index(pos.x); + if (!this._cols || !this._colsS) + return pos; + let dy = 0; + for (dy = 1; dy < this._colsS.heights.length; dy++) + if (this._colsS.heights[dy] > pos.y) + break; + pos.y = Math.ceil((Math.max(0, column) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step); + if (scheduler2._drag_mode || this._mode == "month") + pos.y = (Math.max(0, Math.ceil(column) - 1) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step; + if (this._drag_mode == "move") { + if (scheduler2._ignores_detected && scheduler2.config.preserve_length) { + pos._ignores = true; + if (!this._drag_event._event_length) + this._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step: 1, x_unit: "day" }); + } + } + pos.x = 0; + } + } + pos.timestamp = +/* @__PURE__ */ new Date(); + return pos; + }; + scheduler2._close_not_saved = function() { + if ((/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500 && scheduler2._edit_id) { + const confirmationText = scheduler2.locale.labels.confirm_closing; + scheduler2._dhtmlx_confirm({ message: confirmationText, title: scheduler2.locale.labels.title_confirm_closing, callback: function() { + scheduler2.editStop(scheduler2.config.positive_closing); + } }); + if (confirmationText) { + this._drag_id = this._drag_pos = this._drag_mode = null; + } + } + }; + scheduler2._correct_shift = function(start, back) { + return start -= (new Date(scheduler2._min_date).getTimezoneOffset() - new Date(start).getTimezoneOffset()) * 6e4 * (back ? -1 : 1); + }; + scheduler2._is_pos_changed = function(old_pos, new_pos) { + function diff(old_val, new_val, acc) { + return !!(Math.abs(old_val - new_val) > acc); + } + if (!(old_pos && this._drag_pos)) { + return true; + } + const delay2 = 100; + const d_pos = 5; + return !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || new_pos.timestamp - this._drag_pos.timestamp > delay2 || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos)); + }; + scheduler2._correct_drag_start_date = function(start) { + let obj; + if (scheduler2.matrix) + obj = scheduler2.matrix[scheduler2._mode]; + obj = obj || { x_step: 1, x_unit: "day" }; + start = new Date(start); + let len = 1; + if (obj._start_correction || obj._end_correction) len = (obj.last_hour || 0) * 60 - (start.getHours() * 60 + start.getMinutes()) || 1; return start * 1 + (scheduler2._get_fictional_event_length(start, len, obj) - len); }; @@ -2323,106 +3516,10 @@ function extend$h(scheduler2) { } return payload.apply(this, arguments); }; - }(scheduler2._waiAria[i]); - } - })(); -} -var uidSeed = Date.now(); -function uid() { - return uidSeed++; -} -function isArray(obj) { - if (Array.isArray) { - return Array.isArray(obj); - } else { - return obj && obj.length !== void 0 && obj.pop && obj.push; - } -} -function isStringObject(obj) { - return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function String() { [native code] }"; -} -function isNumberObject(obj) { - return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Number() { [native code] }"; -} -function isBooleanObject(obj) { - return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Boolean() { [native code] }"; -} -function isDate(obj) { - if (obj && typeof obj === "object") { - return !!(obj.getFullYear && obj.getMonth && obj.getDate); - } else { - return false; - } -} -function defined(obj) { - return typeof obj != "undefined"; -} -function delay(callback, timeout) { - var timer; - var result = function() { - result.$cancelTimeout(); - result.$pending = true; - var args = Array.prototype.slice.call(arguments); - timer = setTimeout(function() { - callback.apply(this, args); - result.$pending = false; - }, timeout); - }; - result.$pending = false; - result.$cancelTimeout = function() { - clearTimeout(timer); - result.$pending = false; - }; - result.$execute = function() { - var args = Array.prototype.slice.call(arguments); - callback.apply(this, args); - result.$cancelTimeout(); - }; - return result; -} -const utils = { uid, mixin: function mixin(target, source, force) { - for (var f in source) - if (target[f] === void 0 || force) - target[f] = source[f]; - return target; -}, copy: function copy(object) { - var i, result; - if (object && typeof object == "object") { - switch (true) { - case isDate(object): - result = new Date(object); - break; - case isArray(object): - result = new Array(object.length); - for (i = 0; i < object.length; i++) { - result[i] = copy(object[i]); - } - break; - case isStringObject(object): - result = new String(object); - break; - case isNumberObject(object): - result = new Number(object); - break; - case isBooleanObject(object): - result = new Boolean(object); - break; - default: - result = {}; - for (i in object) { - const varType = typeof object[i]; - if (varType === "string" || varType === "number" || varType === "boolean") { - result[i] = object[i]; - } else if (isDate(object[i])) { - result[i] = new Date(object[i]); - } else if (Object.prototype.hasOwnProperty.apply(object, [i])) - result[i] = copy(object[i]); - } - break; + }(scheduler2._waiAria[i]); } - } - return result || object; -}, defined, isDate, delay }; + })(); +} function elementPosition(elem) { var top = 0, left = 0, right = 0, bottom = 0; if (elem.getBoundingClientRect) { @@ -2451,7 +3548,7 @@ function elementPosition(elem) { function getRelativeEventPosition(ev, node) { var d = document.documentElement; var box = elementPosition(node); - return { x: ev.clientX + d.scrollLeft - d.clientLeft - box.x + node.scrollLeft, y: ev.clientY + d.scrollTop - d.clientTop - box.y + node.scrollTop }; + return { x: ev.clientX - d.clientLeft - box.x + node.scrollLeft, y: ev.clientY - d.clientTop - box.y + node.scrollTop }; } function getNodePosition(elem) { var top = 0, left = 0, right = 0, bottom = 0; @@ -3288,7 +4385,7 @@ function extend$e(scheduler2) { } }; } function extend$d(scheduler2) { - scheduler2.config = { default_date: "%j %M %Y", month_date: "%F %Y", load_date: "%Y-%m-%d", week_date: "%l", day_date: "%D %j", hour_date: "%H:%i", month_day: "%d", date_format: "%Y-%m-%d %H:%i", api_date: "%d-%m-%Y %H:%i", parse_exact_format: false, preserve_length: true, time_step: 5, displayed_event_color: "#ff4a4a", displayed_event_text_color: "#ffef80", wide_form: 0, day_column_padding: 8, use_select_menu_space: true, fix_tab_position: true, start_on_monday: true, first_hour: 0, last_hour: 24, readonly: false, drag_resize: true, drag_move: true, drag_create: true, drag_event_body: true, dblclick_create: true, details_on_dblclick: true, edit_on_create: true, details_on_create: true, header: null, hour_size_px: 44, resize_month_events: false, resize_month_timed: false, responsive_lightbox: false, separate_short_events: true, rtl: false, cascade_event_display: false, cascade_event_count: 4, cascade_event_margin: 30, multi_day: true, multi_day_height_limit: 200, drag_lightbox: true, preserve_scroll: true, select: true, server_utc: false, touch: true, touch_tip: true, touch_drag: 500, touch_swipe_dates: false, quick_info_detached: true, positive_closing: false, drag_highlight: true, limit_drag_out: false, icons_edit: ["icon_save", "icon_cancel"], icons_select: ["icon_details", "icon_edit", "icon_delete"], buttons_left: ["dhx_save_btn", "dhx_cancel_btn"], buttons_right: ["dhx_delete_btn"], lightbox: { sections: [{ name: "description", map_to: "text", type: "textarea", focus: true }, { name: "time", height: 72, type: "time", map_to: "auto" }] }, highlight_displayed_event: true, left_border: false, ajax_error: "alert", delay_render: 0, timeline_swap_resize: true, wai_aria_attributes: true, wai_aria_application_role: true, csp: "auto", event_attribute: "data-event-id", show_errors: true }; + scheduler2.config = { default_date: "%j %M %Y", month_date: "%F %Y", load_date: "%Y-%m-%d", week_date: "%l", day_date: "%D %j", hour_date: "%H:%i", month_day: "%d", date_format: "%Y-%m-%d %H:%i", api_date: "%d-%m-%Y %H:%i", parse_exact_format: false, preserve_length: true, time_step: 5, displayed_event_color: "#ff4a4a", displayed_event_text_color: "#ffef80", wide_form: 0, day_column_padding: 8, use_select_menu_space: true, fix_tab_position: true, start_on_monday: true, first_hour: 0, last_hour: 24, readonly: false, drag_resize: true, drag_move: true, drag_create: true, drag_event_body: true, dblclick_create: true, details_on_dblclick: true, edit_on_create: true, details_on_create: true, header: null, hour_size_px: 44, resize_month_events: false, resize_month_timed: false, responsive_lightbox: false, separate_short_events: true, rtl: false, cascade_event_display: false, cascade_event_count: 4, cascade_event_margin: 30, multi_day: true, multi_day_height_limit: 200, drag_lightbox: true, preserve_scroll: true, select: true, undo_deleted: true, server_utc: false, touch: true, touch_tip: true, touch_drag: 500, touch_swipe_dates: false, quick_info_detached: true, positive_closing: false, drag_highlight: true, limit_drag_out: false, icons_edit: ["icon_save", "icon_cancel"], icons_select: ["icon_details", "icon_edit", "icon_delete"], buttons_left: ["dhx_save_btn", "dhx_cancel_btn"], buttons_right: ["dhx_delete_btn"], lightbox: { sections: [{ name: "description", map_to: "text", type: "textarea", focus: true }, { name: "time", height: 72, type: "time", map_to: "auto" }] }, highlight_displayed_event: true, left_border: false, ajax_error: "alert", delay_render: 0, timeline_swap_resize: true, wai_aria_attributes: true, wai_aria_application_role: true, csp: "auto", event_attribute: "data-event-id", show_errors: true }; scheduler2.config.buttons_left.$initial = scheduler2.config.buttons_left.join(); scheduler2.config.buttons_right.$initial = scheduler2.config.buttons_right.join(); scheduler2._helpers = { parseDate: function parseDate(date) { @@ -4150,7 +5247,10 @@ function extend$c(scheduler2) { cs2 += " dhx_cal_event_cascade"; } var boxWidth = w - 1; - var html = '
'; + var html = `
+
`; d.innerHTML = html; var container = d.cloneNode(true).firstChild; if (!bottom && scheduler2.renderEvent(container, ev, w, h, contentA, contentB)) { @@ -4980,21 +6080,21 @@ function extend$6(scheduler2) { case "%Y": selectBoxClass = "dhx_lightbox_year_select"; sns._time_format_order[3] = p; - var range; + var range2; var start_year; var end_year; if (sns.year_range) { if (!isNaN(sns.year_range)) { - range = sns.year_range; + range2 = sns.year_range; } else if (sns.year_range.push) { start_year = sns.year_range[0]; end_year = sns.year_range[1]; } } - range = range || 10; - var offset = offset || Math.floor(range / 2); + range2 = range2 || 10; + var offset = offset || Math.floor(range2 / 2); start_year = start_year || dt.getFullYear() - offset; - end_year = end_year || start_year + range; + end_year = end_year || start_year + range2; for (var i = start_year; i < end_year; i++) options += ""; break; @@ -5476,7 +6576,7 @@ function extend$6(scheduler2) { if (typeof label_name !== "string") { label_name = sns[i].name; } - html += "
" + button + "
" + block.render.call(this, sns[i]); + html += "
" + button + "
" + block.render.call(this, sns[i]); html += "
"; } var ds = d.getElementsByTagName("div"); @@ -6246,8180 +7346,11198 @@ function extendScheduler(scheduler2, dp) { if (this._is_virtual_event) { return !this._is_virtual_event(id2); } - return true; - }; - scheduler2.setUserData = function(id2, name, value) { - if (id2) { - var ev = this.getEvent(id2); - if (ev) - ev[name] = value; + return true; + }; + scheduler2.setUserData = function(id2, name, value) { + if (id2) { + var ev = this.getEvent(id2); + if (ev) + ev[name] = value; + } else { + this._userdata[name] = value; + } + }; + scheduler2.getUserData = function(id2, name) { + if (id2) { + var ev = this.getEvent(id2); + if (ev) + return ev[name]; + else + return null; + } else { + return this._userdata[name]; + } + }; + scheduler2._set_event_text_style = function(id2, style) { + if (!scheduler2.getEvent(id2)) + return; + this.for_rendered(id2, function(r) { + r.style.cssText += ";" + style; + }); + var ev = this.getEvent(id2); + ev["_text_style"] = style; + this.event_updated(ev); + }; + scheduler2._update_callback = function(upd, id2) { + var data = scheduler2._xmlNodeToJSON(upd.firstChild); + if (data.rec_type == "none") + data.rec_pattern = "none"; + data.text = data.text || data._tagvalue; + data.start_date = scheduler2._helpers.parseDate(data.start_date); + data.end_date = scheduler2._helpers.parseDate(data.end_date); + scheduler2.addEvent(data); + if (scheduler2._add_rec_marker) + scheduler2.setCurrentView(); + }; + scheduler2._dp_change_event_id = function(id2, new_id) { + if (!scheduler2.getEvent(id2)) + return; + scheduler2.changeEventId(id2, new_id); + }; + scheduler2._dp_hook_delete = function(id2, new_id) { + if (!scheduler2.getEvent(id2)) + return; + if (new_id && id2 != new_id) { + if (this.getUserData(id2, dp.action_param) == "true_deleted") + this.setUserData(id2, dp.action_param, "updated"); + this.changeEventId(id2, new_id); + } + return this.deleteEvent(new_id, true); + }; + scheduler2.setDp = function() { + this._dp = dp; + }; + scheduler2.setDp(); +} +function DataProcessor(serverProcessorURL) { + this.serverProcessor = serverProcessorURL; + this.action_param = "!nativeeditor_status"; + this.object = null; + this.updatedRows = []; + this.autoUpdate = true; + this.updateMode = "cell"; + this._tMode = "GET"; + this._headers = null; + this._payload = null; + this.post_delim = "_"; + this._waitMode = 0; + this._in_progress = {}; + this._invalid = {}; + this.messages = []; + this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }; + this.enableUTFencoding(true); + makeEventable(this); + return this; +} +DataProcessor.prototype = { setTransactionMode: function(mode, total) { + if (typeof mode == "object") { + this._tMode = mode.mode || this._tMode; + if (mode.headers !== void 0) { + this._headers = mode.headers; + } + if (mode.payload !== void 0) { + this._payload = mode.payload; + } + this._tSend = !!total; + } else { + this._tMode = mode; + this._tSend = total; + } + if (this._tMode == "REST") { + this._tSend = false; + this._endnm = true; + } + if (this._tMode === "JSON" || this._tMode === "REST-JSON") { + this._tSend = false; + this._endnm = true; + this._serializeAsJson = true; + this._headers = this._headers || {}; + this._headers["Content-Type"] = "application/json"; + } else { + if (this._headers && !this._headers["Content-Type"]) { + this._headers["Content-Type"] = "application/x-www-form-urlencoded"; + } + } + if (this._tMode === "CUSTOM") { + this._tSend = false; + this._endnm = true; + this._router = mode.router; + } +}, escape: function(data) { + if (this._utf) + return encodeURIComponent(data); + else + return escape(data); +}, enableUTFencoding: function(mode) { + this._utf = !!mode; +}, setDataColumns: function(val) { + this._columns = typeof val == "string" ? val.split(",") : val; +}, getSyncState: function() { + return !this.updatedRows.length; +}, enableDataNames: function(mode) { + this._endnm = !!mode; +}, enablePartialDataSend: function(mode) { + this._changed = !!mode; +}, setUpdateMode: function(mode, dnd) { + this.autoUpdate = mode == "cell"; + this.updateMode = mode; + this.dnd = dnd; +}, ignore: function(code, master) { + this._silent_mode = true; + code.call(master || window); + this._silent_mode = false; +}, setUpdated: function(rowId, state, mode) { + if (this._silent_mode) + return; + var ind = this.findRow(rowId); + mode = mode || "updated"; + var existing = this.$scheduler.getUserData(rowId, this.action_param); + if (existing && mode == "updated") + mode = existing; + if (state) { + this.set_invalid(rowId, false); + this.updatedRows[ind] = rowId; + this.$scheduler.setUserData(rowId, this.action_param, mode); + if (this._in_progress[rowId]) + this._in_progress[rowId] = "wait"; + } else { + if (!this.is_invalid(rowId)) { + this.updatedRows.splice(ind, 1); + this.$scheduler.setUserData(rowId, this.action_param, ""); + } + } + this.markRow(rowId, state, mode); + if (state && this.autoUpdate) + this.sendData(rowId); +}, markRow: function(id2, state, mode) { + var str = ""; + var invalid = this.is_invalid(id2); + if (invalid) { + str = this.styles[invalid]; + state = true; + } + if (this.callEvent("onRowMark", [id2, state, mode, invalid])) { + str = this.styles[state ? mode : "clear"] + str; + this.$scheduler[this._methods[0]](id2, str); + if (invalid && invalid.details) { + str += this.styles[invalid + "_cell"]; + for (var i = 0; i < invalid.details.length; i++) + if (invalid.details[i]) + this.$scheduler[this._methods[1]](id2, i, str); + } + } +}, getActionByState: function(state) { + if (state === "inserted") { + return "create"; + } + if (state === "updated") { + return "update"; + } + if (state === "deleted") { + return "delete"; + } + return "update"; +}, getState: function(id2) { + return this.$scheduler.getUserData(id2, this.action_param); +}, is_invalid: function(id2) { + return this._invalid[id2]; +}, set_invalid: function(id2, mode, details) { + if (details) + mode = { value: mode, details, toString: function() { + return this.value.toString(); + } }; + this._invalid[id2] = mode; +}, checkBeforeUpdate: function(rowId) { + return true; +}, sendData: function(rowId) { + if (this.$scheduler.editStop) + this.$scheduler.editStop(); + if (typeof rowId == "undefined" || this._tSend) + return this.sendAllData(); + if (this._in_progress[rowId]) + return false; + this.messages = []; + if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidationError", [rowId, this.messages])) + return false; + this._beforeSendData(this._getRowData(rowId), rowId); +}, _beforeSendData: function(data, rowId) { + if (!this.callEvent("onBeforeUpdate", [rowId, this.getState(rowId), data])) + return false; + this._sendData(data, rowId); +}, serialize: function(data, id2) { + if (this._serializeAsJson) { + return this._serializeAsJSON(data); + } + if (typeof data == "string") + return data; + if (typeof id2 != "undefined") + return this.serialize_one(data, ""); + else { + var stack = []; + var keys = []; + for (var key in data) + if (data.hasOwnProperty(key)) { + stack.push(this.serialize_one(data[key], key + this.post_delim)); + keys.push(key); + } + stack.push("ids=" + this.escape(keys.join(","))); + if (this.$scheduler.security_key) + stack.push("dhx_security=" + this.$scheduler.security_key); + return stack.join("&"); + } +}, serialize_one: function(data, pref) { + if (typeof data == "string") + return data; + var stack = []; + var serialized = ""; + for (var key in data) + if (data.hasOwnProperty(key)) { + if ((key == "id" || key == this.action_param) && this._tMode == "REST") + continue; + if (typeof data[key] === "string" || typeof data[key] === "number") { + serialized = data[key]; + } else { + serialized = JSON.stringify(data[key]); + } + stack.push(this.escape((pref || "") + key) + "=" + this.escape(serialized)); + } + return stack.join("&"); +}, _applyPayload: function(url2) { + var ajax = this.$scheduler.ajax; + if (this._payload) + for (var key in this._payload) + url2 = url2 + ajax.urlSeparator(url2) + this.escape(key) + "=" + this.escape(this._payload[key]); + return url2; +}, _sendData: function(dataToSend, rowId) { + if (!dataToSend) { + return; + } + if (!this.callEvent("onBeforeDataSending", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) { + return false; + } + if (rowId) { + this._in_progress[rowId] = (/* @__PURE__ */ new Date()).valueOf(); + } + var self = this; + var ajax = this.$scheduler.ajax; + if (this._tMode === "CUSTOM") { + var state = this.getState(rowId); + var action = this.getActionByState(state); + var _onResolvedCreateUpdate = function(tag) { + var resultState = state; + if (tag && tag.responseText && tag.setRequestHeader) { + if (tag.status !== 200) { + resultState = "error"; + } + try { + tag = JSON.parse(tag.responseText); + } catch (e) { + } + } + resultState = resultState || "updated"; + var sid = rowId; + var tid = rowId; + if (tag) { + resultState = tag.action || resultState; + sid = tag.sid || sid; + tid = tag.id || tag.tid || tid; + } + self.afterUpdateCallback(sid, tid, resultState, tag); + }; + const routerMode = "event"; + var actionPromise; + if (this._router instanceof Function) { + actionPromise = this._router(routerMode, action, dataToSend, rowId); } else { - this._userdata[name] = value; + switch (state) { + case "inserted": + actionPromise = this._router[routerMode].create(dataToSend); + break; + case "deleted": + actionPromise = this._router[routerMode].delete(rowId); + break; + default: + actionPromise = this._router[routerMode].update(dataToSend, rowId); + break; + } } - }; - scheduler2.getUserData = function(id2, name) { - if (id2) { - var ev = this.getEvent(id2); - if (ev) - return ev[name]; - else - return null; + if (actionPromise) { + if (!actionPromise.then && (actionPromise.id === void 0 && actionPromise.tid === void 0 && actionPromise.action === void 0)) { + throw new Error("Incorrect router return value. A Promise or a response object is expected"); + } + if (actionPromise.then) { + actionPromise.then(_onResolvedCreateUpdate).catch(function(error) { + if (error && error.action) { + _onResolvedCreateUpdate(error); + } else { + _onResolvedCreateUpdate({ action: "error", value: error }); + } + }); + } else { + _onResolvedCreateUpdate(actionPromise); + } } else { - return this._userdata[name]; + _onResolvedCreateUpdate(null); } - }; - scheduler2._set_event_text_style = function(id2, style) { - if (!scheduler2.getEvent(id2)) - return; - this.for_rendered(id2, function(r) { - r.style.cssText += ";" + style; - }); - var ev = this.getEvent(id2); - ev["_text_style"] = style; - this.event_updated(ev); - }; - scheduler2._update_callback = function(upd, id2) { - var data = scheduler2._xmlNodeToJSON(upd.firstChild); - if (data.rec_type == "none") - data.rec_pattern = "none"; - data.text = data.text || data._tagvalue; - data.start_date = scheduler2._helpers.parseDate(data.start_date); - data.end_date = scheduler2._helpers.parseDate(data.end_date); - scheduler2.addEvent(data); - if (scheduler2._add_rec_marker) - scheduler2.setCurrentView(); - }; - scheduler2._dp_change_event_id = function(id2, new_id) { - if (!scheduler2.getEvent(id2)) - return; - scheduler2.changeEventId(id2, new_id); - }; - scheduler2._dp_hook_delete = function(id2, new_id) { - if (!scheduler2.getEvent(id2)) - return; - if (new_id && id2 != new_id) { - if (this.getUserData(id2, dp.action_param) == "true_deleted") - this.setUserData(id2, dp.action_param, "updated"); - this.changeEventId(id2, new_id); + return; + } + var queryParams = { callback: function(xml) { + var ids = []; + if (rowId) { + ids.push(rowId); + } else if (dataToSend) { + for (var key2 in dataToSend) { + ids.push(key2); + } } - return this.deleteEvent(new_id, true); - }; - scheduler2.setDp = function() { - this._dp = dp; - }; - scheduler2.setDp(); -} -function DataProcessor(serverProcessorURL) { - this.serverProcessor = serverProcessorURL; - this.action_param = "!nativeeditor_status"; - this.object = null; - this.updatedRows = []; - this.autoUpdate = true; - this.updateMode = "cell"; - this._tMode = "GET"; - this._headers = null; - this._payload = null; - this.post_delim = "_"; - this._waitMode = 0; - this._in_progress = {}; - this._invalid = {}; + return self.afterUpdate(self, xml, ids); + }, headers: self._headers }; + var urlParams = this.serverProcessor + (this._user ? ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.$scheduler.getUserData(0, "version")].join("&") : ""); + var url2 = this._applyPayload(urlParams); + var data; + switch (this._tMode) { + case "GET": + data = this._cleanupArgumentsBeforeSend(dataToSend); + queryParams.url = url2 + ajax.urlSeparator(url2) + this.serialize(data, rowId); + queryParams.method = "GET"; + break; + case "POST": + data = this._cleanupArgumentsBeforeSend(dataToSend); + queryParams.url = url2; + queryParams.method = "POST"; + queryParams.data = this.serialize(data, rowId); + break; + case "JSON": + data = {}; + var preprocessedData = this._cleanupItemBeforeSend(dataToSend); + for (var key in preprocessedData) { + if (key === this.action_param || key === "id" || key === "gr_id") { + continue; + } + data[key] = preprocessedData[key]; + } + queryParams.url = url2; + queryParams.method = "POST"; + queryParams.data = JSON.stringify({ id: rowId, action: dataToSend[this.action_param], data }); + break; + case "REST": + case "REST-JSON": + url2 = urlParams.replace(/(&|\?)editing=true/, ""); + data = ""; + switch (this.getState(rowId)) { + case "inserted": + queryParams.method = "POST"; + queryParams.data = this.serialize(dataToSend, rowId); + break; + case "deleted": + queryParams.method = "DELETE"; + url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; + break; + default: + queryParams.method = "PUT"; + queryParams.data = this.serialize(dataToSend, rowId); + url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; + break; + } + queryParams.url = this._applyPayload(url2); + break; + } + this._waitMode++; + return ajax.query(queryParams); +}, sendAllData: function() { + if (!this.updatedRows.length || this.updateMode === "off") { + return; + } this.messages = []; - this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }; - this.enableUTFencoding(true); - makeEventable(this); - return this; -} -DataProcessor.prototype = { setTransactionMode: function(mode, total) { - if (typeof mode == "object") { - this._tMode = mode.mode || this._tMode; - if (mode.headers !== void 0) { - this._headers = mode.headers; - } - if (mode.payload !== void 0) { - this._payload = mode.payload; + var valid = true; + this._forEachUpdatedRow(function(rowId) { + valid = valid && this.checkBeforeUpdate(rowId); + }); + if (!valid && !this.callEvent("onValidationError", ["", this.messages])) { + return false; + } + if (this._tSend) { + this._sendData(this._getAllData()); + } else { + this._forEachUpdatedRow(function(rowId) { + if (!this._in_progress[rowId]) { + if (this.is_invalid(rowId)) { + return; + } + this._beforeSendData(this._getRowData(rowId), rowId); + } + }); + } +}, _getAllData: function(rowId) { + var out = {}; + var has_one = false; + this._forEachUpdatedRow(function(id2) { + if (this._in_progress[id2] || this.is_invalid(id2)) { + return; } - this._tSend = !!total; - } else { - this._tMode = mode; - this._tSend = total; + var row = this._getRowData(id2); + if (!this.callEvent("onBeforeUpdate", [id2, this.getState(id2), row])) { + return; + } + out[id2] = row; + has_one = true; + this._in_progress[id2] = (/* @__PURE__ */ new Date()).valueOf(); + }); + return has_one ? out : null; +}, findRow: function(pattern) { + var i = 0; + for (i = 0; i < this.updatedRows.length; i++) + if (pattern == this.updatedRows[i]) + break; + return i; +}, defineAction: function(name, handler) { + if (!this._uActions) + this._uActions = {}; + this._uActions[name] = handler; +}, afterUpdateCallback: function(sid, tid, action, btag) { + if (!this.$scheduler) { + return; } - if (this._tMode == "REST") { - this._tSend = false; - this._endnm = true; + var marker2 = sid; + var correct = action !== "error" && action !== "invalid"; + if (!correct) { + this.set_invalid(sid, action); } - if (this._tMode === "JSON" || this._tMode === "REST-JSON") { - this._tSend = false; - this._endnm = true; - this._serializeAsJson = true; - this._headers = this._headers || {}; - this._headers["Content-Type"] = "application/json"; - } else { - if (this._headers && !this._headers["Content-Type"]) { - this._headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (this._uActions && this._uActions[action] && !this._uActions[action](btag)) { + return delete this._in_progress[marker2]; + } + if (this._in_progress[marker2] !== "wait") { + this.setUpdated(sid, false); + } + var originalSid = sid; + switch (action) { + case "inserted": + case "insert": + if (tid != sid) { + this.setUpdated(sid, false); + this.$scheduler[this._methods[2]](sid, tid); + sid = tid; + } + break; + case "delete": + case "deleted": + this.$scheduler.setUserData(sid, this.action_param, "true_deleted"); + this.$scheduler[this._methods[3]](sid, tid); + delete this._in_progress[marker2]; + return this.callEvent("onAfterUpdate", [sid, action, tid, btag]); + } + if (this._in_progress[marker2] !== "wait") { + if (correct) { + this.$scheduler.setUserData(sid, this.action_param, ""); } + delete this._in_progress[marker2]; + } else { + delete this._in_progress[marker2]; + this.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param)); } - if (this._tMode === "CUSTOM") { - this._tSend = false; - this._endnm = true; - this._router = mode.router; + this.callEvent("onAfterUpdate", [originalSid, action, tid, btag]); +}, _errorResponse: function(xml, id2) { + if (this.$scheduler && this.$scheduler.callEvent) { + this.$scheduler.callEvent("onSaveError", [id2, xml.xmlDoc]); } -}, escape: function(data) { - if (this._utf) - return encodeURIComponent(data); - else - return escape(data); -}, enableUTFencoding: function(mode) { - this._utf = !!mode; -}, setDataColumns: function(val) { - this._columns = typeof val == "string" ? val.split(",") : val; -}, getSyncState: function() { - return !this.updatedRows.length; -}, enableDataNames: function(mode) { - this._endnm = !!mode; -}, enablePartialDataSend: function(mode) { - this._changed = !!mode; -}, setUpdateMode: function(mode, dnd) { - this.autoUpdate = mode == "cell"; - this.updateMode = mode; - this.dnd = dnd; -}, ignore: function(code, master) { - this._silent_mode = true; - code.call(master || window); - this._silent_mode = false; -}, setUpdated: function(rowId, state, mode) { - if (this._silent_mode) + return this.cleanUpdate(id2); +}, _setDefaultTransactionMode: function() { + if (this.serverProcessor) { + this.setTransactionMode("POST", true); + this.serverProcessor += (this.serverProcessor.indexOf("?") !== -1 ? "&" : "?") + "editing=true"; + this._serverProcessor = this.serverProcessor; + } +}, afterUpdate: function(that, xml, id2) { + var ajax = this.$scheduler.ajax; + if (xml.xmlDoc.status !== 200) { + this._errorResponse(xml, id2); return; - var ind = this.findRow(rowId); - mode = mode || "updated"; - var existing = this.$scheduler.getUserData(rowId, this.action_param); - if (existing && mode == "updated") - mode = existing; - if (state) { - this.set_invalid(rowId, false); - this.updatedRows[ind] = rowId; - this.$scheduler.setUserData(rowId, this.action_param, mode); - if (this._in_progress[rowId]) - this._in_progress[rowId] = "wait"; - } else { - if (!this.is_invalid(rowId)) { - this.updatedRows.splice(ind, 1); - this.$scheduler.setUserData(rowId, this.action_param, ""); + } + var tag; + try { + tag = JSON.parse(xml.xmlDoc.responseText); + } catch (e) { + if (!xml.xmlDoc.responseText.length) { + tag = {}; } } - this.markRow(rowId, state, mode); - if (state && this.autoUpdate) - this.sendData(rowId); -}, markRow: function(id2, state, mode) { - var str = ""; - var invalid = this.is_invalid(id2); - if (invalid) { - str = this.styles[invalid]; - state = true; + if (tag) { + var action = tag.action || this.getState(id2) || "updated"; + var sid = tag.sid || id2[0]; + var tid = tag.tid || id2[0]; + that.afterUpdateCallback(sid, tid, action, tag); + that.finalizeUpdate(); + return; } - if (this.callEvent("onRowMark", [id2, state, mode, invalid])) { - str = this.styles[state ? mode : "clear"] + str; - this.$scheduler[this._methods[0]](id2, str); - if (invalid && invalid.details) { - str += this.styles[invalid + "_cell"]; - for (var i = 0; i < invalid.details.length; i++) - if (invalid.details[i]) - this.$scheduler[this._methods[1]](id2, i, str); - } + var top = ajax.xmltop("data", xml.xmlDoc); + if (!top) { + return this._errorResponse(xml, id2); } -}, getActionByState: function(state) { - if (state === "inserted") { - return "create"; + var atag = ajax.xpath("//data/action", top); + if (!atag.length) { + return this._errorResponse(xml, id2); } - if (state === "updated") { - return "update"; + for (var i = 0; i < atag.length; i++) { + var btag = atag[i]; + var action = btag.getAttribute("type"); + var sid = btag.getAttribute("sid"); + var tid = btag.getAttribute("tid"); + that.afterUpdateCallback(sid, tid, action, btag); } - if (state === "deleted") { - return "delete"; + that.finalizeUpdate(); +}, cleanUpdate: function(id2) { + if (id2) + for (var i = 0; i < id2.length; i++) + delete this._in_progress[id2[i]]; +}, finalizeUpdate: function() { + if (this._waitMode) + this._waitMode--; + this.callEvent("onAfterUpdateFinish", []); + if (!this.updatedRows.length) + this.callEvent("onFullSync", []); +}, init: function(scheduler2) { + if (this._initialized) { + return; } - return "update"; -}, getState: function(id2) { - return this.$scheduler.getUserData(id2, this.action_param); -}, is_invalid: function(id2) { - return this._invalid[id2]; -}, set_invalid: function(id2, mode, details) { - if (details) - mode = { value: mode, details, toString: function() { - return this.value.toString(); - } }; - this._invalid[id2] = mode; -}, checkBeforeUpdate: function(rowId) { - return true; -}, sendData: function(rowId) { - if (this.$scheduler.editStop) - this.$scheduler.editStop(); - if (typeof rowId == "undefined" || this._tSend) - return this.sendAllData(); - if (this._in_progress[rowId]) - return false; - this.messages = []; - if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidationError", [rowId, this.messages])) - return false; - this._beforeSendData(this._getRowData(rowId), rowId); -}, _beforeSendData: function(data, rowId) { - if (!this.callEvent("onBeforeUpdate", [rowId, this.getState(rowId), data])) + this.$scheduler = scheduler2; + if (this.$scheduler._dp_init) { + this.$scheduler._dp_init(this); + } + this._setDefaultTransactionMode(); + this._methods = this._methods || ["_set_event_text_style", "", "_dp_change_event_id", "_dp_hook_delete"]; + extendScheduler(this.$scheduler, this); + var dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this); + dataProcessorEvents.attach(); + this.attachEvent("onDestroy", function() { + delete this._getRowData; + delete this.$scheduler._dp; + delete this.$scheduler._dataprocessor; + delete this.$scheduler._set_event_text_style; + delete this.$scheduler._dp_change_event_id; + delete this.$scheduler._dp_hook_delete; + delete this.$scheduler; + dataProcessorEvents.detach(); + }); + this.$scheduler.callEvent("onDataProcessorReady", [this]); + this._initialized = true; + scheduler2._dataprocessor = this; +}, setOnAfterUpdate: function(ev) { + this.attachEvent("onAfterUpdate", ev); +}, setOnBeforeUpdateHandler: function(func) { + this.attachEvent("onBeforeDataSending", func); +}, setAutoUpdate: function(interval, user) { + interval = interval || 2e3; + this._user = user || (/* @__PURE__ */ new Date()).valueOf(); + this._need_update = false; + this._update_busy = false; + this.attachEvent("onAfterUpdate", function(sid, action, tid, xml_node) { + this.afterAutoUpdate(sid, action, tid, xml_node); + }); + this.attachEvent("onFullSync", function() { + this.fullSync(); + }); + var self = this; + let intervalId = global$1.setInterval(function() { + self.loadUpdate(); + }, interval); + this.attachEvent("onDestroy", function() { + clearInterval(intervalId); + }); +}, afterAutoUpdate: function(sid, action, tid, xml_node) { + if (action == "collision") { + this._need_update = true; return false; - this._sendData(data, rowId); -}, serialize: function(data, id2) { - if (this._serializeAsJson) { - return this._serializeAsJSON(data); + } else { + return true; } - if (typeof data == "string") - return data; - if (typeof id2 != "undefined") - return this.serialize_one(data, ""); - else { - var stack = []; - var keys = []; - for (var key in data) - if (data.hasOwnProperty(key)) { - stack.push(this.serialize_one(data[key], key + this.post_delim)); - keys.push(key); - } - stack.push("ids=" + this.escape(keys.join(","))); - if (this.$scheduler.security_key) - stack.push("dhx_security=" + this.$scheduler.security_key); - return stack.join("&"); +}, fullSync: function() { + if (this._need_update) { + this._need_update = false; + this.loadUpdate(); } -}, serialize_one: function(data, pref) { - if (typeof data == "string") - return data; - var stack = []; - var serialized = ""; - for (var key in data) - if (data.hasOwnProperty(key)) { - if ((key == "id" || key == this.action_param) && this._tMode == "REST") - continue; - if (typeof data[key] === "string" || typeof data[key] === "number") { - serialized = data[key]; - } else { - serialized = JSON.stringify(data[key]); - } - stack.push(this.escape((pref || "") + key) + "=" + this.escape(serialized)); - } - return stack.join("&"); -}, _applyPayload: function(url2) { + return true; +}, getUpdates: function(url2, callback) { var ajax = this.$scheduler.ajax; - if (this._payload) - for (var key in this._payload) - url2 = url2 + ajax.urlSeparator(url2) + this.escape(key) + "=" + this.escape(this._payload[key]); - return url2; -}, _sendData: function(dataToSend, rowId) { - if (!dataToSend) { - return; - } - if (!this.callEvent("onBeforeDataSending", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) { + if (this._update_busy) return false; + else + this._update_busy = true; + ajax.get(url2, callback); +}, _getXmlNodeValue: function(node) { + if (node.firstChild) { + return node.firstChild.nodeValue; } - if (rowId) { - this._in_progress[rowId] = (/* @__PURE__ */ new Date()).valueOf(); - } + return ""; +}, loadUpdate: function() { var self = this; var ajax = this.$scheduler.ajax; - if (this._tMode === "CUSTOM") { - var state = this.getState(rowId); - var action = this.getActionByState(state); - var _onResolvedCreateUpdate = function(tag) { - var resultState = state; - if (tag && tag.responseText && tag.setRequestHeader) { - if (tag.status !== 200) { - resultState = "error"; - } - try { - tag = JSON.parse(tag.responseText); - } catch (e) { + var version = this.$scheduler.getUserData(0, "version"); + var url2 = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + version].join("&"); + url2 = url2.replace("editing=true&", ""); + this.getUpdates(url2, function(xml) { + var vers = ajax.xpath("//userdata", xml); + self.$scheduler.setUserData(0, "version", self._getXmlNodeValue(vers[0])); + var updates = ajax.xpath("//update", xml); + if (updates.length) { + self._silent_mode = true; + for (var i = 0; i < updates.length; i++) { + var status = updates[i].getAttribute("status"); + var id2 = updates[i].getAttribute("id"); + var parent = updates[i].getAttribute("parent"); + switch (status) { + case "inserted": + this.callEvent("insertCallback", [updates[i], id2, parent]); + break; + case "updated": + this.callEvent("updateCallback", [updates[i], id2, parent]); + break; + case "deleted": + this.callEvent("deleteCallback", [updates[i], id2, parent]); + break; } } - resultState = resultState || "updated"; - var sid = rowId; - var tid = rowId; - if (tag) { - resultState = tag.action || resultState; - sid = tag.sid || sid; - tid = tag.id || tag.tid || tid; - } - self.afterUpdateCallback(sid, tid, resultState, tag); - }; - const routerMode = "event"; - var actionPromise; - if (this._router instanceof Function) { - actionPromise = this._router(routerMode, action, dataToSend, rowId); - } else { - switch (state) { - case "inserted": - actionPromise = this._router[routerMode].create(dataToSend); - break; - case "deleted": - actionPromise = this._router[routerMode].delete(rowId); - break; - default: - actionPromise = this._router[routerMode].update(dataToSend, rowId); - break; - } - } - if (actionPromise) { - if (!actionPromise.then && (actionPromise.id === void 0 && actionPromise.tid === void 0 && actionPromise.action === void 0)) { - throw new Error("Incorrect router return value. A Promise or a response object is expected"); - } - if (actionPromise.then) { - actionPromise.then(_onResolvedCreateUpdate).catch(function(error) { - if (error && error.action) { - _onResolvedCreateUpdate(error); - } else { - _onResolvedCreateUpdate({ action: "error", value: error }); - } - }); - } else { - _onResolvedCreateUpdate(actionPromise); - } - } else { - _onResolvedCreateUpdate(null); + self._silent_mode = false; } - return; + self._update_busy = false; + self = null; + }); +}, destructor: function() { + this.callEvent("onDestroy", []); + this.detachAllEvents(); + this.updatedRows = []; + this._in_progress = {}; + this._invalid = {}; + this._headers = null; + this._payload = null; + delete this._initialized; +}, url: function(url2) { + this.serverProcessor = this._serverProcessor = url2; +}, _serializeAsJSON: function(data) { + if (typeof data === "string") { + return data; } - var queryParams = { callback: function(xml) { - var ids = []; - if (rowId) { - ids.push(rowId); - } else if (dataToSend) { - for (var key2 in dataToSend) { - ids.push(key2); - } + var copy2 = this.$scheduler.utils.copy(data); + if (this._tMode === "REST-JSON") { + delete copy2.id; + delete copy2[this.action_param]; + } + return JSON.stringify(copy2); +}, _cleanupArgumentsBeforeSend: function(dataToSend) { + var processedData; + if (dataToSend[this.action_param] === void 0) { + processedData = {}; + for (var i in dataToSend) { + processedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]); } - return self.afterUpdate(self, xml, ids); - }, headers: self._headers }; - var urlParams = this.serverProcessor + (this._user ? ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.$scheduler.getUserData(0, "version")].join("&") : ""); - var url2 = this._applyPayload(urlParams); - var data; - switch (this._tMode) { - case "GET": - data = this._cleanupArgumentsBeforeSend(dataToSend); - queryParams.url = url2 + ajax.urlSeparator(url2) + this.serialize(data, rowId); - queryParams.method = "GET"; - break; - case "POST": - data = this._cleanupArgumentsBeforeSend(dataToSend); - queryParams.url = url2; - queryParams.method = "POST"; - queryParams.data = this.serialize(data, rowId); - break; - case "JSON": - data = {}; - var preprocessedData = this._cleanupItemBeforeSend(dataToSend); - for (var key in preprocessedData) { - if (key === this.action_param || key === "id" || key === "gr_id") { - continue; - } - data[key] = preprocessedData[key]; - } - queryParams.url = url2; - queryParams.method = "POST"; - queryParams.data = JSON.stringify({ id: rowId, action: dataToSend[this.action_param], data }); - break; - case "REST": - case "REST-JSON": - url2 = urlParams.replace(/(&|\?)editing=true/, ""); - data = ""; - switch (this.getState(rowId)) { - case "inserted": - queryParams.method = "POST"; - queryParams.data = this.serialize(dataToSend, rowId); - break; - case "deleted": - queryParams.method = "DELETE"; - url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; - break; - default: - queryParams.method = "PUT"; - queryParams.data = this.serialize(dataToSend, rowId); - url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; - break; + } else { + processedData = this._cleanupItemBeforeSend(dataToSend); + } + return processedData; +}, _cleanupItemBeforeSend: function(updatedItem) { + var output = null; + if (updatedItem) { + if (updatedItem[this.action_param] === "deleted") { + output = {}; + output.id = updatedItem.id; + output[this.action_param] = updatedItem[this.action_param]; + } else { + output = updatedItem; + } + } + return output; +}, _forEachUpdatedRow: function(code) { + var updatedRows = this.updatedRows.slice(); + for (var i = 0; i < updatedRows.length; i++) { + var rowId = updatedRows[i]; + if (this.$scheduler.getUserData(rowId, this.action_param)) { + code.call(this, rowId); + } + } +}, _prepareDataItem: function(item) { + var processedItem = {}; + var scheduler2 = this.$scheduler; + var copy2 = scheduler2.utils.copy(item); + for (var i in copy2) { + if (i.indexOf("_") === 0) { + continue; + } else if (copy2[i]) { + if (copy2[i].getUTCFullYear) { + processedItem[i] = scheduler2._helpers.formatDate(copy2[i]); + } else if (typeof copy2[i] == "object") { + processedItem[i] = this._prepareDataItem(copy2[i]); + } else if (copy2[i] === null) { + processedItem[i] = ""; + } else { + processedItem[i] = copy2[i]; } - queryParams.url = this._applyPayload(url2); - break; + } } - this._waitMode++; - return ajax.query(queryParams); -}, sendAllData: function() { - if (!this.updatedRows.length || this.updateMode === "off") { - return; + processedItem[this.action_param] = scheduler2.getUserData(item.id, this.action_param); + return processedItem; +}, _getRowData: function(id2) { + var dataItem = this.$scheduler.getEvent(id2); + if (!dataItem) { + dataItem = { id: id2 }; } - this.messages = []; - var valid = true; - this._forEachUpdatedRow(function(rowId) { - valid = valid && this.checkBeforeUpdate(rowId); - }); - if (!valid && !this.callEvent("onValidationError", ["", this.messages])) { - return false; + return this._prepareDataItem(dataItem); +} }; +function extend(scheduler2) { + scheduler2.createDataProcessor = function(config) { + var router; + var tMode; + if (config instanceof Function) { + router = config; + } else if (config.hasOwnProperty("router")) { + router = config.router; + } else if (config.hasOwnProperty("event")) { + router = config; + } + if (router) { + tMode = "CUSTOM"; + } else { + tMode = config.mode || "REST-JSON"; + } + var dp = new DataProcessor(config.url); + dp.init(scheduler2); + dp.setTransactionMode({ mode: tMode, router }, config.batchUpdate); + return dp; + }; + scheduler2.DataProcessor = DataProcessor; +} +function message(scheduler2) { + var boxAttribute = "data-dhxbox"; + var _dhx_msg_cfg = null; + function callback(config, result) { + var usercall = config.callback; + modalBox.hide(config.box); + _dhx_msg_cfg = config.box = null; + if (usercall) + usercall(result); } - if (this._tSend) { - this._sendData(this._getAllData()); - } else { - this._forEachUpdatedRow(function(rowId) { - if (!this._in_progress[rowId]) { - if (this.is_invalid(rowId)) { - return; + function modal_key(event2) { + if (_dhx_msg_cfg) { + var code = event2.which || event2.keyCode; + var preventDefault = false; + if (messageBox.keyboard) { + if (code == 13 || code == 32) { + var target = event2.target || event2.srcElement; + if (dom_helpers.getClassName(target).indexOf("scheduler_popup_button") > -1 && target.click) { + target.click(); + } else { + callback(_dhx_msg_cfg, true); + preventDefault = true; + } + } + if (code == 27) { + callback(_dhx_msg_cfg, false); + preventDefault = true; } - this._beforeSendData(this._getRowData(rowId), rowId); } - }); - } -}, _getAllData: function(rowId) { - var out = {}; - var has_one = false; - this._forEachUpdatedRow(function(id2) { - if (this._in_progress[id2] || this.is_invalid(id2)) { + if (preventDefault) { + if (event2.preventDefault) { + event2.preventDefault(); + } + return !(event2.cancelBubble = true); + } return; } - var row = this._getRowData(id2); - if (!this.callEvent("onBeforeUpdate", [id2, this.getState(id2), row])) { - return; + } + scheduler2.event(document, "keydown", modal_key, true); + function modality(mode) { + if (!modality.cover) { + modality.cover = document.createElement("div"); + scheduler2.event(modality.cover, "keydown", modal_key); + modality.cover.className = "dhx_modal_cover"; + document.body.appendChild(modality.cover); } - out[id2] = row; - has_one = true; - this._in_progress[id2] = (/* @__PURE__ */ new Date()).valueOf(); - }); - return has_one ? out : null; -}, findRow: function(pattern) { - var i = 0; - for (i = 0; i < this.updatedRows.length; i++) - if (pattern == this.updatedRows[i]) - break; - return i; -}, defineAction: function(name, handler) { - if (!this._uActions) - this._uActions = {}; - this._uActions[name] = handler; -}, afterUpdateCallback: function(sid, tid, action, btag) { - if (!this.$scheduler) { - return; + modality.cover.style.display = mode ? "inline-block" : "none"; } - var marker2 = sid; - var correct = action !== "error" && action !== "invalid"; - if (!correct) { - this.set_invalid(sid, action); + function button(text, classValue, result) { + var buttonAriaAttrs = scheduler2._waiAria.messageButtonAttrString(text); + var name = (classValue || "").toLowerCase().replace(/ /g, "_"); + var buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; + return `
${text}
`; } - if (this._uActions && this._uActions[action] && !this._uActions[action](btag)) { - return delete this._in_progress[marker2]; + function info(text) { + if (!messageBox.area) { + messageBox.area = document.createElement("div"); + messageBox.area.className = "scheduler_message_area dhtmlx_message_area"; + messageBox.area.style[messageBox.position] = "5px"; + document.body.appendChild(messageBox.area); + } + messageBox.hide(text.id); + var message2 = document.createElement("div"); + message2.innerHTML = "
" + text.text + "
"; + message2.className = "scheduler-info dhtmlx-info scheduler-" + text.type + " dhtmlx-" + text.type; + scheduler2.event(message2, "click", function(e) { + if (text.callback) { + text.callback.call(this, e); + } + messageBox.hide(text.id); + text = null; + }); + scheduler2._waiAria.messageInfoAttr(message2); + if (messageBox.position == "bottom" && messageBox.area.firstChild) + messageBox.area.insertBefore(message2, messageBox.area.firstChild); + else + messageBox.area.appendChild(message2); + if (text.expire > 0) + messageBox.timers[text.id] = window.setTimeout(function() { + if (messageBox) + messageBox.hide(text.id); + }, text.expire); + messageBox.pull[text.id] = message2; + message2 = null; + return text.id; } - if (this._in_progress[marker2] !== "wait") { - this.setUpdated(sid, false); + function getFirstDefined() { + var values = [].slice.apply(arguments, [0]); + for (var i = 0; i < values.length; i++) { + if (values[i]) { + return values[i]; + } + } } - var originalSid = sid; - switch (action) { - case "inserted": - case "insert": - if (tid != sid) { - this.setUpdated(sid, false); - this.$scheduler[this._methods[2]](sid, tid); - sid = tid; + function _boxStructure(config, ok, cancel) { + var box = document.createElement("div"); + var contentId = utils.uid(); + scheduler2._waiAria.messageModalAttr(box, contentId); + box.className = " scheduler_modal_box dhtmlx_modal_box scheduler-" + config.type + " dhtmlx-" + config.type; + box.setAttribute(boxAttribute, 1); + var inner = ""; + if (config.width) + box.style.width = config.width; + if (config.height) + box.style.height = config.height; + if (config.title) + inner += '
' + config.title + "
"; + inner += '
' + (config.content ? "" : config.text) + '
'; + if (ok) + inner += button(getFirstDefined(config.ok, scheduler2.locale.labels.message_ok, "OK"), "ok", true); + if (cancel) + inner += button(getFirstDefined(config.cancel, scheduler2.locale.labels.message_cancel, "Cancel"), "cancel", false); + if (config.buttons) { + for (var i = 0; i < config.buttons.length; i++) { + var btn = config.buttons[i]; + if (typeof btn == "object") { + var label = btn.label; + var css = btn.css || "scheduler_" + btn.label.toLowerCase() + "_button dhtmlx_" + btn.label.toLowerCase() + "_button"; + var value = btn.value || i; + inner += button(label, css, value); + } else { + inner += button(btn, btn, i); + } + } + } + inner += "
"; + box.innerHTML = inner; + if (config.content) { + var node = config.content; + if (typeof node == "string") + node = document.getElementById(node); + if (node.style.display == "none") + node.style.display = ""; + box.childNodes[config.title ? 1 : 0].appendChild(node); + } + scheduler2.event(box, "click", function(event2) { + var source = event2.target || event2.srcElement; + if (!source.className) + source = source.parentNode; + if (dom_helpers.closest(source, ".scheduler_popup_button")) { + var result = source.getAttribute("data-result"); + result = result == "true" || (result == "false" ? false : result); + callback(config, result); } - break; - case "delete": - case "deleted": - this.$scheduler.setUserData(sid, this.action_param, "true_deleted"); - this.$scheduler[this._methods[3]](sid, tid); - delete this._in_progress[marker2]; - return this.callEvent("onAfterUpdate", [sid, action, tid, btag]); + }); + config.box = box; + if (ok || cancel) + _dhx_msg_cfg = config; + return box; } - if (this._in_progress[marker2] !== "wait") { - if (correct) { - this.$scheduler.setUserData(sid, this.action_param, ""); - } - delete this._in_progress[marker2]; - } else { - delete this._in_progress[marker2]; - this.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param)); + function _createBox(config, ok, cancel) { + var box = config.tagName ? config : _boxStructure(config, ok, cancel); + if (!config.hidden) + modality(true); + document.body.appendChild(box); + var x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2)); + var y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2)); + if (config.position == "top") + box.style.top = "-3px"; + else + box.style.top = y + "px"; + box.style.left = x + "px"; + scheduler2.event(box, "keydown", modal_key); + modalBox.focus(box); + if (config.hidden) + modalBox.hide(box); + scheduler2.callEvent("onMessagePopup", [box]); + return box; } - this.callEvent("onAfterUpdate", [originalSid, action, tid, btag]); -}, _errorResponse: function(xml, id2) { - if (this.$scheduler && this.$scheduler.callEvent) { - this.$scheduler.callEvent("onSaveError", [id2, xml.xmlDoc]); + function alertPopup(config) { + return _createBox(config, true, false); } - return this.cleanUpdate(id2); -}, _setDefaultTransactionMode: function() { - if (this.serverProcessor) { - this.setTransactionMode("POST", true); - this.serverProcessor += (this.serverProcessor.indexOf("?") !== -1 ? "&" : "?") + "editing=true"; - this._serverProcessor = this.serverProcessor; + function confirmPopup(config) { + return _createBox(config, true, true); } -}, afterUpdate: function(that, xml, id2) { - var ajax = this.$scheduler.ajax; - if (xml.xmlDoc.status !== 200) { - this._errorResponse(xml, id2); - return; + function boxPopup(config) { + return _createBox(config); } - var tag; - try { - tag = JSON.parse(xml.xmlDoc.responseText); - } catch (e) { - if (!xml.xmlDoc.responseText.length) { - tag = {}; + function box_params(text, type, callback2) { + if (typeof text != "object") { + if (typeof type == "function") { + callback2 = type; + type = ""; + } + text = { text, type, callback: callback2 }; } + return text; } - if (tag) { - var action = tag.action || this.getState(id2) || "updated"; - var sid = tag.sid || id2[0]; - var tid = tag.tid || id2[0]; - that.afterUpdateCallback(sid, tid, action, tag); - that.finalizeUpdate(); - return; - } - var top = ajax.xmltop("data", xml.xmlDoc); - if (!top) { - return this._errorResponse(xml, id2); - } - var atag = ajax.xpath("//data/action", top); - if (!atag.length) { - return this._errorResponse(xml, id2); - } - for (var i = 0; i < atag.length; i++) { - var btag = atag[i]; - var action = btag.getAttribute("type"); - var sid = btag.getAttribute("sid"); - var tid = btag.getAttribute("tid"); - that.afterUpdateCallback(sid, tid, action, btag); - } - that.finalizeUpdate(); -}, cleanUpdate: function(id2) { - if (id2) - for (var i = 0; i < id2.length; i++) - delete this._in_progress[id2[i]]; -}, finalizeUpdate: function() { - if (this._waitMode) - this._waitMode--; - this.callEvent("onAfterUpdateFinish", []); - if (!this.updatedRows.length) - this.callEvent("onFullSync", []); -}, init: function(scheduler2) { - if (this._initialized) { - return; - } - this.$scheduler = scheduler2; - if (this.$scheduler._dp_init) { - this.$scheduler._dp_init(this); - } - this._setDefaultTransactionMode(); - this._methods = this._methods || ["_set_event_text_style", "", "_dp_change_event_id", "_dp_hook_delete"]; - extendScheduler(this.$scheduler, this); - var dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this); - dataProcessorEvents.attach(); - this.attachEvent("onDestroy", function() { - delete this._getRowData; - delete this.$scheduler._dp; - delete this.$scheduler._dataprocessor; - delete this.$scheduler._set_event_text_style; - delete this.$scheduler._dp_change_event_id; - delete this.$scheduler._dp_hook_delete; - delete this.$scheduler; - dataProcessorEvents.detach(); - }); - this.$scheduler.callEvent("onDataProcessorReady", [this]); - this._initialized = true; - scheduler2._dataprocessor = this; -}, setOnAfterUpdate: function(ev) { - this.attachEvent("onAfterUpdate", ev); -}, setOnBeforeUpdateHandler: function(func) { - this.attachEvent("onBeforeDataSending", func); -}, setAutoUpdate: function(interval, user) { - interval = interval || 2e3; - this._user = user || (/* @__PURE__ */ new Date()).valueOf(); - this._need_update = false; - this._update_busy = false; - this.attachEvent("onAfterUpdate", function(sid, action, tid, xml_node) { - this.afterAutoUpdate(sid, action, tid, xml_node); - }); - this.attachEvent("onFullSync", function() { - this.fullSync(); - }); - var self = this; - let intervalId = global$1.setInterval(function() { - self.loadUpdate(); - }, interval); - this.attachEvent("onDestroy", function() { - clearInterval(intervalId); - }); -}, afterAutoUpdate: function(sid, action, tid, xml_node) { - if (action == "collision") { - this._need_update = true; - return false; - } else { - return true; - } -}, fullSync: function() { - if (this._need_update) { - this._need_update = false; - this.loadUpdate(); - } - return true; -}, getUpdates: function(url2, callback) { - var ajax = this.$scheduler.ajax; - if (this._update_busy) - return false; - else - this._update_busy = true; - ajax.get(url2, callback); -}, _getXmlNodeValue: function(node) { - if (node.firstChild) { - return node.firstChild.nodeValue; + function params(text, type, expire, id2, callback2) { + if (typeof text != "object") + text = { text, type, expire, id: id2, callback: callback2 }; + text.id = text.id || utils.uid(); + text.expire = text.expire || messageBox.expire; + return text; } - return ""; -}, loadUpdate: function() { - var self = this; - var ajax = this.$scheduler.ajax; - var version = this.$scheduler.getUserData(0, "version"); - var url2 = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + version].join("&"); - url2 = url2.replace("editing=true&", ""); - this.getUpdates(url2, function(xml) { - var vers = ajax.xpath("//userdata", xml); - self.$scheduler.setUserData(0, "version", self._getXmlNodeValue(vers[0])); - var updates = ajax.xpath("//update", xml); - if (updates.length) { - self._silent_mode = true; - for (var i = 0; i < updates.length; i++) { - var status = updates[i].getAttribute("status"); - var id2 = updates[i].getAttribute("id"); - var parent = updates[i].getAttribute("parent"); - switch (status) { - case "inserted": - this.callEvent("insertCallback", [updates[i], id2, parent]); - break; - case "updated": - this.callEvent("updateCallback", [updates[i], id2, parent]); - break; - case "deleted": - this.callEvent("deleteCallback", [updates[i], id2, parent]); - break; - } + var alertBox = function() { + var text = box_params.apply(this, arguments); + text.type = text.type || "confirm"; + return alertPopup(text); + }; + var confirmBox = function() { + var text = box_params.apply(this, arguments); + text.type = text.type || "alert"; + return confirmPopup(text); + }; + var modalBox = function() { + var text = box_params.apply(this, arguments); + text.type = text.type || "alert"; + return boxPopup(text); + }; + modalBox.hide = function(node) { + while (node && node.getAttribute && !node.getAttribute(boxAttribute)) + node = node.parentNode; + if (node) { + node.parentNode.removeChild(node); + modality(false); + scheduler2.callEvent("onAfterMessagePopup", [node]); + } + }; + modalBox.focus = function(node) { + setTimeout(function() { + var focusable = dom_helpers.getFocusableNodes(node); + if (focusable.length) { + if (focusable[0].focus) + focusable[0].focus(); + } + }, 1); + }; + var messageBox = function(text, type, expire, id2) { + text = params.apply(this, arguments); + text.type = text.type || "info"; + var subtype = text.type.split("-")[0]; + switch (subtype) { + case "alert": + return alertPopup(text); + case "confirm": + return confirmPopup(text); + case "modalbox": + return boxPopup(text); + default: + return info(text); + } + }; + messageBox.seed = (/* @__PURE__ */ new Date()).valueOf(); + messageBox.uid = utils.uid; + messageBox.expire = 4e3; + messageBox.keyboard = true; + messageBox.position = "top"; + messageBox.pull = {}; + messageBox.timers = {}; + messageBox.hideAll = function() { + for (var key in messageBox.pull) + messageBox.hide(key); + }; + messageBox.hide = function(id2) { + var obj = messageBox.pull[id2]; + if (obj && obj.parentNode) { + window.setTimeout(function() { + obj.parentNode.removeChild(obj); + obj = null; + }, 2e3); + obj.className += " hidden"; + if (messageBox.timers[id2]) + window.clearTimeout(messageBox.timers[id2]); + delete messageBox.pull[id2]; + } + }; + var popups = []; + scheduler2.attachEvent("onMessagePopup", function(box) { + popups.push(box); + }); + scheduler2.attachEvent("onAfterMessagePopup", function(box) { + for (var i = 0; i < popups.length; i++) { + if (popups[i] === box) { + popups.splice(i, 1); + i--; } - self._silent_mode = false; } - self._update_busy = false; - self = null; }); -}, destructor: function() { - this.callEvent("onDestroy", []); - this.detachAllEvents(); - this.updatedRows = []; - this._in_progress = {}; - this._invalid = {}; - this._headers = null; - this._payload = null; - delete this._initialized; -}, url: function(url2) { - this.serverProcessor = this._serverProcessor = url2; -}, _serializeAsJSON: function(data) { - if (typeof data === "string") { - return data; + scheduler2.attachEvent("onDestroy", function() { + if (modality.cover && modality.cover.parentNode) { + modality.cover.parentNode.removeChild(modality.cover); + } + for (var i = 0; i < popups.length; i++) { + if (popups[i].parentNode) { + popups[i].parentNode.removeChild(popups[i]); + } + } + popups = null; + if (messageBox.area && messageBox.area.parentNode) { + messageBox.area.parentNode.removeChild(messageBox.area); + } + messageBox = null; + }); + return { alert: alertBox, confirm: confirmBox, message: messageBox, modalbox: modalBox }; +} +const ar = { date: { month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"], day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"] }, labels: { dhx_cal_today_button: "اليوم", day_tab: "يوم", week_tab: "أسبوع", month_tab: "شهر", new_event: "حدث جديد", icon_save: "اخزن", icon_cancel: "الغاء", icon_details: "تفاصيل", icon_edit: "تحرير", icon_delete: "حذف", confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟", confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟", section_description: "الوصف", section_time: "الفترة الزمنية", full_day: "طوال اليوم", confirm_recurring: "هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟", section_recurring: "تكرار الحدث", button_recurring: "تعطيل", button_recurring_open: "تمكين", button_edit_series: "تحرير سلسلة", button_edit_occurrence: "تعديل نسخة", grid_tab: "جدول", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "يومي", repeat_radio_week: "أسبوعي", repeat_radio_month: "شهري", repeat_radio_year: "سنوي", repeat_radio_day_type: "كل", repeat_text_day_count: "يوم", repeat_radio_day_type2: "كل يوم عمل", repeat_week: " تكرار كل", repeat_text_week_count: "أسبوع في الأيام التالية:", repeat_radio_month_type: "تكرار", repeat_radio_month_start: "في", repeat_text_month_day: "يوم كل", repeat_text_month_count: "شهر", repeat_text_month_count2_before: "كل", repeat_text_month_count2_after: "شهر", repeat_year_label: "في", select_year_day2: "من", repeat_text_year_day: "يوم", select_year_month: "شهر", repeat_radio_end: "بدون تاريخ انتهاء", repeat_text_occurences_count: "تكرارات", repeat_radio_end2: "بعد", repeat_radio_end3: "ينتهي في", repeat_never: "أبداً", repeat_daily: "كل يوم", repeat_workdays: "كل يوم عمل", repeat_weekly: "كل أسبوع", repeat_monthly: "كل شهر", repeat_yearly: "كل سنة", repeat_custom: "تخصيص", repeat_freq_day: "يوم", repeat_freq_week: "أسبوع", repeat_freq_month: "شهر", repeat_freq_year: "سنة", repeat_on_date: "في التاريخ", repeat_ends: "ينتهي", month_for_recurring: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_for_recurring: ["الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"] } }; +const be = { date: { month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"], month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"], day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"], day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сёння", day_tab: "Дзень", week_tab: "Тыдзень", month_tab: "Месяц", new_event: "Новая падзея", icon_save: "Захаваць", icon_cancel: "Адмяніць", icon_details: "Дэталі", icon_edit: "Змяніць", icon_delete: "Выдаліць", confirm_closing: "", confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?", section_description: "Апісанне", section_time: "Перыяд часу", full_day: "Увесь дзень", confirm_recurring: "Вы хочаце змяніць усю серыю паўтаральных падзей?", section_recurring: "Паўтарэнне", button_recurring: "Адключана", button_recurring_open: "Уключана", button_edit_series: "Рэдагаваць серыю", button_edit_occurrence: "Рэдагаваць асобнік", agenda_tab: "Спіс", date: "Дата", description: "Апісанне", year_tab: "Год", week_agenda_tab: "Спіс", grid_tab: "Спic", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Дзень", repeat_radio_week: "Тыдзень", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Кожны", repeat_text_day_count: "дзень", repeat_radio_day_type2: "Кожны працоўны дзень", repeat_week: " Паўтараць кожны", repeat_text_week_count: "тыдзень", repeat_radio_month_type: "Паўтараць", repeat_radio_month_start: "", repeat_text_month_day: " чысла кожнага", repeat_text_month_count: "месяцу", repeat_text_month_count2_before: "кожны ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "дзень", select_year_month: "", repeat_radio_end: "Без даты заканчэння", repeat_text_occurences_count: "паўтораў", repeat_radio_end2: "", repeat_radio_end3: "Да ", repeat_never: "Ніколі", repeat_daily: "Кожны дзень", repeat_workdays: "Кожны працоўны дзень", repeat_weekly: "Кожны тыдзень", repeat_monthly: "Кожны месяц", repeat_yearly: "Кожны год", repeat_custom: "Наладжвальны", repeat_freq_day: "Дзень", repeat_freq_week: "Тыдзень", repeat_freq_month: "Месяц", repeat_freq_year: "Год", repeat_on_date: "На дату", repeat_ends: "Заканчваецца", month_for_recurring: ["Студзеня", "Лютага", "Сакавіка", "Красавіка", "Мая", "Чэрвеня", "Ліпeня", "Жніўня", "Верасня", "Кастрычніка", "Лістапада", "Снежня"], day_for_recurring: ["Нядзелю", "Панядзелак", "Аўторак", "Сераду", "Чацвер", "Пятніцу", "Суботу"] } }; +const ca = { date: { month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"] }, labels: { dhx_cal_today_button: "Hui", day_tab: "Dia", week_tab: "Setmana", month_tab: "Mes", new_event: "Nou esdeveniment", icon_save: "Guardar", icon_cancel: "Cancel·lar", icon_details: "Detalls", icon_edit: "Editar", icon_delete: "Esborrar", confirm_closing: "", confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?", section_description: "Descripció", section_time: "Periode de temps", full_day: "Tot el dia", confirm_recurring: "¿Desitja modificar el conjunt d'esdeveniments repetits?", section_recurring: "Repeteixca l'esdeveniment", button_recurring: "Impedit", button_recurring_open: "Permés", button_edit_series: "Edit sèrie", button_edit_occurrence: "Edita Instància", agenda_tab: "Agenda", date: "Data", description: "Descripció", year_tab: "Any", week_agenda_tab: "Agenda", grid_tab: "Taula", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diari", repeat_radio_week: "Setmanal", repeat_radio_month: "Mensual", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada dia laborable", repeat_week: " Repetir cada", repeat_text_week_count: "setmana els dies següents:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "de", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sense data de finalització", repeat_text_occurences_count: "ocurrències", repeat_radio_end2: "Després", repeat_radio_end3: "Finalitzar el", repeat_never: "Mai", repeat_daily: "Cada dia", repeat_workdays: "Cada dia laborable", repeat_weekly: "Cada setmana", repeat_monthly: "Cada mes", repeat_yearly: "Cada any", repeat_custom: "Personalitzat", repeat_freq_day: "Dia", repeat_freq_week: "Setmana", repeat_freq_month: "Mes", repeat_freq_year: "Any", repeat_on_date: "En la data", repeat_ends: "Finalitza", month_for_recurring: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], day_for_recurring: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] } }; +const cn = { date: { month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], day_short: ["日", "一", "二", "三", "四", "五", "六"] }, labels: { dhx_cal_today_button: "今天", day_tab: "日", week_tab: "周", month_tab: "月", new_event: "新建日程", icon_save: "保存", icon_cancel: "关闭", icon_details: "详细", icon_edit: "编辑", icon_delete: "删除", confirm_closing: "请确认是否撤销修改!", confirm_deleting: "是否删除日程?", section_description: "描述", section_time: "时间范围", full_day: "整天", confirm_recurring: "请确认是否将日程设为重复模式?", section_recurring: "重复周期", button_recurring: "禁用", button_recurring_open: "启用", button_edit_series: "编辑系列", button_edit_occurrence: "编辑实例", agenda_tab: "议程", date: "日期", description: "说明", year_tab: "今年", week_agenda_tab: "议程", grid_tab: "电网", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "按天", repeat_radio_week: "按周", repeat_radio_month: "按月", repeat_radio_year: "按年", repeat_radio_day_type: "每", repeat_text_day_count: "天", repeat_radio_day_type2: "每个工作日", repeat_week: " 重复 每", repeat_text_week_count: "星期的:", repeat_radio_month_type: "重复", repeat_radio_month_start: "在", repeat_text_month_day: "日 每", repeat_text_month_count: "月", repeat_text_month_count2_before: "每", repeat_text_month_count2_after: "月", repeat_year_label: "在", select_year_day2: "的", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "无结束日期", repeat_text_occurences_count: "次结束", repeat_radio_end2: "重复", repeat_radio_end3: "结束于", repeat_never: "从不", repeat_daily: "每天", repeat_workdays: "每个工作日", repeat_weekly: "每周", repeat_monthly: "每月", repeat_yearly: "每年", repeat_custom: "自定义", repeat_freq_day: "天", repeat_freq_week: "周", repeat_freq_month: "月", repeat_freq_year: "年", repeat_on_date: "在日期", repeat_ends: "结束", month_for_recurring: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], day_for_recurring: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] } }; +const cs = { date: { month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"], day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"], day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Den", week_tab: "Týden", month_tab: "Měsíc", new_event: "Nová událost", icon_save: "Uložit", icon_cancel: "Zpět", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Smazat", confirm_closing: "", confirm_deleting: "Událost bude trvale smazána, opravdu?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Přejete si upravit celou řadu opakovaných událostí?", section_recurring: "Opakování události", button_recurring: "Vypnuto", button_recurring_open: "Zapnuto", button_edit_series: "Edit series", button_edit_occurrence: "Upravit instance", agenda_tab: "Program", date: "Datum", description: "Poznámka", year_tab: "Rok", full_day: "Full day", week_agenda_tab: "Program", grid_tab: "Mřížka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denně", repeat_radio_week: "Týdně", repeat_radio_month: "Měsíčně", repeat_radio_year: "Ročně", repeat_radio_day_type: "každý", repeat_text_day_count: "Den", repeat_radio_day_type2: "pracovní dny", repeat_week: "Opakuje každých", repeat_text_week_count: "Týdnů na:", repeat_radio_month_type: "u každého", repeat_radio_month_start: "na", repeat_text_month_day: "Den každého", repeat_text_month_count: "Měsíc", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "Měsíc", repeat_year_label: "na", select_year_day2: "v", repeat_text_year_day: "Den v", select_year_month: "", repeat_radio_end: "bez data ukončení", repeat_text_occurences_count: "Události", repeat_radio_end2: "po", repeat_radio_end3: "Konec", repeat_never: "Nikdy", repeat_daily: "Každý den", repeat_workdays: "Každý pracovní den", repeat_weekly: "Každý týden", repeat_monthly: "Každý měsíc", repeat_yearly: "Každý rok", repeat_custom: "Vlastní", repeat_freq_day: "Den", repeat_freq_week: "Týden", repeat_freq_month: "Měsíc", repeat_freq_year: "Rok", repeat_on_date: "Na datum", repeat_ends: "Končí", month_for_recurring: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], day_for_recurring: ["Neděle ", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"] } }; +const da = { date: { month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uge", month_tab: "Måned", new_event: "Ny begivenhed", icon_save: "Gem", icon_cancel: "Fortryd", icon_details: "Detaljer", icon_edit: "Tilret", icon_delete: "Slet", confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?", confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du tilrette hele serien af gentagne begivenheder?", section_recurring: "Gentag begivenhed", button_recurring: "Frakoblet", button_recurring_open: "Tilkoblet", button_edit_series: "Rediger serien", button_edit_occurrence: "Rediger en kopi", agenda_tab: "Dagsorden", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Dagsorden", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ugenlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "På hver arbejdsdag", repeat_week: " Gentager sig hver", repeat_text_week_count: "uge på følgende dage:", repeat_radio_month_type: "Hver den", repeat_radio_month_start: "Den", repeat_text_month_day: " i hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen slutdato", repeat_text_occurences_count: "gentagelse", repeat_radio_end2: "Efter", repeat_radio_end3: "Slut", repeat_never: "Aldrig", repeat_daily: "Hver dag", repeat_workdays: "Hver hverdag", repeat_weekly: "Hver uge", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Brugerdefineret", repeat_freq_day: "Dag", repeat_freq_week: "Uge", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; +const de = { date: { month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"], month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"], day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }, labels: { dhx_cal_today_button: "Heute", day_tab: "Tag", week_tab: "Woche", month_tab: "Monat", new_event: "neuer Eintrag", icon_save: "Speichern", icon_cancel: "Abbrechen", icon_details: "Details", icon_edit: "Ändern", icon_delete: "Löschen", confirm_closing: "", confirm_deleting: "Der Eintrag wird gelöscht", section_description: "Beschreibung", section_time: "Zeitspanne", full_day: "Ganzer Tag", confirm_recurring: "Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?", section_recurring: "Wiederholung", button_recurring: "Aus", button_recurring_open: "An", button_edit_series: "Bearbeiten Sie die Serie", button_edit_occurrence: "Bearbeiten Sie eine Kopie", agenda_tab: "Agenda", date: "Datum", description: "Beschreibung", year_tab: "Jahre", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Täglich", repeat_radio_week: "Wöchentlich", repeat_radio_month: "Monatlich", repeat_radio_year: "Jährlich", repeat_radio_day_type: "jeden", repeat_text_day_count: "Tag", repeat_radio_day_type2: "an jedem Arbeitstag", repeat_week: " Wiederholt sich jede", repeat_text_week_count: "Woche am:", repeat_radio_month_type: "an jedem", repeat_radio_month_start: "am", repeat_text_month_day: "Tag eines jeden", repeat_text_month_count: "Monats", repeat_text_month_count2_before: "jeden", repeat_text_month_count2_after: "Monats", repeat_year_label: "am", select_year_day2: "im", repeat_text_year_day: "Tag im", select_year_month: "", repeat_radio_end: "kein Enddatum", repeat_text_occurences_count: "Ereignissen", repeat_radio_end3: "Schluß", repeat_radio_end2: "nach", repeat_never: "Nie", repeat_daily: "Jeden Tag", repeat_workdays: "Jeden Werktag", repeat_weekly: "Jede Woche", repeat_monthly: "Jeden Monat", repeat_yearly: "Jedes Jahr", repeat_custom: "Benutzerdefiniert", repeat_freq_day: "Tag", repeat_freq_week: "Woche", repeat_freq_month: "Monat", repeat_freq_year: "Jahr", repeat_on_date: "Am Datum", repeat_ends: "Endet", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] } }; +const el = { date: { month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"], day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"] }, labels: { dhx_cal_today_button: "Σήμερα", day_tab: "Ημέρα", week_tab: "Εβδομάδα", month_tab: "Μήνας", new_event: "Νέο έργο", icon_save: "Αποθήκευση", icon_cancel: "Άκυρο", icon_details: "Λεπτομέρειες", icon_edit: "Επεξεργασία", icon_delete: "Διαγραφή", confirm_closing: "", confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;", section_description: "Περιγραφή", section_time: "Χρονική περίοδος", full_day: "Πλήρης Ημέρα", confirm_recurring: "Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;", section_recurring: "Επαναλαμβανόμενο έργο", button_recurring: "Ανενεργό", button_recurring_open: "Ενεργό", button_edit_series: "Επεξεργαστείτε τη σειρά", button_edit_occurrence: "Επεξεργασία ένα αντίγραφο", agenda_tab: "Ημερήσια Διάταξη", date: "Ημερομηνία", description: "Περιγραφή", year_tab: "Έτος", week_agenda_tab: "Ημερήσια Διάταξη", grid_tab: "Πλέγμα", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Ημερησίως", repeat_radio_week: "Εβδομαδιαίως", repeat_radio_month: "Μηνιαίως", repeat_radio_year: "Ετησίως", repeat_radio_day_type: "Κάθε", repeat_text_day_count: "ημέρα", repeat_radio_day_type2: "Κάθε εργάσιμη", repeat_week: " Επανάληψη κάθε", repeat_text_week_count: "εβδομάδα τις επόμενες ημέρες:", repeat_radio_month_type: "Επανάληψη", repeat_radio_month_start: "Την", repeat_text_month_day: "ημέρα κάθε", repeat_text_month_count: "μήνα", repeat_text_month_count2_before: "κάθε", repeat_text_month_count2_after: "μήνα", repeat_year_label: "Την", select_year_day2: "του", repeat_text_year_day: "ημέρα", select_year_month: "μήνα", repeat_radio_end: "Χωρίς ημερομηνία λήξεως", repeat_text_occurences_count: "επαναλήψεις", repeat_radio_end3: "Λήγει την", repeat_radio_end2: "Μετά από", repeat_never: "Ποτέ", repeat_daily: "Κάθε μέρα", repeat_workdays: "Κάθε εργάσιμη μέρα", repeat_weekly: "Κάθε εβδομάδα", repeat_monthly: "Κάθε μήνα", repeat_yearly: "Κάθε χρόνο", repeat_custom: "Προσαρμοσμένο", repeat_freq_day: "Ημέρα", repeat_freq_week: "Εβδομάδα", repeat_freq_month: "Μήνας", repeat_freq_year: "Χρόνος", repeat_on_date: "Σε ημερομηνία", repeat_ends: "Λήγει", month_for_recurring: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], day_for_recurring: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"] } }; +const en = { date: { month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, labels: { dhx_cal_today_button: "Today", day_tab: "Day", week_tab: "Week", month_tab: "Month", new_event: "New event", icon_save: "Save", icon_cancel: "Cancel", icon_details: "Details", icon_edit: "Edit", icon_delete: "Delete", confirm_closing: "", confirm_deleting: "Event will be deleted permanently, are you sure?", section_description: "Description", section_time: "Time period", full_day: "Full day", confirm_recurring: "Do you want to edit the whole set of repeated events?", section_recurring: "Repeat event", button_recurring: "Disabled", button_recurring_open: "Enabled", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Agenda", date: "Date", description: "Description", year_tab: "Year", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daily", repeat_radio_week: "Weekly", repeat_radio_month: "Monthly", repeat_radio_year: "Yearly", repeat_radio_day_type: "Every", repeat_text_day_count: "day", repeat_radio_day_type2: "Every workday", repeat_week: " Repeat every", repeat_text_week_count: "week next days:", repeat_radio_month_type: "Repeat", repeat_radio_month_start: "On", repeat_text_month_day: "day every", repeat_text_month_count: "month", repeat_text_month_count2_before: "every", repeat_text_month_count2_after: "month", repeat_year_label: "On", select_year_day2: "of", repeat_text_year_day: "day", select_year_month: "month", repeat_radio_end: "No end date", repeat_text_occurences_count: "occurrences", repeat_radio_end2: "After", repeat_radio_end3: "End by", repeat_never: "Never", repeat_daily: "Every day", repeat_workdays: "Every weekday", repeat_weekly: "Every week", repeat_monthly: "Every month", repeat_yearly: "Every year", repeat_custom: "Custom", repeat_freq_day: "Day", repeat_freq_week: "Week", repeat_freq_month: "Month", repeat_freq_year: "Year", repeat_on_date: "On date", repeat_ends: "Ends", month_for_recurring: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], day_for_recurring: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] } }; +const es = { date: { month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"] }, labels: { dhx_cal_today_button: "Hoy", day_tab: "Día", week_tab: "Semana", month_tab: "Mes", new_event: "Nuevo evento", icon_save: "Guardar", icon_cancel: "Cancelar", icon_details: "Detalles", icon_edit: "Editar", icon_delete: "Eliminar", confirm_closing: "", confirm_deleting: "El evento se borrará definitivamente, ¿continuar?", section_description: "Descripción", section_time: "Período", full_day: "Todo el día", confirm_recurring: "¿Desea modificar el conjunto de eventos repetidos?", section_recurring: "Repita el evento", button_recurring: "Impedido", button_recurring_open: "Permitido", button_edit_series: "Editar la serie", button_edit_occurrence: "Editar este evento", agenda_tab: "Día", date: "Fecha", description: "Descripción", year_tab: "Año", week_agenda_tab: "Día", grid_tab: "Reja", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diariamente", repeat_radio_week: "Semanalmente", repeat_radio_month: "Mensualmente", repeat_radio_year: "Anualmente", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada jornada de trabajo", repeat_week: " Repetir cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repita", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada ", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "del", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sin fecha de finalización", repeat_text_occurences_count: "ocurrencias", repeat_radio_end3: "Fin", repeat_radio_end2: "Después de", repeat_never: "Nunca", repeat_daily: "Cada día", repeat_workdays: "Cada día laborable", repeat_weekly: "Cada semana", repeat_monthly: "Cada mes", repeat_yearly: "Cada año", repeat_custom: "Personalizado", repeat_freq_day: "Día", repeat_freq_week: "Semana", repeat_freq_month: "Mes", repeat_freq_year: "Año", repeat_on_date: "En la fecha", repeat_ends: "Termina", month_for_recurring: ["Enero", "Febrero", "Маrzo", "Аbril", "Mayo", "Junio", "Julio", "Аgosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"], day_for_recurring: ["Domingo", "Lunes", "Martes", "Miércoles", "Jeuves", "Viernes", "Sabado"] } }; +const fi = { date: { month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"], day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"] }, labels: { dhx_cal_today_button: "Tänään", day_tab: "Päivä", week_tab: "Viikko", month_tab: "Kuukausi", new_event: "Uusi tapahtuma", icon_save: "Tallenna", icon_cancel: "Peru", icon_details: "Tiedot", icon_edit: "Muokkaa", icon_delete: "Poista", confirm_closing: "", confirm_deleting: "Haluatko varmasti poistaa tapahtuman?", section_description: "Kuvaus", section_time: "Aikajakso", full_day: "Koko päivä", confirm_recurring: "Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?", section_recurring: "Toista tapahtuma", button_recurring: "Ei käytössä", button_recurring_open: "Käytössä", button_edit_series: "Muokkaa sarja", button_edit_occurrence: "Muokkaa kopio", agenda_tab: "Esityslista", date: "Päivämäärä", description: "Kuvaus", year_tab: "Vuoden", week_agenda_tab: "Esityslista", grid_tab: "Ritilä", drag_to_create: "Luo uusi vetämällä", drag_to_move: "Siirrä vetämällä", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Päivittäin", repeat_radio_week: "Viikoittain", repeat_radio_month: "Kuukausittain", repeat_radio_year: "Vuosittain", repeat_radio_day_type: "Joka", repeat_text_day_count: "päivä", repeat_radio_day_type2: "Joka arkipäivä", repeat_week: "Toista joka", repeat_text_week_count: "viikko näinä päivinä:", repeat_radio_month_type: "Toista", repeat_radio_month_start: "", repeat_text_month_day: "päivänä joka", repeat_text_month_count: "kuukausi", repeat_text_month_count2_before: "joka", repeat_text_month_count2_after: "kuukausi", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "päivä", select_year_month: "kuukausi", repeat_radio_end: "Ei loppumisaikaa", repeat_text_occurences_count: "Toiston jälkeen", repeat_radio_end3: "Loppuu", repeat_radio_end2: "", repeat_never: "Ei koskaan", repeat_daily: "Joka päivä", repeat_workdays: "Joka arkipäivä", repeat_weekly: "Joka viikko", repeat_monthly: "Joka kuukausi", repeat_yearly: "Joka vuosi", repeat_custom: "Mukautettu", repeat_freq_day: "Päivä", repeat_freq_week: "Viikko", repeat_freq_month: "Kuukausi", repeat_freq_year: "Vuosi", repeat_on_date: "Tiettynä päivänä", repeat_ends: "Päättyy", month_for_recurring: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], day_for_recurring: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"] } }; +const fr = { date: { month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"], day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels: { dhx_cal_today_button: "Aujourd'hui", day_tab: "Jour", week_tab: "Semaine", month_tab: "Mois", new_event: "Nouvel événement", icon_save: "Enregistrer", icon_cancel: "Annuler", icon_details: "Détails", icon_edit: "Modifier", icon_delete: "Effacer", confirm_closing: "", confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?", section_description: "Description", section_time: "Période", full_day: "Journée complète", confirm_recurring: "Voulez-vous éditer toute une série d'évènements répétés?", section_recurring: "Périodicité", button_recurring: "Désactivé", button_recurring_open: "Activé", button_edit_series: "Modifier la série", button_edit_occurrence: "Modifier une copie", agenda_tab: "Jour", date: "Date", description: "Description", year_tab: "Année", week_agenda_tab: "Jour", grid_tab: "Grille", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidienne", repeat_radio_week: "Hebdomadaire", repeat_radio_month: "Mensuelle", repeat_radio_year: "Annuelle", repeat_radio_day_type: "Chaque", repeat_text_day_count: "jour", repeat_radio_day_type2: "Chaque journée de travail", repeat_week: " Répéter toutes les", repeat_text_week_count: "semaine:", repeat_radio_month_type: "Répéter", repeat_radio_month_start: "Le", repeat_text_month_day: "jour chaque", repeat_text_month_count: "mois", repeat_text_month_count2_before: "chaque", repeat_text_month_count2_after: "mois", repeat_year_label: "Le", select_year_day2: "du", repeat_text_year_day: "jour", select_year_month: "mois", repeat_radio_end: "Pas de date d"achèvement", repeat_text_occurences_count: "occurrences", repeat_radio_end3: "Fin", repeat_radio_end2: "Après", repeat_never: "Jamais", repeat_daily: "Chaque jour", repeat_workdays: "Chaque jour ouvrable", repeat_weekly: "Chaque semaine", repeat_monthly: "Chaque mois", repeat_yearly: "Chaque année", repeat_custom: "Personnalisé", repeat_freq_day: "Jour", repeat_freq_week: "Semaine", repeat_freq_month: "Mois", repeat_freq_year: "Année", repeat_on_date: "À la date", repeat_ends: "Se termine", month_for_recurring: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], day_for_recurring: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] } }; +const he = { date: { month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"] }, labels: { dhx_cal_today_button: "היום", day_tab: "יום", week_tab: "שבוע", month_tab: "חודש", new_event: "ארוע חדש", icon_save: "שמור", icon_cancel: "בטל", icon_details: "פרטים", icon_edit: "ערוך", icon_delete: "מחק", confirm_closing: "", confirm_deleting: "ארוע ימחק סופית.להמשיך?", section_description: "תיאור", section_time: "תקופה", confirm_recurring: "האם ברצונך לשנות כל סדרת ארועים מתמשכים?", section_recurring: "להעתיק ארוע", button_recurring: "לא פעיל", button_recurring_open: "פעיל", full_day: "יום שלם", button_edit_series: "ערוך את הסדרה", button_edit_occurrence: "עריכת עותק", agenda_tab: "סדר יום", date: "תאריך", description: "תיאור", year_tab: "לשנה", week_agenda_tab: "סדר יום", grid_tab: "סורג", drag_to_create: "Drag to create", drag_to_move: "גרור כדי להזיז", message_ok: "OK", message_cancel: "בטל", next: "הבא", prev: "הקודם", year: "שנה", month: "חודש", day: "יום", hour: "שעה", minute: "דקה", repeat_radio_day: "יומי", repeat_radio_week: "שבועי", repeat_radio_month: "חודשי", repeat_radio_year: "שנתי", repeat_radio_day_type: "חזור כל", repeat_text_day_count: "ימים", repeat_radio_day_type2: "חזור כל יום עבודה", repeat_week: " חזור כל", repeat_text_week_count: "שבוע לפי ימים:", repeat_radio_month_type: "חזור כל", repeat_radio_month_start: "כל", repeat_text_month_day: "ימים כל", repeat_text_month_count: "חודשים", repeat_text_month_count2_before: "חזור כל", repeat_text_month_count2_after: "חודש", repeat_year_label: "כל", select_year_day2: "בחודש", repeat_text_year_day: "ימים", select_year_month: "חודש", repeat_radio_end: "לעולם לא מסתיים", repeat_text_occurences_count: "אירועים", repeat_radio_end3: "מסתיים ב", repeat_radio_end2: "אחרי", repeat_never: "אף פעם", repeat_daily: "כל יום", repeat_workdays: "כל יום עבודה", repeat_weekly: "כל שבוע", repeat_monthly: "כל חודש", repeat_yearly: "כל שנה", repeat_custom: "מותאם אישית", repeat_freq_day: "יום", repeat_freq_week: "שבוע", repeat_freq_month: "חודש", repeat_freq_year: "שנה", repeat_on_date: "בתאריך", repeat_ends: "מסתיים", month_for_recurring: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], day_for_recurring: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"] } }; +const hu = { date: { month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"], day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"] }, labels: { dhx_cal_today_button: "Ma", day_tab: "Nap", week_tab: "Hét", month_tab: "Hónap", new_event: "Új esemény", icon_save: "Mentés", icon_cancel: "Mégse", icon_details: "Részletek", icon_edit: "Szerkesztés", icon_delete: "Törlés", confirm_closing: "", confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?", section_description: "Leírás", section_time: "Idõszak", full_day: "Egesz napos", confirm_recurring: "Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?", section_recurring: "Esemény ismétlése", button_recurring: "Tiltás", button_recurring_open: "Engedélyezés", button_edit_series: "Edit series", button_edit_occurrence: "Szerkesztés bíróság", agenda_tab: "Napirend", date: "Dátum", description: "Leírás", year_tab: "Év", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Napi", repeat_radio_week: "Heti", repeat_radio_month: "Havi", repeat_radio_year: "Éves", repeat_radio_day_type: "Minden", repeat_text_day_count: "nap", repeat_radio_day_type2: "Minden munkanap", repeat_week: " Ismételje meg minden", repeat_text_week_count: "héten a következő napokon:", repeat_radio_month_type: "Ismétlés", repeat_radio_month_start: "Ekkor", repeat_text_month_day: "nap minden", repeat_text_month_count: "hónapban", repeat_text_month_count2_before: "minden", repeat_text_month_count2_after: "hónapban", repeat_year_label: "Ekkor", select_year_day2: "-án/-én", repeat_text_year_day: "nap", select_year_month: "hónap", repeat_radio_end: "Nincs befejezési dátum", repeat_text_occurences_count: "esemény", repeat_radio_end2: "Után", repeat_radio_end3: "Befejező dátum", repeat_never: "Soha", repeat_daily: "Minden nap", repeat_workdays: "Minden munkanap", repeat_weekly: "Minden héten", repeat_monthly: "Minden hónapban", repeat_yearly: "Minden évben", repeat_custom: "Egyedi", repeat_freq_day: "Nap", repeat_freq_week: "Hét", repeat_freq_month: "Hónap", repeat_freq_year: "Év", repeat_on_date: "Dátum szerint", repeat_ends: "Befejeződik", month_for_recurring: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], day_for_recurring: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"] } }; +const id = { date: { month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"], day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, labels: { dhx_cal_today_button: "Hari Ini", day_tab: "Hari", week_tab: "Minggu", month_tab: "Bulan", new_event: "Acara Baru", icon_save: "Simpan", icon_cancel: "Batal", icon_details: "Detail", icon_edit: "Edit", icon_delete: "Hapus", confirm_closing: "", confirm_deleting: "Acara akan dihapus", section_description: "Keterangan", section_time: "Periode", full_day: "Hari penuh", confirm_recurring: "Apakah acara ini akan berulang?", section_recurring: "Acara Rutin", button_recurring: "Tidak Difungsikan", button_recurring_open: "Difungsikan", button_edit_series: "Mengedit seri", button_edit_occurrence: "Mengedit salinan", agenda_tab: "Agenda", date: "Tanggal", description: "Keterangan", year_tab: "Tahun", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Harian", repeat_radio_week: "Mingguan", repeat_radio_month: "Bulanan", repeat_radio_year: "Tahunan", repeat_radio_day_type: "Setiap", repeat_text_day_count: "hari", repeat_radio_day_type2: "Setiap hari kerja", repeat_week: " Ulangi setiap", repeat_text_week_count: "minggu pada hari berikut:", repeat_radio_month_type: "Ulangi", repeat_radio_month_start: "Pada", repeat_text_month_day: "hari setiap", repeat_text_month_count: "bulan", repeat_text_month_count2_before: "setiap", repeat_text_month_count2_after: "bulan", repeat_year_label: "Pada", select_year_day2: "dari", repeat_text_year_day: "hari", select_year_month: "bulan", repeat_radio_end: "Tanpa tanggal akhir", repeat_text_occurences_count: "kejadian", repeat_radio_end2: "Setelah", repeat_radio_end3: "Berakhir pada", repeat_never: "Tidak pernah", repeat_daily: "Setiap hari", repeat_workdays: "Setiap hari kerja", repeat_weekly: "Setiap minggu", repeat_monthly: "Setiap bulan", repeat_yearly: "Setiap tahun", repeat_custom: "Kustom", repeat_freq_day: "Hari", repeat_freq_week: "Minggu", repeat_freq_month: "Bulan", repeat_freq_year: "Tahun", repeat_on_date: "Pada tanggal", repeat_ends: "Berakhir", month_for_recurring: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] } }; +const it = { date: { month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"] }, labels: { dhx_cal_today_button: "Oggi", day_tab: "Giorno", week_tab: "Settimana", month_tab: "Mese", new_event: "Nuovo evento", icon_save: "Salva", icon_cancel: "Chiudi", icon_details: "Dettagli", icon_edit: "Modifica", icon_delete: "Elimina", confirm_closing: "", confirm_deleting: "L'evento sarà eliminato, siete sicuri?", section_description: "Descrizione", section_time: "Periodo di tempo", full_day: "Intera giornata", confirm_recurring: "Vuoi modificare l'intera serie di eventi?", section_recurring: "Ripetere l'evento", button_recurring: "Disattivato", button_recurring_open: "Attivato", button_edit_series: "Modificare la serie", button_edit_occurrence: "Modificare una copia", agenda_tab: "Agenda", date: "Data", description: "Descrizione", year_tab: "Anno", week_agenda_tab: "Agenda", grid_tab: "Griglia", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidiano", repeat_radio_week: "Settimanale", repeat_radio_month: "Mensile", repeat_radio_year: "Annuale", repeat_radio_day_type: "Ogni", repeat_text_day_count: "giorno", repeat_radio_day_type2: "Ogni giornata lavorativa", repeat_week: " Ripetere ogni", repeat_text_week_count: "settimana:", repeat_radio_month_type: "Ripetere", repeat_radio_month_start: "Il", repeat_text_month_day: "giorno ogni", repeat_text_month_count: "mese", repeat_text_month_count2_before: "ogni", repeat_text_month_count2_after: "mese", repeat_year_label: "Il", select_year_day2: "del", repeat_text_year_day: "giorno", select_year_month: "mese", repeat_radio_end: "Senza data finale", repeat_text_occurences_count: "occorenze", repeat_radio_end3: "Fine", repeat_radio_end2: "Dopo", repeat_never: "Mai", repeat_daily: "Ogni giorno", repeat_workdays: "Ogni giorno feriale", repeat_weekly: "Ogni settimana", repeat_monthly: "Ogni mese", repeat_yearly: "Ogni anno", repeat_custom: "Personalizzato", repeat_freq_day: "Giorno", repeat_freq_week: "Settimana", repeat_freq_month: "Mese", repeat_freq_year: "Anno", repeat_on_date: "Alla data", repeat_ends: "Finisce", month_for_recurring: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Jiugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], day_for_recurring: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Jovedì", "Venerdì", "Sabato"] } }; +const jp = { date: { month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], day_short: ["日", "月", "火", "水", "木", "金", "土"] }, labels: { dhx_cal_today_button: "今日", day_tab: "日", week_tab: "週", month_tab: "月", new_event: "新イベント", icon_save: "保存", icon_cancel: "キャンセル", icon_details: "詳細", icon_edit: "編集", icon_delete: "削除", confirm_closing: "", confirm_deleting: "イベント完全に削除されます、宜しいですか?", section_description: "デスクリプション", section_time: "期間", confirm_recurring: "繰り返されているイベントを全て編集しますか?", section_recurring: "イベントを繰り返す", button_recurring: "無効", button_recurring_open: "有効", full_day: "終日", button_edit_series: "シリーズを編集します", button_edit_occurrence: "コピーを編集", agenda_tab: "議題は", date: "日付", description: "説明", year_tab: "今年", week_agenda_tab: "議題は", grid_tab: "グリッド", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "毎日", repeat_radio_week: "毎週", repeat_radio_month: "毎月", repeat_radio_year: "毎年", repeat_radio_day_type: "毎", repeat_text_day_count: "日", repeat_radio_day_type2: "毎営業日", repeat_week: " 繰り返し毎", repeat_text_week_count: "週 次の日:", repeat_radio_month_type: "繰り返し", repeat_radio_month_start: "オン", repeat_text_month_day: "日毎", repeat_text_month_count: "月", repeat_text_month_count2_before: "毎", repeat_text_month_count2_after: "月", repeat_year_label: "オン", select_year_day2: "の", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "終了日なし", repeat_text_occurences_count: "回数", repeat_radio_end2: "後", repeat_radio_end3: "終了日まで", repeat_never: "決して", repeat_daily: "毎日", repeat_workdays: "毎営業日", repeat_weekly: "毎週", repeat_monthly: "毎月", repeat_yearly: "毎年", repeat_custom: "カスタム", repeat_freq_day: "日", repeat_freq_week: "週", repeat_freq_month: "月", repeat_freq_year: "年", repeat_on_date: "日にち", repeat_ends: "終了", month_for_recurring: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_for_recurring: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"] } }; +class LocaleManager { + constructor(config) { + this._locales = {}; + for (const i in config) { + this._locales[i] = config[i]; + } } - var copy2 = this.$scheduler.utils.copy(data); - if (this._tMode === "REST-JSON") { - delete copy2.id; - delete copy2[this.action_param]; + addLocale(name, locale) { + this._locales[name] = locale; } - return JSON.stringify(copy2); -}, _cleanupArgumentsBeforeSend: function(dataToSend) { - var processedData; - if (dataToSend[this.action_param] === void 0) { - processedData = {}; - for (var i in dataToSend) { - processedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]); - } - } else { - processedData = this._cleanupItemBeforeSend(dataToSend); + getLocale(name) { + return this._locales[name]; } - return processedData; -}, _cleanupItemBeforeSend: function(updatedItem) { - var output = null; - if (updatedItem) { - if (updatedItem[this.action_param] === "deleted") { - output = {}; - output.id = updatedItem.id; - output[this.action_param] = updatedItem[this.action_param]; - } else { - output = updatedItem; +} +const nb = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "I dag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny hendelse", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du forandre hele dette settet av repeterende hendelser?", section_recurring: "Repeter hendelsen", button_recurring: "Av", button_recurring_open: "På", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Alle hverdager", repeat_week: " Gjentas hver", repeat_text_week_count: "uke på:", repeat_radio_month_type: "På hver", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "på", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomst", repeat_radio_end3: "Stop den", repeat_radio_end2: "Etter", repeat_never: "Aldri", repeat_daily: "Hver dag", repeat_workdays: "Hver ukedag", repeat_weekly: "Hver uke", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Tilpasset", repeat_freq_day: "Dag", repeat_freq_week: "Uke", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Sondag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; +const nl = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { dhx_cal_today_button: "Vandaag", day_tab: "Dag", week_tab: "Week", month_tab: "Maand", new_event: "Nieuw item", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", full_day: "Hele dag", confirm_recurring: "Wilt u alle terugkerende items bijwerken?", section_recurring: "Item herhalen", button_recurring: "Uit", button_recurring_open: "Aan", button_edit_series: "Bewerk de serie", button_edit_occurrence: "Bewerk een kopie", agenda_tab: "Agenda", date: "Datum", description: "Omschrijving", year_tab: "Jaar", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagelijks", repeat_radio_week: "Wekelijks", repeat_radio_month: "Maandelijks", repeat_radio_year: "Jaarlijks", repeat_radio_day_type: "Elke", repeat_text_day_count: "dag(en)", repeat_radio_day_type2: "Elke werkdag", repeat_week: " Herhaal elke", repeat_text_week_count: "week op de volgende dagen:", repeat_radio_month_type: "Herhaal", repeat_radio_month_start: "Op", repeat_text_month_day: "dag iedere", repeat_text_month_count: "maanden", repeat_text_month_count2_before: "iedere", repeat_text_month_count2_after: "maanden", repeat_year_label: "Op", select_year_day2: "van", repeat_text_year_day: "dag", select_year_month: "maand", repeat_radio_end: "Geen eind datum", repeat_text_occurences_count: "keren", repeat_radio_end3: "Eindigd per", repeat_radio_end2: "Na", repeat_never: "Nooit", repeat_daily: "Elke dag", repeat_workdays: "Elke werkdag", repeat_weekly: "Elke week", repeat_monthly: "Elke maand", repeat_yearly: "Elk jaar", repeat_custom: "Aangepast", repeat_freq_day: "Dag", repeat_freq_week: "Week", repeat_freq_month: "Maand", repeat_freq_year: "Jaar", repeat_on_date: "Op datum", repeat_ends: "Eindigt", month_for_recurring: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], day_for_recurring: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"] } }; +const no = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", full_day: "Full dag", confirm_recurring: "Vil du endre hele settet med repeterende oppføringer?", section_recurring: "Repeterende oppføring", button_recurring: "Ikke aktiv", button_recurring_open: "Aktiv", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Hver arbeidsdag", repeat_week: " Gjenta hver", repeat_text_week_count: "uke neste dager:", repeat_radio_month_type: "Gjenta", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "På", select_year_day2: "av", repeat_text_year_day: "dag", select_year_month: "måned", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomster", repeat_radio_end2: "Etter", repeat_radio_end3: "Slutt innen", repeat_never: "Aldri", repeat_daily: "Hver dag", repeat_workdays: "Hver ukedag", repeat_weekly: "Hver uke", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Tilpasset", repeat_freq_day: "Dag", repeat_freq_week: "Uke", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; +const pl = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { dhx_cal_today_button: "Dziś", day_tab: "Dzień", week_tab: "Tydzień", month_tab: "Miesiąc", new_event: "Nowe zdarzenie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", full_day: "Cały dzień", confirm_recurring: "Czy chcesz edytować cały zbiór powtarzających się zdarzeń?", section_recurring: "Powtórz zdarzenie", button_recurring: "Nieaktywne", button_recurring_open: "Aktywne", button_edit_series: "Edytuj serię", button_edit_occurrence: "Edytuj kopię", agenda_tab: "Agenda", date: "Data", description: "Opis", year_tab: "Rok", week_agenda_tab: "Agenda", grid_tab: "Tabela", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Codziennie", repeat_radio_week: "Co tydzie", repeat_radio_month: "Co miesic", repeat_radio_year: "Co rok", repeat_radio_day_type: "Kadego", repeat_text_day_count: "dnia", repeat_radio_day_type2: "Kadego dnia roboczego", repeat_week: " Powtarzaj kadego", repeat_text_week_count: "tygodnia w dni:", repeat_radio_month_type: "Powtrz", repeat_radio_month_start: "W", repeat_text_month_day: "dnia kadego", repeat_text_month_count: "miesica", repeat_text_month_count2_before: "kadego", repeat_text_month_count2_after: "miesica", repeat_year_label: "W", select_year_day2: "miesica", repeat_text_year_day: "dnia miesica", select_year_month: "", repeat_radio_end: "Bez daty kocowej", repeat_text_occurences_count: "wystpieniu/ach", repeat_radio_end3: "Zakocz w", repeat_radio_end2: "Po", repeat_never: "Nigdy", repeat_daily: "Codziennie", repeat_workdays: "Każdy dzień roboczy", repeat_weekly: "Co tydzień", repeat_monthly: "Co miesiąc", repeat_yearly: "Co rok", repeat_custom: "Niestandardowy", repeat_freq_day: "Dzień", repeat_freq_week: "Tydzień", repeat_freq_month: "Miesiąc", repeat_freq_year: "Rok", repeat_on_date: "W dniu", repeat_ends: "Kończy się", month_for_recurring: ["Stycznia", "Lutego", "Marca", "Kwietnia", "Maja", "Czerwca", "Lipca", "Sierpnia", "Wrzenia", "Padziernka", "Listopada", "Grudnia"], day_for_recurring: ["Niedziela", "Poniedziaek", "Wtorek", "roda", "Czwartek", "Pitek", "Sobota"] } }; +const pt = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { dhx_cal_today_button: "Hoje", day_tab: "Dia", week_tab: "Semana", month_tab: "Mês", new_event: "Novo evento", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Deletar", confirm_closing: "", confirm_deleting: "Tem certeza que deseja excluir?", section_description: "Descrição", section_time: "Período de tempo", full_day: "Dia inteiro", confirm_recurring: "Deseja editar todos esses eventos repetidos?", section_recurring: "Repetir evento", button_recurring: "Desabilitar", button_recurring_open: "Habilitar", button_edit_series: "Editar a série", button_edit_occurrence: "Editar uma cópia", agenda_tab: "Dia", date: "Data", description: "Descrição", year_tab: "Ano", week_agenda_tab: "Dia", grid_tab: "Grade", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diário", repeat_radio_week: "Semanal", repeat_radio_month: "Mensal", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia(s)", repeat_radio_day_type2: "Cada trabalho diário", repeat_week: " Repita cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "Em", repeat_text_month_day: "todo dia", repeat_text_month_count: "mês", repeat_text_month_count2_before: "todo", repeat_text_month_count2_after: "mês", repeat_year_label: "Em", select_year_day2: "of", repeat_text_year_day: "dia", select_year_month: "mês", repeat_radio_end: "Sem data final", repeat_text_occurences_count: "ocorrências", repeat_radio_end3: "Fim", repeat_radio_end2: "Depois", repeat_never: "Nunca", repeat_daily: "Todos os dias", repeat_workdays: "Todos os dias úteis", repeat_weekly: "Toda semana", repeat_monthly: "Todo mês", repeat_yearly: "Todo ano", repeat_custom: "Personalizado", repeat_freq_day: "Dia", repeat_freq_week: "Semana", repeat_freq_month: "Mês", repeat_freq_year: "Ano", repeat_on_date: "Na data", repeat_ends: "Termina", month_for_recurring: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], day_for_recurring: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] } }; +const ro = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { dhx_cal_today_button: "Astazi", day_tab: "Zi", week_tab: "Saptamana", month_tab: "Luna", new_event: "Eveniment nou", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", full_day: "Toata ziua", confirm_recurring: "Vrei sa editezi toata seria de evenimente repetate?", section_recurring: "Repetare", button_recurring: "Dezactivata", button_recurring_open: "Activata", button_edit_series: "Editeaza serie", button_edit_occurrence: "Editeaza doar intrare", agenda_tab: "Agenda", date: "Data", description: "Descriere", year_tab: "An", week_agenda_tab: "Agenda", grid_tab: "Lista", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Zilnic", repeat_radio_week: "Saptamanal", repeat_radio_month: "Lunar", repeat_radio_year: "Anual", repeat_radio_day_type: "La fiecare", repeat_text_day_count: "zi(le)", repeat_radio_day_type2: "Fiecare zi lucratoare", repeat_week: " Repeta la fiecare", repeat_text_week_count: "saptamana in urmatoarele zile:", repeat_radio_month_type: "Repeta in", repeat_radio_month_start: "In a", repeat_text_month_day: "zi la fiecare", repeat_text_month_count: "luni", repeat_text_month_count2_before: "la fiecare", repeat_text_month_count2_after: "luni", repeat_year_label: "In", select_year_day2: "a lunii", repeat_text_year_day: "zi a lunii", select_year_month: "", repeat_radio_end: "Fara data de sfarsit", repeat_text_occurences_count: "evenimente", repeat_radio_end3: "La data", repeat_radio_end2: "Dupa", repeat_never: "Niciodată", repeat_daily: "În fiecare zi", repeat_workdays: "În fiecare zi lucrătoare", repeat_weekly: "În fiecare săptămână", repeat_monthly: "În fiecare lună", repeat_yearly: "În fiecare an", repeat_custom: "Personalizat", repeat_freq_day: "Zi", repeat_freq_week: "Săptămână", repeat_freq_month: "Lună", repeat_freq_year: "An", repeat_on_date: "La data", repeat_ends: "Se termină", month_for_recurring: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], day_for_recurring: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"] } }; +const ru = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сегодня", day_tab: "День", week_tab: "Неделя", month_tab: "Месяц", new_event: "Новое событие", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", full_day: "Весь день", confirm_recurring: "Вы хотите изменить всю серию повторяющихся событий?", section_recurring: "Повторение", button_recurring: "Отключено", button_recurring_open: "Включено", button_edit_series: "Редактировать серию", button_edit_occurrence: "Редактировать экземпляр", agenda_tab: "Список", date: "Дата", description: "Описание", year_tab: "Год", week_agenda_tab: "Список", grid_tab: "Таблица", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Неделя", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Каждый", repeat_text_day_count: "день", repeat_radio_day_type2: "Каждый рабочий день", repeat_week: " Повторять каждую", repeat_text_week_count: "неделю , в:", repeat_radio_month_type: "Повторять", repeat_radio_month_start: "", repeat_text_month_day: " числа каждый ", repeat_text_month_count: "месяц", repeat_text_month_count2_before: "каждый ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без даты окончания", repeat_text_occurences_count: "повторений", repeat_radio_end3: "До ", repeat_radio_end2: "", repeat_never: "Никогда", repeat_daily: "Каждый день", repeat_workdays: "Каждый будний день", repeat_weekly: "Каждую неделю", repeat_monthly: "Каждый месяц", repeat_yearly: "Каждый год", repeat_custom: "Настроить", repeat_freq_day: "День", repeat_freq_week: "Неделя", repeat_freq_month: "Месяц", repeat_freq_year: "Год", repeat_on_date: "В дату", repeat_ends: "Заканчивается", month_for_recurring: ["Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря"], day_for_recurring: ["Воскресенье", "Понедельник", "Вторник", "Среду", "Четверг", "Пятницу", "Субботу"] } }; +const si = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", full_day: "Ves dan", confirm_recurring: "Želite urediti celoten set ponavljajočih dogodkov?", section_recurring: "Ponovi dogodek", button_recurring: "Onemogočeno", button_recurring_open: "Omogočeno", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Zadeva", date: "Datum", description: "Opis", year_tab: "Leto", week_agenda_tab: "Zadeva", grid_tab: "Miza", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dnevno", repeat_radio_week: "Tedensko", repeat_radio_month: "Mesečno", repeat_radio_year: "Letno", repeat_radio_day_type: "Vsak", repeat_text_day_count: "dan", repeat_radio_day_type2: "Vsak delovni dan", repeat_week: " Ponavljaj vsak", repeat_text_week_count: "teden na naslednje dni:", repeat_radio_month_type: "Ponavljaj", repeat_radio_month_start: "Na", repeat_text_month_day: "dan vsak", repeat_text_month_count: "mesec", repeat_text_month_count2_before: "vsak", repeat_text_month_count2_after: "mesec", repeat_year_label: "Na", select_year_day2: "od", repeat_text_year_day: "dan", select_year_month: "mesec", repeat_radio_end: "Brez končnega datuma", repeat_text_occurences_count: "pojavitve", repeat_radio_end2: "Po", repeat_radio_end3: "Končaj do", repeat_never: "Nikoli", repeat_daily: "Vsak dan", repeat_workdays: "Vsak delovni dan", repeat_weekly: "Vsak teden", repeat_monthly: "Vsak mesec", repeat_yearly: "Vsako leto", repeat_custom: "Po meri", repeat_freq_day: "Dan", repeat_freq_week: "Teden", repeat_freq_month: "Mesec", repeat_freq_year: "Leto", repeat_on_date: "Na datum", repeat_ends: "Konča se", month_for_recurring: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], day_for_recurring: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"] } }; +const sk = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Deň", week_tab: "Týždeň", month_tab: "Mesiac", new_event: "Nová udalosť", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Prajete si upraviť celú radu opakovaných udalostí?", section_recurring: "Opakovanie udalosti", button_recurring: "Vypnuté", button_recurring_open: "Zapnuté", button_edit_series: "Upraviť opakovania", button_edit_occurrence: "Upraviť inštancie", agenda_tab: "Program", date: "Dátum", description: "Poznámka", year_tab: "Rok", full_day: "Celý deň", week_agenda_tab: "Program", grid_tab: "Mriežka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denne", repeat_radio_week: "Týždenne", repeat_radio_month: "Mesaène", repeat_radio_year: "Roène", repeat_radio_day_type: "Každý", repeat_text_day_count: "deò", repeat_radio_day_type2: "Každý prac. deò", repeat_week: "Opakova každý", repeat_text_week_count: "týždeò v dòoch:", repeat_radio_month_type: "Opakova", repeat_radio_month_start: "On", repeat_text_month_day: "deò každý", repeat_text_month_count: "mesiac", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "mesiac", repeat_year_label: "On", select_year_day2: "poèas", repeat_text_year_day: "deò", select_year_month: "mesiac", repeat_radio_end: "Bez dátumu ukonèenia", repeat_text_occurences_count: "udalostiach", repeat_radio_end3: "Ukonèi", repeat_radio_end2: "Po", repeat_never: "Nikdy", repeat_daily: "Každý deň", repeat_workdays: "Každý pracovný deň", repeat_weekly: "Každý týždeň", repeat_monthly: "Každý mesiac", repeat_yearly: "Každý rok", repeat_custom: "Vlastné", repeat_freq_day: "Deň", repeat_freq_week: "Týždeň", repeat_freq_month: "Mesiac", repeat_freq_year: "Rok", repeat_on_date: "Na dátum", repeat_ends: "Koniec", month_for_recurring: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], day_for_recurring: ["Nede¾a", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] } }; +const sv = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Vecka", month_tab: "Månad", new_event: "Ny händelse", icon_save: "Spara", icon_cancel: "Ångra", icon_details: "Detaljer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", full_day: "Hela dagen", confirm_recurring: "Vill du redigera hela serien med repeterande händelser?", section_recurring: "Upprepa händelse", button_recurring: "Inaktiverat", button_recurring_open: "Aktiverat", button_edit_series: "Redigera serien", button_edit_occurrence: "Redigera en kopia", agenda_tab: "Dagordning", date: "Datum", description: "Beskrivning", year_tab: "År", week_agenda_tab: "Dagordning", grid_tab: "Galler", drag_to_create: "Dra för att skapa ny", drag_to_move: "Dra för att flytta", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagligen", repeat_radio_week: "Veckovis", repeat_radio_month: "Månadsvis", repeat_radio_year: "Årligen", repeat_radio_day_type: "Var", repeat_text_day_count: "dag", repeat_radio_day_type2: "Varje arbetsdag", repeat_week: " Upprepa var", repeat_text_week_count: "vecka dessa dagar:", repeat_radio_month_type: "Upprepa", repeat_radio_month_start: "Den", repeat_text_month_day: "dagen var", repeat_text_month_count: "månad", repeat_text_month_count2_before: "var", repeat_text_month_count2_after: "månad", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "månad", repeat_radio_end: "Inget slutdatum", repeat_text_occurences_count: "upprepningar", repeat_radio_end3: "Sluta efter", repeat_radio_end2: "Efter", repeat_never: "Aldrig", repeat_daily: "Varje dag", repeat_workdays: "Varje vardag", repeat_weekly: "Varje vecka", repeat_monthly: "Varje månad", repeat_yearly: "Varje år", repeat_custom: "Anpassad", repeat_freq_day: "Dag", repeat_freq_week: "Vecka", repeat_freq_month: "Månad", repeat_freq_year: "År", repeat_on_date: "På datum", repeat_ends: "Slutar", month_for_recurring: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], day_for_recurring: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] } }; +const tr = { date: { month_full: ["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"], month_short: ["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"] }, labels: { dhx_cal_today_button: "Bugün", day_tab: "Gün", week_tab: "Hafta", month_tab: "Ay", new_event: "Uygun", icon_save: "Kaydet", icon_cancel: "Ýptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Etkinlik silinecek, devam?", section_description: "Açýklama", section_time: "Zaman aralýðý", full_day: "Tam gün", confirm_recurring: "Tüm tekrar eden etkinlikler silinecek, devam?", section_recurring: "Etkinliði tekrarla", button_recurring: "Pasif", button_recurring_open: "Aktif", button_edit_series: "Dizi düzenleme", button_edit_occurrence: "Bir kopyasını düzenleyin", agenda_tab: "Ajanda", date: "Tarih", description: "Açýklama", year_tab: "Yýl", week_agenda_tab: "Ajanda", grid_tab: "Izgara", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Günlük", repeat_radio_week: "Haftalık", repeat_radio_month: "Aylık", repeat_radio_year: "Yıllık", repeat_radio_day_type: "Her", repeat_text_day_count: "gün", repeat_radio_day_type2: "Her iş günü", repeat_week: " Tekrar her", repeat_text_week_count: "hafta şu günlerde:", repeat_radio_month_type: "Tekrar et", repeat_radio_month_start: "Tarihinde", repeat_text_month_day: "gün her", repeat_text_month_count: "ay", repeat_text_month_count2_before: "her", repeat_text_month_count2_after: "ay", repeat_year_label: "Tarihinde", select_year_day2: "ayın", repeat_text_year_day: "günü", select_year_month: "ay", repeat_radio_end: "Bitiş tarihi yok", repeat_text_occurences_count: "olay", repeat_radio_end2: "Sonra", repeat_radio_end3: "Tarihinde bitir", repeat_never: "Asla", repeat_daily: "Her gün", repeat_workdays: "Her iş günü", repeat_weekly: "Her hafta", repeat_monthly: "Her ay", repeat_yearly: "Her yıl", repeat_custom: "Özel", repeat_freq_day: "Gün", repeat_freq_week: "Hafta", repeat_freq_month: "Ay", repeat_freq_year: "Yıl", repeat_on_date: "Tarihinde", repeat_ends: "Biter", month_for_recurring: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], day_for_recurring: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"] } }; +const ua = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { dhx_cal_today_button: "Сьогодні", day_tab: "День", week_tab: "Тиждень", month_tab: "Місяць", new_event: "Нова подія", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", full_day: "Весь день", confirm_recurring: "Хочете редагувати весь перелік повторюваних подій?", section_recurring: "Повторювана подія", button_recurring: "Відключено", button_recurring_open: "Включено", button_edit_series: "Редагувати серію", button_edit_occurrence: "Редагувати примірник", agenda_tab: "Перелік", date: "Дата", description: "Опис", year_tab: "Рік", week_agenda_tab: "Перелік", grid_tab: "Таблиця", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Тиждень", repeat_radio_month: "Місяць", repeat_radio_year: "Рік", repeat_radio_day_type: "Кожний", repeat_text_day_count: "день", repeat_radio_day_type2: "Кожний робочий день", repeat_week: " Повторювати кожен", repeat_text_week_count: "тиждень , по:", repeat_radio_month_type: "Повторювати", repeat_radio_month_start: "", repeat_text_month_day: " числа кожний ", repeat_text_month_count: "місяць", repeat_text_month_count2_before: "кожен ", repeat_text_month_count2_after: "місяць", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без дати закінчення", repeat_text_occurences_count: "повторень", repeat_radio_end3: "До ", repeat_radio_end2: "", repeat_never: "Ніколи", repeat_daily: "Щодня", repeat_workdays: "Щодня в робочі дні", repeat_weekly: "Щотижня", repeat_monthly: "Щомісяця", repeat_yearly: "Щороку", repeat_custom: "Налаштоване", repeat_freq_day: "День", repeat_freq_week: "Тиждень", repeat_freq_month: "Місяць", repeat_freq_year: "Рік", repeat_on_date: "На дату", repeat_ends: "Закінчується", month_for_recurring: ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], day_for_recurring: ["Неділям", "Понеділкам", "Вівторкам", "Середам", "Четвергам", "П'ятницям", "Суботам"] } }; +function i18nFactory() { + return new LocaleManager({ en, ar, be, ca, cn, cs, da, de, el, es, fi, fr, he, hu, id, it, jp, nb, nl, no, pl, pt, ro, ru, si, sk, sv, tr, ua }); +} +class DatePicker { + constructor(scheduler2, container, state = {}) { + this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...state }; + this.container = null; + this.element = null; + this.onStateChangeHandlers = []; + this.scheduler = scheduler2; + this._domEvents = scheduler2._createDomEventScope(); + this.state = this.getState(); + makeEventable(this); + if (container) { + this.container = container; + this.render(this.container); } + this.onStateChange((oldState, newState) => { + this.callEvent("onStateChange", [newState, oldState]); + }); } - return output; -}, _forEachUpdatedRow: function(code) { - var updatedRows = this.updatedRows.slice(); - for (var i = 0; i < updatedRows.length; i++) { - var rowId = updatedRows[i]; - if (this.$scheduler.getUserData(rowId, this.action_param)) { - code.call(this, rowId); + getState() { + return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] }; + } + setState(newState) { + const oldState = { ...this.state }; + if (newState.mode) { + newState.currentModeIndex = this.state.modes.indexOf(newState.mode); + } + this.state = { ...this.state, ...newState }; + this._notifyStateChange(oldState, this.state); + if (this.container) { + this.render(this.container); } } -}, _prepareDataItem: function(item) { - var processedItem = {}; - var scheduler2 = this.$scheduler; - var copy2 = scheduler2.utils.copy(item); - for (var i in copy2) { - if (i.indexOf("_") === 0) { - continue; - } else if (copy2[i]) { - if (copy2[i].getUTCFullYear) { - processedItem[i] = scheduler2._helpers.formatDate(copy2[i]); - } else if (typeof copy2[i] == "object") { - processedItem[i] = this._prepareDataItem(copy2[i]); - } else if (copy2[i] === null) { - processedItem[i] = ""; - } else { - processedItem[i] = copy2[i]; + onStateChange(handler) { + this.onStateChangeHandlers.push(handler); + return () => { + const index = this.onStateChangeHandlers.indexOf(handler); + if (index !== -1) { + this.onStateChangeHandlers.splice(index, 1); } - } + }; } - processedItem[this.action_param] = scheduler2.getUserData(item.id, this.action_param); - return processedItem; -}, _getRowData: function(id2) { - var dataItem = this.$scheduler.getEvent(id2); - if (!dataItem) { - dataItem = { id: id2 }; + _notifyStateChange(oldState, newState) { + this.onStateChangeHandlers.forEach((handler) => handler(oldState, newState)); } - return this._prepareDataItem(dataItem); -} }; -function extend(scheduler2) { - scheduler2.createDataProcessor = function(config) { - var router; - var tMode; - if (config instanceof Function) { - router = config; - } else if (config.hasOwnProperty("router")) { - router = config.router; - } else if (config.hasOwnProperty("event")) { - router = config; - } - if (router) { - tMode = "CUSTOM"; + _adjustDate(direction) { + const { mode, date } = this.getState(); + const newDate = new Date(date); + if (mode === "days") { + newDate.setMonth(date.getMonth() + direction); + } else if (mode === "months") { + newDate.setFullYear(date.getFullYear() + direction); } else { - tMode = config.mode || "REST-JSON"; + newDate.setFullYear(date.getFullYear() + direction * 10); } - var dp = new DataProcessor(config.url); - dp.init(scheduler2); - dp.setTransactionMode({ mode: tMode, router }, config.batchUpdate); - return dp; - }; - scheduler2.DataProcessor = DataProcessor; -} -function message(scheduler2) { - var boxAttribute = "data-dhxbox"; - var _dhx_msg_cfg = null; - function callback(config, result) { - var usercall = config.callback; - modalBox.hide(config.box); - _dhx_msg_cfg = config.box = null; - if (usercall) - usercall(result); + this.setState({ date: newDate }); } - function modal_key(event2) { - if (_dhx_msg_cfg) { - var code = event2.which || event2.keyCode; - var preventDefault = false; - if (messageBox.keyboard) { - if (code == 13 || code == 32) { - var target = event2.target || event2.srcElement; - if (dom_helpers.getClassName(target).indexOf("scheduler_popup_button") > -1 && target.click) { - target.click(); - } else { - callback(_dhx_msg_cfg, true); - preventDefault = true; - } - } - if (code == 27) { - callback(_dhx_msg_cfg, false); - preventDefault = true; - } - } - if (preventDefault) { - if (event2.preventDefault) { - event2.preventDefault(); - } - return !(event2.cancelBubble = true); - } - return; + _toggleMode() { + const newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length; + this.setState({ currentModeIndex: newIndex }); + } + _renderCalendarHeader(container) { + const { mode, date } = this.getState(); + const header = document.createElement("div"); + header.classList.add("dhx_cal_datepicker_header"); + const backwardArrow = document.createElement("button"); + backwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"); + header.appendChild(backwardArrow); + const monthLabel = document.createElement("div"); + monthLabel.classList.add("dhx_cal_datepicker_title"); + if (mode === "days") { + monthLabel.innerText = date.toLocaleString("default", { month: "long" }) + " " + date.getFullYear(); + } else if (mode === "months") { + monthLabel.innerText = date.getFullYear(); + } else { + const startYear = Math.floor(date.getFullYear() / 10) * 10; + monthLabel.innerText = `${startYear} - ${startYear + 9}`; } + this._domEvents.attach(monthLabel, "click", this._toggleMode.bind(this)); + header.appendChild(monthLabel); + const forwardArrow = document.createElement("button"); + forwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"); + header.appendChild(forwardArrow); + container.appendChild(header); + this._domEvents.attach(backwardArrow, "click", this._adjustDate.bind(this, -1)); + this._domEvents.attach(forwardArrow, "click", this._adjustDate.bind(this, 1)); } - scheduler2.event(document, "keydown", modal_key, true); - function modality(mode) { - if (!modality.cover) { - modality.cover = document.createElement("div"); - scheduler2.event(modality.cover, "keydown", modal_key); - modality.cover.className = "dhx_modal_cover"; - document.body.appendChild(modality.cover); + render(container) { + this._domEvents.detachAll(); + this.container = container || this.container; + this.container.innerHTML = ""; + if (!this.element) { + this.element = document.createElement("div"); + this.element.classList.add("dhx_cal_datepicker"); + } + this.element.innerHTML = ""; + this.container.appendChild(this.element); + this._renderCalendarHeader(this.element); + const dataContainer = document.createElement("div"); + dataContainer.classList.add("dhx_cal_datepicker_data"); + this.element.appendChild(dataContainer); + const { mode } = this.getState(); + if (mode === "days") { + this._renderDayGrid(dataContainer); + } else if (mode === "months") { + this._renderMonthGrid(dataContainer); + } else { + this._renderYearGrid(dataContainer); } - modality.cover.style.display = mode ? "inline-block" : "none"; - } - function button(text, classValue, result) { - var buttonAriaAttrs = scheduler2._waiAria.messageButtonAttrString(text); - var name = (classValue || "").toLowerCase().replace(/ /g, "_"); - var buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; - return `
${text}
`; } - function info(text) { - if (!messageBox.area) { - messageBox.area = document.createElement("div"); - messageBox.area.className = "scheduler_message_area dhtmlx_message_area"; - messageBox.area.style[messageBox.position] = "5px"; - document.body.appendChild(messageBox.area); + _renderDayGridHeader(daysOfWeekContainer) { + const { date } = this.getState(); + const scheduler2 = this.scheduler; + let currentDate = scheduler2.date.week_start(new Date(date)); + const maxDate = scheduler2.date.add(scheduler2.date.week_start(new Date(date)), 1, "week"); + daysOfWeekContainer.classList.add("dhx_cal_datepicker_days"); + const labelFormat = scheduler2.date.date_to_str("%D"); + while (currentDate.valueOf() < maxDate.valueOf()) { + const label = labelFormat(currentDate); + const dayElement = document.createElement("div"); + dayElement.setAttribute("data-day", currentDate.getDay()); + dayElement.classList.add("dhx_cal_datepicker_dayname"); + dayElement.innerText = label; + daysOfWeekContainer.appendChild(dayElement); + currentDate = scheduler2.date.add(currentDate, 1, "day"); } - messageBox.hide(text.id); - var message2 = document.createElement("div"); - message2.innerHTML = "
" + text.text + "
"; - message2.className = "scheduler-info dhtmlx-info scheduler-" + text.type + " dhtmlx-" + text.type; - scheduler2.event(message2, "click", function() { - messageBox.hide(text.id); - text = null; - }); - scheduler2._waiAria.messageInfoAttr(message2); - if (messageBox.position == "bottom" && messageBox.area.firstChild) - messageBox.area.insertBefore(message2, messageBox.area.firstChild); - else - messageBox.area.appendChild(message2); - if (text.expire > 0) - messageBox.timers[text.id] = window.setTimeout(function() { - if (messageBox) - messageBox.hide(text.id); - }, text.expire); - messageBox.pull[text.id] = message2; - message2 = null; - return text.id; } - function getFirstDefined() { - var values = [].slice.apply(arguments, [0]); - for (var i = 0; i < values.length; i++) { - if (values[i]) { - return values[i]; - } + _weeksBetween(min, max) { + const scheduler2 = this.scheduler; + let weeks = 0; + let currWeek = new Date(min); + while (currWeek.valueOf() < max.valueOf()) { + weeks += 1; + currWeek = scheduler2.date.week_start(scheduler2.date.add(currWeek, 1, "week")); } + return weeks; } - function _boxStructure(config, ok, cancel) { - var box = document.createElement("div"); - var contentId = utils.uid(); - scheduler2._waiAria.messageModalAttr(box, contentId); - box.className = " scheduler_modal_box dhtmlx_modal_box scheduler-" + config.type + " dhtmlx-" + config.type; - box.setAttribute(boxAttribute, 1); - var inner = ""; - if (config.width) - box.style.width = config.width; - if (config.height) - box.style.height = config.height; - if (config.title) - inner += '
' + config.title + "
"; - inner += '
' + (config.content ? "" : config.text) + '
'; - if (ok) - inner += button(getFirstDefined(config.ok, scheduler2.locale.labels.message_ok, "OK"), "ok", true); - if (cancel) - inner += button(getFirstDefined(config.cancel, scheduler2.locale.labels.message_cancel, "Cancel"), "cancel", false); - if (config.buttons) { - for (var i = 0; i < config.buttons.length; i++) { - var btn = config.buttons[i]; - if (typeof btn == "object") { - var label = btn.label; - var css = btn.css || "scheduler_" + btn.label.toLowerCase() + "_button dhtmlx_" + btn.label.toLowerCase() + "_button"; - var value = btn.value || i; - inner += button(label, css, value); - } else { - inner += button(btn, btn, i); + _renderDayGrid(container) { + const { date, currentRange, eventDates, minWeeks } = this.getState(); + let minSchedulerDate = currentRange[0]; + let maxSchedulerDate = currentRange[1]; + const eventDaysTable = eventDates.reduce((acc, date2) => { + const dayStart = this.scheduler.date.day_start(new Date(date2)); + acc[dayStart.valueOf()] = true; + return acc; + }, {}); + const daysOfWeekContainer = document.createElement("div"); + this._renderDayGridHeader(daysOfWeekContainer); + container.appendChild(daysOfWeekContainer); + const scheduler2 = this.scheduler; + const firstDate = scheduler2.date.week_start(scheduler2.date.month_start(new Date(date))); + const monthStart = scheduler2.date.month_start(new Date(date)); + const monthEnd = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); + let lastDate = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); + const currentCalDate = scheduler2.date.date_part(scheduler2._currentDate()); + if (lastDate.getDay() !== 0) { + lastDate = scheduler2.date.add(scheduler2.date.week_start(lastDate), 1, "week"); + } + let weeks = this._weeksBetween(firstDate, lastDate); + if (minWeeks && weeks < minWeeks) { + lastDate = scheduler2.date.add(lastDate, minWeeks - weeks, "week"); + } + let currDate = firstDate; + const dayGridContainer = document.createElement("div"); + dayGridContainer.classList.add("dhx_cal_datepicker_days"); + this._domEvents.attach(dayGridContainer, "click", (event2) => { + const dateCell = event2.target.closest("[data-cell-date]"); + const date2 = new Date(dateCell.getAttribute("data-cell-date")); + this.callEvent("onDateClick", [date2, event2]); + }); + while (currDate.valueOf() < lastDate.valueOf()) { + const dayElement = document.createElement("div"); + dayElement.setAttribute("data-cell-date", scheduler2.templates.format_date(currDate)); + dayElement.setAttribute("data-day", currDate.getDay()); + dayElement.innerHTML = currDate.getDate(); + if (currDate.valueOf() < monthStart.valueOf()) { + dayElement.classList.add("dhx_before"); + } else if (currDate.valueOf() >= monthEnd.valueOf()) { + dayElement.classList.add("dhx_after"); + } + if (currDate.getDay() === 0 || currDate.getDay() === 6) { + dayElement.classList.add("dhx_cal_datepicker_weekend"); + } + if (currDate.valueOf() == currentCalDate.valueOf()) { + dayElement.classList.add("dhx_now"); + } + if (minSchedulerDate && maxSchedulerDate) { + if (currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()) { + dayElement.classList.add("dhx_cal_datepicker_current"); } } + if (eventDaysTable[currDate.valueOf()]) { + dayElement.classList.add("dhx_cal_datepicker_event"); + } + dayElement.classList.add("dhx_cal_datepicker_date"); + dayGridContainer.appendChild(dayElement); + currDate = scheduler2.date.add(currDate, 1, "day"); } - inner += "
"; - box.innerHTML = inner; - if (config.content) { - var node = config.content; - if (typeof node == "string") - node = document.getElementById(node); - if (node.style.display == "none") - node.style.display = ""; - box.childNodes[config.title ? 1 : 0].appendChild(node); + container.appendChild(dayGridContainer); + } + _renderMonthGrid(container) { + const { date } = this.getState(); + const wrapper = document.createElement("div"); + wrapper.classList.add("dhx_cal_datepicker_months"); + const months = []; + for (let i = 0; i < 12; i++) { + months.push(new Date(date.getFullYear(), i, 1)); } - scheduler2.event(box, "click", function(event2) { - var source = event2.target || event2.srcElement; - if (!source.className) - source = source.parentNode; - if (dom_helpers.closest(source, ".scheduler_popup_button")) { - var result = source.getAttribute("data-result"); - result = result == "true" || (result == "false" ? false : result); - callback(config, result); + const formatLabel = this.scheduler.date.date_to_str("%M"); + months.forEach((month) => { + const monthElement = document.createElement("div"); + monthElement.classList.add("dhx_cal_datepicker_month"); + if (date.getMonth() === month.getMonth()) { + monthElement.classList.add("dhx_cal_datepicker_current"); } - }); - config.box = box; - if (ok || cancel) - _dhx_msg_cfg = config; - return box; - } - function _createBox(config, ok, cancel) { - var box = config.tagName ? config : _boxStructure(config, ok, cancel); - if (!config.hidden) - modality(true); - document.body.appendChild(box); - var x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2)); - var y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2)); - if (config.position == "top") - box.style.top = "-3px"; - else - box.style.top = y + "px"; - box.style.left = x + "px"; - scheduler2.event(box, "keydown", modal_key); - modalBox.focus(box); - if (config.hidden) - modalBox.hide(box); - scheduler2.callEvent("onMessagePopup", [box]); - return box; - } - function alertPopup(config) { - return _createBox(config, true, false); - } - function confirmPopup(config) { - return _createBox(config, true, true); - } - function boxPopup(config) { - return _createBox(config); + monthElement.setAttribute("data-month", month.getMonth()); + monthElement.innerHTML = formatLabel(month); + this._domEvents.attach(monthElement, "click", () => { + const newDate = new Date(month); + this.setState({ date: newDate, mode: "days" }); + }); + wrapper.appendChild(monthElement); + }); + container.appendChild(wrapper); + const doneArea = document.createElement("div"); + doneArea.classList.add("dhx_cal_datepicker_done"); + const doneBtn = document.createElement("button"); + doneBtn.innerText = "Done"; + doneBtn.classList.add("dhx_cal_datepicker_done_btn"); + this._domEvents.attach(doneBtn, "click", () => { + this.setState({ mode: "days" }); + }); + doneArea.appendChild(doneBtn); + container.appendChild(doneArea); } - function box_params(text, type, callback2) { - if (typeof text != "object") { - if (typeof type == "function") { - callback2 = type; - type = ""; + _renderYearGrid(container) { + const { date } = this.getState(); + const startYear = Math.floor(date.getFullYear() / 10) * 10; + const wrapper = document.createElement("div"); + wrapper.classList.add("dhx_cal_datepicker_years"); + for (let i = startYear - 1; i <= startYear + 10; i++) { + const yearElement = document.createElement("div"); + yearElement.innerText = i; + yearElement.classList.add("dhx_cal_datepicker_year"); + yearElement.setAttribute("data-year", i); + if (date.getFullYear() === i) { + yearElement.classList.add("dhx_cal_datepicker_current"); } - text = { text, type, callback: callback2 }; + this._domEvents.attach(yearElement, "click", () => { + this.setState({ date: new Date(i, date.getMonth(), 1), mode: "months" }); + }); + wrapper.appendChild(yearElement); } - return text; - } - function params(text, type, expire, id2) { - if (typeof text != "object") - text = { text, type, expire, id: id2 }; - text.id = text.id || utils.uid(); - text.expire = text.expire || messageBox.expire; - return text; + container.appendChild(wrapper); + const doneArea = document.createElement("div"); + doneArea.classList.add("dhx_cal_datepicker_done"); + const doneBtn = document.createElement("button"); + doneBtn.innerText = "Done"; + doneBtn.classList.add("dhx_cal_datepicker_done_btn"); + this._domEvents.attach(doneBtn, "click", () => { + this.setState({ mode: "months" }); + }); + doneArea.appendChild(doneBtn); + container.appendChild(doneArea); } - var alertBox = function() { - var text = box_params.apply(this, arguments); - text.type = text.type || "confirm"; - return alertPopup(text); - }; - var confirmBox = function() { - var text = box_params.apply(this, arguments); - text.type = text.type || "alert"; - return confirmPopup(text); - }; - var modalBox = function() { - var text = box_params.apply(this, arguments); - text.type = text.type || "alert"; - return boxPopup(text); - }; - modalBox.hide = function(node) { - while (node && node.getAttribute && !node.getAttribute(boxAttribute)) - node = node.parentNode; - if (node) { - node.parentNode.removeChild(node); - modality(false); - scheduler2.callEvent("onAfterMessagePopup", [node]); + destructor() { + this.onStateChangeHandlers = []; + if (this.element) { + this.element.innerHTML = ""; + this.element.remove(); } + this._domEvents.detachAll(); + this.callEvent("onDestroy", []); + this.detachAllEvents(); + this.scheduler = null; + } +} +function factoryMethod(extensionManager) { + const scheduler2 = { version: "7.1.0" }; + scheduler2.$stateProvider = StateService(); + scheduler2.getState = scheduler2.$stateProvider.getState; + extend$n(scheduler2); + extend$i(scheduler2); + extend$j(scheduler2); + extend$h(scheduler2); + scheduler2.utils = utils; + scheduler2.$domHelpers = dom_helpers; + scheduler2.utils.dom = dom_helpers; + scheduler2.uid = utils.uid; + scheduler2.mixin = utils.mixin; + scheduler2.defined = utils.defined; + scheduler2.assert = assert(scheduler2); + scheduler2.copy = utils.copy; + scheduler2._createDatePicker = function(container, config) { + return new DatePicker(scheduler2, container, config); }; - modalBox.focus = function(node) { - setTimeout(function() { - var focusable = dom_helpers.getFocusableNodes(node); - if (focusable.length) { - if (focusable[0].focus) - focusable[0].focus(); + scheduler2._getFocusableNodes = dom_helpers.getFocusableNodes; + scheduler2._getClassName = dom_helpers.getClassName; + scheduler2._locate_css = dom_helpers.locateCss; + const messageApi = message(scheduler2); + scheduler2.utils.mixin(scheduler2, messageApi); + scheduler2.env = scheduler2.$env = env; + scheduler2.Promise = window.Promise; + extend$g(scheduler2); + extend$f(scheduler2); + extend$e(scheduler2); + extend$d(scheduler2); + extend$c(scheduler2); + extend$b(scheduler2); + extend$7(scheduler2); + extend$6(scheduler2); + extend$5(scheduler2); + extend$4(scheduler2); + extend$3(scheduler2); + extend$2(); + extend$1(scheduler2); + extend(scheduler2); + extend$m(scheduler2); + const i18n = i18nFactory(); + scheduler2.i18n = { addLocale: i18n.addLocale, setLocale: function(locale) { + if (typeof locale === "string") { + var localeObject = i18n.getLocale(locale); + if (!localeObject) { + localeObject = i18n.getLocale("en"); + } + scheduler2.locale = localeObject; + } else if (locale) { + if (!scheduler2.locale) { + scheduler2.locale = locale; + } else { + for (var i in locale) { + if (locale[i] && typeof locale[i] === "object") { + if (!scheduler2.locale[i]) { + scheduler2.locale[i] = {}; + } + scheduler2.mixin(scheduler2.locale[i], locale[i], true); + } else { + scheduler2.locale[i] = locale[i]; + } + } } - }, 1); - }; - var messageBox = function(text, type, expire, id2) { - text = params.apply(this, arguments); - text.type = text.type || "info"; - var subtype = text.type.split("-")[0]; - switch (subtype) { - case "alert": - return alertPopup(text); - case "confirm": - return confirmPopup(text); - case "modalbox": - return boxPopup(text); - default: - return info(text); } - }; - messageBox.seed = (/* @__PURE__ */ new Date()).valueOf(); - messageBox.uid = utils.uid; - messageBox.expire = 4e3; - messageBox.keyboard = true; - messageBox.position = "top"; - messageBox.pull = {}; - messageBox.timers = {}; - messageBox.hideAll = function() { - for (var key in messageBox.pull) - messageBox.hide(key); - }; - messageBox.hide = function(id2) { - var obj = messageBox.pull[id2]; - if (obj && obj.parentNode) { - window.setTimeout(function() { - obj.parentNode.removeChild(obj); - obj = null; - }, 2e3); - obj.className += " hidden"; - if (messageBox.timers[id2]) - window.clearTimeout(messageBox.timers[id2]); - delete messageBox.pull[id2]; + var labels = scheduler2.locale.labels; + labels.dhx_save_btn = labels.icon_save; + labels.dhx_cancel_btn = labels.icon_cancel; + labels.dhx_delete_btn = labels.icon_delete; + if (scheduler2.$container) { + scheduler2.get_elements(); } + }, getLocale: i18n.getLocale }; + scheduler2.i18n.setLocale("en"); + initPlugins(scheduler2); + scheduler2.ext = {}; + const activePlugins = {}; + scheduler2.plugins = function(config) { + const extensionList = getExtensionList(config, { treetimeline: ["timeline"], daytimeline: ["timeline"], outerdrag: ["legacy"] }, { legacy: 1, limit: 1, timeline: 2, daytimeline: 3, treetimeline: 3, outerdrag: 6 }); + extensionList.forEach(function(name) { + if (!activePlugins[name]) { + const plugin = extensionManager.getExtension(name); + if (plugin) { + plugin(scheduler2); + activePlugins[name] = true; + } else { + throw new Error("unknown plugin " + name); + } + } + }); }; - var popups = []; - scheduler2.attachEvent("onMessagePopup", function(box) { - popups.push(box); - }); - scheduler2.attachEvent("onAfterMessagePopup", function(box) { - for (var i = 0; i < popups.length; i++) { - if (popups[i] === box) { - popups.splice(i, 1); - i--; + function getExtensionList(config, dependencies, priorities) { + const result = []; + for (const i in config) { + if (config[i]) { + const extension = i.toLowerCase(); + if (dependencies[extension]) { + dependencies[extension].forEach(function(dep) { + const dependencyName = dep.toLowerCase(); + if (!config[dependencyName]) { + result.push(dependencyName); + } + }); + } + result.push(extension); } } - }); - scheduler2.attachEvent("onDestroy", function() { - if (modality.cover && modality.cover.parentNode) { - modality.cover.parentNode.removeChild(modality.cover); - } - for (var i = 0; i < popups.length; i++) { - if (popups[i].parentNode) { - popups[i].parentNode.removeChild(popups[i]); + result.sort(function(a, b) { + const orderA = priorities[a] || 0; + const orderB = priorities[b] || 0; + if (orderA > orderB) { + return 1; + } else if (orderA < orderB) { + return -1; + } else { + return 0; } - } - popups = null; - if (messageBox.area && messageBox.area.parentNode) { - messageBox.area.parentNode.removeChild(messageBox.area); - } - messageBox = null; - }); - return { alert: alertBox, confirm: confirmBox, message: messageBox, modalbox: modalBox }; + }); + return result; + } + return scheduler2; } -const ar = { date: { month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"], day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"] }, labels: { dhx_cal_today_button: "اليوم", day_tab: "يوم", week_tab: "أسبوع", month_tab: "شهر", new_event: "حدث جديد", icon_save: "اخزن", icon_cancel: "الغاء", icon_details: "تفاصيل", icon_edit: "تحرير", icon_delete: "حذف", confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟", confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟", section_description: "الوصف", section_time: "الفترة الزمنية", full_day: "طوال اليوم", confirm_recurring: "هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟", section_recurring: "تكرار الحدث", button_recurring: "تعطيل", button_recurring_open: "تمكين", button_edit_series: "تحرير سلسلة", button_edit_occurrence: "تعديل نسخة", grid_tab: "جدول", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const be = { date: { month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"], month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"], day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"], day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сёння", day_tab: "Дзень", week_tab: "Тыдзень", month_tab: "Месяц", new_event: "Новая падзея", icon_save: "Захаваць", icon_cancel: "Адмяніць", icon_details: "Дэталі", icon_edit: "Змяніць", icon_delete: "Выдаліць", confirm_closing: "", confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?", section_description: "Апісанне", section_time: "Перыяд часу", full_day: "Увесь дзень", confirm_recurring: "Вы хочаце змяніць усю серыю паўтаральных падзей?", section_recurring: "Паўтарэнне", button_recurring: "Адключана", button_recurring_open: "Уключана", button_edit_series: "Рэдагаваць серыю", button_edit_occurrence: "Рэдагаваць асобнік", agenda_tab: "Спіс", date: "Дата", description: "Апісанне", year_tab: "Год", week_agenda_tab: "Спіс", grid_tab: "Спic", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Дзень", repeat_radio_week: "Тыдзень", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Кожны", repeat_text_day_count: "дзень", repeat_radio_day_type2: "Кожны працоўны дзень", repeat_week: " Паўтараць кожны", repeat_text_week_count: "тыдзень", repeat_radio_month_type: "Паўтараць", repeat_radio_month_start: "", repeat_text_month_day: " чысла кожнага", repeat_text_month_count: "месяцу", repeat_text_month_count2_before: "кожны ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "дзень", select_year_month: "", repeat_radio_end: "Без даты заканчэння", repeat_text_occurences_count: "паўтораў", repeat_radio_end2: "", repeat_radio_end3: "Да ", month_for_recurring: ["Студзеня", "Лютага", "Сакавіка", "Красавіка", "Мая", "Чэрвеня", "Ліпeня", "Жніўня", "Верасня", "Кастрычніка", "Лістапада", "Снежня"], day_for_recurring: ["Нядзелю", "Панядзелак", "Аўторак", "Сераду", "Чацвер", "Пятніцу", "Суботу"] } }; -const ca = { date: { month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"] }, labels: { dhx_cal_today_button: "Hui", day_tab: "Dia", week_tab: "Setmana", month_tab: "Mes", new_event: "Nou esdeveniment", icon_save: "Guardar", icon_cancel: "Cancel·lar", icon_details: "Detalls", icon_edit: "Editar", icon_delete: "Esborrar", confirm_closing: "", confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?", section_description: "Descripció", section_time: "Periode de temps", full_day: "Tot el dia", confirm_recurring: "¿Desitja modificar el conjunt d'esdeveniments repetits?", section_recurring: "Repeteixca l'esdeveniment", button_recurring: "Impedit", button_recurring_open: "Permés", button_edit_series: "Edit sèrie", button_edit_occurrence: "Edita Instància", agenda_tab: "Agenda", date: "Data", description: "Descripció", year_tab: "Any", week_agenda_tab: "Agenda", grid_tab: "Taula", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const cn = { date: { month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], day_short: ["日", "一", "二", "三", "四", "五", "六"] }, labels: { dhx_cal_today_button: "今天", day_tab: "日", week_tab: "周", month_tab: "月", new_event: "新建日程", icon_save: "保存", icon_cancel: "关闭", icon_details: "详细", icon_edit: "编辑", icon_delete: "删除", confirm_closing: "请确认是否撤销修改!", confirm_deleting: "是否删除日程?", section_description: "描述", section_time: "时间范围", full_day: "整天", confirm_recurring: "请确认是否将日程设为重复模式?", section_recurring: "重复周期", button_recurring: "禁用", button_recurring_open: "启用", button_edit_series: "编辑系列", button_edit_occurrence: "编辑实例", agenda_tab: "议程", date: "日期", description: "说明", year_tab: "今年", week_agenda_tab: "议程", grid_tab: "电网", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "按天", repeat_radio_week: "按周", repeat_radio_month: "按月", repeat_radio_year: "按年", repeat_radio_day_type: "每", repeat_text_day_count: "天", repeat_radio_day_type2: "每个工作日", repeat_week: " 重复 每", repeat_text_week_count: "星期的:", repeat_radio_month_type: "重复", repeat_radio_month_start: "在", repeat_text_month_day: "日 每", repeat_text_month_count: "月", repeat_text_month_count2_before: "每", repeat_text_month_count2_after: "月", repeat_year_label: "在", select_year_day2: "的", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "无结束日期", repeat_text_occurences_count: "次结束", repeat_radio_end2: "重复", repeat_radio_end3: "结束于", month_for_recurring: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], day_for_recurring: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] } }; -const cs = { date: { month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"], day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"], day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Den", week_tab: "Týden", month_tab: "Měsíc", new_event: "Nová událost", icon_save: "Uložit", icon_cancel: "Zpět", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Smazat", confirm_closing: "", confirm_deleting: "Událost bude trvale smazána, opravdu?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Přejete si upravit celou řadu opakovaných událostí?", section_recurring: "Opakování události", button_recurring: "Vypnuto", button_recurring_open: "Zapnuto", button_edit_series: "Edit series", button_edit_occurrence: "Upravit instance", agenda_tab: "Program", date: "Datum", description: "Poznámka", year_tab: "Rok", full_day: "Full day", week_agenda_tab: "Program", grid_tab: "Mřížka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denně", repeat_radio_week: "Týdně", repeat_radio_month: "Měsíčně", repeat_radio_year: "Ročně", repeat_radio_day_type: "každý", repeat_text_day_count: "Den", repeat_radio_day_type2: "pracovní dny", repeat_week: "Opakuje každých", repeat_text_week_count: "Týdnů na:", repeat_radio_month_type: "u každého", repeat_radio_month_start: "na", repeat_text_month_day: "Den každého", repeat_text_month_count: "Měsíc", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "Měsíc", repeat_year_label: "na", select_year_day2: "v", repeat_text_year_day: "Den v", select_year_month: "", repeat_radio_end: "bez data ukončení", repeat_text_occurences_count: "Události", repeat_radio_end2: "po", repeat_radio_end3: "Konec", month_for_recurring: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], day_for_recurring: ["Neděle ", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"] } }; -const da = { date: { month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uge", month_tab: "Måned", new_event: "Ny begivenhed", icon_save: "Gem", icon_cancel: "Fortryd", icon_details: "Detaljer", icon_edit: "Tilret", icon_delete: "Slet", confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?", confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du tilrette hele serien af gentagne begivenheder?", section_recurring: "Gentag begivenhed", button_recurring: "Frakoblet", button_recurring_open: "Tilkoblet", button_edit_series: "Rediger serien", button_edit_occurrence: "Rediger en kopi", agenda_tab: "Dagsorden", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Dagsorden", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ugenlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "På hver arbejdsdag", repeat_week: " Gentager sig hver", repeat_text_week_count: "uge på følgende dage:", repeat_radio_month_type: "Hver den", repeat_radio_month_start: "Den", repeat_text_month_day: " i hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen slutdato", repeat_text_occurences_count: "gentagelse", repeat_radio_end2: "Efter", repeat_radio_end3: "Slut", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; -const de = { date: { month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"], month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"], day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }, labels: { dhx_cal_today_button: "Heute", day_tab: "Tag", week_tab: "Woche", month_tab: "Monat", new_event: "neuer Eintrag", icon_save: "Speichern", icon_cancel: "Abbrechen", icon_details: "Details", icon_edit: "Ändern", icon_delete: "Löschen", confirm_closing: "", confirm_deleting: "Der Eintrag wird gelöscht", section_description: "Beschreibung", section_time: "Zeitspanne", full_day: "Ganzer Tag", confirm_recurring: "Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?", section_recurring: "Wiederholung", button_recurring: "Aus", button_recurring_open: "An", button_edit_series: "Bearbeiten Sie die Serie", button_edit_occurrence: "Bearbeiten Sie eine Kopie", agenda_tab: "Agenda", date: "Datum", description: "Beschreibung", year_tab: "Jahre", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Täglich", repeat_radio_week: "Wöchentlich", repeat_radio_month: "Monatlich", repeat_radio_year: "Jährlich", repeat_radio_day_type: "jeden", repeat_text_day_count: "Tag", repeat_radio_day_type2: "an jedem Arbeitstag", repeat_week: " Wiederholt sich jede", repeat_text_week_count: "Woche am:", repeat_radio_month_type: "an jedem", repeat_radio_month_start: "am", repeat_text_month_day: "Tag eines jeden", repeat_text_month_count: "Monats", repeat_text_month_count2_before: "jeden", repeat_text_month_count2_after: "Monats", repeat_year_label: "am", select_year_day2: "im", repeat_text_year_day: "Tag im", select_year_month: "", repeat_radio_end: "kein Enddatum", repeat_text_occurences_count: "Ereignissen", repeat_radio_end3: "Schluß", repeat_radio_end2: "nach", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] } }; -const el = { date: { month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"], day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"] }, labels: { dhx_cal_today_button: "Σήμερα", day_tab: "Ημέρα", week_tab: "Εβδομάδα", month_tab: "Μήνας", new_event: "Νέο έργο", icon_save: "Αποθήκευση", icon_cancel: "Άκυρο", icon_details: "Λεπτομέρειες", icon_edit: "Επεξεργασία", icon_delete: "Διαγραφή", confirm_closing: "", confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;", section_description: "Περιγραφή", section_time: "Χρονική περίοδος", full_day: "Πλήρης Ημέρα", confirm_recurring: "Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;", section_recurring: "Επαναλαμβανόμενο έργο", button_recurring: "Ανενεργό", button_recurring_open: "Ενεργό", button_edit_series: "Επεξεργαστείτε τη σειρά", button_edit_occurrence: "Επεξεργασία ένα αντίγραφο", agenda_tab: "Ημερήσια Διάταξη", date: "Ημερομηνία", description: "Περιγραφή", year_tab: "Έτος", week_agenda_tab: "Ημερήσια Διάταξη", grid_tab: "Πλέγμα", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Ημερησίως", repeat_radio_week: "Εβδομαδιαίως", repeat_radio_month: "Μηνιαίως", repeat_radio_year: "Ετησίως", repeat_radio_day_type: "Κάθε", repeat_text_day_count: "ημέρα", repeat_radio_day_type2: "Κάθε εργάσιμη", repeat_week: " Επανάληψη κάθε", repeat_text_week_count: "εβδομάδα τις επόμενες ημέρες:", repeat_radio_month_type: "Επανάληψη", repeat_radio_month_start: "Την", repeat_text_month_day: "ημέρα κάθε", repeat_text_month_count: "μήνα", repeat_text_month_count2_before: "κάθε", repeat_text_month_count2_after: "μήνα", repeat_year_label: "Την", select_year_day2: "του", repeat_text_year_day: "ημέρα", select_year_month: "μήνα", repeat_radio_end: "Χωρίς ημερομηνία λήξεως", repeat_text_occurences_count: "επαναλήψεις", repeat_radio_end3: "Λήγει την", repeat_radio_end2: "Μετά από", month_for_recurring: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], day_for_recurring: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"] } }; -const en = { date: { month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, labels: { dhx_cal_today_button: "Today", day_tab: "Day", week_tab: "Week", month_tab: "Month", new_event: "New event", icon_save: "Save", icon_cancel: "Cancel", icon_details: "Details", icon_edit: "Edit", icon_delete: "Delete", confirm_closing: "", confirm_deleting: "Event will be deleted permanently, are you sure?", section_description: "Description", section_time: "Time period", full_day: "Full day", confirm_recurring: "Do you want to edit the whole set of repeated events?", section_recurring: "Repeat event", button_recurring: "Disabled", button_recurring_open: "Enabled", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Agenda", date: "Date", description: "Description", year_tab: "Year", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daily", repeat_radio_week: "Weekly", repeat_radio_month: "Monthly", repeat_radio_year: "Yearly", repeat_radio_day_type: "Every", repeat_text_day_count: "day", repeat_radio_day_type2: "Every workday", repeat_week: " Repeat every", repeat_text_week_count: "week next days:", repeat_radio_month_type: "Repeat", repeat_radio_month_start: "On", repeat_text_month_day: "day every", repeat_text_month_count: "month", repeat_text_month_count2_before: "every", repeat_text_month_count2_after: "month", repeat_year_label: "On", select_year_day2: "of", repeat_text_year_day: "day", select_year_month: "month", repeat_radio_end: "No end date", repeat_text_occurences_count: "occurrences", repeat_radio_end2: "After", repeat_radio_end3: "End by", month_for_recurring: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], day_for_recurring: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] } }; -const es = { date: { month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"] }, labels: { dhx_cal_today_button: "Hoy", day_tab: "Día", week_tab: "Semana", month_tab: "Mes", new_event: "Nuevo evento", icon_save: "Guardar", icon_cancel: "Cancelar", icon_details: "Detalles", icon_edit: "Editar", icon_delete: "Eliminar", confirm_closing: "", confirm_deleting: "El evento se borrará definitivamente, ¿continuar?", section_description: "Descripción", section_time: "Período", full_day: "Todo el día", confirm_recurring: "¿Desea modificar el conjunto de eventos repetidos?", section_recurring: "Repita el evento", button_recurring: "Impedido", button_recurring_open: "Permitido", button_edit_series: "Editar la serie", button_edit_occurrence: "Editar este evento", agenda_tab: "Día", date: "Fecha", description: "Descripción", year_tab: "Año", week_agenda_tab: "Día", grid_tab: "Reja", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diariamente", repeat_radio_week: "Semanalmente", repeat_radio_month: "Mensualmente", repeat_radio_year: "Anualmente", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada jornada de trabajo", repeat_week: " Repetir cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repita", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada ", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "del", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sin fecha de finalización", repeat_text_occurences_count: "ocurrencias", repeat_radio_end3: "Fin", repeat_radio_end2: "Después de", month_for_recurring: ["Enero", "Febrero", "Маrzo", "Аbril", "Mayo", "Junio", "Julio", "Аgosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"], day_for_recurring: ["Domingo", "Lunes", "Martes", "Miércoles", "Jeuves", "Viernes", "Sabado"] } }; -const fi = { date: { month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"], day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"] }, labels: { dhx_cal_today_button: "Tänään", day_tab: "Päivä", week_tab: "Viikko", month_tab: "Kuukausi", new_event: "Uusi tapahtuma", icon_save: "Tallenna", icon_cancel: "Peru", icon_details: "Tiedot", icon_edit: "Muokkaa", icon_delete: "Poista", confirm_closing: "", confirm_deleting: "Haluatko varmasti poistaa tapahtuman?", section_description: "Kuvaus", section_time: "Aikajakso", full_day: "Koko päivä", confirm_recurring: "Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?", section_recurring: "Toista tapahtuma", button_recurring: "Ei käytössä", button_recurring_open: "Käytössä", button_edit_series: "Muokkaa sarja", button_edit_occurrence: "Muokkaa kopio", agenda_tab: "Esityslista", date: "Päivämäärä", description: "Kuvaus", year_tab: "Vuoden", week_agenda_tab: "Esityslista", grid_tab: "Ritilä", drag_to_create: "Luo uusi vetämällä", drag_to_move: "Siirrä vetämällä", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Päivittäin", repeat_radio_week: "Viikoittain", repeat_radio_month: "Kuukausittain", repeat_radio_year: "Vuosittain", repeat_radio_day_type: "Joka", repeat_text_day_count: "päivä", repeat_radio_day_type2: "Joka arkipäivä", repeat_week: "Toista joka", repeat_text_week_count: "viikko näinä päivinä:", repeat_radio_month_type: "Toista", repeat_radio_month_start: "", repeat_text_month_day: "päivänä joka", repeat_text_month_count: "kuukausi", repeat_text_month_count2_before: "joka", repeat_text_month_count2_after: "kuukausi", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "päivä", select_year_month: "kuukausi", repeat_radio_end: "Ei loppumisaikaa", repeat_text_occurences_count: "Toiston jälkeen", repeat_radio_end3: "Loppuu", repeat_radio_end2: "", month_for_recurring: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], day_for_recurring: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"] } }; -const fr = { date: { month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"], day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels: { dhx_cal_today_button: "Aujourd'hui", day_tab: "Jour", week_tab: "Semaine", month_tab: "Mois", new_event: "Nouvel événement", icon_save: "Enregistrer", icon_cancel: "Annuler", icon_details: "Détails", icon_edit: "Modifier", icon_delete: "Effacer", confirm_closing: "", confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?", section_description: "Description", section_time: "Période", full_day: "Journée complète", confirm_recurring: "Voulez-vous éditer toute une série d'évènements répétés?", section_recurring: "Périodicité", button_recurring: "Désactivé", button_recurring_open: "Activé", button_edit_series: "Modifier la série", button_edit_occurrence: "Modifier une copie", agenda_tab: "Jour", date: "Date", description: "Description", year_tab: "Année", week_agenda_tab: "Jour", grid_tab: "Grille", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidienne", repeat_radio_week: "Hebdomadaire", repeat_radio_month: "Mensuelle", repeat_radio_year: "Annuelle", repeat_radio_day_type: "Chaque", repeat_text_day_count: "jour", repeat_radio_day_type2: "Chaque journée de travail", repeat_week: " Répéter toutes les", repeat_text_week_count: "semaine:", repeat_radio_month_type: "Répéter", repeat_radio_month_start: "Le", repeat_text_month_day: "jour chaque", repeat_text_month_count: "mois", repeat_text_month_count2_before: "chaque", repeat_text_month_count2_after: "mois", repeat_year_label: "Le", select_year_day2: "du", repeat_text_year_day: "jour", select_year_month: "mois", repeat_radio_end: "Pas de date d"achèvement", repeat_text_occurences_count: "occurrences", repeat_radio_end3: "Fin", repeat_radio_end2: "Après", month_for_recurring: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], day_for_recurring: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] } }; -const he = { date: { month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"] }, labels: { dhx_cal_today_button: "היום", day_tab: "יום", week_tab: "שבוע", month_tab: "חודש", new_event: "ארוע חדש", icon_save: "שמור", icon_cancel: "בטל", icon_details: "פרטים", icon_edit: "ערוך", icon_delete: "מחק", confirm_closing: "", confirm_deleting: "ארוע ימחק סופית.להמשיך?", section_description: "תיאור", section_time: "תקופה", confirm_recurring: "האם ברצונך לשנות כל סדרת ארועים מתמשכים?", section_recurring: "להעתיק ארוע", button_recurring: "לא פעיל", button_recurring_open: "פעיל", full_day: "יום שלם", button_edit_series: "ערוך את הסדרה", button_edit_occurrence: "עריכת עותק", agenda_tab: "סדר יום", date: "תאריך", description: "תיאור", year_tab: "לשנה", week_agenda_tab: "סדר יום", grid_tab: "סורג", drag_to_create: "Drag to create", drag_to_move: "גרור כדי להזיז", message_ok: "OK", message_cancel: "בטל", next: "הבא", prev: "הקודם", year: "שנה", month: "חודש", day: "יום", hour: "שעה", minute: "דקה", repeat_radio_day: "יומי", repeat_radio_week: "שבועי", repeat_radio_month: "חודשי", repeat_radio_year: "שנתי", repeat_radio_day_type: "חזור כל", repeat_text_day_count: "ימים", repeat_radio_day_type2: "חזור כל יום עבודה", repeat_week: " חזור כל", repeat_text_week_count: "שבוע לפי ימים:", repeat_radio_month_type: "חזור כל", repeat_radio_month_start: "כל", repeat_text_month_day: "ימים כל", repeat_text_month_count: "חודשים", repeat_text_month_count2_before: "חזור כל", repeat_text_month_count2_after: "חודש", repeat_year_label: "כל", select_year_day2: "בחודש", repeat_text_year_day: "ימים", select_year_month: "חודש", repeat_radio_end: "לעולם לא מסתיים", repeat_text_occurences_count: "אירועים", repeat_radio_end3: "מסתיים ב", repeat_radio_end2: "אחרי", month_for_recurring: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], day_for_recurring: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"] } }; -const hu = { date: { month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"], day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"] }, labels: { dhx_cal_today_button: "Ma", day_tab: "Nap", week_tab: "Hét", month_tab: "Hónap", new_event: "Új esemény", icon_save: "Mentés", icon_cancel: "Mégse", icon_details: "Részletek", icon_edit: "Szerkesztés", icon_delete: "Törlés", confirm_closing: "", confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?", section_description: "Leírás", section_time: "Idõszak", full_day: "Egesz napos", confirm_recurring: "Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?", section_recurring: "Esemény ismétlése", button_recurring: "Tiltás", button_recurring_open: "Engedélyezés", button_edit_series: "Edit series", button_edit_occurrence: "Szerkesztés bíróság", agenda_tab: "Napirend", date: "Dátum", description: "Leírás", year_tab: "Év", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const id = { date: { month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"], day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, labels: { dhx_cal_today_button: "Hari Ini", day_tab: "Hari", week_tab: "Minggu", month_tab: "Bulan", new_event: "Acara Baru", icon_save: "Simpan", icon_cancel: "Batal", icon_details: "Detail", icon_edit: "Edit", icon_delete: "Hapus", confirm_closing: "", confirm_deleting: "Acara akan dihapus", section_description: "Keterangan", section_time: "Periode", full_day: "Hari penuh", confirm_recurring: "Apakah acara ini akan berulang?", section_recurring: "Acara Rutin", button_recurring: "Tidak Difungsikan", button_recurring_open: "Difungsikan", button_edit_series: "Mengedit seri", button_edit_occurrence: "Mengedit salinan", agenda_tab: "Agenda", date: "Tanggal", description: "Keterangan", year_tab: "Tahun", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const it = { date: { month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"] }, labels: { dhx_cal_today_button: "Oggi", day_tab: "Giorno", week_tab: "Settimana", month_tab: "Mese", new_event: "Nuovo evento", icon_save: "Salva", icon_cancel: "Chiudi", icon_details: "Dettagli", icon_edit: "Modifica", icon_delete: "Elimina", confirm_closing: "", confirm_deleting: "L'evento sarà eliminato, siete sicuri?", section_description: "Descrizione", section_time: "Periodo di tempo", full_day: "Intera giornata", confirm_recurring: "Vuoi modificare l'intera serie di eventi?", section_recurring: "Ripetere l'evento", button_recurring: "Disattivato", button_recurring_open: "Attivato", button_edit_series: "Modificare la serie", button_edit_occurrence: "Modificare una copia", agenda_tab: "Agenda", date: "Data", description: "Descrizione", year_tab: "Anno", week_agenda_tab: "Agenda", grid_tab: "Griglia", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidiano", repeat_radio_week: "Settimanale", repeat_radio_month: "Mensile", repeat_radio_year: "Annuale", repeat_radio_day_type: "Ogni", repeat_text_day_count: "giorno", repeat_radio_day_type2: "Ogni giornata lavorativa", repeat_week: " Ripetere ogni", repeat_text_week_count: "settimana:", repeat_radio_month_type: "Ripetere", repeat_radio_month_start: "Il", repeat_text_month_day: "giorno ogni", repeat_text_month_count: "mese", repeat_text_month_count2_before: "ogni", repeat_text_month_count2_after: "mese", repeat_year_label: "Il", select_year_day2: "del", repeat_text_year_day: "giorno", select_year_month: "mese", repeat_radio_end: "Senza data finale", repeat_text_occurences_count: "occorenze", repeat_radio_end3: "Fine", repeat_radio_end2: "Dopo", month_for_recurring: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Jiugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], day_for_recurring: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Jovedì", "Venerdì", "Sabato"] } }; -const jp = { date: { month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], day_short: ["日", "月", "火", "水", "木", "金", "土"] }, labels: { dhx_cal_today_button: "今日", day_tab: "日", week_tab: "週", month_tab: "月", new_event: "新イベント", icon_save: "保存", icon_cancel: "キャンセル", icon_details: "詳細", icon_edit: "編集", icon_delete: "削除", confirm_closing: "", confirm_deleting: "イベント完全に削除されます、宜しいですか?", section_description: "デスクリプション", section_time: "期間", confirm_recurring: "繰り返されているイベントを全て編集しますか?", section_recurring: "イベントを繰り返す", button_recurring: "無効", button_recurring_open: "有効", full_day: "終日", button_edit_series: "シリーズを編集します", button_edit_occurrence: "コピーを編集", agenda_tab: "議題は", date: "日付", description: "説明", year_tab: "今年", week_agenda_tab: "議題は", grid_tab: "グリッド", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -class LocaleManager { +class ExtensionsManager { constructor(config) { - this._locales = {}; + this._extensions = {}; for (const i in config) { - this._locales[i] = config[i]; + this._extensions[i] = config[i]; } } - addLocale(name, locale) { - this._locales[name] = locale; + addExtension(name, ext) { + this._extensions[name] = ext; } - getLocale(name) { - return this._locales[name]; + getExtension(name) { + return this._extensions[name]; } } -const nb = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "I dag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny hendelse", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du forandre hele dette settet av repeterende hendelser?", section_recurring: "Repeter hendelsen", button_recurring: "Av", button_recurring_open: "På", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Alle hverdager", repeat_week: " Gjentas hver", repeat_text_week_count: "uke på:", repeat_radio_month_type: "På hver", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "på", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomst", repeat_radio_end3: "Stop den", repeat_radio_end2: "Etter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Sondag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; -const nl = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { dhx_cal_today_button: "Vandaag", day_tab: "Dag", week_tab: "Week", month_tab: "Maand", new_event: "Nieuw item", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", full_day: "Hele dag", confirm_recurring: "Wilt u alle terugkerende items bijwerken?", section_recurring: "Item herhalen", button_recurring: "Uit", button_recurring_open: "Aan", button_edit_series: "Bewerk de serie", button_edit_occurrence: "Bewerk een kopie", agenda_tab: "Agenda", date: "Datum", description: "Omschrijving", year_tab: "Jaar", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagelijks", repeat_radio_week: "Wekelijks", repeat_radio_month: "Maandelijks", repeat_radio_year: "Jaarlijks", repeat_radio_day_type: "Elke", repeat_text_day_count: "dag(en)", repeat_radio_day_type2: "Elke werkdag", repeat_week: " Herhaal elke", repeat_text_week_count: "week op de volgende dagen:", repeat_radio_month_type: "Herhaal", repeat_radio_month_start: "Op", repeat_text_month_day: "dag iedere", repeat_text_month_count: "maanden", repeat_text_month_count2_before: "iedere", repeat_text_month_count2_after: "maanden", repeat_year_label: "Op", select_year_day2: "van", repeat_text_year_day: "dag", select_year_month: "maand", repeat_radio_end: "Geen eind datum", repeat_text_occurences_count: "keren", repeat_radio_end3: "Eindigd per", repeat_radio_end2: "Na", month_for_recurring: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], day_for_recurring: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"] } }; -const no = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", full_day: "Full dag", confirm_recurring: "Vil du endre hele settet med repeterende oppføringer?", section_recurring: "Repeterende oppføring", button_recurring: "Ikke aktiv", button_recurring_open: "Aktiv", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const pl = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { dhx_cal_today_button: "Dziś", day_tab: "Dzień", week_tab: "Tydzień", month_tab: "Miesiąc", new_event: "Nowe zdarzenie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", full_day: "Cały dzień", confirm_recurring: "Czy chcesz edytować cały zbiór powtarzających się zdarzeń?", section_recurring: "Powtórz zdarzenie", button_recurring: "Nieaktywne", button_recurring_open: "Aktywne", button_edit_series: "Edytuj serię", button_edit_occurrence: "Edytuj kopię", agenda_tab: "Agenda", date: "Data", description: "Opis", year_tab: "Rok", week_agenda_tab: "Agenda", grid_tab: "Tabela", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Codziennie", repeat_radio_week: "Co tydzie", repeat_radio_month: "Co miesic", repeat_radio_year: "Co rok", repeat_radio_day_type: "Kadego", repeat_text_day_count: "dnia", repeat_radio_day_type2: "Kadego dnia roboczego", repeat_week: " Powtarzaj kadego", repeat_text_week_count: "tygodnia w dni:", repeat_radio_month_type: "Powtrz", repeat_radio_month_start: "W", repeat_text_month_day: "dnia kadego", repeat_text_month_count: "miesica", repeat_text_month_count2_before: "kadego", repeat_text_month_count2_after: "miesica", repeat_year_label: "W", select_year_day2: "miesica", repeat_text_year_day: "dnia miesica", select_year_month: "", repeat_radio_end: "Bez daty kocowej", repeat_text_occurences_count: "wystpieniu/ach", repeat_radio_end3: "Zakocz w", repeat_radio_end2: "Po", month_for_recurring: ["Stycznia", "Lutego", "Marca", "Kwietnia", "Maja", "Czerwca", "Lipca", "Sierpnia", "Wrzenia", "Padziernka", "Listopada", "Grudnia"], day_for_recurring: ["Niedziela", "Poniedziaek", "Wtorek", "roda", "Czwartek", "Pitek", "Sobota"] } }; -const pt = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { dhx_cal_today_button: "Hoje", day_tab: "Dia", week_tab: "Semana", month_tab: "Mês", new_event: "Novo evento", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Deletar", confirm_closing: "", confirm_deleting: "Tem certeza que deseja excluir?", section_description: "Descrição", section_time: "Período de tempo", full_day: "Dia inteiro", confirm_recurring: "Deseja editar todos esses eventos repetidos?", section_recurring: "Repetir evento", button_recurring: "Desabilitar", button_recurring_open: "Habilitar", button_edit_series: "Editar a série", button_edit_occurrence: "Editar uma cópia", agenda_tab: "Dia", date: "Data", description: "Descrição", year_tab: "Ano", week_agenda_tab: "Dia", grid_tab: "Grade", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diário", repeat_radio_week: "Semanal", repeat_radio_month: "Mensal", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia(s)", repeat_radio_day_type2: "Cada trabalho diário", repeat_week: " Repita cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "Em", repeat_text_month_day: "todo dia", repeat_text_month_count: "mês", repeat_text_month_count2_before: "todo", repeat_text_month_count2_after: "mês", repeat_year_label: "Em", select_year_day2: "of", repeat_text_year_day: "dia", select_year_month: "mês", repeat_radio_end: "Sem data final", repeat_text_occurences_count: "ocorrências", repeat_radio_end3: "Fim", repeat_radio_end2: "Depois", month_for_recurring: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], day_for_recurring: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] } }; -const ro = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { dhx_cal_today_button: "Astazi", day_tab: "Zi", week_tab: "Saptamana", month_tab: "Luna", new_event: "Eveniment nou", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", full_day: "Toata ziua", confirm_recurring: "Vrei sa editezi toata seria de evenimente repetate?", section_recurring: "Repetare", button_recurring: "Dezactivata", button_recurring_open: "Activata", button_edit_series: "Editeaza serie", button_edit_occurrence: "Editeaza doar intrare", agenda_tab: "Agenda", date: "Data", description: "Descriere", year_tab: "An", week_agenda_tab: "Agenda", grid_tab: "Lista", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Zilnic", repeat_radio_week: "Saptamanal", repeat_radio_month: "Lunar", repeat_radio_year: "Anual", repeat_radio_day_type: "La fiecare", repeat_text_day_count: "zi(le)", repeat_radio_day_type2: "Fiecare zi lucratoare", repeat_week: " Repeta la fiecare", repeat_text_week_count: "saptamana in urmatoarele zile:", repeat_radio_month_type: "Repeta in", repeat_radio_month_start: "In a", repeat_text_month_day: "zi la fiecare", repeat_text_month_count: "luni", repeat_text_month_count2_before: "la fiecare", repeat_text_month_count2_after: "luni", repeat_year_label: "In", select_year_day2: "a lunii", repeat_text_year_day: "zi a lunii", select_year_month: "", repeat_radio_end: "Fara data de sfarsit", repeat_text_occurences_count: "evenimente", repeat_radio_end3: "La data", repeat_radio_end2: "Dupa", month_for_recurring: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], day_for_recurring: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"] } }; -const ru = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сегодня", day_tab: "День", week_tab: "Неделя", month_tab: "Месяц", new_event: "Новое событие", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", full_day: "Весь день", confirm_recurring: "Вы хотите изменить всю серию повторяющихся событий?", section_recurring: "Повторение", button_recurring: "Отключено", button_recurring_open: "Включено", button_edit_series: "Редактировать серию", button_edit_occurrence: "Редактировать экземпляр", agenda_tab: "Список", date: "Дата", description: "Описание", year_tab: "Год", week_agenda_tab: "Список", grid_tab: "Таблица", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Неделя", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Каждый", repeat_text_day_count: "день", repeat_radio_day_type2: "Каждый рабочий день", repeat_week: " Повторять каждую", repeat_text_week_count: "неделю , в:", repeat_radio_month_type: "Повторять", repeat_radio_month_start: "", repeat_text_month_day: " числа каждый ", repeat_text_month_count: "месяц", repeat_text_month_count2_before: "каждый ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без даты окончания", repeat_text_occurences_count: "повторений", repeat_radio_end3: "До ", repeat_radio_end2: "", month_for_recurring: ["Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря"], day_for_recurring: ["Воскресенье", "Понедельник", "Вторник", "Среду", "Четверг", "Пятницу", "Субботу"] } }; -const si = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", full_day: "Ves dan", confirm_recurring: "Želite urediti celoten set ponavljajočih dogodkov?", section_recurring: "Ponovi dogodek", button_recurring: "Onemogočeno", button_recurring_open: "Omogočeno", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Zadeva", date: "Datum", description: "Opis", year_tab: "Leto", week_agenda_tab: "Zadeva", grid_tab: "Miza", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const sk = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Deň", week_tab: "Týždeň", month_tab: "Mesiac", new_event: "Nová udalosť", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Prajete si upraviť celú radu opakovaných udalostí?", section_recurring: "Opakovanie udalosti", button_recurring: "Vypnuté", button_recurring_open: "Zapnuté", button_edit_series: "Upraviť opakovania", button_edit_occurrence: "Upraviť inštancie", agenda_tab: "Program", date: "Dátum", description: "Poznámka", year_tab: "Rok", full_day: "Celý deň", week_agenda_tab: "Program", grid_tab: "Mriežka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denne", repeat_radio_week: "Týždenne", repeat_radio_month: "Mesaène", repeat_radio_year: "Roène", repeat_radio_day_type: "Každý", repeat_text_day_count: "deò", repeat_radio_day_type2: "Každý prac. deò", repeat_week: "Opakova každý", repeat_text_week_count: "týždeò v dòoch:", repeat_radio_month_type: "Opakova", repeat_radio_month_start: "On", repeat_text_month_day: "deò každý", repeat_text_month_count: "mesiac", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "mesiac", repeat_year_label: "On", select_year_day2: "poèas", repeat_text_year_day: "deò", select_year_month: "mesiac", repeat_radio_end: "Bez dátumu ukonèenia", repeat_text_occurences_count: "udalostiach", repeat_radio_end3: "Ukonèi", repeat_radio_end2: "Po", month_for_recurring: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], day_for_recurring: ["Nede¾a", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] } }; -const sv = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Vecka", month_tab: "Månad", new_event: "Ny händelse", icon_save: "Spara", icon_cancel: "Ångra", icon_details: "Detaljer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", full_day: "Hela dagen", confirm_recurring: "Vill du redigera hela serien med repeterande händelser?", section_recurring: "Upprepa händelse", button_recurring: "Inaktiverat", button_recurring_open: "Aktiverat", button_edit_series: "Redigera serien", button_edit_occurrence: "Redigera en kopia", agenda_tab: "Dagordning", date: "Datum", description: "Beskrivning", year_tab: "År", week_agenda_tab: "Dagordning", grid_tab: "Galler", drag_to_create: "Dra för att skapa ny", drag_to_move: "Dra för att flytta", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagligen", repeat_radio_week: "Veckovis", repeat_radio_month: "Månadsvis", repeat_radio_year: "Årligen", repeat_radio_day_type: "Var", repeat_text_day_count: "dag", repeat_radio_day_type2: "Varje arbetsdag", repeat_week: " Upprepa var", repeat_text_week_count: "vecka dessa dagar:", repeat_radio_month_type: "Upprepa", repeat_radio_month_start: "Den", repeat_text_month_day: "dagen var", repeat_text_month_count: "månad", repeat_text_month_count2_before: "var", repeat_text_month_count2_after: "månad", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "månad", repeat_radio_end: "Inget slutdatum", repeat_text_occurences_count: "upprepningar", repeat_radio_end3: "Sluta efter", repeat_radio_end2: "Efter", month_for_recurring: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], day_for_recurring: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] } }; -const tr = { date: { month_full: ["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"], month_short: ["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"] }, labels: { dhx_cal_today_button: "Bugün", day_tab: "Gün", week_tab: "Hafta", month_tab: "Ay", new_event: "Uygun", icon_save: "Kaydet", icon_cancel: "Ýptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Etkinlik silinecek, devam?", section_description: "Açýklama", section_time: "Zaman aralýðý", full_day: "Tam gün", confirm_recurring: "Tüm tekrar eden etkinlikler silinecek, devam?", section_recurring: "Etkinliði tekrarla", button_recurring: "Pasif", button_recurring_open: "Aktif", button_edit_series: "Dizi düzenleme", button_edit_occurrence: "Bir kopyasını düzenleyin", agenda_tab: "Ajanda", date: "Tarih", description: "Açýklama", year_tab: "Yýl", week_agenda_tab: "Ajanda", grid_tab: "Izgara", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; -const ua = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { dhx_cal_today_button: "Сьогодні", day_tab: "День", week_tab: "Тиждень", month_tab: "Місяць", new_event: "Нова подія", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", full_day: "Весь день", confirm_recurring: "Хочете редагувати весь перелік повторюваних подій?", section_recurring: "Повторювана подія", button_recurring: "Відключено", button_recurring_open: "Включено", button_edit_series: "Редагувати серію", button_edit_occurrence: "Редагувати примірник", agenda_tab: "Перелік", date: "Дата", description: "Опис", year_tab: "Рік", week_agenda_tab: "Перелік", grid_tab: "Таблиця", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Тиждень", repeat_radio_month: "Місяць", repeat_radio_year: "Рік", repeat_radio_day_type: "Кожний", repeat_text_day_count: "день", repeat_radio_day_type2: "Кожний робочий день", repeat_week: " Повторювати кожен", repeat_text_week_count: "тиждень , по:", repeat_radio_month_type: "Повторювати", repeat_radio_month_start: "", repeat_text_month_day: " числа кожний ", repeat_text_month_count: "місяць", repeat_text_month_count2_before: "кожен ", repeat_text_month_count2_after: "місяць", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без дати закінчення", repeat_text_occurences_count: "повторень", repeat_radio_end3: "До ", repeat_radio_end2: "", month_for_recurring: ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], day_for_recurring: ["Неділям", "Понеділкам", "Вівторкам", "Середам", "Четвергам", "П'ятницям", "Суботам"] } }; -function i18nFactory() { - return new LocaleManager({ en, ar, be, ca, cn, cs, da, de, el, es, fi, fr, he, hu, id, it, jp, nb, nl, no, pl, pt, ro, ru, si, sk, sv, tr, ua }); -} -class DatePicker { - constructor(scheduler2, container, state = {}) { - this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...state }; - this.container = null; - this.element = null; - this.onStateChangeHandlers = []; - this.scheduler = scheduler2; - this._domEvents = scheduler2._createDomEventScope(); - this.state = this.getState(); - makeEventable(this); - if (container) { - this.container = container; - this.render(this.container); - } - this.onStateChange((oldState, newState) => { - this.callEvent("onStateChange", [newState, oldState]); - }); +dhtmlxHook(); +class SchedulerFactory { + constructor(extensions) { + this._seed = 0; + this._schedulerPlugins = []; + this._bundledExtensions = extensions; + this._extensionsManager = new ExtensionsManager(extensions); } - getState() { - return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] }; + plugin(code) { + this._schedulerPlugins.push(code); + if (global$1.scheduler) { + code(global$1.scheduler); + } } - setState(newState) { - const oldState = { ...this.state }; - if (newState.mode) { - newState.currentModeIndex = this.state.modes.indexOf(newState.mode); + getSchedulerInstance(initConfig) { + var scheduler2 = factoryMethod(this._extensionsManager); + for (var i = 0; i < this._schedulerPlugins.length; i++) { + this._schedulerPlugins[i](scheduler2); } - this.state = { ...this.state, ...newState }; - this._notifyStateChange(oldState, this.state); - if (this.container) { - this.render(this.container); + scheduler2._internal_id = this._seed++; + if (this.$syncFactory) { + this.$syncFactory(scheduler2); } + if (initConfig) { + this._initFromConfig(scheduler2, initConfig); + } + return scheduler2; } - onStateChange(handler) { - this.onStateChangeHandlers.push(handler); - return () => { - const index = this.onStateChangeHandlers.indexOf(handler); - if (index !== -1) { - this.onStateChangeHandlers.splice(index, 1); + _initFromConfig(scheduler2, initConfig) { + if (initConfig.plugins) { + scheduler2.plugins(initConfig.plugins); + } + if (initConfig.config) { + scheduler2.mixin(scheduler2.config, initConfig.config, true); + } + if (initConfig.templates) { + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.mixin(scheduler2.templates, initConfig.templates, true); + }, { once: true }); + } + if (initConfig.events) { + for (const event2 in initConfig.events) { + scheduler2.attachEvent(event2, initConfig.events[event2]); } - }; - } - _notifyStateChange(oldState, newState) { - this.onStateChangeHandlers.forEach((handler) => handler(oldState, newState)); - } - _adjustDate(direction) { - const { mode, date } = this.getState(); - const newDate = new Date(date); - if (mode === "days") { - newDate.setMonth(date.getMonth() + direction); - } else if (mode === "months") { - newDate.setFullYear(date.getFullYear() + direction); - } else { - newDate.setFullYear(date.getFullYear() + direction * 10); } - this.setState({ date: newDate }); - } - _toggleMode() { - const newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length; - this.setState({ currentModeIndex: newIndex }); - } - _renderCalendarHeader(container) { - const { mode, date } = this.getState(); - const header = document.createElement("div"); - header.classList.add("dhx_cal_datepicker_header"); - const backwardArrow = document.createElement("button"); - backwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"); - header.appendChild(backwardArrow); - const monthLabel = document.createElement("div"); - monthLabel.classList.add("dhx_cal_datepicker_title"); - if (mode === "days") { - monthLabel.innerText = date.toLocaleString("default", { month: "long" }) + " " + date.getFullYear(); - } else if (mode === "months") { - monthLabel.innerText = date.getFullYear(); - } else { - const startYear = Math.floor(date.getFullYear() / 10) * 10; - monthLabel.innerText = `${startYear} - ${startYear + 9}`; + if (initConfig.locale) { + scheduler2.i18n.setLocale(initConfig.locale); } - this._domEvents.attach(monthLabel, "click", this._toggleMode.bind(this)); - header.appendChild(monthLabel); - const forwardArrow = document.createElement("button"); - forwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"); - header.appendChild(forwardArrow); - container.appendChild(header); - this._domEvents.attach(backwardArrow, "click", this._adjustDate.bind(this, -1)); - this._domEvents.attach(forwardArrow, "click", this._adjustDate.bind(this, 1)); - } - render(container) { - this._domEvents.detachAll(); - this.container = container || this.container; - this.container.innerHTML = ""; - if (!this.element) { - this.element = document.createElement("div"); - this.element.classList.add("dhx_cal_datepicker"); + if (Array.isArray(initConfig.calendars)) { + initConfig.calendars.forEach(function(calendar) { + scheduler2.addCalendar(calendar); + }); } - this.element.innerHTML = ""; - this.container.appendChild(this.element); - this._renderCalendarHeader(this.element); - const dataContainer = document.createElement("div"); - dataContainer.classList.add("dhx_cal_datepicker_data"); - this.element.appendChild(dataContainer); - const { mode } = this.getState(); - if (mode === "days") { - this._renderDayGrid(dataContainer); - } else if (mode === "months") { - this._renderMonthGrid(dataContainer); + if (initConfig.container) { + scheduler2.init(initConfig.container); } else { - this._renderYearGrid(dataContainer); - } - } - _renderDayGridHeader(daysOfWeekContainer) { - const { date } = this.getState(); - const scheduler2 = this.scheduler; - let currentDate = scheduler2.date.week_start(new Date(date)); - const maxDate = scheduler2.date.add(scheduler2.date.week_start(new Date(date)), 1, "week"); - daysOfWeekContainer.classList.add("dhx_cal_datepicker_days"); - const labelFormat = scheduler2.date.date_to_str("%D"); - while (currentDate.valueOf() < maxDate.valueOf()) { - const label = labelFormat(currentDate); - const dayElement = document.createElement("div"); - dayElement.setAttribute("data-day", currentDate.getDay()); - dayElement.classList.add("dhx_cal_datepicker_dayname"); - dayElement.innerText = label; - daysOfWeekContainer.appendChild(dayElement); - currentDate = scheduler2.date.add(currentDate, 1, "day"); + scheduler2.init(); } - } - _weeksBetween(min, max) { - const scheduler2 = this.scheduler; - let weeks = 0; - let currWeek = new Date(min); - while (currWeek.valueOf() < max.valueOf()) { - weeks += 1; - currWeek = scheduler2.date.week_start(scheduler2.date.add(currWeek, 1, "week")); + if (initConfig.data) { + if (typeof initConfig.data === "string") { + scheduler2.load(initConfig.data); + } else { + scheduler2.parse(initConfig.data); + } } - return weeks; } - _renderDayGrid(container) { - const { date, currentRange, eventDates, minWeeks } = this.getState(); - let minSchedulerDate = currentRange[0]; - let maxSchedulerDate = currentRange[1]; - const eventDaysTable = eventDates.reduce((acc, date2) => { - const dayStart = this.scheduler.date.day_start(new Date(date2)); - acc[dayStart.valueOf()] = true; - return acc; - }, {}); - const daysOfWeekContainer = document.createElement("div"); - this._renderDayGridHeader(daysOfWeekContainer); - container.appendChild(daysOfWeekContainer); - const scheduler2 = this.scheduler; - const firstDate = scheduler2.date.week_start(scheduler2.date.month_start(new Date(date))); - const monthStart = scheduler2.date.month_start(new Date(date)); - const monthEnd = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); - let lastDate = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); - const currentCalDate = scheduler2.date.date_part(scheduler2._currentDate()); - if (lastDate.getDay() !== 0) { - lastDate = scheduler2.date.add(scheduler2.date.week_start(lastDate), 1, "week"); +} +function active_links(scheduler2) { + scheduler2.config.active_link_view = "day"; + scheduler2._active_link_click = function(e) { + var start = e.target; + var to = start.getAttribute("data-link-date"); + var s_d = scheduler2.date.str_to_date(scheduler2.config.api_date, false, true); + if (to) { + scheduler2.setCurrentView(s_d(to), scheduler2.config.active_link_view); + if (e && e.preventDefault) + e.preventDefault(); + return false; } - let weeks = this._weeksBetween(firstDate, lastDate); - if (minWeeks && weeks < minWeeks) { - lastDate = scheduler2.date.add(lastDate, minWeeks - weeks, "week"); + }; + scheduler2.attachEvent("onTemplatesReady", function() { + var do_wrapper = function(key2, fullname) { + fullname = fullname || key2 + "_scale_date"; + if (!scheduler2.templates["_active_links_old_" + fullname]) { + scheduler2.templates["_active_links_old_" + fullname] = scheduler2.templates[fullname]; + } + var week_x = scheduler2.templates["_active_links_old_" + fullname]; + var d_s = scheduler2.date.date_to_str(scheduler2.config.api_date); + scheduler2.templates[fullname] = function(date) { + return "" + week_x(date) + ""; + }; + }; + do_wrapper("week"); + do_wrapper("", "month_day"); + if (this.matrix) { + for (var key in this.matrix) + do_wrapper(key); } - let currDate = firstDate; - const dayGridContainer = document.createElement("div"); - dayGridContainer.classList.add("dhx_cal_datepicker_days"); - this._domEvents.attach(dayGridContainer, "click", (event2) => { - const dateCell = event2.target.closest("[data-cell-date]"); - const date2 = new Date(dateCell.getAttribute("data-cell-date")); - this.callEvent("onDateClick", [date2, event2]); - }); - while (currDate.valueOf() < lastDate.valueOf()) { - const dayElement = document.createElement("div"); - dayElement.setAttribute("data-cell-date", scheduler2.templates.format_date(currDate)); - dayElement.setAttribute("data-day", currDate.getDay()); - dayElement.innerHTML = currDate.getDate(); - if (currDate.valueOf() < monthStart.valueOf()) { - dayElement.classList.add("dhx_before"); - } else if (currDate.valueOf() >= monthEnd.valueOf()) { - dayElement.classList.add("dhx_after"); + this._detachDomEvent(this._obj, "click", scheduler2._active_link_click); + scheduler2.event(this._obj, "click", scheduler2._active_link_click); + }); +} +function agenda_legacy(scheduler2) { + scheduler2.date.add_agenda_legacy = function(date) { + return scheduler2.date.add(date, 1, "year"); + }; + scheduler2.templates.agenda_legacy_time = function(start, end, ev) { + if (ev._timed) + return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); + else + return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); + }; + scheduler2.templates.agenda_legacy_text = function(start, end, event2) { + return event2.text; + }; + scheduler2.templates.agenda_legacy_date = function() { + return ""; + }; + scheduler2.date.agenda_legacy_start = function() { + return scheduler2.date.date_part(scheduler2._currentDate()); + }; + scheduler2.attachEvent("onTemplatesReady", function() { + var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; + scheduler2.dblclick_dhx_cal_data = function() { + if (this._mode == "agenda_legacy") { + if (!this.config.readonly && this.config.dblclick_create) + this.addEventNow(); + } else { + if (old_dblclick_dhx_cal_data) + return old_dblclick_dhx_cal_data.apply(this, arguments); } - if (currDate.getDay() === 0 || currDate.getDay() === 6) { - dayElement.classList.add("dhx_cal_datepicker_weekend"); + }; + var old = scheduler2.render_data; + scheduler2.render_data = function(evs) { + if (this._mode == "agenda_legacy") + fill_agenda_tab(); + else + return old.apply(this, arguments); + }; + var old_render_view_data = scheduler2.render_view_data; + scheduler2.render_view_data = function() { + if (this._mode == "agenda_legacy") { + scheduler2._agendaScrollTop = scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop; + scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0; } - if (currDate.valueOf() == currentCalDate.valueOf()) { - dayElement.classList.add("dhx_now"); + return old_render_view_data.apply(this, arguments); + }; + function set_full_view(mode) { + if (mode) { + var l = scheduler2.locale.labels; + var rowAttr = scheduler2._waiAria.agendaHeadAttrString(); + var dateHeader = scheduler2._waiAria.agendaHeadDateString(l.date); + var descriptionHeader = scheduler2._waiAria.agendaHeadDescriptionString(l.description); + scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; + scheduler2._table_view = true; + scheduler2.set_sizes(); } - if (minSchedulerDate && maxSchedulerDate) { - if (currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()) { - dayElement.classList.add("dhx_cal_datepicker_current"); - } + } + function fill_agenda_tab() { + var events = scheduler2.get_visible_events(); + events.sort(function(a, b) { + return a.start_date > b.start_date ? 1 : -1; + }); + var tableAttr = scheduler2._waiAria.agendaDataAttrString(); + var agendaEventAttrString; + var html = "
"; + for (var i = 0; i < events.length; i++) { + var ev = events[i]; + var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; + var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; + var ev_class = scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); + agendaEventAttrString = scheduler2._waiAria.agendaEventAttrString(ev); + var agendaDetailsButtonAttr = scheduler2._waiAria.agendaDetailsBtnString(); + html += "
" + (scheduler2.config.rtl ? scheduler2.templates.agenda_time(ev.end_date, ev.start_date, ev) : scheduler2.templates.agenda_time(ev.start_date, ev.end_date, ev)) + "
"; + html += `
+ +
`; + html += "" + scheduler2.templates.agenda_text(ev.start_date, ev.end_date, ev) + "
"; } - if (eventDaysTable[currDate.valueOf()]) { - dayElement.classList.add("dhx_cal_datepicker_event"); + html += "
"; + scheduler2._els["dhx_cal_data"][0].innerHTML = html; + scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = scheduler2._agendaScrollTop || 0; + var agenda_area = scheduler2._els["dhx_cal_data"][0].childNodes[0]; + var v_border = agenda_area.childNodes[agenda_area.childNodes.length - 1]; + v_border.style.height = agenda_area.offsetHeight < scheduler2._els["dhx_cal_data"][0].offsetHeight ? "100%" : agenda_area.offsetHeight + "px"; + var t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; + var dateElement = scheduler2._getNavDateElement(); + if (dateElement) { + dateElement.innerHTML = scheduler2.templates.agenda_date(scheduler2._min_date, scheduler2._max_date, scheduler2._mode); } - dayElement.classList.add("dhx_cal_datepicker_date"); - dayGridContainer.appendChild(dayElement); - currDate = scheduler2.date.add(currDate, 1, "day"); + scheduler2._rendered = []; + for (var i = 0; i < t.length - 1; i++) + scheduler2._rendered[i] = t[i]; } - container.appendChild(dayGridContainer); - } - _renderMonthGrid(container) { - const { date } = this.getState(); - const wrapper = document.createElement("div"); - wrapper.classList.add("dhx_cal_datepicker_months"); - const months = []; - for (let i = 0; i < 12; i++) { - months.push(new Date(date.getFullYear(), i, 1)); + scheduler2.agenda_legacy_view = function(mode) { + scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_legacy_start(scheduler2._date); + scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda_legacy(scheduler2._min_date, 1); + set_full_view(mode); + if (mode) { + scheduler2._cols = null; + scheduler2._colsS = null; + scheduler2._table_view = true; + fill_agenda_tab(); + } else { + scheduler2._table_view = false; + } + }; + }); +} +function agenda_view(scheduler2) { + scheduler2.date.add_agenda = function(date, inc) { + return scheduler2.date.add(date, 1 * inc, "month"); + }; + scheduler2.templates.agenda_time = function(start, end, ev) { + if (ev._timed) { + return `${this.event_date(start)} - ${this.event_date(end)}`; + } else { + return scheduler2.locale.labels.full_day; } - const formatLabel = this.scheduler.date.date_to_str("%M"); - months.forEach((month) => { - const monthElement = document.createElement("div"); - monthElement.classList.add("dhx_cal_datepicker_month"); - if (date.getMonth() === month.getMonth()) { - monthElement.classList.add("dhx_cal_datepicker_current"); + }; + scheduler2.templates.agenda_text = function(start, end, ev) { + return ev.text; + }; + const dayDateToStr = scheduler2.date.date_to_str("%F %j"); + const dayDowToStr = scheduler2.date.date_to_str("%l"); + scheduler2.templates.agenda_day = function(date) { + return `
${dayDateToStr(date)}
+
${dayDowToStr(date)}
`; + }; + scheduler2.templates.agenda_date = function(start, end) { + return scheduler2.templates.month_date(scheduler2.getState().date); + }; + scheduler2.date.agenda_start = function(date) { + return scheduler2.date.month_start(new Date(date)); + }; + let scrollTop = 0; + scheduler2.attachEvent("onTemplatesReady", function() { + var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; + scheduler2.dblclick_dhx_cal_data = function() { + if (this._mode == "agenda") { + if (!this.config.readonly && this.config.dblclick_create) + this.addEventNow(); + } else { + if (old_dblclick_dhx_cal_data) + return old_dblclick_dhx_cal_data.apply(this, arguments); } - monthElement.setAttribute("data-month", month.getMonth()); - monthElement.innerHTML = formatLabel(month); - this._domEvents.attach(monthElement, "click", () => { - const newDate = new Date(month); - this.setState({ date: newDate, mode: "days" }); + }; + var old = scheduler2.render_data; + scheduler2.render_data = function(evs) { + if (this._mode == "agenda") + fill_agenda_tab(); + else + return old.apply(this, arguments); + }; + var old_render_view_data = scheduler2.render_view_data; + scheduler2.render_view_data = function() { + if (this._mode == "agenda") { + scrollTop = scheduler2._els["dhx_cal_data"][0].scrollTop; + scheduler2._els["dhx_cal_data"][0].scrollTop = 0; + } + return old_render_view_data.apply(this, arguments); + }; + function fill_agenda_tab() { + const events = scheduler2.get_visible_events(); + events.sort(function(a, b) { + return a.start_date > b.start_date ? 1 : -1; }); - wrapper.appendChild(monthElement); - }); - container.appendChild(wrapper); - const doneArea = document.createElement("div"); - doneArea.classList.add("dhx_cal_datepicker_done"); - const doneBtn = document.createElement("button"); - doneBtn.innerText = "Done"; - doneBtn.classList.add("dhx_cal_datepicker_done_btn"); - this._domEvents.attach(doneBtn, "click", () => { - this.setState({ mode: "days" }); - }); - doneArea.appendChild(doneBtn); - container.appendChild(doneArea); - } - _renderYearGrid(container) { - const { date } = this.getState(); - const startYear = Math.floor(date.getFullYear() / 10) * 10; - const wrapper = document.createElement("div"); - wrapper.classList.add("dhx_cal_datepicker_years"); - for (let i = startYear - 1; i <= startYear + 10; i++) { - const yearElement = document.createElement("div"); - yearElement.innerText = i; - yearElement.classList.add("dhx_cal_datepicker_year"); - yearElement.setAttribute("data-year", i); - if (date.getFullYear() === i) { - yearElement.classList.add("dhx_cal_datepicker_current"); + const eventsInDays = {}; + let currDate = scheduler2.getState().min_date; + const maxDate = scheduler2.getState().max_date; + while (currDate.valueOf() < maxDate.valueOf()) { + eventsInDays[currDate.valueOf()] = []; + currDate = scheduler2.date.add(currDate, 1, "day"); + } + let anyEvents = false; + events.forEach((ev) => { + let eventStart = scheduler2.date.day_start(new Date(ev.start_date)); + while (eventStart.valueOf() < ev.end_date.valueOf()) { + if (eventsInDays[eventStart.valueOf()]) { + eventsInDays[eventStart.valueOf()].push(ev); + anyEvents = true; + } + eventStart = scheduler2.date.day_start(scheduler2.date.add(eventStart, 1, "day")); + } + }); + if (!anyEvents) { + scheduler2._els["dhx_cal_data"][0].innerHTML = renderEmptyView(); + } else { + let html = ""; + for (let day in eventsInDays) { + html += renderDay(new Date(day * 1), eventsInDays[day]); + } + scheduler2._els["dhx_cal_data"][0].innerHTML = html; } - this._domEvents.attach(yearElement, "click", () => { - this.setState({ date: new Date(i, date.getMonth(), 1), mode: "months" }); + scheduler2._els["dhx_cal_data"][0].scrollTop = scrollTop; + let t = scheduler2._els["dhx_cal_data"][0].querySelectorAll(".dhx_cal_agenda_event_line"); + scheduler2._rendered = []; + for (var i = 0; i < t.length - 1; i++) { + scheduler2._rendered[i] = t[i]; + } + } + function renderEmptyView() { + return `
${scheduler2.locale.labels.agenda_tab}
`; + } + function renderDay(day, events) { + if (!events.length) { + return ""; + } + let html = ` +
+
${scheduler2.templates.agenda_day(day)}
+
+`; + events.forEach((calendarEvent) => { + html += renderOneEvent(day, calendarEvent); }); - wrapper.appendChild(yearElement); + html += `
`; + return html; } - container.appendChild(wrapper); - const doneArea = document.createElement("div"); - doneArea.classList.add("dhx_cal_datepicker_done"); - const doneBtn = document.createElement("button"); - doneBtn.innerText = "Done"; - doneBtn.classList.add("dhx_cal_datepicker_done_btn"); - this._domEvents.attach(doneBtn, "click", () => { - this.setState({ mode: "months" }); - }); - doneArea.appendChild(doneBtn); - container.appendChild(doneArea); - } - destructor() { - this.onStateChangeHandlers = []; - if (this.element) { - this.element.innerHTML = ""; - this.element.remove(); + function renderOneEvent(day, calendarEvent) { + const dates = scheduler2.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); + const selectedId = scheduler2.getState().select_id; + const cls = scheduler2.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); + const description = scheduler2.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); + let style = ""; + if (calendarEvent.color || calendarEvent.textColor) { + const bg = calendarEvent.color ? "--dhx-scheduler-event-background:" + calendarEvent.color + ";" : ""; + const color = calendarEvent.textColor ? "--dhx-scheduler-event-color:" + calendarEvent.textColor + ";" : ""; + style = ` style="${bg}${color}" `; + } + return `
+
+
${dates}
+
${description}
+
`; } - this._domEvents.detachAll(); - this.callEvent("onDestroy", []); - this.detachAllEvents(); - this.scheduler = null; - } + scheduler2.agenda_view = function(mode) { + if (mode) { + scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_start(scheduler2._date); + scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda(scheduler2._min_date, 1); + scheduler2._cols = null; + scheduler2._colsS = null; + scheduler2._table_view = true; + const dateHeader = scheduler2._getNavDateElement(); + dateHeader.innerHTML = scheduler2.templates.agenda_date(scheduler2._date); + fill_agenda_tab(); + } else { + scheduler2._table_view = false; + } + }; + }); } -function factoryMethod(extensionManager) { - const scheduler2 = { version: "7.0.5" }; - extend$n(scheduler2); - extend$i(scheduler2); - extend$j(scheduler2); - extend$h(scheduler2); - scheduler2.utils = utils; - scheduler2.$domHelpers = dom_helpers; - scheduler2.utils.dom = dom_helpers; - scheduler2.uid = utils.uid; - scheduler2.mixin = utils.mixin; - scheduler2.defined = utils.defined; - scheduler2.assert = assert(scheduler2); - scheduler2.copy = utils.copy; - scheduler2._createDatePicker = function(container, config) { - return new DatePicker(scheduler2, container, config); +function all_timed(scheduler2) { + scheduler2.config.all_timed = "short"; + scheduler2.config.all_timed_month = false; + var is_event_short = function(ev) { + if (!((ev.end_date - ev.start_date) / (1e3 * 60 * 60) >= 24)) { + return true; + } + if (scheduler2._drag_mode == "resize" && scheduler2._drag_id == ev.id) { + return true; + } + return false; }; - scheduler2._getFocusableNodes = dom_helpers.getFocusableNodes; - scheduler2._getClassName = dom_helpers.getClassName; - scheduler2._locate_css = dom_helpers.locateCss; - const messageApi = message(scheduler2); - scheduler2.utils.mixin(scheduler2, messageApi); - scheduler2.env = scheduler2.$env = env; - scheduler2.Promise = window.Promise; - extend$g(scheduler2); - extend$f(scheduler2); - extend$e(scheduler2); - extend$d(scheduler2); - extend$c(scheduler2); - extend$b(scheduler2); - extend$7(scheduler2); - extend$6(scheduler2); - extend$5(scheduler2); - extend$4(scheduler2); - extend$3(scheduler2); - extend$2(); - extend$1(scheduler2); - extend(scheduler2); - extend$m(scheduler2); - const i18n = i18nFactory(); - scheduler2.i18n = { addLocale: i18n.addLocale, setLocale: function(locale) { - if (typeof locale === "string") { - var localeObject = i18n.getLocale(locale); - if (!localeObject) { - localeObject = i18n.getLocale("en"); - } - scheduler2.locale = localeObject; - } else if (locale) { - if (!scheduler2.locale) { - scheduler2.locale = locale; - } else { - for (var i in locale) { - if (locale[i] && typeof locale[i] === "object") { - if (!scheduler2.locale[i]) { - scheduler2.locale[i] = {}; - } - scheduler2.mixin(scheduler2.locale[i], locale[i], true); - } else { - scheduler2.locale[i] = locale[i]; + scheduler2._safe_copy = function(event2) { + var proto = null, copy2 = scheduler2._copy_event(event2); + if (event2.event_pid) { + proto = scheduler2.getEvent(event2.event_pid); + } + if (proto && proto.isPrototypeOf(event2)) { + delete copy2.event_length; + delete copy2.event_pid; + delete copy2.rec_pattern; + delete copy2.rec_type; + } + return copy2; + }; + var old_prerender_events_line = scheduler2._pre_render_events_line; + var old_prerender_events_table = scheduler2._pre_render_events_table; + var prerender_events = function(evs, hold) { + if (!this._table_view) { + return old_prerender_events_line.call(this, evs, hold); + } + return old_prerender_events_table.call(this, evs, hold); + }; + scheduler2._pre_render_events_line = scheduler2._pre_render_events_table = function(evs, hold) { + if (!this.config.all_timed || this._table_view && this._mode != "month" || this._mode == "month" && !this.config.all_timed_month) + return prerender_events.call(this, evs, hold); + for (var i = 0; i < evs.length; i++) { + var ev = evs[i]; + if (ev._timed) + continue; + if (this.config.all_timed == "short") { + if (!is_event_short(ev)) { + if (this._mode != "month") { + evs.splice(i--, 1); } + continue; } } - } - var labels = scheduler2.locale.labels; - labels.dhx_save_btn = labels.icon_save; - labels.dhx_cancel_btn = labels.icon_cancel; - labels.dhx_delete_btn = labels.icon_delete; - if (scheduler2.$container) { - scheduler2.get_elements(); - } - }, getLocale: i18n.getLocale }; - scheduler2.i18n.setLocale("en"); - scheduler2.ext = {}; - const activePlugins = {}; - scheduler2.plugins = function(config) { - const extensionList = getExtensionList(config, { treetimeline: ["timeline"], daytimeline: ["timeline"], outerdrag: ["legacy"] }, { legacy: 1, limit: 1, timeline: 2, daytimeline: 3, treetimeline: 3, outerdrag: 6 }); - extensionList.forEach(function(name) { - if (!activePlugins[name]) { - const plugin = extensionManager.getExtension(name); - if (plugin) { - plugin(scheduler2); - activePlugins[name] = true; - } else { - throw new Error("unknown plugin " + name); + var ce = this._safe_copy(ev); + if (!ev._virtual) { + ce._first_chunk = true; + } else { + ce._first_chunk = false; + } + ce._drag_resize = false; + ce._virtual = true; + ce.start_date = new Date(ce.start_date); + if (!isOvernightEvent(ev)) { + ce.end_date = new Date(ev.end_date); + } else { + ce.end_date = getNextDay(ce.start_date); + if (this.config.last_hour != 24) { + ce.end_date = setDateTime(ce.start_date, this.config.last_hour); } } - }); - }; - function getExtensionList(config, dependencies, priorities) { - const result = []; - for (const i in config) { - if (config[i]) { - const extension = i.toLowerCase(); - if (dependencies[extension]) { - dependencies[extension].forEach(function(dep) { - const dependencyName = dep.toLowerCase(); - if (!config[dependencyName]) { - result.push(dependencyName); - } - }); + var event_changed = false; + if (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) { + evs[i] = ce; + event_changed = true; + } + var re = this._safe_copy(ev); + re._virtual = true; + re.end_date = new Date(re.end_date); + if (re.start_date < this._min_date) + re.start_date = setDateTime(this._min_date, this.config.first_hour); + else + re.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour); + if (re.start_date < this._max_date && re.start_date < re.end_date) { + if (event_changed) { + evs.splice(i + 1, 0, re); + } else { + evs[i--] = re; + continue; } - result.push(extension); - } - } - result.sort(function(a, b) { - const orderA = priorities[a] || 0; - const orderB = priorities[b] || 0; - if (orderA > orderB) { - return 1; - } else if (orderA < orderB) { - return -1; + re._last_chunk = false; } else { - return 0; + ce._last_chunk = true; + ce._drag_resize = true; } - }); - return result; - } - return scheduler2; -} -class ExtensionsManager { - constructor(config) { - this._extensions = {}; - for (const i in config) { - this._extensions[i] = config[i]; - } - } - addExtension(name, ext) { - this._extensions[name] = ext; - } - getExtension(name) { - return this._extensions[name]; - } -} -dhtmlxHook(); -class SchedulerFactory { - constructor(extensions) { - this._seed = 0; - this._schedulerPlugins = []; - this._bundledExtensions = extensions; - this._extensionsManager = new ExtensionsManager(extensions); - } - plugin(code) { - this._schedulerPlugins.push(code); - if (global$1.scheduler) { - code(global$1.scheduler); } - } - getSchedulerInstance(initConfig) { - var scheduler2 = factoryMethod(this._extensionsManager); - for (var i = 0; i < this._schedulerPlugins.length; i++) { - this._schedulerPlugins[i](scheduler2); + var redraw = this._drag_mode == "move" ? false : hold; + return prerender_events.call(this, evs, redraw); + function isOvernightEvent(ev2) { + var next_day = getNextDay(ev2.start_date); + return +ev2.end_date > +next_day; } - scheduler2._internal_id = this._seed++; - if (this.$syncFactory) { - this.$syncFactory(scheduler2); + function getNextDay(date) { + var next_day = scheduler2.date.add(date, 1, "day"); + next_day = scheduler2.date.date_part(next_day); + return next_day; } - if (initConfig) { - this._initFromConfig(scheduler2, initConfig); + function setDateTime(date, hours) { + var val = scheduler2.date.date_part(new Date(date)); + val.setHours(hours); + return val; } - return scheduler2; - } - _initFromConfig(scheduler2, initConfig) { - if (initConfig.plugins) { - scheduler2.plugins(initConfig.plugins); + }; + var old_get_visible_events = scheduler2.get_visible_events; + scheduler2.get_visible_events = function(only_timed) { + if (!(this.config.all_timed && this.config.multi_day)) + return old_get_visible_events.call(this, only_timed); + return old_get_visible_events.call(this, false); + }; + scheduler2.attachEvent("onBeforeViewChange", function(old_mode, old_date, mode, date) { + scheduler2._allow_dnd = mode == "day" || mode == "week" || scheduler2.getView(mode); + return true; + }); + scheduler2._is_main_area_event = function(ev) { + return !!(ev._timed || this.config.all_timed === true || this.config.all_timed == "short" && is_event_short(ev)); + }; + var oldUpdate = scheduler2.updateEvent; + scheduler2.updateEvent = function(id2) { + var ev = scheduler2.getEvent(id2); + var fullRedrawNeeded; + var initial; + if (ev) { + fullRedrawNeeded = scheduler2.config.all_timed && !(scheduler2.isOneDayEvent(scheduler2._events[id2]) || scheduler2.getState().drag_id); + if (fullRedrawNeeded) { + initial = scheduler2.config.update_render; + scheduler2.config.update_render = true; + } } - if (initConfig.config) { - scheduler2.mixin(scheduler2.config, initConfig.config, true); + oldUpdate.apply(scheduler2, arguments); + if (ev) { + if (fullRedrawNeeded) { + scheduler2.config.update_render = initial; + } } - if (initConfig.templates) { - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.mixin(scheduler2.templates, initConfig.templates, true); - }, { once: true }); + }; +} +function collision(scheduler2) { + var temp_section; + var before; + scheduler2.config.collision_limit = 1; + function _setTempSection(event_id) { + var checked_mode = scheduler2._get_section_view(); + if (checked_mode && event_id) { + temp_section = scheduler2.getEvent(event_id)[scheduler2._get_section_property()]; } - if (initConfig.events) { - for (const event2 in initConfig.events) { - scheduler2.attachEvent(event2, initConfig.events[event2]); - } + } + scheduler2.attachEvent("onBeforeDrag", function(id2) { + _setTempSection(id2); + return true; + }); + scheduler2.attachEvent("onBeforeLightbox", function(id2) { + var ev = scheduler2.getEvent(id2); + before = [ev.start_date, ev.end_date]; + _setTempSection(id2); + return true; + }); + scheduler2.attachEvent("onEventChanged", function(id2) { + if (!id2 || !scheduler2.getEvent(id2)) + return true; + var ev = scheduler2.getEvent(id2); + if (!scheduler2.checkCollision(ev)) { + if (!before) + return false; + ev.start_date = before[0]; + ev.end_date = before[1]; + ev._timed = this.isOneDayEvent(ev); } - if (initConfig.locale) { - scheduler2.i18n.setLocale(initConfig.locale); + return true; + }); + scheduler2.attachEvent("onBeforeEventChanged", function(ev, e, is_new) { + return scheduler2.checkCollision(ev); + }); + scheduler2.attachEvent("onEventAdded", function(id2, ev) { + var result = scheduler2.checkCollision(ev); + if (!result) + scheduler2.deleteEvent(id2); + }); + scheduler2.attachEvent("onEventSave", function(id2, edited_ev, is_new) { + edited_ev = scheduler2._lame_clone(edited_ev); + edited_ev.id = id2; + if (!(edited_ev.start_date && edited_ev.end_date)) { + var ev = scheduler2.getEvent(id2); + edited_ev.start_date = new Date(ev.start_date); + edited_ev.end_date = new Date(ev.end_date); } - if (Array.isArray(initConfig.calendars)) { - initConfig.calendars.forEach(function(calendar) { - scheduler2.addCalendar(calendar); - }); + if (edited_ev.rec_type) { + scheduler2._roll_back_dates(edited_ev); } - if (initConfig.container) { - scheduler2.init(initConfig.container); + return scheduler2.checkCollision(edited_ev); + }); + scheduler2._check_sections_collision = function(first, second) { + var map_to = scheduler2._get_section_property(); + if (first[map_to] == second[map_to] && first.id != second.id) + return true; + return false; + }; + scheduler2.checkCollision = function(ev) { + var evs = []; + var collision_limit = scheduler2.config.collision_limit; + if (ev.rec_type) { + var evs_dates = scheduler2.getRecDates(ev); + for (var k = 0; k < evs_dates.length; k++) { + var tevs = scheduler2.getEvents(evs_dates[k].start_date, evs_dates[k].end_date); + for (var j = 0; j < tevs.length; j++) { + if ((tevs[j].event_pid || tevs[j].id) != ev.id) + evs.push(tevs[j]); + } + } } else { - scheduler2.init(); - } - if (initConfig.data) { - if (typeof initConfig.data === "string") { - scheduler2.load(initConfig.data); - } else { - scheduler2.parse(initConfig.data); + evs = scheduler2.getEvents(ev.start_date, ev.end_date); + for (var i = 0; i < evs.length; i++) { + var concurrent = evs[i]; + if (concurrent.id == ev.id || concurrent.event_length && [concurrent.event_pid, concurrent.event_length].join("#") == ev.id) { + evs.splice(i, 1); + break; + } } } - } -} -function active_links(scheduler2) { - scheduler2.config.active_link_view = "day"; - scheduler2._active_link_click = function(e) { - var start = e.target; - var to = start.getAttribute("data-link-date"); - var s_d = scheduler2.date.str_to_date(scheduler2.config.api_date, false, true); - if (to) { - scheduler2.setCurrentView(s_d(to), scheduler2.config.active_link_view); - if (e && e.preventDefault) - e.preventDefault(); - return false; + var checked_mode = scheduler2._get_section_view(); + var map_to = scheduler2._get_section_property(); + var single = true; + if (checked_mode) { + var count = 0; + for (var i = 0; i < evs.length; i++) { + if (evs[i].id != ev.id && this._check_sections_collision(evs[i], ev)) + count++; + } + if (count >= collision_limit) { + single = false; + } + } else { + if (evs.length >= collision_limit) + single = false; } - }; - scheduler2.attachEvent("onTemplatesReady", function() { - var do_wrapper = function(key2, fullname) { - fullname = fullname || key2 + "_scale_date"; - if (!scheduler2.templates["_active_links_old_" + fullname]) { - scheduler2.templates["_active_links_old_" + fullname] = scheduler2.templates[fullname]; + if (!single) { + var res = !scheduler2.callEvent("onEventCollision", [ev, evs]); + if (!res) { + ev[map_to] = temp_section || ev[map_to]; } - var week_x = scheduler2.templates["_active_links_old_" + fullname]; - var d_s = scheduler2.date.date_to_str(scheduler2.config.api_date); - scheduler2.templates[fullname] = function(date) { - return "" + week_x(date) + ""; - }; - }; - do_wrapper("week"); - do_wrapper("", "month_day"); - if (this.matrix) { - for (var key in this.matrix) - do_wrapper(key); + return res; } - this._detachDomEvent(this._obj, "click", scheduler2._active_link_click); - scheduler2.event(this._obj, "click", scheduler2._active_link_click); - }); -} -function agenda_legacy(scheduler2) { - scheduler2.date.add_agenda_legacy = function(date) { - return scheduler2.date.add(date, 1, "year"); + return single; }; - scheduler2.templates.agenda_legacy_time = function(start, end, ev) { - if (ev._timed) - return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); +} +function container_autoresize(scheduler2) { + scheduler2.config.container_autoresize = true; + scheduler2.config.month_day_min_height = 90; + scheduler2.config.min_grid_size = 25; + scheduler2.config.min_map_size = 400; + var old_pre_render_event = scheduler2._pre_render_events; + var active = true; + var total_height = 0; + var multiday_height = 0; + scheduler2._pre_render_events = function(evs, hold) { + if (!(scheduler2.config.container_autoresize && active)) { + return old_pre_render_event.apply(this, arguments); + } + var hb = this.xy.bar_height; + var h_old = this._colsS.heights; + var h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0]; + var data = this._els["dhx_cal_data"][0]; + if (!this._table_view) + evs = this._pre_render_events_line(evs, hold); else - return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); - }; - scheduler2.templates.agenda_legacy_text = function(start, end, event2) { - return event2.text; - }; - scheduler2.templates.agenda_legacy_date = function() { - return ""; - }; - scheduler2.date.agenda_legacy_start = function() { - return scheduler2.date.date_part(scheduler2._currentDate()); - }; - scheduler2.attachEvent("onTemplatesReady", function() { - var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; - scheduler2.dblclick_dhx_cal_data = function() { - if (this._mode == "agenda_legacy") { - if (!this.config.readonly && this.config.dblclick_create) - this.addEventNow(); + evs = this._pre_render_events_table(evs, hold); + if (this._table_view) { + if (hold) { + this._colsS.heights = h_old; } else { - if (old_dblclick_dhx_cal_data) - return old_dblclick_dhx_cal_data.apply(this, arguments); - } - }; - var old = scheduler2.render_data; - scheduler2.render_data = function(evs) { - if (this._mode == "agenda_legacy") - fill_agenda_tab(); - else - return old.apply(this, arguments); - }; - var old_render_view_data = scheduler2.render_view_data; - scheduler2.render_view_data = function() { - if (this._mode == "agenda_legacy") { - scheduler2._agendaScrollTop = scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop; - scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0; - } - return old_render_view_data.apply(this, arguments); - }; - function set_full_view(mode) { - if (mode) { - var l = scheduler2.locale.labels; - var rowAttr = scheduler2._waiAria.agendaHeadAttrString(); - var dateHeader = scheduler2._waiAria.agendaHeadDateString(l.date); - var descriptionHeader = scheduler2._waiAria.agendaHeadDescriptionString(l.description); - scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; - scheduler2._table_view = true; - scheduler2.set_sizes(); + var evl = data.firstChild; + const rows = evl.querySelectorAll(".dhx_cal_month_row"); + if (rows) { + for (var i = 0; i < rows.length; i++) { + h[i]++; + if (h[i] * hb > this._colsS.height - this.xy.month_head_height) { + var cells = rows[i].querySelectorAll(".dhx_cal_month_cell"); + var cHeight = this._colsS.height - this.xy.month_head_height; + if (this.config.max_month_events * 1 !== this.config.max_month_events || h[i] <= this.config.max_month_events) { + cHeight = h[i] * hb; + } else if ((this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height) { + cHeight = (this.config.max_month_events + 1) * hb; + } + rows[i].style.height = cHeight + this.xy.month_head_height + "px"; + for (var j = 0; j < cells.length; j++) { + cells[j].childNodes[1].style.height = cHeight + "px"; + } + h[i] = (h[i - 1] || 0) + cells[0].offsetHeight; + } + h[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight; + } + h.unshift(0); + if (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) + ; + } else { + if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible") + h[0] = -1; + if (evs.length || h[0] == -1) { + var dh = (h[0] + 1) * hb + 1; + if (multiday_height != dh + 1) { + this._obj.style.height = total_height - multiday_height + dh - 1 + "px"; + } + dh += "px"; + const navHeight = this._els["dhx_cal_navline"][0].offsetHeight; + const headerHeight = this._els["dhx_cal_header"][0].offsetHeight; + data.style.height = this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0) + "px"; + var last = this._els["dhx_multi_day"][0]; + last.style.height = dh; + last.style.visibility = h[0] == -1 ? "hidden" : "visible"; + last = this._els["dhx_multi_day"][1]; + last.style.height = dh; + last.style.visibility = h[0] == -1 ? "hidden" : "visible"; + if (last.style.visibility == "hidden") { + last.style.display = "none"; + } else { + last.style.display = ""; + } + last.className = h[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small"; + this._dy_shift = (h[0] + 1) * hb; + h[0] = 0; + } + } } } - function fill_agenda_tab() { - var events = scheduler2.get_visible_events(); - events.sort(function(a, b) { - return a.start_date > b.start_date ? 1 : -1; - }); - var tableAttr = scheduler2._waiAria.agendaDataAttrString(); - var agendaEventAttrString; - var html = "
"; - for (var i = 0; i < events.length; i++) { - var ev = events[i]; - var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; - var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; - var ev_class = scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); - agendaEventAttrString = scheduler2._waiAria.agendaEventAttrString(ev); - var agendaDetailsButtonAttr = scheduler2._waiAria.agendaDetailsBtnString(); - html += "
" + (scheduler2.config.rtl ? scheduler2.templates.agenda_time(ev.end_date, ev.start_date, ev) : scheduler2.templates.agenda_time(ev.start_date, ev.end_date, ev)) + "
"; - html += `
- -
`; - html += "" + scheduler2.templates.agenda_text(ev.start_date, ev.end_date, ev) + "
"; - } - html += "
"; - scheduler2._els["dhx_cal_data"][0].innerHTML = html; - scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = scheduler2._agendaScrollTop || 0; - var agenda_area = scheduler2._els["dhx_cal_data"][0].childNodes[0]; - var v_border = agenda_area.childNodes[agenda_area.childNodes.length - 1]; - v_border.style.height = agenda_area.offsetHeight < scheduler2._els["dhx_cal_data"][0].offsetHeight ? "100%" : agenda_area.offsetHeight + "px"; - var t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; - var dateElement = scheduler2._getNavDateElement(); - if (dateElement) { - dateElement.innerHTML = scheduler2.templates.agenda_date(scheduler2._min_date, scheduler2._max_date, scheduler2._mode); + return evs; + }; + var checked_divs = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"]; + var updateContainterHeight = function(is_repaint) { + total_height = 0; + for (var i = 0; i < checked_divs.length; i++) { + var className = checked_divs[i]; + var checked_div = scheduler2._els[className] ? scheduler2._els[className][0] : null; + var height = 0; + switch (className) { + case "dhx_cal_navline": + case "dhx_cal_header": + height = checked_div.offsetHeight; + break; + case "dhx_multi_day": + height = checked_div ? checked_div.offsetHeight - 1 : 0; + multiday_height = height; + break; + case "dhx_cal_data": + var mode = scheduler2.getState().mode; + if (checked_div.childNodes[1] && mode != "month") { + let maxHeight = 0; + for (let i2 = 0; i2 < checked_div.childNodes.length; i2++) { + if (checked_div.childNodes[i2].offsetHeight > maxHeight) { + maxHeight = checked_div.childNodes[i2].offsetHeight; + } + } + height = maxHeight; + } else { + height = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight); + } + if (mode == "month") { + if (scheduler2.config.month_day_min_height && !is_repaint) { + var rows_length = checked_div.querySelectorAll(".dhx_cal_month_row").length; + height = rows_length * scheduler2.config.month_day_min_height; + } + if (is_repaint) { + checked_div.style.height = height + "px"; + } + } else if (mode == "year") { + height = 190 * scheduler2.config.year_y; + } else if (mode == "agenda") { + height = 0; + if (checked_div.childNodes && checked_div.childNodes.length) { + for (var j = 0; j < checked_div.childNodes.length; j++) { + height += checked_div.childNodes[j].offsetHeight; + } + } + if (height + 2 < scheduler2.config.min_grid_size) { + height = scheduler2.config.min_grid_size; + } else { + height += 2; + } + } else if (mode == "week_agenda") { + var min_height = scheduler2.xy.week_agenda_scale_height + scheduler2.config.min_grid_size, cur_height; + var column; + for (var k = 0; k < checked_div.childNodes.length; k++) { + column = checked_div.childNodes[k]; + for (var j = 0; j < column.childNodes.length; j++) { + var innerHeight = 0, eventsContainer = column.childNodes[j].childNodes[1]; + for (var g = 0; g < eventsContainer.childNodes.length; g++) { + innerHeight += eventsContainer.childNodes[g].offsetHeight; + } + cur_height = innerHeight + scheduler2.xy.week_agenda_scale_height; + cur_height = k == 1 && (j == 2 || j == 3) ? cur_height * 2 : cur_height; + if (cur_height > min_height) { + min_height = cur_height; + } + } + } + height = min_height * 3; + } else if (mode == "map") { + height = 0; + var evs = checked_div.querySelectorAll(".dhx_map_line"); + for (var j = 0; j < evs.length; j++) { + height += evs[j].offsetHeight; + } + if (height + 2 < scheduler2.config.min_map_size) { + height = scheduler2.config.min_map_size; + } else { + height += 2; + } + } else if (scheduler2._gridView) { + height = 0; + if (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) { + var evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes; + for (var j = 0; j < evs.length; j++) { + height += evs[j].offsetHeight; + } + height += 2; + if (height < scheduler2.config.min_grid_size) { + height = scheduler2.config.min_grid_size; + } + } else { + height = scheduler2.config.min_grid_size; + } + } + if (scheduler2.matrix && scheduler2.matrix[mode]) { + if (is_repaint) { + height += 0; + checked_div.style.height = height + "px"; + } else { + height = 0; + var cfg = scheduler2.matrix[mode]; + var rows = cfg.y_unit; + for (var r = 0; r < rows.length; r++) { + height += cfg.getSectionHeight(rows[r].key); + } + if (scheduler2.$container.clientWidth != scheduler2.$container.scrollWidth) { + height += getScrollSize(); + } + } + height -= 1; + } + if (mode == "day" || mode == "week" || scheduler2._props && scheduler2._props[mode]) { + height += 2; + } + break; } - scheduler2._rendered = []; - for (var i = 0; i < t.length - 1; i++) - scheduler2._rendered[i] = t[i]; + height += 1; + total_height += height; } - scheduler2.agenda_legacy_view = function(mode) { - scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_legacy_start(scheduler2._date); - scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda_legacy(scheduler2._min_date, 1); - set_full_view(mode); - if (mode) { - scheduler2._cols = null; - scheduler2._colsS = null; - scheduler2._table_view = true; - fill_agenda_tab(); - } else { - scheduler2._table_view = false; - } - }; - }); -} -function agenda_view(scheduler2) { - scheduler2.date.add_agenda = function(date, inc) { - return scheduler2.date.add(date, 1 * inc, "month"); + scheduler2._obj.style.height = total_height + "px"; + if (!is_repaint) + scheduler2.updateView(); }; - scheduler2.templates.agenda_time = function(start, end, ev) { - if (ev._timed) { - return `${this.event_date(start)} - ${this.event_date(end)}`; - } else { - return scheduler2.locale.labels.full_day; + function callUpdate() { + active = false; + scheduler2.callEvent("onAfterSchedulerResize", []); + active = true; + } + var conditionalUpdateContainerHeight = function() { + if (!(scheduler2.config.container_autoresize && active)) + return true; + var mode = scheduler2.getState().mode; + if (!mode) { + return true; } - }; - scheduler2.templates.agenda_text = function(start, end, ev) { - return ev.text; - }; - const dayDateToStr = scheduler2.date.date_to_str("%F %j"); - const dayDowToStr = scheduler2.date.date_to_str("%l"); - scheduler2.templates.agenda_day = function(date) { - return `
${dayDateToStr(date)}
-
${dayDowToStr(date)}
`; - }; - scheduler2.templates.agenda_date = function(start, end) { - return scheduler2.templates.month_date(scheduler2.getState().date); - }; - scheduler2.date.agenda_start = function(date) { - return scheduler2.date.month_start(new Date(date)); - }; - let scrollTop = 0; - scheduler2.attachEvent("onTemplatesReady", function() { - var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; - scheduler2.dblclick_dhx_cal_data = function() { - if (this._mode == "agenda") { - if (!this.config.readonly && this.config.dblclick_create) - this.addEventNow(); - } else { - if (old_dblclick_dhx_cal_data) - return old_dblclick_dhx_cal_data.apply(this, arguments); - } - }; - var old = scheduler2.render_data; - scheduler2.render_data = function(evs) { - if (this._mode == "agenda") - fill_agenda_tab(); - else - return old.apply(this, arguments); - }; - var old_render_view_data = scheduler2.render_view_data; - scheduler2.render_view_data = function() { - if (this._mode == "agenda") { - scrollTop = scheduler2._els["dhx_cal_data"][0].scrollTop; - scheduler2._els["dhx_cal_data"][0].scrollTop = 0; - } - return old_render_view_data.apply(this, arguments); - }; - function fill_agenda_tab() { - const events = scheduler2.get_visible_events(); - events.sort(function(a, b) { - return a.start_date > b.start_date ? 1 : -1; - }); - const eventsInDays = {}; - let currDate = scheduler2.getState().min_date; - const maxDate = scheduler2.getState().max_date; - while (currDate.valueOf() < maxDate.valueOf()) { - eventsInDays[currDate.valueOf()] = []; - currDate = scheduler2.date.add(currDate, 1, "day"); + var asyncRepaint = window.requestAnimationFrame || window.setTimeout; + var scrollTop = document.documentElement.scrollTop; + asyncRepaint(function() { + if (scheduler2.$destroyed || !scheduler2.$initialized) { + return; } - let anyEvents = false; - events.forEach((ev) => { - let eventStart = scheduler2.date.day_start(new Date(ev.start_date)); - while (eventStart.valueOf() < ev.end_date.valueOf()) { - if (eventsInDays[eventStart.valueOf()]) { - eventsInDays[eventStart.valueOf()].push(ev); - anyEvents = true; - } - eventStart = scheduler2.date.day_start(scheduler2.date.add(eventStart, 1, "day")); - } - }); - if (!anyEvents) { - scheduler2._els["dhx_cal_data"][0].innerHTML = renderEmptyView(); - } else { - let html = ""; - for (let day in eventsInDays) { - html += renderDay(new Date(day * 1), eventsInDays[day]); + updateContainterHeight(); + }); + if (scheduler2.matrix && scheduler2.matrix[mode] || mode == "month") { + asyncRepaint(function() { + if (scheduler2.$destroyed || !scheduler2.$initialized) { + return; } - scheduler2._els["dhx_cal_data"][0].innerHTML = html; - } - scheduler2._els["dhx_cal_data"][0].scrollTop = scrollTop; - let t = scheduler2._els["dhx_cal_data"][0].querySelectorAll(".dhx_cal_agenda_event_line"); - scheduler2._rendered = []; - for (var i = 0; i < t.length - 1; i++) { - scheduler2._rendered[i] = t[i]; - } - } - function renderEmptyView() { - return `
${scheduler2.locale.labels.agenda_tab}
`; + updateContainterHeight(true); + document.documentElement.scrollTop = scrollTop; + callUpdate(); + }, 1); + } else { + callUpdate(); } - function renderDay(day, events) { - if (!events.length) { - return ""; - } - let html = ` -
-
${scheduler2.templates.agenda_day(day)}
-
-`; - events.forEach((calendarEvent) => { - html += renderOneEvent(day, calendarEvent); - }); - html += `
`; - return html; + }; + scheduler2.attachEvent("onBeforeViewChange", function() { + var autosizeEnabled = scheduler2.config.container_autoresize; + if (!scheduler2.xy.$original_scroll_width) { + scheduler2.xy.$original_scroll_width = scheduler2.xy.scroll_width; } - function renderOneEvent(day, calendarEvent) { - const dates = scheduler2.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); - const selectedId = scheduler2.getState().select_id; - const cls = scheduler2.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); - const description = scheduler2.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); - let style = ""; - if (calendarEvent.color || calendarEvent.textColor) { - const bg = calendarEvent.color ? "--dhx-scheduler-event-background:" + calendarEvent.color + ";" : ""; - const color = calendarEvent.textColor ? "--dhx-scheduler-event-color:" + calendarEvent.textColor + ";" : ""; - style = ` style="${bg}${color}" `; + scheduler2.xy.scroll_width = autosizeEnabled ? 0 : scheduler2.xy.$original_scroll_width; + if (scheduler2.matrix) { + for (var i in scheduler2.matrix) { + var timeline = scheduler2.matrix[i]; + if (!timeline.$original_section_autoheight) { + timeline.$original_section_autoheight = timeline.section_autoheight; + } + if (autosizeEnabled) { + timeline.section_autoheight = false; + } else { + timeline.section_autoheight = timeline.$original_section_autoheight; + } } - return `
-
-
${dates}
-
${description}
-
`; } - scheduler2.agenda_view = function(mode) { - if (mode) { - scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_start(scheduler2._date); - scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda(scheduler2._min_date, 1); - scheduler2._cols = null; - scheduler2._colsS = null; - scheduler2._table_view = true; - const dateHeader = scheduler2._getNavDateElement(); - dateHeader.innerHTML = scheduler2.templates.agenda_date(scheduler2._date); - fill_agenda_tab(); - } else { - scheduler2._table_view = false; + return true; + }); + scheduler2.attachEvent("onViewChange", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onXLE", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventChanged", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventCreated", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventAdded", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventDeleted", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onAfterSchedulerResize", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onClearAll", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onBeforeExpand", function() { + active = false; + return true; + }); + scheduler2.attachEvent("onBeforeCollapse", function() { + active = true; + return true; + }); + function getScrollSize() { + var div = document.createElement("div"); + div.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;"; + document.body.appendChild(div); + var size = div.offsetWidth - div.clientWidth; + document.body.removeChild(div); + return size; + } +} +function cookie(scheduler2) { + function setCookie(name, cookie_param, value) { + var str = name + "=" + value + (cookie_param ? "; " + cookie_param : ""); + document.cookie = str; + } + function getCookie(name) { + var search = name + "="; + if (document.cookie.length > 0) { + var offset = document.cookie.indexOf(search); + if (offset != -1) { + offset += search.length; + var end = document.cookie.indexOf(";", offset); + if (end == -1) + end = document.cookie.length; + return document.cookie.substring(offset, end); } - }; - }); -} -function all_timed(scheduler2) { - scheduler2.config.all_timed = "short"; - scheduler2.config.all_timed_month = false; - var is_event_short = function(ev) { - if (!((ev.end_date - ev.start_date) / (1e3 * 60 * 60) >= 24)) { - return true; } - if (scheduler2._drag_mode == "resize" && scheduler2._drag_id == ev.id) { - return true; - } - return false; - }; - scheduler2._safe_copy = function(event2) { - var proto = null, copy2 = scheduler2._copy_event(event2); - if (event2.event_pid) { - proto = scheduler2.getEvent(event2.event_pid); + return ""; + } + function getCookieName(scheduler3) { + return (scheduler3._obj.id || "scheduler") + "_settings"; + } + var first = true; + scheduler2.attachEvent("onBeforeViewChange", function(oldMode, oldDate, mode, date) { + if (first && scheduler2._get_url_nav) { + var urlNavigationPlugin = scheduler2._get_url_nav(); + if (urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event) { + first = false; + } } - if (proto && proto.isPrototypeOf(event2)) { - delete copy2.event_length; - delete copy2.event_pid; - delete copy2.rec_pattern; - delete copy2.rec_type; + var cookie2 = getCookieName(scheduler2); + if (first) { + first = false; + var schedulerCookie = getCookie(cookie2); + if (schedulerCookie) { + if (!scheduler2._min_date) { + scheduler2._min_date = date; + } + schedulerCookie = unescape(schedulerCookie).split("@"); + schedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]); + var view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode, date = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date; + window.setTimeout(function() { + if (scheduler2.$destroyed) { + return; + } + scheduler2.setCurrentView(date, view); + }, 1); + return false; + } } - return copy2; - }; - var old_prerender_events_line = scheduler2._pre_render_events_line; - var old_prerender_events_table = scheduler2._pre_render_events_table; - var prerender_events = function(evs, hold) { - if (!this._table_view) { - return old_prerender_events_line.call(this, evs, hold); + return true; + }); + scheduler2.attachEvent("onViewChange", function(newMode, newDate) { + var cookie2 = getCookieName(scheduler2); + var text = escape(this._helpers.formatDate(newDate) + "@" + newMode); + setCookie(cookie2, "expires=Sun, 31 Jan 9999 22:00:00 GMT", text); + }); + var old_load = scheduler2._load; + scheduler2._load = function() { + var args = arguments; + if (!scheduler2._date) { + var that = this; + window.setTimeout(function() { + old_load.apply(that, args); + }, 1); + } else { + old_load.apply(this, args); } - return old_prerender_events_table.call(this, evs, hold); }; - scheduler2._pre_render_events_line = scheduler2._pre_render_events_table = function(evs, hold) { - if (!this.config.all_timed || this._table_view && this._mode != "month" || this._mode == "month" && !this.config.all_timed_month) - return prerender_events.call(this, evs, hold); - for (var i = 0; i < evs.length; i++) { - var ev = evs[i]; - if (ev._timed) - continue; - if (this.config.all_timed == "short") { - if (!is_event_short(ev)) { - if (this._mode != "month") { - evs.splice(i--, 1); +} +const notImplemented = { alert: (extension, assert2) => { + assert2(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
+ You may need a Professional version of the component.
+ Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`); +} }; +function daytimeline_restricted(scheduler2) { + notImplemented.alert("Day Timeline", scheduler2.assert); +} +function drag_between_restricted(scheduler2) { + notImplemented.alert("Drag Between", scheduler2.assert); +} +function editors(scheduler2) { + scheduler2.form_blocks["combo"] = { render: function(sns) { + if (!sns.cached_options) + sns.cached_options = {}; + var res = ""; + res += "
"; + return res; + }, set_value: function(node, value, ev, config) { + (function() { + resetCombo(); + var id2 = scheduler2.attachEvent("onAfterLightbox", function() { + resetCombo(); + scheduler2.detachEvent(id2); + }); + function resetCombo() { + if (node._combo && node._combo.DOMParent) { + var combo2 = node._combo; + if (combo2.unload) { + combo2.unload(); + } else if (combo2.destructor) { + combo2.destructor(); } - continue; + combo2.DOMParent = combo2.DOMelem = null; } } - var ce = this._safe_copy(ev); - if (!ev._virtual) { - ce._first_chunk = true; - } else { - ce._first_chunk = false; - } - ce._drag_resize = false; - ce._virtual = true; - ce.start_date = new Date(ce.start_date); - if (!isOvernightEvent(ev)) { - ce.end_date = new Date(ev.end_date); - } else { - ce.end_date = getNextDay(ce.start_date); - if (this.config.last_hour != 24) { - ce.end_date = setDateTime(ce.start_date, this.config.last_hour); - } + })(); + window.dhx_globalImgPath = config.image_path || "/"; + node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth - 8); + if (config.onchange) + node._combo.attachEvent("onChange", config.onchange); + if (config.options_height) + node._combo.setOptionHeight(config.options_height); + var combo = node._combo; + combo.enableFilteringMode(config.filtering, config.script_path || null, !!config.cache); + if (!config.script_path) { + var all_options = []; + for (var i = 0; i < config.options.length; i++) { + var option = config.options[i]; + var single_option = [option.key, option.label, option.css]; + all_options.push(single_option); } - var event_changed = false; - if (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) { - evs[i] = ce; - event_changed = true; + combo.addOption(all_options); + if (ev[config.map_to]) { + var index = combo.getIndexByValue(ev[config.map_to]); + combo.selectOption(index); } - var re = this._safe_copy(ev); - re._virtual = true; - re.end_date = new Date(re.end_date); - if (re.start_date < this._min_date) - re.start_date = setDateTime(this._min_date, this.config.first_hour); - else - re.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour); - if (re.start_date < this._max_date && re.start_date < re.end_date) { - if (event_changed) { - evs.splice(i + 1, 0, re); + } else { + var selected_id = ev[config.map_to]; + if (selected_id) { + if (config.cached_options[selected_id]) { + combo.addOption(selected_id, config.cached_options[selected_id]); + combo.disable(1); + combo.selectOption(0); + combo.disable(0); } else { - evs[i--] = re; - continue; + scheduler2.ajax.get(config.script_path + "?id=" + selected_id + "&uid=" + scheduler2.uid(), function(result) { + var responseText = result.xmlDoc.responseText; + var label; + try { + var res = JSON.parse(responseText); + label = res.options[0].text; + } catch (e) { + var option2 = scheduler2.ajax.xpath("//option", result.xmlDoc)[0]; + label = option2.childNodes[0].nodeValue; + } + config.cached_options[selected_id] = label; + combo.addOption(selected_id, label); + combo.disable(1); + combo.selectOption(0); + combo.disable(0); + }); } - re._last_chunk = false; } else { - ce._last_chunk = true; - ce._drag_resize = true; - } - } - var redraw = this._drag_mode == "move" ? false : hold; - return prerender_events.call(this, evs, redraw); - function isOvernightEvent(ev2) { - var next_day = getNextDay(ev2.start_date); - return +ev2.end_date > +next_day; - } - function getNextDay(date) { - var next_day = scheduler2.date.add(date, 1, "day"); - next_day = scheduler2.date.date_part(next_day); - return next_day; - } - function setDateTime(date, hours) { - var val = scheduler2.date.date_part(new Date(date)); - val.setHours(hours); - return val; - } - }; - var old_get_visible_events = scheduler2.get_visible_events; - scheduler2.get_visible_events = function(only_timed) { - if (!(this.config.all_timed && this.config.multi_day)) - return old_get_visible_events.call(this, only_timed); - return old_get_visible_events.call(this, false); - }; - scheduler2.attachEvent("onBeforeViewChange", function(old_mode, old_date, mode, date) { - scheduler2._allow_dnd = mode == "day" || mode == "week" || scheduler2.getView(mode); - return true; - }); - scheduler2._is_main_area_event = function(ev) { - return !!(ev._timed || this.config.all_timed === true || this.config.all_timed == "short" && is_event_short(ev)); - }; - var oldUpdate = scheduler2.updateEvent; - scheduler2.updateEvent = function(id2) { - var ev = scheduler2.getEvent(id2); - var fullRedrawNeeded; - var initial; - if (ev) { - fullRedrawNeeded = scheduler2.config.all_timed && !(scheduler2.isOneDayEvent(scheduler2._events[id2]) || scheduler2.getState().drag_id); - if (fullRedrawNeeded) { - initial = scheduler2.config.update_render; - scheduler2.config.update_render = true; + combo.setComboValue(""); } } - oldUpdate.apply(scheduler2, arguments); - if (ev) { - if (fullRedrawNeeded) { - scheduler2.config.update_render = initial; - } + }, get_value: function(node, ev, config) { + var selected_id = node._combo.getSelectedValue(); + if (config.script_path) { + config.cached_options[selected_id] = node._combo.getSelectedText(); } - }; -} -function collision(scheduler2) { - var temp_section; - var before; - scheduler2.config.collision_limit = 1; - function _setTempSection(event_id) { - var checked_mode = scheduler2._get_section_view(); - if (checked_mode && event_id) { - temp_section = scheduler2.getEvent(event_id)[scheduler2._get_section_property()]; + return selected_id; + }, focus: function(node) { + } }; + scheduler2.form_blocks["radio"] = { render: function(sns) { + var res = ""; + res += `
`; + for (var i = 0; i < sns.options.length; i++) { + var id2 = scheduler2.uid(); + res += ""; } - } - scheduler2.attachEvent("onBeforeDrag", function(id2) { - _setTempSection(id2); - return true; - }); - scheduler2.attachEvent("onBeforeLightbox", function(id2) { - var ev = scheduler2.getEvent(id2); - before = [ev.start_date, ev.end_date]; - _setTempSection(id2); - return true; - }); - scheduler2.attachEvent("onEventChanged", function(id2) { - if (!id2 || !scheduler2.getEvent(id2)) - return true; - var ev = scheduler2.getEvent(id2); - if (!scheduler2.checkCollision(ev)) { - if (!before) - return false; - ev.start_date = before[0]; - ev.end_date = before[1]; - ev._timed = this.isOneDayEvent(ev); + res += "
"; + return res; + }, set_value: function(node, value, ev, config) { + var radiobuttons = node.getElementsByTagName("input"); + for (var i = 0; i < radiobuttons.length; i++) { + radiobuttons[i].checked = false; + var checked_value = ev[config.map_to] || value; + if (radiobuttons[i].value == checked_value) { + radiobuttons[i].checked = true; + } } - return true; - }); - scheduler2.attachEvent("onBeforeEventChanged", function(ev, e, is_new) { - return scheduler2.checkCollision(ev); - }); - scheduler2.attachEvent("onEventAdded", function(id2, ev) { - var result = scheduler2.checkCollision(ev); - if (!result) - scheduler2.deleteEvent(id2); - }); - scheduler2.attachEvent("onEventSave", function(id2, edited_ev, is_new) { - edited_ev = scheduler2._lame_clone(edited_ev); - edited_ev.id = id2; - if (!(edited_ev.start_date && edited_ev.end_date)) { - var ev = scheduler2.getEvent(id2); - edited_ev.start_date = new Date(ev.start_date); - edited_ev.end_date = new Date(ev.end_date); + }, get_value: function(node, ev, config) { + var radiobuttons = node.getElementsByTagName("input"); + for (var i = 0; i < radiobuttons.length; i++) { + if (radiobuttons[i].checked) { + return radiobuttons[i].value; + } } - if (edited_ev.rec_type) { - scheduler2._roll_back_dates(edited_ev); + }, focus: function(node) { + } }; + scheduler2.form_blocks["checkbox"] = { render: function(sns) { + if (scheduler2.config.wide_form) + return '
'; + else + return ""; + }, set_value: function(node, value, ev, config) { + node = scheduler2._lightbox.querySelector(`#${config.id}`); + var id2 = scheduler2.uid(); + var isChecked = typeof config.checked_value != "undefined" ? value == config.checked_value : !!value; + node.className += " dhx_cal_checkbox"; + var check_html = ""; + var label_html = ""; + if (scheduler2.config.wide_form) { + node.innerHTML = label_html; + node.nextSibling.innerHTML = check_html; + } else + node.innerHTML = check_html + label_html; + if (config.handler) { + var checkbox = node.getElementsByTagName("input")[0]; + if (checkbox.$_eventAttached) { + return; + } + checkbox.$_eventAttached = true; + scheduler2.event(checkbox, "click", config.handler); } - return scheduler2.checkCollision(edited_ev); - }); - scheduler2._check_sections_collision = function(first, second) { - var map_to = scheduler2._get_section_property(); - if (first[map_to] == second[map_to] && first.id != second.id) - return true; - return false; + }, get_value: function(node, ev, config) { + node = scheduler2._lightbox.querySelector(`#${config.id}`); + var checkbox = node.getElementsByTagName("input")[0]; + if (!checkbox) + checkbox = node.nextSibling.getElementsByTagName("input")[0]; + return checkbox.checked ? config.checked_value || true : config.unchecked_value || false; + }, focus: function(node) { + } }; +} +function expand(scheduler2) { + scheduler2.ext.fullscreen = { toggleIcon: null }; + scheduler2.expand = function() { + if (!scheduler2.callEvent("onBeforeExpand", [])) + return; + var t = scheduler2._obj; + do { + t._position = t.style.position || ""; + t.style.position = "static"; + } while ((t = t.parentNode) && t.style); + t = scheduler2._obj; + t.style.position = "absolute"; + t._width = t.style.width; + t._height = t.style.height; + t.style.width = t.style.height = "100%"; + t.style.top = t.style.left = "0px"; + var top = document.body; + top.scrollTop = 0; + top = top.parentNode; + if (top) + top.scrollTop = 0; + document.body._overflow = document.body.style.overflow || ""; + document.body.style.overflow = "hidden"; + scheduler2._maximize(); + scheduler2.callEvent("onExpand", []); }; - scheduler2.checkCollision = function(ev) { - var evs = []; - var collision_limit = scheduler2.config.collision_limit; - if (ev.rec_type) { - var evs_dates = scheduler2.getRecDates(ev); - for (var k = 0; k < evs_dates.length; k++) { - var tevs = scheduler2.getEvents(evs_dates[k].start_date, evs_dates[k].end_date); - for (var j = 0; j < tevs.length; j++) { - if ((tevs[j].event_pid || tevs[j].id) != ev.id) - evs.push(tevs[j]); - } - } + scheduler2.collapse = function() { + if (!scheduler2.callEvent("onBeforeCollapse", [])) + return; + var t = scheduler2._obj; + do { + t.style.position = t._position; + } while ((t = t.parentNode) && t.style); + t = scheduler2._obj; + t.style.width = t._width; + t.style.height = t._height; + document.body.style.overflow = document.body._overflow; + scheduler2._maximize(); + scheduler2.callEvent("onCollapse", []); + }; + scheduler2.attachEvent("onTemplatesReady", function() { + var t = document.createElement("div"); + t.className = "dhx_expand_icon"; + scheduler2.ext.fullscreen.toggleIcon = t; + t.innerHTML = ` + + + + + + + + + + + + `; + scheduler2._obj.appendChild(t); + scheduler2.event(t, "click", function() { + if (!scheduler2.expanded) + scheduler2.expand(); + else + scheduler2.collapse(); + }); + }); + scheduler2._maximize = function() { + this.expanded = !this.expanded; + if (this.expanded) { + this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded"); } else { - evs = scheduler2.getEvents(ev.start_date, ev.end_date); - for (var i = 0; i < evs.length; i++) { - var concurrent = evs[i]; - if (concurrent.id == ev.id || concurrent.event_length && [concurrent.event_pid, concurrent.event_length].join("#") == ev.id) { - evs.splice(i, 1); - break; - } - } + this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded"); } - var checked_mode = scheduler2._get_section_view(); - var map_to = scheduler2._get_section_property(); - var single = true; - if (checked_mode) { - var count = 0; - for (var i = 0; i < evs.length; i++) { - if (evs[i].id != ev.id && this._check_sections_collision(evs[i], ev)) - count++; - } - if (count >= collision_limit) { - single = false; + var directions = ["left", "top"]; + for (var i = 0; i < directions.length; i++) { + var prev_margin = scheduler2["_prev_margin_" + directions[i]]; + if (scheduler2.xy["margin_" + directions[i]]) { + scheduler2["_prev_margin_" + directions[i]] = scheduler2.xy["margin_" + directions[i]]; + scheduler2.xy["margin_" + directions[i]] = 0; + } else { + if (prev_margin) { + scheduler2.xy["margin_" + directions[i]] = scheduler2["_prev_margin_" + directions[i]]; + delete scheduler2["_prev_margin_" + directions[i]]; + } } - } else { - if (evs.length >= collision_limit) - single = false; } - if (!single) { - var res = !scheduler2.callEvent("onEventCollision", [ev, evs]); - if (!res) { - ev[map_to] = temp_section || ev[map_to]; + scheduler2.setCurrentView(); + }; +} +function grid_view(scheduler2) { + notImplemented.alert("Grid", scheduler2.assert); +} +function html_templates(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + var els = document.body.getElementsByTagName("DIV"); + for (var i = 0; i < els.length; i++) { + var cs2 = els[i].className || ""; + cs2 = cs2.split(":"); + if (cs2.length == 2 && cs2[0] == "template") { + var code = 'return "' + (els[i].innerHTML || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\n\r]+/g, "") + '";'; + code = unescape(code).replace(/\{event\.([a-z]+)\}/g, function(all, mask) { + return '"+ev.' + mask + '+"'; + }); + scheduler2.templates[cs2[1]] = Function("start", "end", "ev", code); + els[i].style.display = "none"; } - return res; } - return single; - }; + }); } -function container_autoresize(scheduler2) { - scheduler2.config.container_autoresize = true; - scheduler2.config.month_day_min_height = 90; - scheduler2.config.min_grid_size = 25; - scheduler2.config.min_map_size = 400; - var old_pre_render_event = scheduler2._pre_render_events; - var active = true; - var total_height = 0; - var multiday_height = 0; - scheduler2._pre_render_events = function(evs, hold) { - if (!(scheduler2.config.container_autoresize && active)) { - return old_pre_render_event.apply(this, arguments); - } - var hb = this.xy.bar_height; - var h_old = this._colsS.heights; - var h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0]; - var data = this._els["dhx_cal_data"][0]; - if (!this._table_view) - evs = this._pre_render_events_line(evs, hold); - else - evs = this._pre_render_events_table(evs, hold); - if (this._table_view) { - if (hold) { - this._colsS.heights = h_old; - } else { - var evl = data.firstChild; - const rows = evl.querySelectorAll(".dhx_cal_month_row"); - if (rows) { - for (var i = 0; i < rows.length; i++) { - h[i]++; - if (h[i] * hb > this._colsS.height - this.xy.month_head_height) { - var cells = rows[i].querySelectorAll(".dhx_cal_month_cell"); - var cHeight = this._colsS.height - this.xy.month_head_height; - if (this.config.max_month_events * 1 !== this.config.max_month_events || h[i] <= this.config.max_month_events) { - cHeight = h[i] * hb; - } else if ((this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height) { - cHeight = (this.config.max_month_events + 1) * hb; - } - rows[i].style.height = cHeight + this.xy.month_head_height + "px"; - for (var j = 0; j < cells.length; j++) { - cells[j].childNodes[1].style.height = cHeight + "px"; - } - h[i] = (h[i - 1] || 0) + cells[0].offsetHeight; - } - h[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight; - } - h.unshift(0); - if (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) - ; +function keyboard_shortcuts(scheduler2) { + scheduler2.$keyboardNavigation.shortcuts = { createCommand: function() { + return { modifiers: { shift: false, alt: false, ctrl: false, meta: false }, keyCode: null }; + }, parse: function(shortcut) { + var commands = []; + var expr = this.getExpressions(this.trim(shortcut)); + for (var i = 0; i < expr.length; i++) { + var words = this.getWords(expr[i]); + var command = this.createCommand(); + for (var j = 0; j < words.length; j++) { + if (this.commandKeys[words[j]]) { + command.modifiers[words[j]] = true; + } else if (this.specialKeys[words[j]]) { + command.keyCode = this.specialKeys[words[j]]; } else { - if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible") - h[0] = -1; - if (evs.length || h[0] == -1) { - var dh = (h[0] + 1) * hb + 1; - if (multiday_height != dh + 1) { - this._obj.style.height = total_height - multiday_height + dh - 1 + "px"; - } - dh += "px"; - const navHeight = this._els["dhx_cal_navline"][0].offsetHeight; - const headerHeight = this._els["dhx_cal_header"][0].offsetHeight; - data.style.height = this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0) + "px"; - var last = this._els["dhx_multi_day"][0]; - last.style.height = dh; - last.style.visibility = h[0] == -1 ? "hidden" : "visible"; - last = this._els["dhx_multi_day"][1]; - last.style.height = dh; - last.style.visibility = h[0] == -1 ? "hidden" : "visible"; - if (last.style.visibility == "hidden") { - last.style.display = "none"; - } else { - last.style.display = ""; - } - last.className = h[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small"; - this._dy_shift = (h[0] + 1) * hb; - h[0] = 0; - } + command.keyCode = words[j].charCodeAt(0); } } + commands.push(command); } - return evs; - }; - var checked_divs = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"]; - var updateContainterHeight = function(is_repaint) { - total_height = 0; - for (var i = 0; i < checked_divs.length; i++) { - var className = checked_divs[i]; - var checked_div = scheduler2._els[className] ? scheduler2._els[className][0] : null; - var height = 0; - switch (className) { - case "dhx_cal_navline": - case "dhx_cal_header": - height = checked_div.offsetHeight; - break; - case "dhx_multi_day": - height = checked_div ? checked_div.offsetHeight - 1 : 0; - multiday_height = height; - break; - case "dhx_cal_data": - var mode = scheduler2.getState().mode; - if (checked_div.childNodes[1] && mode != "month") { - let maxHeight = 0; - for (let i2 = 0; i2 < checked_div.childNodes.length; i2++) { - if (checked_div.childNodes[i2].offsetHeight > maxHeight) { - maxHeight = checked_div.childNodes[i2].offsetHeight; - } - } - height = maxHeight; - } else { - height = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight); - } - if (mode == "month") { - if (scheduler2.config.month_day_min_height && !is_repaint) { - var rows_length = checked_div.querySelectorAll(".dhx_cal_month_row").length; - height = rows_length * scheduler2.config.month_day_min_height; - } - if (is_repaint) { - checked_div.style.height = height + "px"; - } - } else if (mode == "year") { - height = 190 * scheduler2.config.year_y; - } else if (mode == "agenda") { - height = 0; - if (checked_div.childNodes && checked_div.childNodes.length) { - for (var j = 0; j < checked_div.childNodes.length; j++) { - height += checked_div.childNodes[j].offsetHeight; - } - } - if (height + 2 < scheduler2.config.min_grid_size) { - height = scheduler2.config.min_grid_size; - } else { - height += 2; - } - } else if (mode == "week_agenda") { - var min_height = scheduler2.xy.week_agenda_scale_height + scheduler2.config.min_grid_size, cur_height; - var column; - for (var k = 0; k < checked_div.childNodes.length; k++) { - column = checked_div.childNodes[k]; - for (var j = 0; j < column.childNodes.length; j++) { - var innerHeight = 0, eventsContainer = column.childNodes[j].childNodes[1]; - for (var g = 0; g < eventsContainer.childNodes.length; g++) { - innerHeight += eventsContainer.childNodes[g].offsetHeight; - } - cur_height = innerHeight + scheduler2.xy.week_agenda_scale_height; - cur_height = k == 1 && (j == 2 || j == 3) ? cur_height * 2 : cur_height; - if (cur_height > min_height) { - min_height = cur_height; - } - } - } - height = min_height * 3; - } else if (mode == "map") { - height = 0; - var evs = checked_div.querySelectorAll(".dhx_map_line"); - for (var j = 0; j < evs.length; j++) { - height += evs[j].offsetHeight; - } - if (height + 2 < scheduler2.config.min_map_size) { - height = scheduler2.config.min_map_size; - } else { - height += 2; - } - } else if (scheduler2._gridView) { - height = 0; - if (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) { - var evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes; - for (var j = 0; j < evs.length; j++) { - height += evs[j].offsetHeight; - } - height += 2; - if (height < scheduler2.config.min_grid_size) { - height = scheduler2.config.min_grid_size; - } - } else { - height = scheduler2.config.min_grid_size; - } - } - if (scheduler2.matrix && scheduler2.matrix[mode]) { - if (is_repaint) { - height += 0; - checked_div.style.height = height + "px"; - } else { - height = 0; - var cfg = scheduler2.matrix[mode]; - var rows = cfg.y_unit; - for (var r = 0; r < rows.length; r++) { - height += cfg.getSectionHeight(rows[r].key); - } - if (scheduler2.$container.clientWidth != scheduler2.$container.scrollWidth) { - height += getScrollSize(); - } - } - height -= 1; - } - if (mode == "day" || mode == "week" || scheduler2._props && scheduler2._props[mode]) { - height += 2; - } - break; + return commands; + }, getCommandFromEvent: function(domEvent) { + var command = this.createCommand(); + command.modifiers.shift = !!domEvent.shiftKey; + command.modifiers.alt = !!domEvent.altKey; + command.modifiers.ctrl = !!domEvent.ctrlKey; + command.modifiers.meta = !!domEvent.metaKey; + command.keyCode = domEvent.which || domEvent.keyCode; + if (command.keyCode >= 96 && command.keyCode <= 105) { + command.keyCode -= 48; + } + var printableKey = String.fromCharCode(command.keyCode); + if (printableKey) { + command.keyCode = printableKey.toLowerCase().charCodeAt(0); + } + return command; + }, getHashFromEvent: function(domEvent) { + return this.getHash(this.getCommandFromEvent(domEvent)); + }, getHash: function(command) { + var parts = []; + for (var i in command.modifiers) { + if (command.modifiers[i]) { + parts.push(i); } - height += 1; - total_height += height; } - scheduler2._obj.style.height = total_height + "px"; - if (!is_repaint) - scheduler2.updateView(); - }; - function callUpdate() { - active = false; - scheduler2.callEvent("onAfterSchedulerResize", []); - active = true; - } - var conditionalUpdateContainerHeight = function() { - if (!(scheduler2.config.container_autoresize && active)) - return true; - var mode = scheduler2.getState().mode; - if (!mode) { - return true; + parts.push(command.keyCode); + return parts.join(this.junctionChar); + }, getExpressions: function(shortcut) { + return shortcut.split(this.junctionChar); + }, getWords: function(term) { + return term.split(this.combinationChar); + }, trim: function(shortcut) { + return shortcut.replace(/\s/g, ""); + }, junctionChar: ",", combinationChar: "+", commandKeys: { shift: 16, alt: 18, ctrl: 17, meta: true }, specialKeys: { backspace: 8, tab: 9, enter: 13, esc: 27, space: 32, up: 38, down: 40, left: 37, right: 39, home: 36, end: 35, pageup: 33, pagedown: 34, delete: 46, insert: 45, plus: 107, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 } }; +} +function eventhandler(scheduler2) { + scheduler2.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(command) { + if (!this._handlers) + this._handlers = {}; + var shortcuts = scheduler2.$keyboardNavigation.shortcuts; + var hash = shortcuts.getHash(command); + return this._handlers[hash]; + }, doAction: function(command, e) { + var handler = this.findHandler(command); + if (handler) { + handler.call(this, e); + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; + } + }, bind: function(shortcut, handler) { + if (!this._handlers) + this._handlers = {}; + var shortcuts = scheduler2.$keyboardNavigation.shortcuts; + var commands = shortcuts.parse(shortcut); + for (var i = 0; i < commands.length; i++) { + this._handlers[shortcuts.getHash(commands[i])] = handler; } - var asyncRepaint = window.requestAnimationFrame || window.setTimeout; - var scrollTop = document.documentElement.scrollTop; - asyncRepaint(function() { - if (scheduler2.$destroyed || !scheduler2.$initialized) { - return; + }, unbind: function(shortcut) { + var shortcuts = scheduler2.$keyboardNavigation.shortcuts; + var commands = shortcuts.parse(shortcut); + for (var i = 0; i < commands.length; i++) { + if (this._handlers[shortcuts.getHash(commands[i])]) { + delete this._handlers[shortcuts.getHash(commands[i])]; } - updateContainterHeight(); - }); - if (scheduler2.matrix && scheduler2.matrix[mode] || mode == "month") { - asyncRepaint(function() { - if (scheduler2.$destroyed || !scheduler2.$initialized) { - return; - } - updateContainterHeight(true); - document.documentElement.scrollTop = scrollTop; - callUpdate(); - }, 1); - } else { - callUpdate(); } - }; - scheduler2.attachEvent("onBeforeViewChange", function() { - var autosizeEnabled = scheduler2.config.container_autoresize; - if (!scheduler2.xy.$original_scroll_width) { - scheduler2.xy.$original_scroll_width = scheduler2.xy.scroll_width; + }, bindAll: function(map) { + for (var i in map) { + this.bind(i, map[i]); } - scheduler2.xy.scroll_width = autosizeEnabled ? 0 : scheduler2.xy.$original_scroll_width; - if (scheduler2.matrix) { - for (var i in scheduler2.matrix) { - var timeline = scheduler2.matrix[i]; - if (!timeline.$original_section_autoheight) { - timeline.$original_section_autoheight = timeline.section_autoheight; + }, initKeys: function() { + if (!this._handlers) + this._handlers = {}; + if (this.keys) { + this.bindAll(this.keys); + } + } }; +} +function trap_modal_focus(scheduler2) { + (function() { + scheduler2.$keyboardNavigation.getFocusableNodes = scheduler2._getFocusableNodes; + scheduler2.$keyboardNavigation.trapFocus = function trapFocus(root, e) { + if (e.keyCode != 9) + return false; + var focusable = scheduler2.$keyboardNavigation.getFocusableNodes(root); + var currentFocus = document.activeElement; + var currentIndex = -1; + for (var i = 0; i < focusable.length; i++) { + if (focusable[i] == currentFocus) { + currentIndex = i; + break; } - if (autosizeEnabled) { - timeline.section_autoheight = false; - } else { - timeline.section_autoheight = timeline.$original_section_autoheight; + } + var nextIndex, nextItem; + if (e.shiftKey) { + nextIndex = currentIndex <= 0 ? focusable.length - 1 : currentIndex - 1; + nextItem = focusable[nextIndex]; + if (nextItem) { + nextItem.focus(); + e.preventDefault(); + return true; + } + } else { + nextIndex = currentIndex >= focusable.length - 1 ? 0 : currentIndex + 1; + nextItem = focusable[nextIndex]; + if (nextItem) { + nextItem.focus(); + e.preventDefault(); + return true; } } - } - return true; - }); - scheduler2.attachEvent("onViewChange", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onXLE", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventChanged", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventCreated", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventAdded", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventDeleted", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onAfterSchedulerResize", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onClearAll", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onBeforeExpand", function() { - active = false; - return true; - }); - scheduler2.attachEvent("onBeforeCollapse", function() { - active = true; - return true; - }); - function getScrollSize() { - var div = document.createElement("div"); - div.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;"; - document.body.appendChild(div); - var size = div.offsetWidth - div.clientWidth; - document.body.removeChild(div); - return size; - } + return false; + }; + })(); } -function cookie(scheduler2) { - function setCookie(name, cookie_param, value) { - var str = name + "=" + value + (cookie_param ? "; " + cookie_param : ""); - document.cookie = str; - } - function getCookie(name) { - var search = name + "="; - if (document.cookie.length > 0) { - var offset = document.cookie.indexOf(search); - if (offset != -1) { - offset += search.length; - var end = document.cookie.indexOf(";", offset); - if (end == -1) - end = document.cookie.length; - return document.cookie.substring(offset, end); +function marker(scheduler2) { + scheduler2.$keyboardNavigation.marker = { clear: function() { + var divs = scheduler2.$container.querySelectorAll(".dhx_focus_slot"); + for (var i = 0; i < divs.length; i++) { + divs[i].parentNode.removeChild(divs[i]); + } + }, createElement: function() { + var element = document.createElement("div"); + element.setAttribute("tabindex", -1); + element.className = "dhx_focus_slot"; + return element; + }, renderMultiple: function(start, end, method) { + var divs = []; + var currentStart = new Date(start); + var currentEnd = new Date(Math.min(end.valueOf(), scheduler2.date.add(scheduler2.date.day_start(new Date(start)), 1, "day").valueOf())); + while (currentStart.valueOf() < end.valueOf()) { + divs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf())))); + currentStart = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); + currentEnd = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); + currentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf())); + } + return divs; + }, render: function(start, end, section) { + this.clear(); + var divs = []; + var modes = scheduler2.$keyboardNavigation.TimeSlot.prototype._modes; + var view = scheduler2.$keyboardNavigation.TimeSlot.prototype._getMode(); + switch (view) { + case modes.units: + divs = this.renderVerticalMarker(start, end, section); + break; + case modes.timeline: + divs = this.renderTimelineMarker(start, end, section); + break; + case modes.year: + divs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker)); + break; + case modes.month: + divs = this.renderMonthMarker(start, end); + break; + case modes.weekAgenda: + divs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker)); + break; + case modes.list: + divs = this.renderAgendaMarker(start, end); + break; + case modes.dayColumns: + divs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker)); + break; + } + this.addWaiAriaLabel(divs, start, end, section); + this.addDataAttributes(divs, start, end, section); + for (var i = divs.length - 1; i >= 0; i--) { + if (divs[i].offsetWidth) { + return divs[i]; + } + } + return null; + }, addDataAttributes: function(divs, start, end, section) { + var dateToStr = scheduler2.date.date_to_str(scheduler2.config.api_date); + var from = dateToStr(start), to = dateToStr(end); + for (var i = 0; i < divs.length; i++) { + divs[i].setAttribute("data-start-date", from); + divs[i].setAttribute("data-end-date", to); + if (section) { + divs[i].setAttribute("data-section", section); + } + } + }, addWaiAriaLabel: function(divs, start, end, section) { + var label = ""; + var state = scheduler2.getState(); + var mode = state.mode; + var dateTimeLabel = false; + label += scheduler2.templates.day_date(start); + if (scheduler2.date.day_start(new Date(start)).valueOf() != start.valueOf()) { + label += " " + scheduler2.templates.hour_scale(start); + dateTimeLabel = true; + } + if (scheduler2.date.day_start(new Date(start)).valueOf() != scheduler2.date.day_start(new Date(end)).valueOf()) { + label += " - " + scheduler2.templates.day_date(end); + if (dateTimeLabel || scheduler2.date.day_start(new Date(end)).valueOf() != end.valueOf()) { + label += " " + scheduler2.templates.hour_scale(end); + } + } + if (section) { + if (scheduler2.matrix && scheduler2.matrix[mode]) { + const timeline = scheduler2.matrix[mode]; + const sectionObject = timeline.y_unit[timeline.order[section]]; + label += ", " + scheduler2.templates[mode + "_scale_label"](sectionObject.key, sectionObject.label, sectionObject); + } else if (scheduler2._props && scheduler2._props[mode]) { + const units = scheduler2._props[mode]; + const sectionObject = units.options[units.order[section]]; + label += ", " + scheduler2.templates[mode + "_scale_text"](sectionObject.key, sectionObject.label, sectionObject); } } - return ""; - } - function getCookieName(scheduler3) { - return (scheduler3._obj.id || "scheduler") + "_settings"; - } - var first = true; - scheduler2.attachEvent("onBeforeViewChange", function(oldMode, oldDate, mode, date) { - if (first && scheduler2._get_url_nav) { - var urlNavigationPlugin = scheduler2._get_url_nav(); - if (urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event) { - first = false; - } + for (var i = 0; i < divs.length; i++) { + scheduler2._waiAria.setAttributes(divs[i], { "aria-label": label, "aria-live": "polite" }); } - var cookie2 = getCookieName(scheduler2); - if (first) { - first = false; - var schedulerCookie = getCookie(cookie2); - if (schedulerCookie) { - if (!scheduler2._min_date) { - scheduler2._min_date = date; - } - schedulerCookie = unescape(schedulerCookie).split("@"); - schedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]); - var view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode, date = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date; - window.setTimeout(function() { - if (scheduler2.$destroyed) { - return; - } - scheduler2.setCurrentView(date, view); - }, 1); - return false; + }, renderWeekAgendaMarker: function(start_date, end_date) { + var divs = scheduler2.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar"); + var currDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); + var index = -1; + var markerDate = scheduler2.date.day_start(new Date(start_date)); + for (var i = 0; i < divs.length; i++) { + index++; + if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { + break; + } else { + currDate = scheduler2.date.add(currDate, 1, "day"); } } - return true; - }); - scheduler2.attachEvent("onViewChange", function(newMode, newDate) { - var cookie2 = getCookieName(scheduler2); - var text = escape(this._helpers.formatDate(newDate) + "@" + newMode); - setCookie(cookie2, "expires=Sun, 31 Jan 9999 22:00:00 GMT", text); - }); - var old_load = scheduler2._load; - scheduler2._load = function() { - var args = arguments; - if (!scheduler2._date) { - var that = this; - window.setTimeout(function() { - old_load.apply(that, args); - }, 1); + if (index != -1) + return this._wrapDiv(divs[index]); + return []; + }, _wrapDiv: function(cell) { + var marker2 = this.createElement(); + marker2.style.top = cell.offsetTop + "px"; + marker2.style.left = cell.offsetLeft + "px"; + marker2.style.width = cell.offsetWidth + "px"; + marker2.style.height = cell.offsetHeight + "px"; + cell.appendChild(marker2); + return [marker2]; + }, renderYearMarker: function(start_date, end_date) { + var cell = scheduler2._get_year_cell(start_date); + cell.style.position = "relative"; + var marker2 = this.createElement(); + marker2.style.top = "0px"; + marker2.style.left = "0px"; + marker2.style.width = "100%"; + marker2.style.height = "100%"; + cell.appendChild(marker2); + return [marker2]; + }, renderAgendaMarker: function(start_date, end_date) { + var block = this.createElement(); + block.style.height = "1px"; + block.style.width = "100%"; + block.style.opacity = 1; + block.style.top = "0px"; + block.style.left = "0px"; + scheduler2.$container.querySelector(".dhx_cal_data").appendChild(block); + return [block]; + }, renderTimelineMarker: function(start_date, end_date, section) { + var view_opts = scheduler2._lame_copy({}, scheduler2.matrix[scheduler2._mode]); + var areas = view_opts._scales; + view_opts.round_position = false; + var blocks = []; + var min_date = start_date ? new Date(start_date) : scheduler2._min_date; + var max_date = end_date ? new Date(end_date) : scheduler2._max_date; + if (min_date.valueOf() < scheduler2._min_date.valueOf()) + min_date = new Date(scheduler2._min_date); + if (max_date.valueOf() > scheduler2._max_date.valueOf()) + max_date = new Date(scheduler2._max_date); + if (!view_opts._trace_x) + return blocks; + for (var i = 0; i < view_opts._trace_x.length; i++) { + if (scheduler2._is_column_visible(view_opts._trace_x[i])) + break; + } + if (i == view_opts._trace_x.length) + return blocks; + var area = areas[section]; + if (!(min_date < end_date && max_date > start_date)) + return blocks; + var block = this.createElement(); + let start_pos; + let end_pos; + function set_date_part(source, target) { + target.setDate(1); + target.setFullYear(source.getFullYear()); + target.setMonth(source.getMonth()); + target.setDate(source.getDate()); + } + if (!scheduler2.getView().days) { + start_pos = scheduler2._timeline_getX({ start_date }, false, view_opts); + end_pos = scheduler2._timeline_getX({ start_date: end_date }, false, view_opts); } else { - old_load.apply(this, args); + const tempStart = new Date(start_date); + set_date_part(scheduler2._min_date, tempStart); + const tempEnd = new Date(end_date); + set_date_part(scheduler2._min_date, tempEnd); + start_pos = scheduler2._timeline_getX({ start_date: tempStart }, false, view_opts); + end_pos = scheduler2._timeline_getX({ start_date: tempEnd }, false, view_opts); } - }; -} -const notImplemented = { alert: (extension, assert2) => { - assert2(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
- You may need a Professional version of the component.
- Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`); -} }; -function daytimeline_restricted(scheduler2) { - notImplemented.alert("Day Timeline", scheduler2.assert); -} -function drag_between_restricted(scheduler2) { - notImplemented.alert("Drag Between", scheduler2.assert); -} -function editors(scheduler2) { - scheduler2.form_blocks["combo"] = { render: function(sns) { - if (!sns.cached_options) - sns.cached_options = {}; - var res = ""; - res += "
"; - return res; - }, set_value: function(node, value, ev, config) { - (function() { - resetCombo(); - var id2 = scheduler2.attachEvent("onAfterLightbox", function() { - resetCombo(); - scheduler2.detachEvent(id2); - }); - function resetCombo() { - if (node._combo && node._combo.DOMParent) { - var combo2 = node._combo; - if (combo2.unload) { - combo2.unload(); - } else if (combo2.destructor) { - combo2.destructor(); - } - combo2.DOMParent = combo2.DOMelem = null; - } - } - })(); - window.dhx_globalImgPath = config.image_path || "/"; - node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth - 8); - if (config.onchange) - node._combo.attachEvent("onChange", config.onchange); - if (config.options_height) - node._combo.setOptionHeight(config.options_height); - var combo = node._combo; - combo.enableFilteringMode(config.filtering, config.script_path || null, !!config.cache); - if (!config.script_path) { - var all_options = []; - for (var i = 0; i < config.options.length; i++) { - var option = config.options[i]; - var single_option = [option.key, option.label, option.css]; - all_options.push(single_option); - } - combo.addOption(all_options); - if (ev[config.map_to]) { - var index = combo.getIndexByValue(ev[config.map_to]); - combo.selectOption(index); + var height = view_opts._section_height[section] - 1 || view_opts.dy - 1; + var top = 0; + if (scheduler2._isRender("cell")) { + top = area.offsetTop; + start_pos += view_opts.dx; + end_pos += view_opts.dx; + area = scheduler2.$container.querySelector(".dhx_cal_data"); + } + var width = Math.max(1, end_pos - start_pos - 1); + let direction = "left"; + if (scheduler2.config.rtl) { + direction = "right"; + } + block.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`; + if (area) { + area.appendChild(block); + blocks.push(block); + } + return blocks; + }, renderMonthCell: function(date) { + var cells = scheduler2.$container.querySelectorAll(".dhx_month_head"); + var divs = []; + for (var i = 0; i < cells.length; i++) { + divs.push(cells[i].parentNode); + } + var firstDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); + var index = -1; + var weekNumber = 0; + var dayIndex = -1; + var currDate = firstDate; + var markerDate = scheduler2.date.day_start(new Date(date)); + for (var i = 0; i < divs.length; i++) { + index++; + if (dayIndex == 6) { + weekNumber++; + dayIndex = 0; + } else { + dayIndex++; } - } else { - var selected_id = ev[config.map_to]; - if (selected_id) { - if (config.cached_options[selected_id]) { - combo.addOption(selected_id, config.cached_options[selected_id]); - combo.disable(1); - combo.selectOption(0); - combo.disable(0); - } else { - scheduler2.ajax.get(config.script_path + "?id=" + selected_id + "&uid=" + scheduler2.uid(), function(result) { - var responseText = result.xmlDoc.responseText; - var label; - try { - var res = JSON.parse(responseText); - label = res.options[0].text; - } catch (e) { - var option2 = scheduler2.ajax.xpath("//option", result.xmlDoc)[0]; - label = option2.childNodes[0].nodeValue; - } - config.cached_options[selected_id] = label; - combo.addOption(selected_id, label); - combo.disable(1); - combo.selectOption(0); - combo.disable(0); - }); - } + if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { + break; } else { - combo.setComboValue(""); + currDate = scheduler2.date.add(currDate, 1, "day"); } } - }, get_value: function(node, ev, config) { - var selected_id = node._combo.getSelectedValue(); - if (config.script_path) { - config.cached_options[selected_id] = node._combo.getSelectedText(); + if (index == -1) { + return []; + } + var left = scheduler2._colsS[dayIndex]; + var top = scheduler2._colsS.heights[weekNumber]; + var div = this.createElement(); + div.style.top = top + "px"; + div.style.left = left + "px"; + div.style.width = scheduler2._cols[dayIndex] + "px"; + div.style.height = (scheduler2._colsS.heights[weekNumber + 1] - top || scheduler2._colsS.height) + "px"; + var container = scheduler2.$container.querySelector(".dhx_cal_data"); + var datatable = container.querySelector(".dhx_cal_month_table"); + if (datatable.nextSibling) { + container.insertBefore(div, datatable.nextSibling); + } else { + container.appendChild(div); } - return selected_id; - }, focus: function(node) { - } }; - scheduler2.form_blocks["radio"] = { render: function(sns) { - var res = ""; - res += `
`; - for (var i = 0; i < sns.options.length; i++) { - var id2 = scheduler2.uid(); - res += ""; + return div; + }, renderMonthMarker: function(start_date, end_date) { + var res = []; + var currentDate = start_date; + while (currentDate.valueOf() < end_date.valueOf()) { + res.push(this.renderMonthCell(currentDate)); + currentDate = scheduler2.date.add(currentDate, 1, "day"); } - res += "
"; return res; - }, set_value: function(node, value, ev, config) { - var radiobuttons = node.getElementsByTagName("input"); - for (var i = 0; i < radiobuttons.length; i++) { - radiobuttons[i].checked = false; - var checked_value = ev[config.map_to] || value; - if (radiobuttons[i].value == checked_value) { - radiobuttons[i].checked = true; + }, renderVerticalMarker: function(start_date, end_date, section) { + var index = scheduler2.locate_holder_day(start_date); + var divs = []; + var area = null; + var c = scheduler2.config; + if (scheduler2._ignores[index]) + return divs; + if (scheduler2._props && scheduler2._props[scheduler2._mode] && section) { + var view = scheduler2._props[scheduler2._mode]; + index = view.order[section]; + var inner_index = view.order[section]; + if (!(view.days > 1)) { + index = inner_index; + if (view.size && index > view.position + view.size) { + index = 0; + } + } else { + index = scheduler2.locate_holder_day(start_date) + inner_index; } } - }, get_value: function(node, ev, config) { - var radiobuttons = node.getElementsByTagName("input"); - for (var i = 0; i < radiobuttons.length; i++) { - if (radiobuttons[i].checked) { - return radiobuttons[i].value; - } + area = scheduler2.locate_holder(index); + if (!area || area.querySelector(".dhx_scale_hour")) { + return document.createElement("div"); } - }, focus: function(node) { - } }; - scheduler2.form_blocks["checkbox"] = { render: function(sns) { - if (scheduler2.config.wide_form) - return '
'; - else - return ""; - }, set_value: function(node, value, ev, config) { - node = scheduler2._lightbox.querySelector(`#${config.id}`); - var id2 = scheduler2.uid(); - var isChecked = typeof config.checked_value != "undefined" ? value == config.checked_value : !!value; - node.className += " dhx_cal_checkbox"; - var check_html = ""; - var label_html = ""; - if (scheduler2.config.wide_form) { - node.innerHTML = label_html; - node.nextSibling.innerHTML = check_html; - } else - node.innerHTML = check_html + label_html; - if (config.handler) { - var checkbox = node.getElementsByTagName("input")[0]; - if (checkbox.$_eventAttached) { - return; - } - checkbox.$_eventAttached = true; - scheduler2.event(checkbox, "click", config.handler); + var start = Math.max(start_date.getHours() * 60 + start_date.getMinutes(), c.first_hour * 60); + var end = Math.min(end_date.getHours() * 60 + end_date.getMinutes(), c.last_hour * 60); + if (!end && scheduler2.date.day_start(new Date(end_date)).valueOf() > scheduler2.date.day_start(new Date(start_date)).valueOf()) { + end = c.last_hour * 60; } - }, get_value: function(node, ev, config) { - node = scheduler2._lightbox.querySelector(`#${config.id}`); - var checkbox = node.getElementsByTagName("input")[0]; - if (!checkbox) - checkbox = node.nextSibling.getElementsByTagName("input")[0]; - return checkbox.checked ? config.checked_value || true : config.unchecked_value || false; - }, focus: function(node) { + if (end <= start) { + return []; + } + var block = this.createElement(); + var all_hours_height = scheduler2.config.hour_size_px * c.last_hour + 1; + var hour_ms = 60 * 60 * 1e3; + block.style.top = Math.round((start * 60 * 1e3 - scheduler2.config.first_hour * hour_ms) * scheduler2.config.hour_size_px / hour_ms) % all_hours_height + "px"; + block.style.lineHeight = block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * scheduler2.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; + block.style.width = "100%"; + area.appendChild(block); + divs.push(block); + return divs[0]; } }; } -function expand(scheduler2) { - scheduler2.ext.fullscreen = { toggleIcon: null }; - scheduler2.expand = function() { - if (!scheduler2.callEvent("onBeforeExpand", [])) - return; - var t = scheduler2._obj; - do { - t._position = t.style.position || ""; - t.style.position = "static"; - } while ((t = t.parentNode) && t.style); - t = scheduler2._obj; - t.style.position = "absolute"; - t._width = t.style.width; - t._height = t.style.height; - t.style.width = t.style.height = "100%"; - t.style.top = t.style.left = "0px"; - var top = document.body; - top.scrollTop = 0; - top = top.parentNode; - if (top) - top.scrollTop = 0; - document.body._overflow = document.body.style.overflow || ""; - document.body.style.overflow = "hidden"; - scheduler2._maximize(); - scheduler2.callEvent("onExpand", []); - }; - scheduler2.collapse = function() { - if (!scheduler2.callEvent("onBeforeCollapse", [])) - return; - var t = scheduler2._obj; - do { - t.style.position = t._position; - } while ((t = t.parentNode) && t.style); - t = scheduler2._obj; - t.style.width = t._width; - t.style.height = t._height; - document.body.style.overflow = document.body._overflow; - scheduler2._maximize(); - scheduler2.callEvent("onCollapse", []); +function scheduler_node(scheduler2) { + scheduler2.$keyboardNavigation.SchedulerNode = function() { }; - scheduler2.attachEvent("onTemplatesReady", function() { - var t = document.createElement("div"); - t.className = "dhx_expand_icon"; - scheduler2.ext.fullscreen.toggleIcon = t; - t.innerHTML = ` - - - - - - - - - - - - `; - scheduler2._obj.appendChild(t); - scheduler2.event(t, "click", function() { - if (!scheduler2.expanded) - scheduler2.expand(); - else - scheduler2.collapse(); - }); - }); - scheduler2._maximize = function() { - this.expanded = !this.expanded; - if (this.expanded) { - this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded"); + scheduler2.$keyboardNavigation.SchedulerNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { getDefaultNode: function() { + var node = new scheduler2.$keyboardNavigation.TimeSlot(); + if (!node.isValid()) { + node = node.fallback(); + } + return node; + }, _modes: { month: "month", year: "year", dayColumns: "dayColumns", timeline: "timeline", units: "units", weekAgenda: "weekAgenda", list: "list" }, getMode: function() { + var state = scheduler2.getState(); + var mode = state.mode; + if (scheduler2.matrix && scheduler2.matrix[mode]) { + return this._modes.timeline; + } else if (scheduler2._props && scheduler2._props[mode]) { + return this._modes.units; + } else if (mode == "month") { + return this._modes.month; + } else if (mode == "year") { + return this._modes.year; + } else if (mode == "week_agenda") { + return this._modes.weekAgenda; + } else if (mode == "map" || mode == "agenda" || scheduler2._grid && scheduler2["grid_" + mode]) { + return this._modes.list; } else { - this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded"); + return this._modes.dayColumns; + } + }, focus: function() { + scheduler2.focus(); + }, blur: function() { + }, disable: function() { + scheduler2.$container.setAttribute("tabindex", "0"); + }, enable: function() { + if (scheduler2.$container) + scheduler2.$container.removeAttribute("tabindex"); + }, isEnabled: function() { + return scheduler2.$container.hasAttribute("tabindex"); + }, _compareEvents: function(a, b) { + if (a.start_date.valueOf() == b.start_date.valueOf()) + return a.id > b.id ? 1 : -1; + return a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1; + }, _pickEvent: function(from, to, startId, reverse) { + var range2 = scheduler2.getState(); + from = new Date(Math.max(range2.min_date.valueOf(), from.valueOf())); + to = new Date(Math.min(range2.max_date.valueOf(), to.valueOf())); + var evs = scheduler2.getEvents(from, to); + evs.sort(this._compareEvents); + if (reverse) { + evs = evs.reverse(); + } + var trim = !!startId; + for (var i = 0; i < evs.length && trim; i++) { + if (evs[i].id == startId) { + trim = false; + } + evs.splice(i, 1); + i--; + } + for (var i = 0; i < evs.length; i++) { + var eventElement = new scheduler2.$keyboardNavigation.Event(evs[i].id); + if (eventElement.getNode()) + return evs[i]; + } + return null; + }, nextEventHandler: function(id2) { + var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; + var startId = id2 || activeNode && activeNode.eventId; + var nextEvent = null; + if (startId && scheduler2.getEvent(startId)) { + var currEvent = scheduler2.getEvent(startId); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(currEvent.start_date, scheduler2.date.add(currEvent.start_date, 1, "year"), currEvent.id, false); + } + if (!nextEvent && !id2) { + var visibleDates = scheduler2.getState(); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(visibleDates.min_date, scheduler2.date.add(visibleDates.min_date, 1, "year"), null, false); } - var directions = ["left", "top"]; - for (var i = 0; i < directions.length; i++) { - var prev_margin = scheduler2["_prev_margin_" + directions[i]]; - if (scheduler2.xy["margin_" + directions[i]]) { - scheduler2["_prev_margin_" + directions[i]] = scheduler2.xy["margin_" + directions[i]]; - scheduler2.xy["margin_" + directions[i]] = 0; + if (nextEvent) { + var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); + if (!nextEv.isValid()) { + this.nextEventHandler(nextEvent.id); } else { - if (prev_margin) { - scheduler2.xy["margin_" + directions[i]] = scheduler2["_prev_margin_" + directions[i]]; - delete scheduler2["_prev_margin_" + directions[i]]; + if (activeNode) { + activeNode.blur(); } + scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); } } - scheduler2.setCurrentView(); - }; -} -function grid_view(scheduler2) { - notImplemented.alert("Grid", scheduler2.assert); + }, prevEventHandler: function(id2) { + var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; + var startId = id2 || activeNode && activeNode.eventId; + var nextEvent = null; + if (startId && scheduler2.getEvent(startId)) { + var currEvent = scheduler2.getEvent(startId); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(currEvent.end_date, -1, "year"), currEvent.end_date, currEvent.id, true); + } + if (!nextEvent && !id2) { + var visibleDates = scheduler2.getState(); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(visibleDates.max_date, -1, "year"), visibleDates.max_date, null, true); + } + if (nextEvent) { + var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); + if (!nextEv.isValid()) { + this.prevEventHandler(nextEvent.id); + } else { + if (activeNode) { + activeNode.blur(); + } + scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); + } + } + }, keys: { "alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9": function(e) { + var tabs = scheduler2.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab"); + var key = e.key; + if (key === void 0) { + key = e.keyCode - 48; + } + if (tabs[key * 1 - 1]) { + tabs[key * 1 - 1].click(); + } + }, "ctrl+left,meta+left": function(e) { + scheduler2._click.dhx_cal_prev_button(); + }, "ctrl+right,meta+right": function(e) { + scheduler2._click.dhx_cal_next_button(); + }, "ctrl+up,meta+up": function(e) { + var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); + dataArea.scrollTop -= 20; + }, "ctrl+down,meta+down": function(e) { + var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); + dataArea.scrollTop += 20; + }, e: function() { + this.nextEventHandler(); + }, home: function() { + scheduler2.setCurrentView(/* @__PURE__ */ new Date()); + }, "shift+e": function() { + this.prevEventHandler(); + }, "ctrl+enter,meta+enter": function() { + scheduler2.addEventNow({ start_date: new Date(scheduler2.getState().date) }); + }, "ctrl+c,meta+c": function(e) { + scheduler2._key_nav_copy_paste(e); + }, "ctrl+v,meta+v": function(e) { + scheduler2._key_nav_copy_paste(e); + }, "ctrl+x,meta+x": function(e) { + scheduler2._key_nav_copy_paste(e); + } } }); + scheduler2.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler2.$keyboardNavigation.SchedulerNode.prototype.keys); } -function html_templates(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - var els = document.body.getElementsByTagName("DIV"); - for (var i = 0; i < els.length; i++) { - var cs2 = els[i].className || ""; - cs2 = cs2.split(":"); - if (cs2.length == 2 && cs2[0] == "template") { - var code = 'return "' + (els[i].innerHTML || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\n\r]+/g, "") + '";'; - code = unescape(code).replace(/\{event\.([a-z]+)\}/g, function(all, mask) { - return '"+ev.' + mask + '+"'; - }); - scheduler2.templates[cs2[1]] = Function("start", "end", "ev", code); - els[i].style.display = "none"; +function nav_node(scheduler2) { + scheduler2.$keyboardNavigation.KeyNavNode = function() { + }; + scheduler2.$keyboardNavigation.KeyNavNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { isValid: function() { + return true; + }, fallback: function() { + return null; + }, moveTo: function(element) { + scheduler2.$keyboardNavigation.dispatcher.setActiveNode(element); + }, compareTo: function(b) { + if (!b) + return false; + for (var i in this) { + if (!!this[i] != !!b[i]) + return false; + var canStringifyThis = !!(this[i] && this[i].toString); + var canStringifyThat = !!(b[i] && b[i].toString); + if (canStringifyThat != canStringifyThis) + return false; + if (!(canStringifyThat && canStringifyThis)) { + if (b[i] != this[i]) + return false; + } else { + if (b[i].toString() != this[i].toString()) + return false; } } - }); + return true; + }, getNode: function() { + }, focus: function() { + var node = this.getNode(); + if (node) { + node.setAttribute("tabindex", "-1"); + if (node.focus) + node.focus(); + } + }, blur: function() { + var node = this.getNode(); + if (node) { + node.setAttribute("tabindex", "-1"); + } + } }); } -function keyboard_shortcuts(scheduler2) { - scheduler2.$keyboardNavigation.shortcuts = { createCommand: function() { - return { modifiers: { shift: false, alt: false, ctrl: false, meta: false }, keyCode: null }; - }, parse: function(shortcut) { - var commands = []; - var expr = this.getExpressions(this.trim(shortcut)); - for (var i = 0; i < expr.length; i++) { - var words = this.getWords(expr[i]); - var command = this.createCommand(); - for (var j = 0; j < words.length; j++) { - if (this.commandKeys[words[j]]) { - command.modifiers[words[j]] = true; - } else if (this.specialKeys[words[j]]) { - command.keyCode = this.specialKeys[words[j]]; - } else { - command.keyCode = words[j].charCodeAt(0); +function header_cell(scheduler2) { + scheduler2.$keyboardNavigation.HeaderCell = function(index) { + this.index = index || 0; + }; + scheduler2.$keyboardNavigation.HeaderCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { + index = index || this.index || 0; + var nodes = this.getNodes(); + if (nodes[index]) + return nodes[index]; + }, getNodes: function(selector) { + selector = selector || [".dhx_cal_navline .dhx_cal_prev_button", ".dhx_cal_navline .dhx_cal_next_button", ".dhx_cal_navline .dhx_cal_today_button", ".dhx_cal_navline .dhx_cal_tab"].join(", "); + var nodes = Array.prototype.slice.call(scheduler2.$container.querySelectorAll(selector)); + nodes.sort(function(a, b) { + return a.offsetLeft - b.offsetLeft; + }); + return nodes; + }, _handlers: null, isValid: function() { + return !!this.getNode(this.index); + }, fallback: function() { + var defaultCell = this.getNode(0); + if (!defaultCell) { + defaultCell = new scheduler2.$keyboardNavigation.TimeSlot(); + } + return defaultCell; + }, keys: { left: function() { + var newIndex = this.index - 1; + if (newIndex < 0) { + newIndex = this.getNodes().length - 1; + } + this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); + }, right: function() { + var newIndex = this.index + 1; + if (newIndex >= this.getNodes().length) { + newIndex = 0; + } + this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); + }, down: function() { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + }, enter: function() { + var node = this.getNode(); + if (node) { + node.click(); + } + } } }); + scheduler2.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler2.$keyboardNavigation.HeaderCell.prototype.keys); +} +function event(scheduler2) { + scheduler2.$keyboardNavigation.Event = function(id2) { + this.eventId = null; + if (scheduler2.getEvent(id2)) { + var ev = scheduler2.getEvent(id2); + this.start = new Date(ev.start_date); + this.end = new Date(ev.end_date); + this.section = this._getSection(ev); + this.eventId = id2; + } + }; + scheduler2.$keyboardNavigation.Event.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _getNodes: function() { + return Array.prototype.slice.call(scheduler2.$container.querySelectorAll("[" + scheduler2.config.event_attribute + "]")); + }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { + return !!(scheduler2.getEvent(this.eventId) && this.getNode()); + }, fallback: function() { + var eventNode = this._getNodes()[0]; + var defaultElement = null; + if (!eventNode || !scheduler2._locate_event(eventNode)) { + defaultElement = new scheduler2.$keyboardNavigation.TimeSlot(); + } else { + var id2 = scheduler2._locate_event(eventNode); + defaultElement = new scheduler2.$keyboardNavigation.Event(id2); + } + return defaultElement; + }, isScrolledIntoView: function(el2) { + var eventBox = el2.getBoundingClientRect(); + var viewPort = scheduler2.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); + if (eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom) { + return false; + } + return true; + }, getNode: function() { + var idSelector = "[" + scheduler2.config.event_attribute + "='" + this.eventId + "']"; + var inlineEditor = scheduler2.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); + if (inlineEditor) { + return inlineEditor; + } else { + if (scheduler2.isMultisectionEvent && scheduler2.isMultisectionEvent(scheduler2.getEvent(this.eventId))) { + var nodes = scheduler2.$container.querySelectorAll(idSelector); + for (var i = 0; i < nodes.length; i++) { + if (this.isScrolledIntoView(nodes[i])) { + return nodes[i]; + } } + return nodes[0]; + } else { + return scheduler2.$container.querySelector(idSelector); } - commands.push(command); } - return commands; - }, getCommandFromEvent: function(domEvent) { - var command = this.createCommand(); - command.modifiers.shift = !!domEvent.shiftKey; - command.modifiers.alt = !!domEvent.altKey; - command.modifiers.ctrl = !!domEvent.ctrlKey; - command.modifiers.meta = !!domEvent.metaKey; - command.keyCode = domEvent.which || domEvent.keyCode; - if (command.keyCode >= 96 && command.keyCode <= 105) { - command.keyCode -= 48; + }, focus: function() { + var event2 = scheduler2.getEvent(this.eventId); + var calendar = scheduler2.getState(); + if (event2.start_date.valueOf() > calendar.max_date.valueOf() || event2.end_date.valueOf() <= calendar.min_date.valueOf()) { + scheduler2.setCurrentView(event2.start_date); } - var printableKey = String.fromCharCode(command.keyCode); - if (printableKey) { - command.keyCode = printableKey.toLowerCase().charCodeAt(0); + var node = this.getNode(); + if (this.isScrolledIntoView(node)) { + scheduler2.$keyboardNavigation.dispatcher.keepScrollPosition((function() { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }).bind(this)); + } else { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); } - return command; - }, getHashFromEvent: function(domEvent) { - return this.getHash(this.getCommandFromEvent(domEvent)); - }, getHash: function(command) { - var parts = []; - for (var i in command.modifiers) { - if (command.modifiers[i]) { - parts.push(i); - } + }, blur: function() { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + }, _getSection: function(ev) { + var section = null; + var mode = scheduler2.getState().mode; + if (scheduler2.matrix && scheduler2.matrix[mode]) { + var timeline = scheduler2.matrix[scheduler2.getState().mode]; + section = ev[timeline.y_property]; + } else if (scheduler2._props && scheduler2._props[mode]) { + var unit = scheduler2._props[mode]; + section = ev[unit.map_to]; } - parts.push(command.keyCode); - return parts.join(this.junctionChar); - }, getExpressions: function(shortcut) { - return shortcut.split(this.junctionChar); - }, getWords: function(term) { - return term.split(this.combinationChar); - }, trim: function(shortcut) { - return shortcut.replace(/\s/g, ""); - }, junctionChar: ",", combinationChar: "+", commandKeys: { shift: 16, alt: 18, ctrl: 17, meta: true }, specialKeys: { backspace: 8, tab: 9, enter: 13, esc: 27, space: 32, up: 38, down: 40, left: 37, right: 39, home: 36, end: 35, pageup: 33, pagedown: 34, delete: 46, insert: 45, plus: 107, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 } }; -} -function eventhandler(scheduler2) { - scheduler2.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(command) { - if (!this._handlers) - this._handlers = {}; - var shortcuts = scheduler2.$keyboardNavigation.shortcuts; - var hash = shortcuts.getHash(command); - return this._handlers[hash]; - }, doAction: function(command, e) { - var handler = this.findHandler(command); - if (handler) { - handler.call(this, e); - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; + return section; + }, _moveToSlot: function(dir) { + var ev = scheduler2.getEvent(this.eventId); + if (ev) { + var section = this._getSection(ev); + var slot = new scheduler2.$keyboardNavigation.TimeSlot(ev.start_date, null, section); + this.moveTo(slot.nextSlot(slot, dir)); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); } - }, bind: function(shortcut, handler) { - if (!this._handlers) - this._handlers = {}; - var shortcuts = scheduler2.$keyboardNavigation.shortcuts; - var commands = shortcuts.parse(shortcut); - for (var i = 0; i < commands.length; i++) { - this._handlers[shortcuts.getHash(commands[i])] = handler; + }, keys: { left: function() { + this._moveToSlot("left"); + }, right: function() { + this._moveToSlot("right"); + }, down: function() { + if (this.getMode() == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); + } else { + this._moveToSlot("down"); } - }, unbind: function(shortcut) { - var shortcuts = scheduler2.$keyboardNavigation.shortcuts; - var commands = shortcuts.parse(shortcut); - for (var i = 0; i < commands.length; i++) { - if (this._handlers[shortcuts.getHash(commands[i])]) { - delete this._handlers[shortcuts.getHash(commands[i])]; - } + }, space: function() { + var node = this.getNode(); + if (node && node.click) { + node.click(); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); } - }, bindAll: function(map) { - for (var i in map) { - this.bind(i, map[i]); + }, up: function() { + if (this.getMode() == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); + } else { + this._moveToSlot("up"); } - }, initKeys: function() { - if (!this._handlers) - this._handlers = {}; - if (this.keys) { - this.bindAll(this.keys); + }, delete: function() { + if (scheduler2.getEvent(this.eventId)) { + scheduler2._click.buttons["delete"](this.eventId); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); } - } }; + }, enter: function() { + if (scheduler2.getEvent(this.eventId)) { + scheduler2.showLightbox(this.eventId); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + } + } } }); + scheduler2.$keyboardNavigation.Event.prototype.bindAll(scheduler2.$keyboardNavigation.Event.prototype.keys); } -function trap_modal_focus(scheduler2) { - (function() { - scheduler2.$keyboardNavigation.getFocusableNodes = scheduler2._getFocusableNodes; - scheduler2.$keyboardNavigation.trapFocus = function trapFocus(root, e) { - if (e.keyCode != 9) - return false; - var focusable = scheduler2.$keyboardNavigation.getFocusableNodes(root); - var currentFocus = document.activeElement; - var currentIndex = -1; - for (var i = 0; i < focusable.length; i++) { - if (focusable[i] == currentFocus) { - currentIndex = i; - break; - } - } - var nextIndex, nextItem; - if (e.shiftKey) { - nextIndex = currentIndex <= 0 ? focusable.length - 1 : currentIndex - 1; - nextItem = focusable[nextIndex]; - if (nextItem) { - nextItem.focus(); - e.preventDefault(); - return true; - } +function time_slot(scheduler2) { + scheduler2.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate) { + var state = scheduler2.getState(); + var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; + if (!from) { + from = this.getDefaultDate(); + } + if (!to) { + if (timeline) { + to = scheduler2.date.add(from, timeline.x_step, timeline.x_unit); } else { - nextIndex = currentIndex >= focusable.length - 1 ? 0 : currentIndex + 1; - nextItem = focusable[nextIndex]; - if (nextItem) { - nextItem.focus(); - e.preventDefault(); - return true; - } + to = scheduler2.date.add(from, scheduler2.config.key_nav_step, "minute"); } - return false; - }; - })(); -} -function marker(scheduler2) { - scheduler2.$keyboardNavigation.marker = { clear: function() { - var divs = scheduler2.$container.querySelectorAll(".dhx_focus_slot"); - for (var i = 0; i < divs.length; i++) { - divs[i].parentNode.removeChild(divs[i]); - } - }, createElement: function() { - var element = document.createElement("div"); - element.setAttribute("tabindex", -1); - element.className = "dhx_focus_slot"; - return element; - }, renderMultiple: function(start, end, method) { - var divs = []; - var currentStart = new Date(start); - var currentEnd = new Date(Math.min(end.valueOf(), scheduler2.date.add(scheduler2.date.day_start(new Date(start)), 1, "day").valueOf())); - while (currentStart.valueOf() < end.valueOf()) { - divs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf())))); - currentStart = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); - currentEnd = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); - currentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf())); } - return divs; - }, render: function(start, end, section) { - this.clear(); - var divs = []; - var modes = scheduler2.$keyboardNavigation.TimeSlot.prototype._modes; - var view = scheduler2.$keyboardNavigation.TimeSlot.prototype._getMode(); - switch (view) { - case modes.units: - divs = this.renderVerticalMarker(start, end, section); - break; - case modes.timeline: - divs = this.renderTimelineMarker(start, end, section); - break; - case modes.year: - divs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker)); - break; - case modes.month: - divs = this.renderMonthMarker(start, end); - break; - case modes.weekAgenda: - divs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker)); - break; - case modes.list: - divs = this.renderAgendaMarker(start, end); - break; - case modes.dayColumns: - divs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker)); - break; + this.section = section || this._getDefaultSection(); + this.start_date = new Date(from); + this.end_date = new Date(to); + this.movingDate = movingDate || null; + }; + scheduler2.$keyboardNavigation.TimeSlot.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _handlers: null, getDefaultDate: function() { + var from; + var state = scheduler2.getState(); + var visibleTime = new Date(state.date); + visibleTime.setSeconds(0); + visibleTime.setMilliseconds(0); + var nowTime = /* @__PURE__ */ new Date(); + nowTime.setSeconds(0); + nowTime.setMilliseconds(0); + var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; + var showNowTime = false; + if (visibleTime.valueOf() === nowTime.valueOf()) { + showNowTime = true; } - this.addWaiAriaLabel(divs, start, end, section); - this.addDataAttributes(divs, start, end, section); - for (var i = divs.length - 1; i >= 0; i--) { - if (divs[i].offsetWidth) { - return divs[i]; + if (timeline) { + if (showNowTime) { + if (timeline.x_unit === "day") { + nowTime.setHours(0); + nowTime.setMinutes(0); + } else if (timeline.x_unit === "hour") { + nowTime.setMinutes(0); + } + from = nowTime; + } else { + from = scheduler2.date[timeline.name + "_start"](new Date(state.date)); + } + from = this.findVisibleColumn(from); + } else { + from = new Date(scheduler2.getState().min_date); + if (showNowTime) { + from = nowTime; } - } - return null; - }, addDataAttributes: function(divs, start, end, section) { - var dateToStr = scheduler2.date.date_to_str(scheduler2.config.api_date); - var from = dateToStr(start), to = dateToStr(end); - for (var i = 0; i < divs.length; i++) { - divs[i].setAttribute("data-start-date", from); - divs[i].setAttribute("data-end-date", to); - if (section) { - divs[i].setAttribute("data-section", section); + from = this.findVisibleColumn(from); + if (!showNowTime) { + from.setHours(scheduler2.config.first_hour); + } + if (!scheduler2._table_view) { + var dataContainer = scheduler2.$container.querySelector(".dhx_cal_data"); + if (dataContainer.scrollTop) { + from.setHours(scheduler2.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler2.config.hour_size_px)); + } } } - }, addWaiAriaLabel: function(divs, start, end, section) { - var label = ""; + return from; + }, clone: function(timeslot) { + return new scheduler2.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate); + }, _getMultisectionView: function() { var state = scheduler2.getState(); - var mode = state.mode; - var dateTimeLabel = false; - label += scheduler2.templates.day_date(start); - if (scheduler2.date.day_start(new Date(start)).valueOf() != start.valueOf()) { - label += " " + scheduler2.templates.hour_scale(start); - dateTimeLabel = true; - } - if (scheduler2.date.day_start(new Date(start)).valueOf() != scheduler2.date.day_start(new Date(end)).valueOf()) { - label += " - " + scheduler2.templates.day_date(end); - if (dateTimeLabel || scheduler2.date.day_start(new Date(end)).valueOf() != end.valueOf()) { - label += " " + scheduler2.templates.hour_scale(end); - } + var view; + if (scheduler2._props && scheduler2._props[state.mode]) { + view = scheduler2._props[state.mode]; + } else if (scheduler2.matrix && scheduler2.matrix[state.mode]) { + view = scheduler2.matrix[state.mode]; } - if (section) { - if (scheduler2.matrix && scheduler2.matrix[mode]) { - const timeline = scheduler2.matrix[mode]; - const sectionObject = timeline.y_unit[timeline.order[section]]; - label += ", " + scheduler2.templates[mode + "_scale_label"](sectionObject.key, sectionObject.label, sectionObject); - } else if (scheduler2._props && scheduler2._props[mode]) { - const units = scheduler2._props[mode]; - const sectionObject = units.options[units.order[section]]; - label += ", " + scheduler2.templates[mode + "_scale_text"](sectionObject.key, sectionObject.label, sectionObject); - } + return view; + }, _getDefaultSection: function() { + var section = null; + var view = this._getMultisectionView(); + if (view && !section) { + section = this._getNextSection(); } - for (var i = 0; i < divs.length; i++) { - scheduler2._waiAria.setAttributes(divs[i], { "aria-label": label, "aria-live": "polite" }); + return section; + }, _getNextSection: function(sectionId, dir) { + var view = this._getMultisectionView(); + var currentIndex = view.order[sectionId]; + var nextIndex = currentIndex; + if (currentIndex !== void 0) { + nextIndex = currentIndex + dir; + } else { + nextIndex = view.size && view.position ? view.position : 0; } - }, renderWeekAgendaMarker: function(start_date, end_date) { - var divs = scheduler2.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar"); - var currDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); - var index = -1; - var markerDate = scheduler2.date.day_start(new Date(start_date)); - for (var i = 0; i < divs.length; i++) { - index++; - if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { - break; - } else { - currDate = scheduler2.date.add(currDate, 1, "day"); - } + if (nextIndex < 0) { + nextIndex = 0; } - if (index != -1) - return this._wrapDiv(divs[index]); - return []; - }, _wrapDiv: function(cell) { - var marker2 = this.createElement(); - marker2.style.top = cell.offsetTop + "px"; - marker2.style.left = cell.offsetLeft + "px"; - marker2.style.width = cell.offsetWidth + "px"; - marker2.style.height = cell.offsetHeight + "px"; - cell.appendChild(marker2); - return [marker2]; - }, renderYearMarker: function(start_date, end_date) { - var cell = scheduler2._get_year_cell(start_date); - cell.style.position = "relative"; - var marker2 = this.createElement(); - marker2.style.top = "0px"; - marker2.style.left = "0px"; - marker2.style.width = "100%"; - marker2.style.height = "100%"; - cell.appendChild(marker2); - return [marker2]; - }, renderAgendaMarker: function(start_date, end_date) { - var block = this.createElement(); - block.style.height = "1px"; - block.style.width = "100%"; - block.style.opacity = 1; - block.style.top = "0px"; - block.style.left = "0px"; - scheduler2.$container.querySelector(".dhx_cal_data").appendChild(block); - return [block]; - }, renderTimelineMarker: function(start_date, end_date, section) { - var view_opts = scheduler2._lame_copy({}, scheduler2.matrix[scheduler2._mode]); - var areas = view_opts._scales; - view_opts.round_position = false; - var blocks = []; - var min_date = start_date ? new Date(start_date) : scheduler2._min_date; - var max_date = end_date ? new Date(end_date) : scheduler2._max_date; - if (min_date.valueOf() < scheduler2._min_date.valueOf()) - min_date = new Date(scheduler2._min_date); - if (max_date.valueOf() > scheduler2._max_date.valueOf()) - max_date = new Date(scheduler2._max_date); - if (!view_opts._trace_x) - return blocks; - for (var i = 0; i < view_opts._trace_x.length; i++) { - if (scheduler2._is_column_visible(view_opts._trace_x[i])) - break; + var options = view.options || view.y_unit; + if (nextIndex >= options.length) { + nextIndex = options.length - 1; } - if (i == view_opts._trace_x.length) - return blocks; - var area = areas[section]; - if (!(min_date < end_date && max_date > start_date)) - return blocks; - var block = this.createElement(); - let start_pos; - let end_pos; - function set_date_part(source, target) { - target.setDate(1); - target.setFullYear(source.getFullYear()); - target.setMonth(source.getMonth()); - target.setDate(source.getDate()); + if (options[nextIndex]) { + return options[nextIndex].key; + } else { + return null; } - if (!scheduler2.getView().days) { - start_pos = scheduler2._timeline_getX({ start_date }, false, view_opts); - end_pos = scheduler2._timeline_getX({ start_date: end_date }, false, view_opts); + }, isValid: function() { + var state = scheduler2.getState(); + var isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf()); + if (!isInRange) + return false; + if (!this.isVisible(this.start_date, this.end_date)) + return false; + var view = this._getMultisectionView(); + if (view) { + return view.order[this.section] !== void 0; } else { - const tempStart = new Date(start_date); - set_date_part(scheduler2._min_date, tempStart); - const tempEnd = new Date(end_date); - set_date_part(scheduler2._min_date, tempEnd); - start_pos = scheduler2._timeline_getX({ start_date: tempStart }, false, view_opts); - end_pos = scheduler2._timeline_getX({ start_date: tempEnd }, false, view_opts); + return true; } - var height = view_opts._section_height[section] - 1 || view_opts.dy - 1; - var top = 0; - if (scheduler2._isRender("cell")) { - top = area.offsetTop; - start_pos += view_opts.dx; - end_pos += view_opts.dx; - area = scheduler2.$container.querySelector(".dhx_cal_data"); + }, fallback: function() { + var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); + if (!defaultSlot.isValid()) { + return new scheduler2.$keyboardNavigation.DataArea(); + } else { + return defaultSlot; } - var width = Math.max(1, end_pos - start_pos - 1); - let direction = "left"; - if (scheduler2.config.rtl) { - direction = "right"; + }, getNodes: function() { + return Array.prototype.slice.call(scheduler2.$container.querySelectorAll(".dhx_focus_slot")); + }, getNode: function() { + return this.getNodes()[0]; + }, focus: function() { + if (this.section && scheduler2.getView() && scheduler2.getView().smart_rendering && scheduler2.getView().scrollTo && !scheduler2.$container.querySelector(`[data-section-id="${this.section}"]`)) { + scheduler2.getView().scrollTo({ section: this.section }); } - block.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`; - if (area) { - area.appendChild(block); - blocks.push(block); + scheduler2.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + scheduler2.$keyboardNavigation._pasteDate = this.start_date; + scheduler2.$keyboardNavigation._pasteSection = this.section; + }, blur: function() { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + scheduler2.$keyboardNavigation.marker.clear(); + }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, _getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, addMonthDate: function(date, dir, extend2) { + var res; + switch (dir) { + case "up": + res = scheduler2.date.add(date, -1, "week"); + break; + case "down": + res = scheduler2.date.add(date, 1, "week"); + break; + case "left": + res = scheduler2.date.day_start(scheduler2.date.add(date, -1, "day")); + res = this.findVisibleColumn(res, -1); + break; + case "right": + res = scheduler2.date.day_start(scheduler2.date.add(date, 1, "day")); + res = this.findVisibleColumn(res, 1); + break; + default: + res = scheduler2.date.day_start(new Date(date)); + break; } - return blocks; - }, renderMonthCell: function(date) { - var cells = scheduler2.$container.querySelectorAll(".dhx_month_head"); - var divs = []; - for (var i = 0; i < cells.length; i++) { - divs.push(cells[i].parentNode); + var state = scheduler2.getState(); + if (date.valueOf() < state.min_date.valueOf() || !extend2 && date.valueOf() >= state.max_date.valueOf()) { + res = new Date(state.min_date); } - var firstDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); - var index = -1; - var weekNumber = 0; - var dayIndex = -1; - var currDate = firstDate; - var markerDate = scheduler2.date.day_start(new Date(date)); - for (var i = 0; i < divs.length; i++) { - index++; - if (dayIndex == 6) { - weekNumber++; - dayIndex = 0; - } else { - dayIndex++; - } - if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { - break; - } else { - currDate = scheduler2.date.add(currDate, 1, "day"); - } + return res; + }, nextMonthSlot: function(slot, dir, extend2) { + var start, end; + start = this.addMonthDate(slot.start_date, dir, extend2); + start.setHours(scheduler2.config.first_hour); + end = new Date(start); + end.setHours(scheduler2.config.last_hour); + return { start_date: start, end_date: end }; + }, _alignTimeSlot: function(date, minDate, unit, step) { + var currentDate = new Date(minDate); + while (currentDate.valueOf() < date.valueOf()) { + currentDate = scheduler2.date.add(currentDate, step, unit); } - if (index == -1) { - return []; + if (currentDate.valueOf() > date.valueOf()) { + currentDate = scheduler2.date.add(currentDate, -step, unit); } - var left = scheduler2._colsS[dayIndex]; - var top = scheduler2._colsS.heights[weekNumber]; - var div = this.createElement(); - div.style.top = top + "px"; - div.style.left = left + "px"; - div.style.width = scheduler2._cols[dayIndex] + "px"; - div.style.height = (scheduler2._colsS.heights[weekNumber + 1] - top || scheduler2._colsS.height) + "px"; - var container = scheduler2.$container.querySelector(".dhx_cal_data"); - var datatable = container.querySelector(".dhx_cal_month_table"); - if (datatable.nextSibling) { - container.insertBefore(div, datatable.nextSibling); - } else { - container.appendChild(div); + return currentDate; + }, nextTimelineSlot: function(slot, dir, extend2) { + var state = scheduler2.getState(); + var view = scheduler2.matrix[state.mode]; + var startDate = this._alignTimeSlot(slot.start_date, scheduler2.date[view.name + "_start"](new Date(slot.start_date)), view.x_unit, view.x_step); + var endDate = this._alignTimeSlot(slot.end_date, scheduler2.date[view.name + "_start"](new Date(slot.end_date)), view.x_unit, view.x_step); + if (endDate.valueOf() <= startDate.valueOf()) { + endDate = scheduler2.date.add(startDate, view.x_step, view.x_unit); } - return div; - }, renderMonthMarker: function(start_date, end_date) { - var res = []; - var currentDate = start_date; - while (currentDate.valueOf() < end_date.valueOf()) { - res.push(this.renderMonthCell(currentDate)); - currentDate = scheduler2.date.add(currentDate, 1, "day"); + var newPos = this.clone(slot); + newPos.start_date = startDate; + newPos.end_date = endDate; + newPos.section = slot.section || this._getNextSection(); + switch (dir) { + case "up": + newPos.section = this._getNextSection(slot.section, -1); + break; + case "down": + newPos.section = this._getNextSection(slot.section, 1); + break; + case "left": + newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, -view.x_step, view.x_unit), -1); + newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); + break; + case "right": + newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit), 1); + newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); + break; } - return res; - }, renderVerticalMarker: function(start_date, end_date, section) { - var index = scheduler2.locate_holder_day(start_date); - var divs = []; - var area = null; - var c = scheduler2.config; - if (scheduler2._ignores[index]) - return divs; - if (scheduler2._props && scheduler2._props[scheduler2._mode] && section) { - var view = scheduler2._props[scheduler2._mode]; - index = view.order[section]; - var inner_index = view.order[section]; - if (!(view.days > 1)) { - index = inner_index; - if (view.size && index > view.position + view.size) { - index = 0; - } + if (newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()) { + if (extend2 && newPos.start_date.valueOf() >= state.max_date.valueOf()) { + newPos.start_date = new Date(state.max_date); } else { - index = scheduler2.locate_holder_day(start_date) + inner_index; + newPos.start_date = scheduler2.date[state.mode + "_start"](scheduler2.date.add(state.date, dir == "left" ? -1 : 1, state.mode)); + newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); } } - area = scheduler2.locate_holder(index); - if (!area || area.querySelector(".dhx_scale_hour")) { - return document.createElement("div"); + return newPos; + }, nextUnitsSlot: function(slot, dir, extend2) { + var newPos = this.clone(slot); + newPos.section = slot.section || this._getNextSection(); + var section = slot.section || this._getNextSection(); + var state = scheduler2.getState(); + var view = scheduler2._props[state.mode]; + switch (dir) { + case "left": + section = this._getNextSection(slot.section, -1); + var optionsCount = view.size ? view.size - 1 : view.options.length; + if (view.days > 1 && view.order[section] == optionsCount - 1) { + if (scheduler2.date.add(slot.start_date, -1, "day").valueOf() >= state.min_date.valueOf()) { + newPos = this.nextDaySlot(slot, dir, extend2); + } + } + break; + case "right": + section = this._getNextSection(slot.section, 1); + if (view.days > 1 && !view.order[section]) { + if (scheduler2.date.add(slot.start_date, 1, "day").valueOf() < state.max_date.valueOf()) { + newPos = this.nextDaySlot(slot, dir, extend2); + } + } + break; + default: + newPos = this.nextDaySlot(slot, dir, extend2); + section = slot.section; + break; } - var start = Math.max(start_date.getHours() * 60 + start_date.getMinutes(), c.first_hour * 60); - var end = Math.min(end_date.getHours() * 60 + end_date.getMinutes(), c.last_hour * 60); - if (!end && scheduler2.date.day_start(new Date(end_date)).valueOf() > scheduler2.date.day_start(new Date(start_date)).valueOf()) { - end = c.last_hour * 60; + newPos.section = section; + return newPos; + }, _moveDate: function(oldDate, dir) { + var newDate = this.findVisibleColumn(scheduler2.date.add(oldDate, dir, "day"), dir); + newDate.setHours(oldDate.getHours()); + newDate.setMinutes(oldDate.getMinutes()); + return newDate; + }, isBeforeLastHour: function(date, isStartDate) { + var minutes = date.getMinutes(), hours = date.getHours(), last_hour = scheduler2.config.last_hour; + return hours < last_hour || !isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes); + }, isAfterFirstHour: function(date, isStartDate) { + var minutes = date.getMinutes(), hours = date.getHours(), first_hour = scheduler2.config.first_hour, last_hour = scheduler2.config.last_hour; + return hours >= first_hour || !isStartDate && (!minutes && (!hours && last_hour == 24 || hours == last_hour)); + }, isInVisibleDayTime: function(date, isStartDate) { + return this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate); + }, nextDaySlot: function(slot, dir, extend2) { + var start, end; + var key_nav_step = scheduler2.config.key_nav_step; + var date = this._alignTimeSlot(slot.start_date, scheduler2.date.day_start(new Date(slot.start_date)), "minute", key_nav_step); + var oldStart = slot.start_date; + switch (dir) { + case "up": + start = scheduler2.date.add(date, -key_nav_step, "minute"); + if (!this.isInVisibleDayTime(start, true)) { + if (!extend2 || this.isInVisibleDayTime(oldStart, true)) { + var toNextDay = true; + if (extend2 && scheduler2.date.date_part(new Date(start)).valueOf() != scheduler2.date.date_part(new Date(oldStart)).valueOf()) + toNextDay = false; + if (toNextDay) + start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, -1, "day"), -1); + start.setHours(scheduler2.config.last_hour); + start.setMinutes(0); + start = scheduler2.date.add(start, -key_nav_step, "minute"); + } + } + end = scheduler2.date.add(start, key_nav_step, "minute"); + break; + case "down": + start = scheduler2.date.add(date, key_nav_step, "minute"); + var testEnd = extend2 ? start : scheduler2.date.add(start, key_nav_step, "minute"); + if (!this.isInVisibleDayTime(testEnd, false)) { + if (!extend2 || this.isInVisibleDayTime(oldStart, false)) { + if (!extend2) { + start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); + start.setHours(scheduler2.config.first_hour); + start.setMinutes(0); + } else { + var toNextDay = true; + if (scheduler2.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) { + toNextDay = false; + } + if (toNextDay) { + start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); + } + start.setHours(scheduler2.config.first_hour); + start.setMinutes(0); + start = scheduler2.date.add(start, key_nav_step, "minute"); + } + } + } + end = scheduler2.date.add(start, key_nav_step, "minute"); + break; + case "left": + start = this._moveDate(slot.start_date, -1); + end = this._moveDate(slot.end_date, -1); + break; + case "right": + start = this._moveDate(slot.start_date, 1); + end = this._moveDate(slot.end_date, 1); + break; + default: + start = date; + end = scheduler2.date.add(start, key_nav_step, "minute"); + break; } - if (end <= start) { - return []; + return { start_date: start, end_date: end }; + }, nextWeekAgendaSlot: function(slot, dir) { + var start, end; + var state = scheduler2.getState(); + switch (dir) { + case "down": + case "left": + start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, -1, "day")); + start = this.findVisibleColumn(start, -1); + break; + case "up": + case "right": + start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, 1, "day")); + start = this.findVisibleColumn(start, 1); + break; + default: + start = scheduler2.date.day_start(slot.start_date); + break; } - var block = this.createElement(); - var all_hours_height = scheduler2.config.hour_size_px * c.last_hour + 1; - var hour_ms = 60 * 60 * 1e3; - block.style.top = Math.round((start * 60 * 1e3 - scheduler2.config.first_hour * hour_ms) * scheduler2.config.hour_size_px / hour_ms) % all_hours_height + "px"; - block.style.lineHeight = block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * scheduler2.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; - block.style.width = "100%"; - area.appendChild(block); - divs.push(block); - return divs[0]; - } }; -} -function scheduler_node(scheduler2) { - scheduler2.$keyboardNavigation.SchedulerNode = function() { - }; - scheduler2.$keyboardNavigation.SchedulerNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { getDefaultNode: function() { - var node = new scheduler2.$keyboardNavigation.TimeSlot(); - if (!node.isValid()) { - node = node.fallback(); + if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { + start = new Date(state.min_date); } - return node; - }, _modes: { month: "month", year: "year", dayColumns: "dayColumns", timeline: "timeline", units: "units", weekAgenda: "weekAgenda", list: "list" }, getMode: function() { - var state = scheduler2.getState(); - var mode = state.mode; - if (scheduler2.matrix && scheduler2.matrix[mode]) { - return this._modes.timeline; - } else if (scheduler2._props && scheduler2._props[mode]) { - return this._modes.units; - } else if (mode == "month") { - return this._modes.month; - } else if (mode == "year") { - return this._modes.year; - } else if (mode == "week_agenda") { - return this._modes.weekAgenda; - } else if (mode == "map" || mode == "agenda" || scheduler2._grid && scheduler2["grid_" + mode]) { - return this._modes.list; + end = new Date(start); + end.setHours(scheduler2.config.last_hour); + return { start_date: start, end_date: end }; + }, nextAgendaSlot: function(slot, dir) { + return { start_date: slot.start_date, end_date: slot.end_date }; + }, isDateVisible: function(date) { + if (!scheduler2._ignores_detected) + return true; + var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; + var index; + if (timeline) { + index = scheduler2._get_date_index(timeline, date); } else { - return this._modes.dayColumns; + index = scheduler2.locate_holder_day(date); } - }, focus: function() { - scheduler2.focus(); - }, blur: function() { - }, disable: function() { - scheduler2.$container.setAttribute("tabindex", "0"); - }, enable: function() { - if (scheduler2.$container) - scheduler2.$container.removeAttribute("tabindex"); - }, isEnabled: function() { - return scheduler2.$container.hasAttribute("tabindex"); - }, _compareEvents: function(a, b) { - if (a.start_date.valueOf() == b.start_date.valueOf()) - return a.id > b.id ? 1 : -1; - return a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1; - }, _pickEvent: function(from, to, startId, reverse) { - var range = scheduler2.getState(); - from = new Date(Math.max(range.min_date.valueOf(), from.valueOf())); - to = new Date(Math.min(range.max_date.valueOf(), to.valueOf())); - var evs = scheduler2.getEvents(from, to); - evs.sort(this._compareEvents); - if (reverse) { - evs = evs.reverse(); + return !scheduler2._ignores[index]; + }, findVisibleColumn: function(start, dir) { + var date = start; + dir = dir || 1; + var range2 = scheduler2.getState(); + while (!this.isDateVisible(date) && (dir > 0 && date.valueOf() <= range2.max_date.valueOf() || dir < 0 && date.valueOf() >= range2.min_date.valueOf())) { + date = this.nextDateColumn(date, dir); } - var trim = !!startId; - for (var i = 0; i < evs.length && trim; i++) { - if (evs[i].id == startId) { - trim = false; - } - evs.splice(i, 1); - i--; + return date; + }, nextDateColumn: function(start, dir) { + dir = dir || 1; + var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; + var date; + if (timeline) { + date = scheduler2.date.add(start, dir * timeline.x_step, timeline.x_unit); + } else { + date = scheduler2.date.day_start(scheduler2.date.add(start, dir, "day")); } - for (var i = 0; i < evs.length; i++) { - var eventElement = new scheduler2.$keyboardNavigation.Event(evs[i].id); - if (eventElement.getNode()) - return evs[i]; + return date; + }, isVisible: function(from, to) { + if (!scheduler2._ignores_detected) + return true; + var current = new Date(from); + while (current.valueOf() < to.valueOf()) { + if (this.isDateVisible(current)) + return true; + current = this.nextDateColumn(current); } - return null; - }, nextEventHandler: function(id2) { - var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; - var startId = id2 || activeNode && activeNode.eventId; - var nextEvent = null; - if (startId && scheduler2.getEvent(startId)) { - var currEvent = scheduler2.getEvent(startId); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(currEvent.start_date, scheduler2.date.add(currEvent.start_date, 1, "year"), currEvent.id, false); + return false; + }, nextSlot: function(slot, dir, view, extend2) { + var next; + view = view || this._getMode(); + var tempSlot = scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); + switch (view) { + case this._modes.units: + next = this.nextUnitsSlot(tempSlot, dir, extend2); + break; + case this._modes.timeline: + next = this.nextTimelineSlot(tempSlot, dir, extend2); + break; + case this._modes.year: + next = this.nextMonthSlot(tempSlot, dir, extend2); + break; + case this._modes.month: + next = this.nextMonthSlot(tempSlot, dir, extend2); + break; + case this._modes.weekAgenda: + next = this.nextWeekAgendaSlot(tempSlot, dir, extend2); + break; + case this._modes.list: + next = this.nextAgendaSlot(tempSlot, dir, extend2); + break; + case this._modes.dayColumns: + next = this.nextDaySlot(tempSlot, dir, extend2); + break; } - if (!nextEvent && !id2) { - var visibleDates = scheduler2.getState(); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(visibleDates.min_date, scheduler2.date.add(visibleDates.min_date, 1, "year"), null, false); + if (next.start_date.valueOf() >= next.end_date.valueOf()) { + next = this.nextSlot(next, dir, view); } - if (nextEvent) { - var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); - if (!nextEv.isValid()) { - this.nextEventHandler(nextEvent.id); - } else { - if (activeNode) { - activeNode.blur(); + return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); + }, extendSlot: function(slot, dir) { + var view = this._getMode(); + var next; + switch (view) { + case this._modes.units: + if (dir == "left" || dir == "right") { + next = this.nextUnitsSlot(slot, dir); + } else { + next = this.extendUnitsSlot(slot, dir); } - scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); - } - } - }, prevEventHandler: function(id2) { - var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; - var startId = id2 || activeNode && activeNode.eventId; - var nextEvent = null; - if (startId && scheduler2.getEvent(startId)) { - var currEvent = scheduler2.getEvent(startId); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(currEvent.end_date, -1, "year"), currEvent.end_date, currEvent.id, true); + break; + case this._modes.timeline: + if (dir == "down" || dir == "up") { + next = this.nextTimelineSlot(slot, dir); + } else { + next = this.extendTimelineSlot(slot, dir); + } + break; + case this._modes.year: + next = this.extendMonthSlot(slot, dir); + break; + case this._modes.month: + next = this.extendMonthSlot(slot, dir); + break; + case this._modes.dayColumns: + next = this.extendDaySlot(slot, dir); + break; + case this._modes.weekAgenda: + next = this.extendWeekAgendaSlot(slot, dir); + break; + default: + next = slot; + break; } - if (!nextEvent && !id2) { - var visibleDates = scheduler2.getState(); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(visibleDates.max_date, -1, "year"), visibleDates.max_date, null, true); + var range2 = scheduler2.getState(); + if (next.start_date.valueOf() < range2.min_date.valueOf()) { + next.start_date = this.findVisibleColumn(range2.min_date); + next.start_date.setHours(scheduler2.config.first_hour); } - if (nextEvent) { - var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); - if (!nextEv.isValid()) { - this.prevEventHandler(nextEvent.id); - } else { - if (activeNode) { - activeNode.blur(); - } - scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); - } + if (next.end_date.valueOf() > range2.max_date.valueOf()) { + next.end_date = this.findVisibleColumn(range2.max_date, -1); } - }, keys: { "alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9": function(e) { - var tabs = scheduler2.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab"); - var key = e.key; - if (key === void 0) { - key = e.keyCode - 48; + return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); + }, extendTimelineSlot: function(slot, direction) { + return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "timeline"); + }, extendWeekAgendaSlot: function(slot, direction) { + return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "weekAgenda"); + }, extendGenericSlot: function(allowedDirections, slot, direction, type) { + var next; + var moveDate = slot.movingDate; + if (!moveDate) { + moveDate = allowedDirections[direction]; } - if (tabs[key * 1 - 1]) { - tabs[key * 1 - 1].click(); + if (!moveDate || !allowedDirections[direction]) { + return slot; } - }, "ctrl+left,meta+left": function(e) { - scheduler2._click.dhx_cal_prev_button(); - }, "ctrl+right,meta+right": function(e) { - scheduler2._click.dhx_cal_next_button(); - }, "ctrl+up,meta+up": function(e) { - var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); - dataArea.scrollTop -= 20; - }, "ctrl+down,meta+down": function(e) { - var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); - dataArea.scrollTop += 20; - }, e: function() { - this.nextEventHandler(); - }, home: function() { - scheduler2.setCurrentView(/* @__PURE__ */ new Date()); - }, "shift+e": function() { - this.prevEventHandler(); - }, "ctrl+enter,meta+enter": function() { - scheduler2.addEventNow({ start_date: new Date(scheduler2.getState().date) }); - }, "ctrl+c,meta+c": function(e) { - scheduler2._key_nav_copy_paste(e); - }, "ctrl+v,meta+v": function(e) { - scheduler2._key_nav_copy_paste(e); - }, "ctrl+x,meta+x": function(e) { - scheduler2._key_nav_copy_paste(e); - } } }); - scheduler2.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler2.$keyboardNavigation.SchedulerNode.prototype.keys); -} -function nav_node(scheduler2) { - scheduler2.$keyboardNavigation.KeyNavNode = function() { - }; - scheduler2.$keyboardNavigation.KeyNavNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { isValid: function() { - return true; - }, fallback: function() { - return null; - }, moveTo: function(element) { - scheduler2.$keyboardNavigation.dispatcher.setActiveNode(element); - }, compareTo: function(b) { - if (!b) - return false; - for (var i in this) { - if (!!this[i] != !!b[i]) - return false; - var canStringifyThis = !!(this[i] && this[i].toString); - var canStringifyThat = !!(b[i] && b[i].toString); - if (canStringifyThat != canStringifyThis) - return false; - if (!(canStringifyThat && canStringifyThis)) { - if (b[i] != this[i]) - return false; - } else { - if (b[i].toString() != this[i].toString()) - return false; + if (direction) { + next = this.nextSlot({ start_date: slot[moveDate], section: slot.section }, direction, type, true); + if (next.start_date.valueOf() == slot.start_date.valueOf()) { + next = this.nextSlot({ start_date: next.start_date, section: next.section }, direction, type, true); } + next.movingDate = moveDate; + } else { + return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); + } + var newDates = this.extendSlotDates(slot, next, next.movingDate); + if (newDates.end_date.valueOf() <= newDates.start_date.valueOf()) { + next.movingDate = next.movingDate == "end_date" ? "start_date" : "end_date"; + } + newDates = this.extendSlotDates(slot, next, next.movingDate); + next.start_date = newDates.start_date; + next.end_date = newDates.end_date; + return next; + }, extendSlotDates: function(oldSlot, newSlot, dateDirection) { + var res = { start_date: null, end_date: null }; + if (dateDirection == "start_date") { + res.start_date = newSlot.start_date; + res.end_date = oldSlot.end_date; + } else { + res.start_date = oldSlot.start_date; + res.end_date = newSlot.start_date; } - return true; - }, getNode: function() { - }, focus: function() { - var node = this.getNode(); - if (node) { - node.setAttribute("tabindex", "-1"); - if (node.focus) - node.focus(); + return res; + }, extendMonthSlot: function(slot, direction) { + var slot = this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "month"); + slot.start_date.setHours(scheduler2.config.first_hour); + slot.end_date = scheduler2.date.add(slot.end_date, -1, "day"); + slot.end_date.setHours(scheduler2.config.last_hour); + return slot; + }, extendUnitsSlot: function(slot, direction) { + var next; + switch (direction) { + case "down": + case "up": + next = this.extendDaySlot(slot, direction); + break; + default: + next = slot; + break; } - }, blur: function() { - var node = this.getNode(); - if (node) { - node.setAttribute("tabindex", "-1"); + next.section = slot.section; + return next; + }, extendDaySlot: function(slot, direction) { + return this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "dayColumns"); + }, scrollSlot: function(dir) { + var state = scheduler2.getState(); + var slot = this.nextSlot(this, dir); + if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { + scheduler2.setCurrentView(new Date(slot.start_date)); } - } }); + this.moveTo(slot); + }, keys: { left: function() { + this.scrollSlot("left"); + }, right: function() { + this.scrollSlot("right"); + }, down: function() { + var mode = this._getMode(); + if (mode == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); + } else { + this.scrollSlot("down"); + } + }, up: function() { + var mode = this._getMode(); + if (mode == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); + } else { + this.scrollSlot("up"); + } + }, "shift+down": function() { + this.moveTo(this.extendSlot(this, "down")); + }, "shift+up": function() { + this.moveTo(this.extendSlot(this, "up")); + }, "shift+right": function() { + this.moveTo(this.extendSlot(this, "right")); + }, "shift+left": function() { + this.moveTo(this.extendSlot(this, "left")); + }, enter: function() { + var obj = { start_date: new Date(this.start_date), end_date: new Date(this.end_date) }; + var mode = scheduler2.getState().mode; + if (scheduler2.matrix && scheduler2.matrix[mode]) { + var timeline = scheduler2.matrix[scheduler2.getState().mode]; + obj[timeline.y_property] = this.section; + } else if (scheduler2._props && scheduler2._props[mode]) { + var unit = scheduler2._props[mode]; + obj[unit.map_to] = this.section; + } + scheduler2.addEventNow(obj); + } } }); + scheduler2.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler2.$keyboardNavigation.TimeSlot.prototype.keys); } -function header_cell(scheduler2) { - scheduler2.$keyboardNavigation.HeaderCell = function(index) { +function minical_button(scheduler2) { + scheduler2.$keyboardNavigation.MinicalButton = function(div, index) { + this.container = div; this.index = index || 0; }; - scheduler2.$keyboardNavigation.HeaderCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { - index = index || this.index || 0; - var nodes = this.getNodes(); - if (nodes[index]) - return nodes[index]; - }, getNodes: function(selector) { - selector = selector || [".dhx_cal_navline .dhx_cal_prev_button", ".dhx_cal_navline .dhx_cal_next_button", ".dhx_cal_navline .dhx_cal_today_button", ".dhx_cal_navline .dhx_cal_tab"].join(", "); - var nodes = Array.prototype.slice.call(scheduler2.$container.querySelectorAll(selector)); - nodes.sort(function(a, b) { - return a.offsetLeft - b.offsetLeft; - }); - return nodes; - }, _handlers: null, isValid: function() { - return !!this.getNode(this.index); + scheduler2.$keyboardNavigation.MinicalButton.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { + var container = this.container; + return !!container.offsetWidth; }, fallback: function() { - var defaultCell = this.getNode(0); - if (!defaultCell) { - defaultCell = new scheduler2.$keyboardNavigation.TimeSlot(); - } - return defaultCell; - }, keys: { left: function() { - var newIndex = this.index - 1; - if (newIndex < 0) { - newIndex = this.getNodes().length - 1; + var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); + if (defaultSlot.isValid()) { + return defaultSlot; + } else { + return new scheduler2.$keyboardNavigation.DataArea(); } - this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); - }, right: function() { - var newIndex = this.index + 1; - if (newIndex >= this.getNodes().length) { - newIndex = 0; + }, focus: function() { + scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); + this.container.removeAttribute("tabindex"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }, blur: function() { + this.container.setAttribute("tabindex", "0"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + }, getNode: function() { + if (!this.index) { + return this.container.querySelector(".dhx_cal_prev_button"); + } else { + return this.container.querySelector(".dhx_cal_next_button"); } - this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); + }, keys: { right: function(e) { + this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); + }, left: function(e) { + this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); }, down: function() { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); - }, enter: function() { - var node = this.getNode(); - if (node) { - node.click(); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, 0, 0); + if (next && !next.isValid()) { + next = next.fallback(); } + this.moveTo(next); + }, enter: function(e) { + this.getNode().click(); } } }); - scheduler2.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler2.$keyboardNavigation.HeaderCell.prototype.keys); + scheduler2.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalButton.prototype.keys); } -function event(scheduler2) { - scheduler2.$keyboardNavigation.Event = function(id2) { - this.eventId = null; - if (scheduler2.getEvent(id2)) { - var ev = scheduler2.getEvent(id2); - this.start = new Date(ev.start_date); - this.end = new Date(ev.end_date); - this.section = this._getSection(ev); - this.eventId = id2; - } +function minical_cell(scheduler2) { + scheduler2.$keyboardNavigation.MinicalCell = function(div, row, col) { + this.container = div; + this.row = row || 0; + this.col = col || 0; }; - scheduler2.$keyboardNavigation.Event.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _getNodes: function() { - return Array.prototype.slice.call(scheduler2.$container.querySelectorAll("[" + scheduler2.config.event_attribute + "]")); - }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { - return !!(scheduler2.getEvent(this.eventId) && this.getNode()); + scheduler2.$keyboardNavigation.MinicalCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { + var grid = this._getGrid(); + return !!(grid[this.row] && grid[this.row][this.col]); }, fallback: function() { - var eventNode = this._getNodes()[0]; - var defaultElement = null; - if (!eventNode || !scheduler2._locate_event(eventNode)) { - defaultElement = new scheduler2.$keyboardNavigation.TimeSlot(); - } else { - var id2 = scheduler2._locate_event(eventNode); - defaultElement = new scheduler2.$keyboardNavigation.Event(id2); + var row = this.row; + var col = this.col; + var grid = this._getGrid(); + if (!grid[row]) { + row = 0; } - return defaultElement; - }, isScrolledIntoView: function(el2) { - var eventBox = el2.getBoundingClientRect(); - var viewPort = scheduler2.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); - if (eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom) { - return false; + var dir = true; + if (row > grid.length / 2) { + dir = false; } - return true; - }, getNode: function() { - var idSelector = "[" + scheduler2.config.event_attribute + "='" + this.eventId + "']"; - var inlineEditor = scheduler2.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); - if (inlineEditor) { - return inlineEditor; + if (!grid[row]) { + var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); + if (defaultSlot.isValid()) { + return defaultSlot; + } else { + return new scheduler2.$keyboardNavigation.DataArea(); + } + } + if (dir) { + for (var c = col; grid[row] && c < grid[row].length; c++) { + if (!grid[row][c] && c == grid[row].length - 1) { + row++; + col = 0; + } + if (grid[row][c]) { + return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); + } + } } else { - if (scheduler2.isMultisectionEvent && scheduler2.isMultisectionEvent(scheduler2.getEvent(this.eventId))) { - var nodes = scheduler2.$container.querySelectorAll(idSelector); - for (var i = 0; i < nodes.length; i++) { - if (this.isScrolledIntoView(nodes[i])) { - return nodes[i]; - } + for (var c = col; grid[row] && c < grid[row].length; c--) { + if (!grid[row][c] && !c) { + row--; + col = grid[row].length - 1; + } + if (grid[row][c]) { + return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); + } + } + } + return new scheduler2.$keyboardNavigation.MinicalButton(this.container, 0); + }, focus: function() { + scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); + this.container.removeAttribute("tabindex"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }, blur: function() { + this.container.setAttribute("tabindex", "0"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + }, _getNode: function(row, col) { + return this.container.querySelector(".dhx_year_body tr:nth-child(" + (row + 1) + ") td:nth-child(" + (col + 1) + ")"); + }, getNode: function() { + return this._getNode(this.row, this.col); + }, _getGrid: function() { + var rows = this.container.querySelectorAll(".dhx_year_body tr"); + var grid = []; + for (var i = 0; i < rows.length; i++) { + grid[i] = []; + var row = rows[i]; + var cells = row.querySelectorAll("td"); + for (var c = 0; c < cells.length; c++) { + var cell = cells[c]; + var enabled = true; + var css = scheduler2._getClassName(cell); + if (css.indexOf("dhx_after") > -1 || css.indexOf("dhx_before") > -1 || css.indexOf("dhx_scale_ignore") > -1) { + enabled = false; } - return nodes[0]; - } else { - return scheduler2.$container.querySelector(idSelector); + grid[i][c] = enabled; } } - }, focus: function() { - var event2 = scheduler2.getEvent(this.eventId); - var calendar = scheduler2.getState(); - if (event2.start_date.valueOf() > calendar.max_date.valueOf() || event2.end_date.valueOf() <= calendar.min_date.valueOf()) { - scheduler2.setCurrentView(event2.start_date); + return grid; + }, keys: { right: function(e) { + var grid = this._getGrid(); + var newRow = this.row; + var newCol = this.col + 1; + if (!grid[newRow] || !grid[newRow][newCol]) { + if (grid[newRow + 1]) { + newRow = newRow + 1; + newCol = 0; + } else { + newCol = this.col; + } } - var node = this.getNode(); - if (this.isScrolledIntoView(node)) { - scheduler2.$keyboardNavigation.dispatcher.keepScrollPosition((function() { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }).bind(this)); - } else { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); } - }, blur: function() { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - }, _getSection: function(ev) { - var section = null; - var mode = scheduler2.getState().mode; - if (scheduler2.matrix && scheduler2.matrix[mode]) { - var timeline = scheduler2.matrix[scheduler2.getState().mode]; - section = ev[timeline.y_property]; - } else if (scheduler2._props && scheduler2._props[mode]) { - var unit = scheduler2._props[mode]; - section = ev[unit.map_to]; + this.moveTo(next); + }, left: function(e) { + var grid = this._getGrid(); + var newRow = this.row; + var newCol = this.col - 1; + if (!grid[newRow] || !grid[newRow][newCol]) { + if (grid[newRow - 1]) { + newRow = newRow - 1; + newCol = grid[newRow].length - 1; + } else { + newCol = this.col; + } } - return section; - }, _moveToSlot: function(dir) { - var ev = scheduler2.getEvent(this.eventId); - if (ev) { - var section = this._getSection(ev); - var slot = new scheduler2.$keyboardNavigation.TimeSlot(ev.start_date, null, section); - this.moveTo(slot.nextSlot(slot, dir)); - } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); } - }, keys: { left: function() { - this._moveToSlot("left"); - }, right: function() { - this._moveToSlot("right"); + this.moveTo(next); }, down: function() { - if (this.getMode() == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); - } else { - this._moveToSlot("down"); + var grid = this._getGrid(); + var newRow = this.row + 1; + var newCol = this.col; + if (!grid[newRow] || !grid[newRow][newCol]) { + newRow = this.row; } - }, space: function() { - var node = this.getNode(); - if (node && node.click) { - node.click(); - } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); } + this.moveTo(next); }, up: function() { - if (this.getMode() == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); - } else { - this._moveToSlot("up"); - } - }, delete: function() { - if (scheduler2.getEvent(this.eventId)) { - scheduler2._click.buttons["delete"](this.eventId); - } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); - } - }, enter: function() { - if (scheduler2.getEvent(this.eventId)) { - scheduler2.showLightbox(this.eventId); + var grid = this._getGrid(); + var newRow = this.row - 1; + var newCol = this.col; + if (!grid[newRow] || !grid[newRow][newCol]) { + var index = 0; + if (this.col > grid[this.row].length / 2) { + index = 1; + } + this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, index)); } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); + } + this.moveTo(next); } + }, enter: function(e) { + this.getNode().querySelector(".dhx_month_head").click(); } } }); - scheduler2.$keyboardNavigation.Event.prototype.bindAll(scheduler2.$keyboardNavigation.Event.prototype.keys); + scheduler2.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalCell.prototype.keys); } -function time_slot(scheduler2) { - scheduler2.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate) { - var state = scheduler2.getState(); - var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; - if (!from) { - from = this.getDefaultDate(); +function data_area(scheduler2) { + scheduler2.$keyboardNavigation.DataArea = function(index) { + this.index = index || 0; + }; + scheduler2.$keyboardNavigation.DataArea.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { + return scheduler2.$container.querySelector(".dhx_cal_data"); + }, _handlers: null, isValid: function() { + return true; + }, fallback: function() { + return this; + }, keys: { "up,down,right,left": function() { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + } } }); + scheduler2.$keyboardNavigation.DataArea.prototype.bindAll(scheduler2.$keyboardNavigation.DataArea.prototype.keys); +} +function modals(scheduler2) { + (function() { + var modalsStack = []; + function isModal() { + return !!modalsStack.length; } - if (!to) { - if (timeline) { - to = scheduler2.date.add(from, timeline.x_step, timeline.x_unit); - } else { - to = scheduler2.date.add(from, scheduler2.config.key_nav_step, "minute"); + function isChildOf(child, parent) { + while (child && child != parent) { + child = child.parentNode; } + return !!(child == parent); } - this.section = section || this._getDefaultSection(); - this.start_date = new Date(from); - this.end_date = new Date(to); - this.movingDate = movingDate || null; - }; - scheduler2.$keyboardNavigation.TimeSlot.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _handlers: null, getDefaultDate: function() { - var from; - var state = scheduler2.getState(); - var visibleTime = new Date(state.date); - visibleTime.setSeconds(0); - visibleTime.setMilliseconds(0); - var nowTime = /* @__PURE__ */ new Date(); - nowTime.setSeconds(0); - nowTime.setMilliseconds(0); - var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; - var showNowTime = false; - if (visibleTime.valueOf() === nowTime.valueOf()) { - showNowTime = true; - } - if (timeline) { - if (showNowTime) { - if (timeline.x_unit === "day") { - nowTime.setHours(0); - nowTime.setMinutes(0); - } else if (timeline.x_unit === "hour") { - nowTime.setMinutes(0); + function afterPopup(box) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; } - from = nowTime; - } else { - from = scheduler2.date[timeline.name + "_start"](new Date(state.date)); - } - from = this.findVisibleColumn(from); - } else { - from = new Date(scheduler2.getState().min_date); - if (showNowTime) { - from = nowTime; - } - from = this.findVisibleColumn(from); - if (!showNowTime) { - from.setHours(scheduler2.config.first_hour); + if (!isModal() && !isChildOf(document.activeElement, scheduler2.$container)) { + scheduler2.focus(); + } + }, 1); + } + function startModal(box) { + scheduler2.eventRemove(box, "keydown", trapFocus); + scheduler2.event(box, "keydown", trapFocus); + modalsStack.push(box); + } + function endModal() { + var box = modalsStack.pop(); + if (box) { + scheduler2.eventRemove(box, "keydown", trapFocus); } - if (!scheduler2._table_view) { - var dataContainer = scheduler2.$container.querySelector(".dhx_cal_data"); - if (dataContainer.scrollTop) { - from.setHours(scheduler2.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler2.config.hour_size_px)); + afterPopup(); + } + function isTopModal(box) { + return box == modalsStack[modalsStack.length - 1]; + } + function trapFocus(event2) { + var event2 = event2 || window.event; + var target = event2.currentTarget; + if (!isTopModal(target)) + return; + scheduler2.$keyboardNavigation.trapFocus(target, event2); + } + function traceLightbox() { + startModal(scheduler2.getLightbox()); + } + scheduler2.attachEvent("onLightbox", traceLightbox); + scheduler2.attachEvent("onAfterLightbox", endModal); + scheduler2.attachEvent("onAfterQuickInfo", function() { + afterPopup(); + }); + if (!scheduler2._keyNavMessagePopup) { + scheduler2._keyNavMessagePopup = true; + var focusElement = null; + var backupFocus = null; + const modalsStack2 = []; + scheduler2.attachEvent("onMessagePopup", function(box) { + focusElement = document.activeElement; + backupFocus = focusElement; + while (backupFocus && scheduler2._getClassName(backupFocus).indexOf("dhx_cal_data") < 0) { + backupFocus = backupFocus.parentNode; + } + if (backupFocus) { + backupFocus = backupFocus.parentNode; } - } + scheduler2.eventRemove(box, "keydown", trapFocus); + scheduler2.event(box, "keydown", trapFocus); + modalsStack2.push(box); + }); + scheduler2.attachEvent("onAfterMessagePopup", function() { + var box = modalsStack2.pop(); + if (box) { + scheduler2.eventRemove(box, "keydown", trapFocus); + } + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + var currentTarget = document.activeElement; + while (currentTarget && scheduler2._getClassName(currentTarget).indexOf("dhx_cal_light") < 0) { + currentTarget = currentTarget.parentNode; + } + if (currentTarget) + return; + if (focusElement && focusElement.parentNode) { + focusElement.focus(); + } else if (backupFocus && backupFocus.parentNode) { + backupFocus.focus(); + } + focusElement = null; + backupFocus = null; + }, 1); + }); } - return from; - }, clone: function(timeslot) { - return new scheduler2.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate); - }, _getMultisectionView: function() { - var state = scheduler2.getState(); - var view; - if (scheduler2._props && scheduler2._props[state.mode]) { - view = scheduler2._props[state.mode]; - } else if (scheduler2.matrix && scheduler2.matrix[state.mode]) { - view = scheduler2.matrix[state.mode]; + scheduler2.$keyboardNavigation.isModal = isModal; + })(); +} +function core(scheduler2) { + scheduler2.$keyboardNavigation.dispatcher = { isActive: false, activeNode: null, globalNode: new scheduler2.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(callback) { + var top, left; + var scrollable = scheduler2.$container.querySelector(".dhx_timeline_scrollable_data"); + if (!scrollable) { + scrollable = scheduler2.$container.querySelector(".dhx_cal_data"); } - return view; - }, _getDefaultSection: function() { - var section = null; - var view = this._getMultisectionView(); - if (view && !section) { - section = this._getNextSection(); + if (scrollable) { + top = scrollable.scrollTop; + left = scrollable.scrollLeft; } - return section; - }, _getNextSection: function(sectionId, dir) { - var view = this._getMultisectionView(); - var currentIndex = view.order[sectionId]; - var nextIndex = currentIndex; - if (currentIndex !== void 0) { - nextIndex = currentIndex + dir; - } else { - nextIndex = view.size && view.position ? view.position : 0; + callback(); + if (scrollable) { + scrollable.scrollTop = top; + scrollable.scrollLeft = left; } - if (nextIndex < 0) { - nextIndex = 0; + }, enable: function() { + if (!scheduler2.$container) { + return; } - var options = view.options || view.y_unit; - if (nextIndex >= options.length) { - nextIndex = options.length - 1; + this.isActive = true; + var self = this; + this.keepScrollPosition(function() { + self.globalNode.enable(); + self.setActiveNode(self.getActiveNode()); + }); + }, disable: function() { + this.isActive = false; + this.globalNode.disable(); + }, isEnabled: function() { + return !!this.isActive; + }, getDefaultNode: function() { + return this.globalNode.getDefaultNode(); + }, setDefaultNode: function() { + this.setActiveNode(this.getDefaultNode()); + }, getActiveNode: function() { + var node = this.activeNode; + if (node && !node.isValid()) { + node = node.fallback(); } - if (options[nextIndex]) { - return options[nextIndex].key; - } else { - return null; + return node; + }, focusGlobalNode: function() { + this.blurNode(this.globalNode); + this.focusNode(this.globalNode); + }, setActiveNode: function(el2) { + if (!el2 || !el2.isValid()) + return; + if (this.activeNode) { + if (this.activeNode.compareTo(el2)) { + return; + } } - }, isValid: function() { - var state = scheduler2.getState(); - var isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf()); - if (!isInRange) - return false; - if (!this.isVisible(this.start_date, this.end_date)) - return false; - var view = this._getMultisectionView(); - if (view) { - return view.order[this.section] !== void 0; - } else { - return true; + if (this.isEnabled()) { + this.blurNode(this.activeNode); + this.activeNode = el2; + this.focusNode(this.activeNode); } - }, fallback: function() { - var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); - if (!defaultSlot.isValid()) { - return new scheduler2.$keyboardNavigation.DataArea(); - } else { - return defaultSlot; + }, focusNode: function(el2) { + if (el2 && el2.focus) { + el2.focus(); + if (el2.getNode && document.activeElement != el2.getNode()) { + this.setActiveNode(new scheduler2.$keyboardNavigation.DataArea()); + } } - }, getNodes: function() { - return Array.prototype.slice.call(scheduler2.$container.querySelectorAll(".dhx_focus_slot")); - }, getNode: function() { - return this.getNodes()[0]; - }, focus: function() { - if (this.section && scheduler2.getView() && scheduler2.getView().smart_rendering && scheduler2.getView().scrollTo && !scheduler2.$container.querySelector(`[data-section-id="${this.section}"]`)) { - scheduler2.getView().scrollTo({ section: this.section }); + }, blurNode: function(el2) { + if (el2 && el2.blur) { + el2.blur(); } - scheduler2.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - scheduler2.$keyboardNavigation._pasteDate = this.start_date; - scheduler2.$keyboardNavigation._pasteSection = this.section; - }, blur: function() { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - scheduler2.$keyboardNavigation.marker.clear(); - }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, _getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, addMonthDate: function(date, dir, extend2) { - var res; - switch (dir) { - case "up": - res = scheduler2.date.add(date, -1, "week"); - break; - case "down": - res = scheduler2.date.add(date, 1, "week"); - break; - case "left": - res = scheduler2.date.day_start(scheduler2.date.add(date, -1, "day")); - res = this.findVisibleColumn(res, -1); - break; - case "right": - res = scheduler2.date.day_start(scheduler2.date.add(date, 1, "day")); - res = this.findVisibleColumn(res, 1); - break; - default: - res = scheduler2.date.day_start(new Date(date)); - break; + }, getInlineEditor: function(id2) { + var editor = scheduler2.$container.querySelector(".dhx_cal_editor[" + scheduler2.config.event_attribute + "='" + id2 + "'] textarea"); + if (editor && editor.offsetWidth) { + return editor; } - var state = scheduler2.getState(); - if (date.valueOf() < state.min_date.valueOf() || !extend2 && date.valueOf() >= state.max_date.valueOf()) { - res = new Date(state.min_date); + return null; + }, keyDownHandler: function(e) { + if (e.defaultPrevented) { + return; } - return res; - }, nextMonthSlot: function(slot, dir, extend2) { - var start, end; - start = this.addMonthDate(slot.start_date, dir, extend2); - start.setHours(scheduler2.config.first_hour); - end = new Date(start); - end.setHours(scheduler2.config.last_hour); - return { start_date: start, end_date: end }; - }, _alignTimeSlot: function(date, minDate, unit, step) { - var currentDate = new Date(minDate); - while (currentDate.valueOf() < date.valueOf()) { - currentDate = scheduler2.date.add(currentDate, step, unit); + var activeElement = this.getActiveNode(); + if (scheduler2.$keyboardNavigation.isModal() && !(activeElement && activeElement.container && scheduler2.utils.dom.locateCss({ target: activeElement.container }, "dhx_minical_popup", false))) + return; + if (scheduler2.getState().editor_id && this.getInlineEditor(scheduler2.getState().editor_id)) + return; + if (!this.isEnabled()) + return; + e = e || window.event; + var schedulerNode = this.globalNode; + var command = scheduler2.$keyboardNavigation.shortcuts.getCommandFromEvent(e); + if (!activeElement) { + this.setDefaultNode(); + } else if (activeElement.findHandler(command)) { + activeElement.doAction(command, e); + } else if (schedulerNode.findHandler(command)) { + schedulerNode.doAction(command, e); } - if (currentDate.valueOf() > date.valueOf()) { - currentDate = scheduler2.date.add(currentDate, -step, unit); + }, _timeout: null, delay: function(callback, delay2) { + clearTimeout(this._timeout); + this._timeout = setTimeout(callback, delay2 || 1); + } }; +} +function key_nav_legacy(scheduler2) { + scheduler2._temp_key_scope = function() { + scheduler2.config.key_nav = true; + scheduler2.$keyboardNavigation._pasteDate = null; + scheduler2.$keyboardNavigation._pasteSection = null; + var isCopy = null; + var pos = {}; + if (!document.body) { + scheduler2.event(window, "load", function() { + scheduler2.event(document.body, "mousemove", trackMousePosition); + }); + } else { + scheduler2.event(document.body, "mousemove", trackMousePosition); } - return currentDate; - }, nextTimelineSlot: function(slot, dir, extend2) { - var state = scheduler2.getState(); - var view = scheduler2.matrix[state.mode]; - var startDate = this._alignTimeSlot(slot.start_date, scheduler2.date[view.name + "_start"](new Date(slot.start_date)), view.x_unit, view.x_step); - var endDate = this._alignTimeSlot(slot.end_date, scheduler2.date[view.name + "_start"](new Date(slot.end_date)), view.x_unit, view.x_step); - if (endDate.valueOf() <= startDate.valueOf()) { - endDate = scheduler2.date.add(startDate, view.x_step, view.x_unit); + function trackMousePosition(event2) { + event2 = event2 || window.event; + pos.x = event2.clientX; + pos.y = event2.clientY; + } + function currentTarget() { + var mousePointer = false; + var keyNavPointer = false; + var target = document.elementFromPoint(pos.x, pos.y); + while (target && target != scheduler2._obj) { + target = target.parentNode; + } + mousePointer = !!(target == scheduler2._obj); + keyNavPointer = scheduler2.$keyboardNavigation.dispatcher.isEnabled(); + return mousePointer || keyNavPointer; } - var newPos = this.clone(slot); - newPos.start_date = startDate; - newPos.end_date = endDate; - newPos.section = slot.section || this._getNextSection(); - switch (dir) { - case "up": - newPos.section = this._getNextSection(slot.section, -1); - break; - case "down": - newPos.section = this._getNextSection(slot.section, 1); - break; - case "left": - newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, -view.x_step, view.x_unit), -1); - newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); - break; - case "right": - newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit), 1); - newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); - break; + scheduler2.attachEvent("onMouseMove", function(id2, e) { + var state = scheduler2.getState(); + if (!(state.mode && state.min_date)) { + return; + } + var position = scheduler2.getActionData(e); + scheduler2.$keyboardNavigation._pasteDate = position.date; + scheduler2.$keyboardNavigation._pasteSection = position.section; + }); + function clear_event_after(ev) { + delete ev.rec_type; + delete ev.rec_pattern; + delete ev.event_pid; + delete ev.event_length; } - if (newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()) { - if (extend2 && newPos.start_date.valueOf() >= state.max_date.valueOf()) { - newPos.start_date = new Date(state.max_date); - } else { - newPos.start_date = scheduler2.date[state.mode + "_start"](scheduler2.date.add(state.date, dir == "left" ? -1 : 1, state.mode)); - newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); + function copyEvent(ev) { + return scheduler2._lame_copy({}, ev); + } + scheduler2._make_pasted_event = function(ev) { + var date = scheduler2.$keyboardNavigation._pasteDate; + var section = scheduler2.$keyboardNavigation._pasteSection; + var event_duration = ev.end_date - ev.start_date; + var copy2 = copyEvent(ev); + clear_event_after(copy2); + copy2.start_date = new Date(date); + copy2.end_date = new Date(copy2.start_date.valueOf() + event_duration); + if (section) { + var property = scheduler2._get_section_property(); + if (scheduler2.config.multisection) + copy2[property] = ev[property]; + else + copy2[property] = section; + } + return copy2; + }; + scheduler2._do_paste = function(is_copy, modified_ev, original_ev) { + if (scheduler2.callEvent("onBeforeEventPasted", [is_copy, modified_ev, original_ev]) === false) { + return; + } + scheduler2.addEvent(modified_ev); + scheduler2.callEvent("onEventPasted", [is_copy, modified_ev, original_ev]); + }; + scheduler2._is_key_nav_active = function() { + if (this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav) { + return true; } + return false; + }; + function getSelectedEvent() { + var node = scheduler2.$keyboardNavigation.dispatcher.getActiveNode(); + if (node && node.eventId) + return node.eventId; + return scheduler2._select_id; } - return newPos; - }, nextUnitsSlot: function(slot, dir, extend2) { - var newPos = this.clone(slot); - newPos.section = slot.section || this._getNextSection(); - var section = slot.section || this._getNextSection(); - var state = scheduler2.getState(); - var view = scheduler2._props[state.mode]; - switch (dir) { - case "left": - section = this._getNextSection(slot.section, -1); - var optionsCount = view.size ? view.size - 1 : view.options.length; - if (view.days > 1 && view.order[section] == optionsCount - 1) { - if (scheduler2.date.add(slot.start_date, -1, "day").valueOf() >= state.min_date.valueOf()) { - newPos = this.nextDaySlot(slot, dir, extend2); - } + scheduler2.event(document, "keydown", function(e) { + if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && scheduler2._buffer_event && !scheduler2.$keyboardNavigation.dispatcher.isEnabled()) { + scheduler2.$keyboardNavigation.dispatcher.isActive = currentTarget(); + } + }); + scheduler2._key_nav_copy_paste = function(e) { + if (!scheduler2._is_key_nav_active()) + return true; + if (e.keyCode == 37 || e.keyCode == 39) { + e.cancelBubble = true; + var next = scheduler2.date.add(scheduler2._date, e.keyCode == 37 ? -1 : 1, scheduler2._mode); + scheduler2.setCurrentView(next); + return true; + } + var select_id = getSelectedEvent(); + if ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { + if (select_id) { + scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); + isCopy = true; + scheduler2.callEvent("onEventCopied", [scheduler2.getEvent(select_id)]); } - break; - case "right": - section = this._getNextSection(slot.section, 1); - if (view.days > 1 && !view.order[section]) { - if (scheduler2.date.add(slot.start_date, 1, "day").valueOf() < state.max_date.valueOf()) { - newPos = this.nextDaySlot(slot, dir, extend2); - } + return true; + } + if ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { + if (select_id) { + isCopy = false; + var ev = scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); + scheduler2.updateEvent(ev.id); + scheduler2.callEvent("onEventCut", [ev]); } - break; - default: - newPos = this.nextDaySlot(slot, dir, extend2); - section = slot.section; - break; - } - newPos.section = section; - return newPos; - }, _moveDate: function(oldDate, dir) { - var newDate = this.findVisibleColumn(scheduler2.date.add(oldDate, dir, "day"), dir); - newDate.setHours(oldDate.getHours()); - newDate.setMinutes(oldDate.getMinutes()); - return newDate; - }, isBeforeLastHour: function(date, isStartDate) { - var minutes = date.getMinutes(), hours = date.getHours(), last_hour = scheduler2.config.last_hour; - return hours < last_hour || !isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes); - }, isAfterFirstHour: function(date, isStartDate) { - var minutes = date.getMinutes(), hours = date.getHours(), first_hour = scheduler2.config.first_hour, last_hour = scheduler2.config.last_hour; - return hours >= first_hour || !isStartDate && (!minutes && (!hours && last_hour == 24 || hours == last_hour)); - }, isInVisibleDayTime: function(date, isStartDate) { - return this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate); - }, nextDaySlot: function(slot, dir, extend2) { - var start, end; - var key_nav_step = scheduler2.config.key_nav_step; - var date = this._alignTimeSlot(slot.start_date, scheduler2.date.day_start(new Date(slot.start_date)), "minute", key_nav_step); - var oldStart = slot.start_date; - switch (dir) { - case "up": - start = scheduler2.date.add(date, -key_nav_step, "minute"); - if (!this.isInVisibleDayTime(start, true)) { - if (!extend2 || this.isInVisibleDayTime(oldStart, true)) { - var toNextDay = true; - if (extend2 && scheduler2.date.date_part(new Date(start)).valueOf() != scheduler2.date.date_part(new Date(oldStart)).valueOf()) - toNextDay = false; - if (toNextDay) - start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, -1, "day"), -1); - start.setHours(scheduler2.config.last_hour); - start.setMinutes(0); - start = scheduler2.date.add(start, -key_nav_step, "minute"); + } + if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget()) { + var ev = scheduler2._buffer_event ? scheduler2.getEvent(scheduler2._buffer_event.id) : scheduler2._buffer_event; + ev = ev || scheduler2._buffer_event; + if (ev) { + var new_ev = scheduler2._make_pasted_event(ev); + if (isCopy) { + new_ev.id = scheduler2.uid(); + scheduler2._do_paste(isCopy, new_ev, ev); + } else { + var res = scheduler2.callEvent("onBeforeEventChanged", [new_ev, e, false, ev]); + if (res) { + scheduler2._do_paste(isCopy, new_ev, ev); + isCopy = true; + } } } - end = scheduler2.date.add(start, key_nav_step, "minute"); - break; - case "down": - start = scheduler2.date.add(date, key_nav_step, "minute"); - var testEnd = extend2 ? start : scheduler2.date.add(start, key_nav_step, "minute"); - if (!this.isInVisibleDayTime(testEnd, false)) { - if (!extend2 || this.isInVisibleDayTime(oldStart, false)) { - if (!extend2) { - start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); - start.setHours(scheduler2.config.first_hour); - start.setMinutes(0); - } else { - var toNextDay = true; - if (scheduler2.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) { - toNextDay = false; - } - if (toNextDay) { - start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); - } - start.setHours(scheduler2.config.first_hour); - start.setMinutes(0); - start = scheduler2.date.add(start, key_nav_step, "minute"); - } + return true; + } + }; + }; + scheduler2._temp_key_scope(); +} +function scheduler_handlers(scheduler2) { + scheduler2.$keyboardNavigation.attachSchedulerHandlers = function() { + var dispatcher = scheduler2.$keyboardNavigation.dispatcher; + var keyDownHandler = function(e) { + if (!scheduler2.config.key_nav) + return; + return dispatcher.keyDownHandler(e); + }; + var focusHandler = function() { + dispatcher.keepScrollPosition(function() { + dispatcher.focusGlobalNode(); + }); + }; + var waitCall; + scheduler2.attachEvent("onDataRender", function() { + if (!scheduler2.config.key_nav) + return; + if (!(dispatcher.isEnabled() && !scheduler2.getState().editor_id)) + return; + clearTimeout(waitCall); + waitCall = setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + if (!dispatcher.isEnabled()) + dispatcher.enable(); + reFocusActiveNode(); + }); + }); + var reFocusActiveNode = function() { + if (!dispatcher.isEnabled()) + return; + var activeNode = dispatcher.getActiveNode(); + if (!activeNode) + return; + if (!activeNode.isValid()) { + activeNode = activeNode.fallback(); + } + if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) + return; + dispatcher.keepScrollPosition(function() { + activeNode.focus(true); + }); + }; + scheduler2.attachEvent("onSchedulerReady", function() { + var container = scheduler2.$container; + scheduler2.eventRemove(document, "keydown", keyDownHandler); + scheduler2.eventRemove(container, "mousedown", mousedownHandler); + scheduler2.eventRemove(container, "focus", focusHandler); + if (scheduler2.config.key_nav) { + scheduler2.event(document, "keydown", keyDownHandler); + scheduler2.event(container, "mousedown", mousedownHandler); + scheduler2.event(container, "focus", focusHandler); + container.setAttribute("tabindex", "0"); + } else { + container.removeAttribute("tabindex"); + } + }); + function mousedownHandler(e) { + if (!scheduler2.config.key_nav) + return true; + const view = scheduler2.getView(); + let dataAreaClick = false; + if (scheduler2.getState().mode === "month") { + dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_cal_month_table")); + } else if (view && view.layout === "timeline") { + dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_timeline_data_col")); + } else { + const listOfScales = scheduler2.$container.querySelectorAll(".dhx_scale_holder"); + const arrOfScales = Array.from(listOfScales); + dataAreaClick = arrOfScales.some((scale) => scale === e.target.parentNode); + } + var pos = scheduler2.getActionData(e); + var focusNode; + if (scheduler2._locate_event(e.target || e.srcElement)) { + focusNode = new scheduler2.$keyboardNavigation.Event(scheduler2._locate_event(e.target || e.srcElement)); + } else if (dataAreaClick) { + focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); + if (pos.date && dataAreaClick) { + focusNode = focusNode.nextSlot(new scheduler2.$keyboardNavigation.TimeSlot(pos.date, null, pos.section)); + } + } + if (focusNode) { + if (!dispatcher.isEnabled()) { + dispatcher.activeNode = focusNode; + } else { + if (pos.date && dataAreaClick) { + dispatcher.delay(function() { + dispatcher.setActiveNode(focusNode); + }); } } - end = scheduler2.date.add(start, key_nav_step, "minute"); - break; - case "left": - start = this._moveDate(slot.start_date, -1); - end = this._moveDate(slot.end_date, -1); - break; - case "right": - start = this._moveDate(slot.start_date, 1); - end = this._moveDate(slot.end_date, 1); - break; - default: - start = date; - end = scheduler2.date.add(start, key_nav_step, "minute"); - break; - } - return { start_date: start, end_date: end }; - }, nextWeekAgendaSlot: function(slot, dir) { - var start, end; - var state = scheduler2.getState(); - switch (dir) { - case "down": - case "left": - start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, -1, "day")); - start = this.findVisibleColumn(start, -1); - break; - case "up": - case "right": - start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, 1, "day")); - start = this.findVisibleColumn(start, 1); - break; - default: - start = scheduler2.date.day_start(slot.start_date); - break; - } - if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { - start = new Date(state.min_date); - } - end = new Date(start); - end.setHours(scheduler2.config.last_hour); - return { start_date: start, end_date: end }; - }, nextAgendaSlot: function(slot, dir) { - return { start_date: slot.start_date, end_date: slot.end_date }; - }, isDateVisible: function(date) { - if (!scheduler2._ignores_detected) - return true; - var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; - var index; - if (timeline) { - index = scheduler2._get_date_index(timeline, date); - } else { - index = scheduler2.locate_holder_day(date); - } - return !scheduler2._ignores[index]; - }, findVisibleColumn: function(start, dir) { - var date = start; - dir = dir || 1; - var range = scheduler2.getState(); - while (!this.isDateVisible(date) && (dir > 0 && date.valueOf() <= range.max_date.valueOf() || dir < 0 && date.valueOf() >= range.min_date.valueOf())) { - date = this.nextDateColumn(date, dir); + } } - return date; - }, nextDateColumn: function(start, dir) { - dir = dir || 1; - var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; - var date; - if (timeline) { - date = scheduler2.date.add(start, dir * timeline.x_step, timeline.x_unit); - } else { - date = scheduler2.date.day_start(scheduler2.date.add(start, dir, "day")); + function focusEvent(evNode) { + if (!scheduler2.config.key_nav) + return; + if (!dispatcher.isEnabled()) + return; + var prevState = evNode; + var focusNode = new scheduler2.$keyboardNavigation.Event(prevState.eventId); + if (!focusNode.isValid()) { + var lastStart = focusNode.start || prevState.start; + var lastEnd = focusNode.end || prevState.end; + var lastSection = focusNode.section || prevState.section; + focusNode = new scheduler2.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection); + if (!focusNode.isValid()) { + focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); + } + } + dispatcher.setActiveNode(focusNode); + var node = dispatcher.getActiveNode(); + if (node && node.getNode && document.activeElement != node.getNode()) { + dispatcher.focusNode(dispatcher.getActiveNode()); + } } - return date; - }, isVisible: function(from, to) { - if (!scheduler2._ignores_detected) + var updateEvent = scheduler2.updateEvent; + scheduler2.updateEvent = function(id2) { + var res = updateEvent.apply(this, arguments); + if (scheduler2.config.key_nav && dispatcher.isEnabled()) { + if (scheduler2.getState().select_id == id2) { + var element = new scheduler2.$keyboardNavigation.Event(id2); + if (!scheduler2.getState().lightbox_id) { + focusEvent(element); + } + } + } + return res; + }; + scheduler2.attachEvent("onEventDeleted", function(id2) { + if (!scheduler2.config.key_nav) + return true; + if (dispatcher.isEnabled()) { + var activeNode = dispatcher.getActiveNode(); + if (activeNode.eventId == id2) { + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); + } + } return true; - var current = new Date(from); - while (current.valueOf() < to.valueOf()) { - if (this.isDateVisible(current)) + }); + scheduler2.attachEvent("onClearAll", function() { + if (!scheduler2.config.key_nav) + return true; + if (dispatcher.isEnabled()) { + if (dispatcher.getActiveNode() instanceof scheduler2.$keyboardNavigation.Event) { + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); + } + } + }); + }; +} +function minical_handlers(scheduler2) { + scheduler2.$keyboardNavigation._minicalendars = []; + scheduler2.$keyboardNavigation.isMinical = function(node) { + var minicalendars = scheduler2.$keyboardNavigation._minicalendars; + for (var i = 0; i < minicalendars.length; i++) { + if (this.isChildOf(node, minicalendars[i])) return true; - current = this.nextDateColumn(current); } return false; - }, nextSlot: function(slot, dir, view, extend2) { - var next; - view = view || this._getMode(); - var tempSlot = scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); - switch (view) { - case this._modes.units: - next = this.nextUnitsSlot(tempSlot, dir, extend2); - break; - case this._modes.timeline: - next = this.nextTimelineSlot(tempSlot, dir, extend2); - break; - case this._modes.year: - next = this.nextMonthSlot(tempSlot, dir, extend2); - break; - case this._modes.month: - next = this.nextMonthSlot(tempSlot, dir, extend2); - break; - case this._modes.weekAgenda: - next = this.nextWeekAgendaSlot(tempSlot, dir, extend2); - break; - case this._modes.list: - next = this.nextAgendaSlot(tempSlot, dir, extend2); - break; - case this._modes.dayColumns: - next = this.nextDaySlot(tempSlot, dir, extend2); - break; + }; + scheduler2.$keyboardNavigation.isChildOf = function(child, parent) { + while (child && child !== parent) { + child = child.parentNode; } - if (next.start_date.valueOf() >= next.end_date.valueOf()) { - next = this.nextSlot(next, dir, view); + return !!(child === parent); + }; + scheduler2.$keyboardNavigation.patchMinicalendar = function() { + var dispatcher = scheduler2.$keyboardNavigation.dispatcher; + function focusMinical(e) { + var target = e.target; + dispatcher.enable(); + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(target, 0)); + } + function minicalClick(e) { + var target = e.target || e.srcElement; + var prev = scheduler2.utils.dom.locateCss(e, "dhx_cal_prev_button", false); + var next = scheduler2.utils.dom.locateCss(e, "dhx_cal_next_button", false); + var cell = scheduler2.utils.dom.locateCss(e, "dhx_year_body", false); + var rowIndex = 0; + var cellIndex = 0; + if (cell) { + var tr2; + var td; + var current = target; + while (current && current.tagName.toLowerCase() != "td") { + current = current.parentNode; + } + if (current) { + td = current; + tr2 = td.parentNode; + } + if (tr2 && td) { + var rows = tr2.parentNode.querySelectorAll("tr"); + for (var i = 0; i < rows.length; i++) { + if (rows[i] == tr2) { + rowIndex = i; + break; + } + } + var cells = tr2.querySelectorAll("td"); + for (var i = 0; i < cells.length; i++) { + if (cells[i] == td) { + cellIndex = i; + break; + } + } + } + } + var root = e.currentTarget; + dispatcher.delay(function() { + if (prev || next || cell) { + var element; + if (prev) { + element = new scheduler2.$keyboardNavigation.MinicalButton(root, 0); + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(root, 0)); + } else if (next) { + element = new scheduler2.$keyboardNavigation.MinicalButton(root, 1); + } else if (cell) { + element = new scheduler2.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex); + } + if (element) { + dispatcher.enable(); + if (element.isValid()) { + dispatcher.activeNode = null; + dispatcher.setActiveNode(element); + } + } + } + }); } - return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); - }, extendSlot: function(slot, dir) { - var view = this._getMode(); - var next; - switch (view) { - case this._modes.units: - if (dir == "left" || dir == "right") { - next = this.nextUnitsSlot(slot, dir); - } else { - next = this.extendUnitsSlot(slot, dir); + if (scheduler2.renderCalendar) { + var renderMinical = scheduler2.renderCalendar; + scheduler2.renderCalendar = function() { + var cal = renderMinical.apply(this, arguments); + var minicalendars = scheduler2.$keyboardNavigation._minicalendars; + scheduler2.eventRemove(cal, "click", minicalClick); + scheduler2.event(cal, "click", minicalClick); + scheduler2.eventRemove(cal, "focus", focusMinical); + scheduler2.event(cal, "focus", focusMinical); + var added = false; + for (var i = 0; i < minicalendars.length; i++) { + if (minicalendars[i] == cal) { + added = true; + break; + } } - break; - case this._modes.timeline: - if (dir == "down" || dir == "up") { - next = this.nextTimelineSlot(slot, dir); + if (!added) + minicalendars.push(cal); + if (dispatcher.isEnabled()) { + var node = dispatcher.getActiveNode(); + if (node && node.container == cal) { + dispatcher.focusNode(node); + } else { + cal.setAttribute("tabindex", "0"); + } } else { - next = this.extendTimelineSlot(slot, dir); + cal.setAttribute("tabindex", "0"); } - break; - case this._modes.year: - next = this.extendMonthSlot(slot, dir); - break; - case this._modes.month: - next = this.extendMonthSlot(slot, dir); - break; - case this._modes.dayColumns: - next = this.extendDaySlot(slot, dir); - break; - case this._modes.weekAgenda: - next = this.extendWeekAgendaSlot(slot, dir); - break; - default: - next = slot; - break; - } - var range = scheduler2.getState(); - if (next.start_date.valueOf() < range.min_date.valueOf()) { - next.start_date = this.findVisibleColumn(range.min_date); - next.start_date.setHours(scheduler2.config.first_hour); - } - if (next.end_date.valueOf() > range.max_date.valueOf()) { - next.end_date = this.findVisibleColumn(range.max_date, -1); + return cal; + }; } - return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); - }, extendTimelineSlot: function(slot, direction) { - return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "timeline"); - }, extendWeekAgendaSlot: function(slot, direction) { - return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "weekAgenda"); - }, extendGenericSlot: function(allowedDirections, slot, direction, type) { - var next; - var moveDate = slot.movingDate; - if (!moveDate) { - moveDate = allowedDirections[direction]; + if (scheduler2.destroyCalendar) { + var destroyMinical = scheduler2.destroyCalendar; + scheduler2.destroyCalendar = function(cal, force) { + cal = cal || (scheduler2._def_count ? scheduler2._def_count.firstChild : null); + var res = destroyMinical.apply(this, arguments); + if (!cal || !cal.parentNode) { + var minicalendars = scheduler2.$keyboardNavigation._minicalendars; + for (var i = 0; i < minicalendars.length; i++) { + if (minicalendars[i] == cal) { + scheduler2.eventRemove(minicalendars[i], "focus", focusMinical); + minicalendars.splice(i, 1); + i--; + } + } + } + return res; + }; } - if (!moveDate || !allowedDirections[direction]) { - return slot; + }; +} +function key_nav(scheduler2) { + scheduler2.config.key_nav = true; + scheduler2.config.key_nav_step = 30; + scheduler2.addShortcut = function(shortcut, handler, scope) { + var scopeObject = getScope(scope); + if (scopeObject) { + scopeObject.prototype.bind(shortcut, handler); } - if (direction) { - next = this.nextSlot({ start_date: slot[moveDate], section: slot.section }, direction, type, true); - if (next.start_date.valueOf() == slot.start_date.valueOf()) { - next = this.nextSlot({ start_date: next.start_date, section: next.section }, direction, type, true); + }; + scheduler2.getShortcutHandler = function(shortcut, scope) { + var scopeObject = getScope(scope); + if (scopeObject) { + var commands = scheduler2.$keyboardNavigation.shortcuts.parse(shortcut); + if (commands.length) { + return scopeObject.prototype.findHandler(commands[0]); } - next.movingDate = moveDate; - } else { - return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); - } - var newDates = this.extendSlotDates(slot, next, next.movingDate); - if (newDates.end_date.valueOf() <= newDates.start_date.valueOf()) { - next.movingDate = next.movingDate == "end_date" ? "start_date" : "end_date"; - } - newDates = this.extendSlotDates(slot, next, next.movingDate); - next.start_date = newDates.start_date; - next.end_date = newDates.end_date; - return next; - }, extendSlotDates: function(oldSlot, newSlot, dateDirection) { - var res = { start_date: null, end_date: null }; - if (dateDirection == "start_date") { - res.start_date = newSlot.start_date; - res.end_date = oldSlot.end_date; - } else { - res.start_date = oldSlot.start_date; - res.end_date = newSlot.start_date; - } - return res; - }, extendMonthSlot: function(slot, direction) { - var slot = this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "month"); - slot.start_date.setHours(scheduler2.config.first_hour); - slot.end_date = scheduler2.date.add(slot.end_date, -1, "day"); - slot.end_date.setHours(scheduler2.config.last_hour); - return slot; - }, extendUnitsSlot: function(slot, direction) { - var next; - switch (direction) { - case "down": - case "up": - next = this.extendDaySlot(slot, direction); - break; - default: - next = slot; - break; - } - next.section = slot.section; - return next; - }, extendDaySlot: function(slot, direction) { - return this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "dayColumns"); - }, scrollSlot: function(dir) { - var state = scheduler2.getState(); - var slot = this.nextSlot(this, dir); - if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { - scheduler2.setCurrentView(new Date(slot.start_date)); - } - this.moveTo(slot); - }, keys: { left: function() { - this.scrollSlot("left"); - }, right: function() { - this.scrollSlot("right"); - }, down: function() { - var mode = this._getMode(); - if (mode == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); - } else { - this.scrollSlot("down"); - } - }, up: function() { - var mode = this._getMode(); - if (mode == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); - } else { - this.scrollSlot("up"); } - }, "shift+down": function() { - this.moveTo(this.extendSlot(this, "down")); - }, "shift+up": function() { - this.moveTo(this.extendSlot(this, "up")); - }, "shift+right": function() { - this.moveTo(this.extendSlot(this, "right")); - }, "shift+left": function() { - this.moveTo(this.extendSlot(this, "left")); - }, enter: function() { - var obj = { start_date: new Date(this.start_date), end_date: new Date(this.end_date) }; - var mode = scheduler2.getState().mode; - if (scheduler2.matrix && scheduler2.matrix[mode]) { - var timeline = scheduler2.matrix[scheduler2.getState().mode]; - obj[timeline.y_property] = this.section; - } else if (scheduler2._props && scheduler2._props[mode]) { - var unit = scheduler2._props[mode]; - obj[unit.map_to] = this.section; + }; + scheduler2.removeShortcut = function(shortcut, scope) { + var scopeObject = getScope(scope); + if (scopeObject) { + scopeObject.prototype.unbind(shortcut); } - scheduler2.addEventNow(obj); - } } }); - scheduler2.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler2.$keyboardNavigation.TimeSlot.prototype.keys); -} -function minical_button(scheduler2) { - scheduler2.$keyboardNavigation.MinicalButton = function(div, index) { - this.container = div; - this.index = index || 0; }; - scheduler2.$keyboardNavigation.MinicalButton.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { - var container = this.container; - return !!container.offsetWidth; - }, fallback: function() { - var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); - if (defaultSlot.isValid()) { - return defaultSlot; - } else { - return new scheduler2.$keyboardNavigation.DataArea(); + scheduler2.focus = function() { + if (!scheduler2.config.key_nav) { + return; } - }, focus: function() { - scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); - this.container.removeAttribute("tabindex"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }, blur: function() { - this.container.setAttribute("tabindex", "0"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - }, getNode: function() { - if (!this.index) { - return this.container.querySelector(".dhx_cal_prev_button"); + var disp = scheduler2.$keyboardNavigation.dispatcher; + disp.enable(); + var activeNode = disp.getActiveNode(); + if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) { + disp.setDefaultNode(); } else { - return this.container.querySelector(".dhx_cal_next_button"); - } - }, keys: { right: function(e) { - this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); - }, left: function(e) { - this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); - }, down: function() { - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, 0, 0); - if (next && !next.isValid()) { - next = next.fallback(); + disp.focusNode(disp.getActiveNode()); } - this.moveTo(next); - }, enter: function(e) { - this.getNode().click(); - } } }); - scheduler2.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalButton.prototype.keys); -} -function minical_cell(scheduler2) { - scheduler2.$keyboardNavigation.MinicalCell = function(div, row, col) { - this.container = div; - this.row = row || 0; - this.col = col || 0; }; - scheduler2.$keyboardNavigation.MinicalCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { - var grid = this._getGrid(); - return !!(grid[this.row] && grid[this.row][this.col]); - }, fallback: function() { - var row = this.row; - var col = this.col; - var grid = this._getGrid(); - if (!grid[row]) { - row = 0; + function getScope(mode) { + var scopes = { minicalButton: scheduler2.$keyboardNavigation.MinicalButton, minicalDate: scheduler2.$keyboardNavigation.MinicalCell, scheduler: scheduler2.$keyboardNavigation.SchedulerNode, dataArea: scheduler2.$keyboardNavigation.DataArea, timeSlot: scheduler2.$keyboardNavigation.TimeSlot, event: scheduler2.$keyboardNavigation.Event }; + var searchMap = {}; + for (var i in scopes) + searchMap[i.toLowerCase()] = scopes[i]; + mode = (mode + "").toLowerCase(); + return searchMap[mode] || scopes.scheduler; + } + scheduler2.$keyboardNavigation = {}; + scheduler2._compose = function() { + var parts = Array.prototype.slice.call(arguments, 0); + var res = {}; + for (var i = 0; i < parts.length; i++) { + var obj = parts[i]; + if (typeof obj == "function") { + obj = new obj(); + } + for (var p in obj) { + res[p] = obj[p]; + } } - var dir = true; - if (row > grid.length / 2) { - dir = false; + return res; + }; + keyboard_shortcuts(scheduler2); + eventhandler(scheduler2); + trap_modal_focus(scheduler2); + marker(scheduler2); + scheduler_node(scheduler2); + nav_node(scheduler2); + header_cell(scheduler2); + event(scheduler2); + time_slot(scheduler2); + minical_button(scheduler2); + minical_cell(scheduler2); + data_area(scheduler2); + modals(scheduler2); + core(scheduler2); + key_nav_legacy(scheduler2); + (function() { + scheduler_handlers(scheduler2); + minical_handlers(scheduler2); + var dispatcher = scheduler2.$keyboardNavigation.dispatcher; + scheduler2.$keyboardNavigation.attachSchedulerHandlers(); + if (scheduler2.renderCalendar) { + scheduler2.$keyboardNavigation.patchMinicalendar(); + } else { + var attachOnce = scheduler2.attachEvent("onSchedulerReady", function() { + scheduler2.detachEvent(attachOnce); + scheduler2.$keyboardNavigation.patchMinicalendar(); + }); } - if (!grid[row]) { - var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); - if (defaultSlot.isValid()) { - return defaultSlot; + function isSchedulerSelected() { + if (!scheduler2.config.key_nav) + return; + var enable; + var focusElement = document.activeElement; + if (!focusElement || scheduler2.utils.dom.locateCss(focusElement, "dhx_cal_quick_info", false)) { + enable = false; } else { - return new scheduler2.$keyboardNavigation.DataArea(); + enable = scheduler2.$keyboardNavigation.isChildOf(focusElement, scheduler2.$container) || scheduler2.$keyboardNavigation.isMinical(focusElement); + } + return enable; + } + function changeState(enable) { + if (enable && !dispatcher.isEnabled()) { + dispatcher.enable(); + } else if (!enable && dispatcher.isEnabled()) { + dispatcher.disable(); + } + } + const intervalId = setInterval(function() { + if (!scheduler2.$container || !scheduler2.$keyboardNavigation.isChildOf(scheduler2.$container, document.body)) { + return; + } + var enable = isSchedulerSelected(); + if (enable) { + changeState(enable); + } else if (!enable && dispatcher.isEnabled()) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return; + } + if (scheduler2.config.key_nav) { + changeState(isSchedulerSelected()); + } else { + scheduler2.$container.removeAttribute("tabindex"); + } + }, 100); + } + }, 500); + scheduler2.attachEvent("onDestroy", function() { + clearInterval(intervalId); + }); + })(); +} +function layer(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + this.layers.sort(function(a, b) { + return a.zIndex - b.zIndex; + }); + scheduler2._dp_init = function(dp) { + dp._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"]; + this.attachEvent("onEventAdded", function(id2) { + if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) + dp.setUpdated(id2, true, "inserted"); + }); + this.attachEvent("onBeforeEventDelete", function(id2) { + if (this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) { + if (!this.validId(id2)) + return; + var z = dp.getState(id2); + if (z == "inserted" || this._new_event) { + dp.setUpdated(id2, false); + return true; + } + if (z == "deleted") + return false; + if (z == "true_deleted") + return true; + dp.setUpdated(id2, true, "deleted"); + return false; + } else + return true; + }); + this.attachEvent("onEventChanged", function(id2) { + if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) + dp.setUpdated(id2, true, "updated"); + }); + dp._getRowData = function(id2, pref) { + var ev = this.obj.getEvent(id2); + var data = {}; + for (var a in ev) { + if (a.indexOf("_") === 0) + continue; + if (ev[a] && ev[a].getUTCFullYear) + data[a] = this.obj._helpers.formatDate(ev[a]); + else + data[a] = ev[a]; + } + return data; + }; + dp._clearUpdateFlag = function() { + }; + dp.attachEvent("insertCallback", scheduler2._update_callback); + dp.attachEvent("updateCallback", scheduler2._update_callback); + dp.attachEvent("deleteCallback", function(upd, id2) { + this.obj.setUserData(id2, this.action_param, "true_deleted"); + this.obj.deleteEvent(id2); + }); + }; + (function() { + var _cloneObj = function(obj) { + if (obj === null || typeof obj != "object") + return obj; + var temp = new obj.constructor(); + for (var key in obj) + temp[key] = _cloneObj(obj[key]); + return temp; + }; + scheduler2._dataprocessors = []; + scheduler2._layers_zindex = {}; + for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { + scheduler2.config["lightbox_" + scheduler2.layers[i2].name] = {}; + scheduler2.config["lightbox_" + scheduler2.layers[i2].name].sections = _cloneObj(scheduler2.config.lightbox.sections); + scheduler2._layers_zindex[scheduler2.layers[i2].name] = scheduler2.config.initial_layer_zindex || 5 + i2 * 3; + if (scheduler2.layers[i2].url) { + var dp = scheduler2.createDataProcessor({ url: scheduler2.layers[i2].url }); + dp.layer = scheduler2.layers[i2].name; + scheduler2._dataprocessors.push(dp); + scheduler2._dataprocessors[i2].init(scheduler2); + } + if (scheduler2.layers[i2].isDefault) + scheduler2.defaultLayer = scheduler2.layers[i2].name; + } + })(); + scheduler2.showLayer = function(tlayer) { + this.toggleLayer(tlayer, true); + }; + scheduler2.hideLayer = function(tlayer) { + this.toggleLayer(tlayer, false); + }; + scheduler2.toggleLayer = function(tlayer, visible) { + var layer2 = this.getLayer(tlayer); + if (typeof visible != "undefined") + layer2.visible = !!visible; + else + layer2.visible = !layer2.visible; + this.setCurrentView(this._date, this._mode); + }; + scheduler2.getLayer = function(tlayer) { + var layer2, layer_name; + if (typeof tlayer == "string") + layer_name = tlayer; + if (typeof tlayer == "object") + layer_name = tlayer.layer; + for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { + if (scheduler2.layers[i2].name == layer_name) + layer2 = scheduler2.layers[i2]; + } + return layer2; + }; + scheduler2.attachEvent("onBeforeLightbox", function(event_id) { + var ev = this.getEvent(event_id); + this.config.lightbox.sections = this.config["lightbox_" + ev.layer].sections; + scheduler2.resetLightbox(); + return true; + }); + scheduler2.attachEvent("onClick", function(event_id, native_event_object) { + var ev = scheduler2.getEvent(event_id); + return !scheduler2.getLayer(ev.layer).noMenu; + }); + scheduler2.attachEvent("onEventCollision", function(ev, evs) { + var layer2 = this.getLayer(ev); + if (!layer2.checkCollision) + return false; + var count = 0; + for (var i2 = 0; i2 < evs.length; i2++) { + if (evs[i2].layer == layer2.name && evs[i2].id != ev.id) + count++; + } + return count >= scheduler2.config.collision_limit; + }); + scheduler2.addEvent = function(start_date, end_date, text, id2, extra_data) { + var ev = start_date; + if (arguments.length != 1) { + ev = extra_data || {}; + ev.start_date = start_date; + ev.end_date = end_date; + ev.text = text; + ev.id = id2; + ev.layer = this.defaultLayer; } + ev.id = ev.id || scheduler2.uid(); + ev.text = ev.text || ""; + if (typeof ev.start_date == "string") + ev.start_date = this.templates.api_date(ev.start_date); + if (typeof ev.end_date == "string") + ev.end_date = this.templates.api_date(ev.end_date); + ev._timed = this.isOneDayEvent(ev); + var is_new = !this._events[ev.id]; + this._events[ev.id] = ev; + this.event_updated(ev); + if (!this._loading) + this.callEvent(is_new ? "onEventAdded" : "onEventChanged", [ev.id, ev]); + }; + this._evs_layer = {}; + for (var i = 0; i < this.layers.length; i++) { + this._evs_layer[this.layers[i].name] = []; } - if (dir) { - for (var c = col; grid[row] && c < grid[row].length; c++) { - if (!grid[row][c] && c == grid[row].length - 1) { - row++; - col = 0; - } - if (grid[row][c]) { - return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); - } + scheduler2.addEventNow = function(start, end, e) { + var base = {}; + if (typeof start == "object") { + base = start; + start = null; } - } else { - for (var c = col; grid[row] && c < grid[row].length; c--) { - if (!grid[row][c] && !c) { - row--; - col = grid[row].length - 1; - } - if (grid[row][c]) { - return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); + var d = (this.config.event_duration || this.config.time_step) * 6e4; + if (!start) + start = Math.round(scheduler2._currentDate().valueOf() / d) * d; + var start_date = new Date(start); + if (!end) { + var start_hour = this.config.first_hour; + if (start_hour > start_date.getHours()) { + start_date.setHours(start_hour); + start = start_date.valueOf(); } + end = start + d; } - } - return new scheduler2.$keyboardNavigation.MinicalButton(this.container, 0); - }, focus: function() { - scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); - this.container.removeAttribute("tabindex"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }, blur: function() { - this.container.setAttribute("tabindex", "0"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - }, _getNode: function(row, col) { - return this.container.querySelector(".dhx_year_body tr:nth-child(" + (row + 1) + ") td:nth-child(" + (col + 1) + ")"); - }, getNode: function() { - return this._getNode(this.row, this.col); - }, _getGrid: function() { - var rows = this.container.querySelectorAll(".dhx_year_body tr"); - var grid = []; - for (var i = 0; i < rows.length; i++) { - grid[i] = []; - var row = rows[i]; - var cells = row.querySelectorAll("td"); - for (var c = 0; c < cells.length; c++) { - var cell = cells[c]; - var enabled = true; - var css = scheduler2._getClassName(cell); - if (css.indexOf("dhx_after") > -1 || css.indexOf("dhx_before") > -1 || css.indexOf("dhx_scale_ignore") > -1) { - enabled = false; + base.start_date = base.start_date || start_date; + base.end_date = base.end_date || new Date(end); + base.text = base.text || this.locale.labels.new_event; + base.id = this._drag_id = this.uid(); + base.layer = this.defaultLayer; + this._drag_mode = "new-size"; + this._loading = true; + this.addEvent(base); + this.callEvent("onEventCreated", [this._drag_id, e]); + this._loading = false; + this._drag_event = {}; + this._on_mouse_up(e); + }; + scheduler2._t_render_view_data = function(events) { + if (this.config.multi_day && !this._table_view) { + var tvs = []; + var tvd = []; + for (var k = 0; k < events.length; k++) { + if (events[k]._timed) + tvs.push(events[k]); + else + tvd.push(events[k]); } - grid[i][c] = enabled; + this._table_view = true; + this.render_data(tvd); + this._table_view = false; + this.render_data(tvs); + } else + this.render_data(events); + }; + scheduler2.render_view_data = function() { + if (this._not_render) { + this._render_wait = true; + return; } - } - return grid; - }, keys: { right: function(e) { - var grid = this._getGrid(); - var newRow = this.row; - var newCol = this.col + 1; - if (!grid[newRow] || !grid[newRow][newCol]) { - if (grid[newRow + 1]) { - newRow = newRow + 1; - newCol = 0; - } else { - newCol = this.col; + this._render_wait = false; + this.clear_view(); + this._evs_layer = {}; + for (var i2 = 0; i2 < this.layers.length; i2++) { + this._evs_layer[this.layers[i2].name] = []; } - } - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); - } - this.moveTo(next); - }, left: function(e) { - var grid = this._getGrid(); - var newRow = this.row; - var newCol = this.col - 1; - if (!grid[newRow] || !grid[newRow][newCol]) { - if (grid[newRow - 1]) { - newRow = newRow - 1; - newCol = grid[newRow].length - 1; + var evs = this.get_visible_events(); + for (var i2 = 0; i2 < evs.length; i2++) { + if (this._evs_layer[evs[i2].layer]) + this._evs_layer[evs[i2].layer].push(evs[i2]); + } + if (this._mode == "month") { + var tevs = []; + for (var i2 = 0; i2 < this.layers.length; i2++) { + if (this.layers[i2].visible) + tevs = tevs.concat(this._evs_layer[this.layers[i2].name]); + } + this._t_render_view_data(tevs); } else { - newCol = this.col; + for (var i2 = 0; i2 < this.layers.length; i2++) { + if (this.layers[i2].visible) { + var evs_layer = this._evs_layer[this.layers[i2].name]; + this._t_render_view_data(evs_layer); + } + } } - } - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); - } - this.moveTo(next); - }, down: function() { - var grid = this._getGrid(); - var newRow = this.row + 1; - var newCol = this.col; - if (!grid[newRow] || !grid[newRow][newCol]) { - newRow = this.row; - } - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); - } - this.moveTo(next); - }, up: function() { - var grid = this._getGrid(); - var newRow = this.row - 1; - var newCol = this.col; - if (!grid[newRow] || !grid[newRow][newCol]) { - var index = 0; - if (this.col > grid[this.row].length / 2) { - index = 1; + }; + scheduler2._render_v_bar = function(ev, x, y, w, h, style, contentA, contentB, bottom) { + var id2 = ev.id; + if (contentA.indexOf("
'; + html += '
 
'; + html += '
' + contentA + "
"; + html += '
' + contentB + "
"; + html += '
'; + d.innerHTML = html; + d.style.zIndex = 100; + return d.firstChild; + }; + scheduler2.render_event_bar = function(ev) { + var parent = this._els["dhx_cal_data"][0]; + var x = this._colsS[ev._sday]; + var x2 = this._colsS[ev._eday]; + if (x2 == x) + x2 = this._colsS[ev._eday + 1]; + var hb = this.xy.bar_height; + var y = this._colsS.heights[ev._sweek] + (this._colsS.height ? this.xy.month_scale_height + 2 : 2) + ev._sorder * hb; + var d = document.createElement("div"); + var cs2 = ev._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line"; + var cse = scheduler2.templates["event_class_" + ev.layer] ? scheduler2.templates["event_class_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); + if (cse) + cs2 = cs2 + " " + cse; + var html = '
'; + if (ev._timed) + html += scheduler2.templates["event_bar_date_" + ev.layer] ? scheduler2.templates["event_bar_date_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_date(ev.start_date, ev.end_date, ev); + html += scheduler2.templates["event_bar_text_" + ev.layer] ? scheduler2.templates["event_bar_text_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_text(ev.start_date, ev.end_date, ev) + "
)"; + html += "
"; + d.innerHTML = html; + this._rendered.push(d.firstChild); + parent.appendChild(d.firstChild); + }; + scheduler2.render_event = function(ev) { + var menu = scheduler2.xy.menu_width; + if (scheduler2.getLayer(ev.layer).noMenu) + menu = 0; + if (ev._sday < 0) + return; + var parent = scheduler2.locate_holder(ev._sday); + if (!parent) + return; + var sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes(); + var em = ev.end_date.getHours() * 60 + ev.end_date.getMinutes() || scheduler2.config.last_hour * 60; + var top = Math.round((sm * 60 * 1e3 - this.config.first_hour * 60 * 60 * 1e3) * this.config.hour_size_px / (60 * 60 * 1e3)) % (this.config.hour_size_px * 24) + 1; + var height = Math.max(scheduler2.xy.min_event_height, (em - sm) * this.config.hour_size_px / 60) + 1; + var width = Math.floor((parent.clientWidth - menu) / ev._count); + var left = ev._sorder * width + 1; + if (!ev._inner) + width = width * (ev._count - ev._sorder); + var d = this._render_v_bar(ev.id, menu + left, top, width, height, ev._text_style, scheduler2.templates.event_header(ev.start_date, ev.end_date, ev), scheduler2.templates.event_text(ev.start_date, ev.end_date, ev)); + this._rendered.push(d); + parent.appendChild(d); + left = left + parseInt(parent.style.left, 10) + menu; + top += this._dy_shift; + d.style.zIndex = this._layers_zindex[ev.layer]; + if (this._edit_id == ev.id) { + d.style.zIndex = parseInt(d.style.zIndex) + 1; + var new_zIndex = d.style.zIndex; + width = Math.max(width - 4, scheduler2.xy.editor_width); + var d = document.createElement("div"); + d.setAttribute("event_id", ev.id); + d.setAttribute(this.config.event_attribute, ev.id); + this.set_xy(d, width, height - 20, left, top + 14); + d.className = "dhx_cal_editor"; + d.style.zIndex = new_zIndex; + var d2 = document.createElement("div"); + this.set_xy(d2, width - 6, height - 26); + d2.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;"; + d2.style.zIndex = new_zIndex; + d.appendChild(d2); + this._els["dhx_cal_data"][0].appendChild(d); + this._rendered.push(d); + d2.innerHTML = ""; + this._editor = d2.firstChild; + this._editor.addEventListener("keypress", function(e) { + if (e.shiftKey) + return true; + var code = e.keyCode; + if (code == scheduler2.keys.edit_save) + scheduler2.editStop(true); + if (code == scheduler2.keys.edit_cancel) + scheduler2.editStop(false); + }); + this._editor.addEventListener("selectstart", function(e) { + e.cancelBubble = true; + return true; + }); + d2.firstChild.focus(); + this._els["dhx_cal_data"][0].scrollLeft = 0; + d2.firstChild.select(); } - this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, index)); - } else { - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); + if (this._select_id == ev.id) { + d.style.zIndex = parseInt(d.style.zIndex) + 1; + var icons = this.config["icons_" + (this._edit_id == ev.id ? "edit" : "select")]; + var icons_str = ""; + for (var i2 = 0; i2 < icons.length; i2++) + icons_str += "
"; + var obj = this._render_v_bar(ev.id, left - menu + 1, top, menu, icons.length * 20 + 26, "", "
", icons_str, true); + obj.style.left = left - menu + 1; + obj.style.zIndex = d.style.zIndex; + this._els["dhx_cal_data"][0].appendChild(obj); + this._rendered.push(obj); } - this.moveTo(next); - } - }, enter: function(e) { - this.getNode().querySelector(".dhx_month_head").click(); - } } }); - scheduler2.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalCell.prototype.keys); -} -function data_area(scheduler2) { - scheduler2.$keyboardNavigation.DataArea = function(index) { - this.index = index || 0; - }; - scheduler2.$keyboardNavigation.DataArea.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { - return scheduler2.$container.querySelector(".dhx_cal_data"); - }, _handlers: null, isValid: function() { - return true; - }, fallback: function() { - return this; - }, keys: { "up,down,right,left": function() { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); - } } }); - scheduler2.$keyboardNavigation.DataArea.prototype.bindAll(scheduler2.$keyboardNavigation.DataArea.prototype.keys); + }; + scheduler2.filter_agenda = function(id2, event2) { + var layer2 = scheduler2.getLayer(event2.layer); + return layer2 && layer2.visible; + }; + }); } -function modals(scheduler2) { - (function() { - var modalsStack = []; - function isModal() { - return !!modalsStack.length; - } - function isChildOf(child, parent) { - while (child && child != parent) { - child = child.parentNode; +function limit(scheduler2) { + scheduler2.config.limit_start = null; + scheduler2.config.limit_end = null; + scheduler2.config.limit_view = false; + scheduler2.config.check_limits = true; + scheduler2._temp_limit_scope = function() { + var before = null; + var dhx_time_block = "dhx_time_block"; + scheduler2.attachEvent("onBeforeViewChange", function(om, od, nm, nd) { + function isBlocked(date, mode) { + var limit_start = scheduler2.config.limit_start, limit_end = scheduler2.config.limit_end, date_end = scheduler2.date.add(date, 1, mode); + return date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf(); } - return !!(child == parent); - } - function afterPopup(box) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - if (!isModal() && !isChildOf(document.activeElement, scheduler2.$container)) { - scheduler2.focus(); + if (scheduler2.config.limit_view) { + nd = nd || od; + nm = nm || om; + if (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + var resetDate = !isBlocked(od, nm) ? od : scheduler2.config.limit_start; + scheduler2.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm); + }, 1); + return false; } - }, 1); - } - function startModal(box) { - scheduler2.eventRemove(box, "keydown", trapFocus); - scheduler2.event(box, "keydown", trapFocus); - modalsStack.push(box); - } - function endModal() { - var box = modalsStack.pop(); - if (box) { - scheduler2.eventRemove(box, "keydown", trapFocus); } - afterPopup(); - } - function isTopModal(box) { - return box == modalsStack[modalsStack.length - 1]; - } - function trapFocus(event2) { - var event2 = event2 || window.event; - var target = event2.currentTarget; - if (!isTopModal(target)) - return; - scheduler2.$keyboardNavigation.trapFocus(target, event2); - } - function traceLightbox() { - startModal(scheduler2.getLightbox()); - } - scheduler2.attachEvent("onLightbox", traceLightbox); - scheduler2.attachEvent("onAfterLightbox", endModal); - scheduler2.attachEvent("onAfterQuickInfo", function() { - afterPopup(); + return true; }); - if (!scheduler2._keyNavMessagePopup) { - scheduler2._keyNavMessagePopup = true; - var focusElement = null; - var backupFocus = null; - const modalsStack2 = []; - scheduler2.attachEvent("onMessagePopup", function(box) { - focusElement = document.activeElement; - backupFocus = focusElement; - while (backupFocus && scheduler2._getClassName(backupFocus).indexOf("dhx_cal_data") < 0) { - backupFocus = backupFocus.parentNode; + scheduler2.attachEvent("onMouseDown", function(classname) { + return !(classname == dhx_time_block); + }); + scheduler2.attachEvent("onBeforeDrag", function(id2) { + if (!id2) + return true; + return scheduler2.checkLimitViolation(scheduler2.getEvent(id2)); + }); + scheduler2.attachEvent("onClick", function(event_id, native_event_object) { + return scheduler2.checkLimitViolation(scheduler2.getEvent(event_id)); + }); + scheduler2.attachEvent("onBeforeLightbox", function(id2) { + var ev = scheduler2.getEvent(id2); + before = [ev.start_date, ev.end_date]; + return scheduler2.checkLimitViolation(ev); + }); + scheduler2.attachEvent("onEventSave", function(id2, data, is_new_event) { + if (!(data.start_date && data.end_date)) { + var ev = scheduler2.getEvent(id2); + data.start_date = new Date(ev.start_date); + data.end_date = new Date(ev.end_date); + } + if (data.rec_type) { + var data_copy = scheduler2._lame_clone(data); + scheduler2._roll_back_dates(data_copy); + return scheduler2.checkLimitViolation(data_copy); + } + return scheduler2.checkLimitViolation(data); + }); + scheduler2.attachEvent("onEventAdded", function(id2) { + if (!id2) + return true; + var ev = scheduler2.getEvent(id2); + if (!scheduler2.checkLimitViolation(ev) && scheduler2.config.limit_start && scheduler2.config.limit_end) { + if (ev.start_date < scheduler2.config.limit_start) { + ev.start_date = new Date(scheduler2.config.limit_start); } - if (backupFocus) { - backupFocus = backupFocus.parentNode; + if (ev.start_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { + ev.start_date = this.date.add(scheduler2.config.limit_end, -1, "day"); } - scheduler2.eventRemove(box, "keydown", trapFocus); - scheduler2.event(box, "keydown", trapFocus); - modalsStack2.push(box); - }); - scheduler2.attachEvent("onAfterMessagePopup", function() { - var box = modalsStack2.pop(); - if (box) { - scheduler2.eventRemove(box, "keydown", trapFocus); + if (ev.end_date < scheduler2.config.limit_start) { + ev.end_date = new Date(scheduler2.config.limit_start); } - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - var currentTarget = document.activeElement; - while (currentTarget && scheduler2._getClassName(currentTarget).indexOf("dhx_cal_light") < 0) { - currentTarget = currentTarget.parentNode; - } - if (currentTarget) - return; - if (focusElement && focusElement.parentNode) { - focusElement.focus(); - } else if (backupFocus && backupFocus.parentNode) { - backupFocus.focus(); + if (ev.end_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { + ev.end_date = this.date.add(scheduler2.config.limit_end, -1, "day"); + } + if (ev.start_date.valueOf() >= ev.end_date.valueOf()) { + ev.end_date = this.date.add(ev.start_date, this.config.event_duration || this.config.time_step, "minute"); + } + ev._timed = this.isOneDayEvent(ev); + } + return true; + }); + scheduler2.attachEvent("onEventChanged", function(id2) { + if (!id2) + return true; + var ev = scheduler2.getEvent(id2); + if (!scheduler2.checkLimitViolation(ev)) { + if (!before) + return false; + ev.start_date = before[0]; + ev.end_date = before[1]; + ev._timed = this.isOneDayEvent(ev); + } + return true; + }); + scheduler2.attachEvent("onBeforeEventChanged", function(ev, native_object, is_new) { + return scheduler2.checkLimitViolation(ev); + }); + scheduler2.attachEvent("onBeforeEventCreated", function(ev) { + var start_date = scheduler2.getActionData(ev).date; + var event2 = { _timed: true, start_date, end_date: scheduler2.date.add(start_date, scheduler2.config.time_step, "minute") }; + return scheduler2.checkLimitViolation(event2); + }); + scheduler2.attachEvent("onViewChange", function() { + scheduler2._mark_now(); + }); + scheduler2.attachEvent("onAfterSchedulerResize", function() { + window.setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + scheduler2._mark_now(); + }, 1); + return true; + }); + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2._mark_now_timer = window.setInterval(function() { + if (!scheduler2._is_initialized()) + return; + scheduler2._mark_now(); + }, 6e4); + }); + scheduler2.attachEvent("onDestroy", function() { + clearInterval(scheduler2._mark_now_timer); + }); + }; + scheduler2._temp_limit_scope(); +} +class GoogleMapAdapter { + constructor(scheduler2) { + this.map = null; + this._markers = []; + this.scheduler = scheduler2; + } + onEventClick(event2) { + if (this._markers && this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + if (event2.id == this._markers[i].event.id) { + let zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom; + if (event2.lat && event2.lng) { + this.map.setCenter({ lat: event2.lat, lng: event2.lng }); + this.map.setZoom(zoom); + } else { + this.map.setCenter({ lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }); + this.map.setZoom(zoom); } - focusElement = null; - backupFocus = null; - }, 1); - }); + google.maps.event.trigger(this._markers[i].marker, "click"); + } + } } - scheduler2.$keyboardNavigation.isModal = isModal; - })(); -} -function core(scheduler2) { - scheduler2.$keyboardNavigation.dispatcher = { isActive: false, activeNode: null, globalNode: new scheduler2.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(callback) { - var top, left; - var scrollable = scheduler2.$container.querySelector(".dhx_timeline_scrollable_data"); - if (!scrollable) { - scrollable = scheduler2.$container.querySelector(".dhx_cal_data"); + } + initialize(container, options) { + this.settings = options; + let scheduler2 = this.scheduler; + let mapOptions = { center: { lat: options.initial_position.lat, lng: options.initial_position.lng }, zoom: options.initial_zoom, mapId: container.id, scrollwheel: true, mapTypeId: options.type }; + if (this.map === null) { + this.map = new google.maps.Map(container, mapOptions); + } else { + let map = this.map; + container.appendChild(this.map.__gm.messageOverlay); + container.appendChild(this.map.__gm.outerContainer); + setTimeout(function() { + map.setOptions({ container: container.id }); + }, 500); } - if (scrollable) { - top = scrollable.scrollTop; - left = scrollable.scrollLeft; + google.maps.event.addListener(this.map, "dblclick", function(event2) { + const geocoder = new google.maps.Geocoder(); + if (!scheduler2.config.readonly && scheduler2.config.dblclick_create) { + let point = event2.latLng; + geocoder.geocode({ latLng: point }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + point = results[0].geometry.location; + scheduler2.addEventNow({ lat: point.lat(), lng: point.lng(), event_location: results[0].formatted_address, start_date: scheduler2.getState().date, end_date: scheduler2.date.add(scheduler2.getState().date, scheduler2.config.time_step, "minute") }); + } else { + console.error("Geocode was not successful for the following reason: " + status); + } + }); + } + }); + } + destroy(container) { + google.maps.event.clearInstanceListeners(window); + google.maps.event.clearInstanceListeners(document); + google.maps.event.clearInstanceListeners(container); + while (container.firstChild) { + container.firstChild.remove(); + } + container.innerHTML = ""; + } + async addEventMarker(event2) { + let config = { title: event2.text, position: {}, map: {} }; + if (event2.lat && event2.lng) { + config.position = { lat: event2.lat, lng: event2.lng }; + } else { + config.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }; } - callback(); - if (scrollable) { - scrollable.scrollTop = top; - scrollable.scrollLeft = left; + const { AdvancedMarkerElement } = await google.maps.importLibrary("marker"); + let marker2; + if (this.scheduler.ext.mapView.createMarker) { + config.map = this.map; + marker2 = this.scheduler.ext.mapView.createMarker(config); + } else { + marker2 = new AdvancedMarkerElement(config); + marker2.map = this.map; } - }, enable: function() { - if (!scheduler2.$container) { - return; + marker2.setMap(this.map); + if (event2["!nativeeditor_status"] == "true_deleted") { + marker2.setMap(null); } - this.isActive = true; - var self = this; - this.keepScrollPosition(function() { - self.globalNode.enable(); - self.setActiveNode(self.getActiveNode()); + google.maps.event.addListener(marker2, "click", () => { + if (this.infoWindow) { + this.infoWindow.close(); + } + this.infoWindow = new google.maps.InfoWindow({ maxWidth: this.settings.info_window_max_width }); + this.infoWindow.setContent(this.scheduler.templates.map_info_content(event2)); + this.infoWindow.open({ anchor: marker2, map: this.map }); }); - }, disable: function() { - this.isActive = false; - this.globalNode.disable(); - }, isEnabled: function() { - return !!this.isActive; - }, getDefaultNode: function() { - return this.globalNode.getDefaultNode(); - }, setDefaultNode: function() { - this.setActiveNode(this.getDefaultNode()); - }, getActiveNode: function() { - var node = this.activeNode; - if (node && !node.isValid()) { - node = node.fallback(); - } - return node; - }, focusGlobalNode: function() { - this.blurNode(this.globalNode); - this.focusNode(this.globalNode); - }, setActiveNode: function(el2) { - if (!el2 || !el2.isValid()) - return; - if (this.activeNode) { - if (this.activeNode.compareTo(el2)) { - return; + let markerInfo = { event: event2, ...config, marker: marker2 }; + this._markers.push(markerInfo); + } + removeEventMarker(eventId) { + for (let i = 0; i < this._markers.length; i++) { + if (eventId == this._markers[i].event.id) { + this._markers[i].marker.setVisible(false); + this._markers[i].marker.setMap(null); + this._markers[i].marker.setPosition(null); + this._markers[i].marker = null; + this._markers.splice(i, 1); + i--; } } - if (this.isEnabled()) { - this.blurNode(this.activeNode); - this.activeNode = el2; - this.focusNode(this.activeNode); - } - }, focusNode: function(el2) { - if (el2 && el2.focus) { - el2.focus(); - if (el2.getNode && document.activeElement != el2.getNode()) { - this.setActiveNode(new scheduler2.$keyboardNavigation.DataArea()); + } + updateEventMarker(event2) { + for (let i = 0; i < this._markers.length; i++) { + if (this._markers[i].event.id == event2.id) { + this._markers[i].event = event2; + this._markers[i].position.lat = event2.lat; + this._markers[i].position.lng = event2.lng; + this._markers[i].text = event2.text; + let latlng = new google.maps.LatLng(event2.lat, event2.lng); + this._markers[i].marker.setPosition(latlng); } } - }, blurNode: function(el2) { - if (el2 && el2.blur) { - el2.blur(); - } - }, getInlineEditor: function(id2) { - var editor = scheduler2.$container.querySelector(".dhx_cal_editor[" + scheduler2.config.event_attribute + "='" + id2 + "'] textarea"); - if (editor && editor.offsetWidth) { - return editor; - } - return null; - }, keyDownHandler: function(e) { - if (e.defaultPrevented) { - return; - } - var activeElement = this.getActiveNode(); - if (scheduler2.$keyboardNavigation.isModal() && !(activeElement && activeElement.container && scheduler2.utils.dom.locateCss({ target: activeElement.container }, "dhx_minical_popup", false))) - return; - if (scheduler2.getState().editor_id && this.getInlineEditor(scheduler2.getState().editor_id)) - return; - if (!this.isEnabled()) - return; - e = e || window.event; - var schedulerNode = this.globalNode; - var command = scheduler2.$keyboardNavigation.shortcuts.getCommandFromEvent(e); - if (!activeElement) { - this.setDefaultNode(); - } else if (activeElement.findHandler(command)) { - activeElement.doAction(command, e); - } else if (schedulerNode.findHandler(command)) { - schedulerNode.doAction(command, e); + } + clearEventMarkers() { + if (this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + this._markers[i].marker.setMap(null); + } + this._markers = []; } - }, _timeout: null, delay: function(callback, delay2) { - clearTimeout(this._timeout); - this._timeout = setTimeout(callback, delay2 || 1); - } }; -} -function key_nav_legacy(scheduler2) { - scheduler2._temp_key_scope = function() { - scheduler2.config.key_nav = true; - scheduler2.$keyboardNavigation._pasteDate = null; - scheduler2.$keyboardNavigation._pasteSection = null; - var isCopy = null; - var pos = {}; - if (!document.body) { - scheduler2.event(window, "load", function() { - scheduler2.event(document.body, "mousemove", trackMousePosition); + } + setView(latitude, longitude, zoom) { + this.map.setCenter({ lat: latitude, lng: longitude }); + this.map.setZoom(zoom); + } + async resolveAddress(string) { + const geocoder = new google.maps.Geocoder(); + let position = await new Promise((resolve) => { + geocoder.geocode({ address: string }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + resolve({ lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng() }); + } else { + console.error("Geocode was not successful for the following reason: " + status); + resolve({}); + } }); - } else { - scheduler2.event(document.body, "mousemove", trackMousePosition); - } - function trackMousePosition(event2) { - event2 = event2 || window.event; - pos.x = event2.clientX; - pos.y = event2.clientY; - } - function currentTarget() { - var mousePointer = false; - var keyNavPointer = false; - var target = document.elementFromPoint(pos.x, pos.y); - while (target && target != scheduler2._obj) { - target = target.parentNode; + }); + return position; + } +} +class OpenStreetMapAdapter { + constructor(scheduler2) { + this.map = null; + this._markers = []; + this.scheduler = scheduler2; + } + onEventClick(event2) { + if (this._markers && this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + if (event2.id == this._markers[i].event.id) { + this._markers[i].marker.openPopup(); + this._markers[i].marker.closeTooltip(); + if (event2.lat && event2.lng) { + this.setView(event2.lat, event2.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } else { + this.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } + } } - mousePointer = !!(target == scheduler2._obj); - keyNavPointer = scheduler2.$keyboardNavigation.dispatcher.isEnabled(); - return mousePointer || keyNavPointer; } - scheduler2.attachEvent("onMouseMove", function(id2, e) { - var state = scheduler2.getState(); - if (!(state.mode && state.min_date)) { - return; + } + initialize(container, options) { + let scheduler2 = this.scheduler; + let mapWrapper = document.createElement("div"); + mapWrapper.className = "mapWrapper"; + mapWrapper.id = "mapWrapper"; + mapWrapper.style.width = container.style.width; + mapWrapper.style.height = container.style.height; + container.appendChild(mapWrapper); + let map = L.map(mapWrapper, { center: L.latLng(options.initial_position.lat, options.initial_position.lng), zoom: options.initial_zoom, keyboard: false }); + L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(map); + map.on("dblclick", async function(e) { + const settings = { method: "GET", headers: { "Accept-Language": "en" } }; + let response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then((response2) => response2.json()); + if (response.address) { + let address = response.address.country; + scheduler2.addEventNow({ lat: e.latlng.lat, lng: e.latlng.lng, event_location: address, start_date: scheduler2.getState().date, end_date: scheduler2.date.add(scheduler2.getState().date, scheduler2.config.time_step, "minute") }); + } else { + console.error("unable recieve a position of the event", response.error); } - var position = scheduler2.getActionData(e); - scheduler2.$keyboardNavigation._pasteDate = position.date; - scheduler2.$keyboardNavigation._pasteSection = position.section; }); - function clear_event_after(ev) { - delete ev.rec_type; - delete ev.rec_pattern; - delete ev.event_pid; - delete ev.event_length; + this.map = map; + this.settings = options; + } + destroy(container) { + this.map.remove(); + while (container.firstChild) { + container.firstChild.remove(); } - function copyEvent(ev) { - return scheduler2._lame_copy({}, ev); + container.innerHTML = ""; + } + addEventMarker(event2) { + const myIcon = L.icon({ iconUrl: "https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png", iconSize: [25, 41], shadowSize: [30, 65], iconAnchor: [12, 41], shadowAnchor: [7, 65] }); + let popupConfig = { minWidth: 180, maxWidth: this.settings.info_window_max_width }; + const markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event2)); + const tooltip2 = L.tooltip().setContent(event2.text); + let markerConfig = [event2.lat, event2.lng]; + if (!event2.lat || !event2.lng) { + markerConfig = [this.settings.error_position.lat, this.settings.error_position.lng]; + } + const marker2 = L.marker(markerConfig, { icon: myIcon }).bindPopup(markerPopup).bindTooltip(tooltip2).addTo(this.map); + const markerInfo = { event: event2, marker: marker2 }; + this._markers.push(markerInfo); + } + removeEventMarker(eventId) { + for (let i = 0; i < this._markers.length; i++) { + if (eventId == this._markers[i].event.id) { + this.map.removeLayer(this._markers[i].marker); + this._markers.splice(i, 1); + i--; + } } - scheduler2._make_pasted_event = function(ev) { - var date = scheduler2.$keyboardNavigation._pasteDate; - var section = scheduler2.$keyboardNavigation._pasteSection; - var event_duration = ev.end_date - ev.start_date; - var copy2 = copyEvent(ev); - clear_event_after(copy2); - copy2.start_date = new Date(date); - copy2.end_date = new Date(copy2.start_date.valueOf() + event_duration); - if (section) { - var property = scheduler2._get_section_property(); - if (scheduler2.config.multisection) - copy2[property] = ev[property]; - else - copy2[property] = section; + } + updateEventMarker(event2) { + for (let i = 0; i < this._markers.length; i++) { + if (this._markers[i].event.id == event2.id) { + this._markers[i].event = event2; + if (!event2.lat || !event2.lng) { + this._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]); + } else { + this._markers[i].marker.setLatLng([event2.lat, event2.lng]); + } } - return copy2; - }; - scheduler2._do_paste = function(is_copy, modified_ev, original_ev) { - if (scheduler2.callEvent("onBeforeEventPasted", [is_copy, modified_ev, original_ev]) === false) { - return; + } + } + clearEventMarkers() { + if (this._markers) { + for (let i = 0; i < this._markers.length; i++) { + this.map.removeLayer(this._markers[i].marker); } - scheduler2.addEvent(modified_ev); - scheduler2.callEvent("onEventPasted", [is_copy, modified_ev, original_ev]); - }; - scheduler2._is_key_nav_active = function() { - if (this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav) { - return true; + this._markers = []; + } + } + setView(latitude, longitude, zoom) { + this.map.setView([latitude, longitude], zoom); + } + async resolveAddress(string) { + const settings = { method: "GET", headers: { "Accept-Language": "en" } }; + let position = {}; + let response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then((response2) => response2.json()); + if (response && response.length) { + position.lat = +response[0].lat; + position.lng = +response[0].lon; + } else { + console.error(`Unable recieve a position of the event's location: ${string}`); + } + return position; + } +} +class MapboxAdapter { + constructor(scheduler2) { + this.map = null; + this._markers = []; + this.scheduler = scheduler2; + } + onEventClick(event2) { + if (this._markers && this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + const popup = this._markers[i].marker.getPopup(); + if (popup.isOpen()) { + popup.remove(); + } + if (event2.id == this._markers[i].event.id) { + this._markers[i].marker.togglePopup(); + if (event2.lat && event2.lng) { + this.setView(event2.lat, event2.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } else { + this.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } + } } - return false; - }; - function getSelectedEvent() { - var node = scheduler2.$keyboardNavigation.dispatcher.getActiveNode(); - if (node && node.eventId) - return node.eventId; - return scheduler2._select_id; } - scheduler2.event(document, "keydown", function(e) { - if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && scheduler2._buffer_event && !scheduler2.$keyboardNavigation.dispatcher.isEnabled()) { - scheduler2.$keyboardNavigation.dispatcher.isActive = currentTarget(); + } + initialize(container, options) { + let scheduler2 = this.scheduler; + mapboxgl.accessToken = options.accessToken; + const map = new mapboxgl.Map({ container, center: [options.initial_position.lng, options.initial_position.lat], zoom: options.initial_zoom + 1 }); + map.on("dblclick", async function(e) { + let response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${e.lngLat.lat}.json?access_token=${options.accessToken}`).then((response2) => response2.json()); + if (response.features) { + let address = response.features[0].place_name; + scheduler2.addEventNow({ lat: e.lngLat.lat, lng: e.lngLat.lng, event_location: address, start_date: scheduler2.getState().date, end_date: scheduler2.date.add(scheduler2.getState().date, scheduler2.config.time_step, "minute") }); + } else { + console.error("unable recieve a position of the event"); } }); - scheduler2._key_nav_copy_paste = function(e) { - if (!scheduler2._is_key_nav_active()) - return true; - if (e.keyCode == 37 || e.keyCode == 39) { - e.cancelBubble = true; - var next = scheduler2.date.add(scheduler2._date, e.keyCode == 37 ? -1 : 1, scheduler2._mode); - scheduler2.setCurrentView(next); - return true; + this.map = map; + this.settings = options; + } + destroy(container) { + this.map.remove(); + while (container.firstChild) { + container.firstChild.remove(); + } + container.innerHTML = ""; + } + addEventMarker(event2) { + let config = [event2.lng, event2.lat]; + if (!event2.lat || !event2.lng) { + config = [this.settings.error_position.lng, this.settings.error_position.lat]; + } + const popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false }).setMaxWidth(`${this.settings.info_window_max_width}px`).setHTML(this.scheduler.templates.map_info_content(event2)); + const marker2 = new mapboxgl.Marker().setLngLat(config).setPopup(popup).addTo(this.map); + const markerInfo = { event: event2, marker: marker2 }; + this._markers.push(markerInfo); + } + removeEventMarker(eventId) { + for (let i = 0; i < this._markers.length; i++) { + if (eventId == this._markers[i].event.id) { + this._markers[i].marker.remove(); + this._markers.splice(i, 1); + i--; } - var select_id = getSelectedEvent(); - if ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { - if (select_id) { - scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); - isCopy = true; - scheduler2.callEvent("onEventCopied", [scheduler2.getEvent(select_id)]); + } + } + updateEventMarker(event2) { + for (let i = 0; i < this._markers.length; i++) { + if (this._markers[i].event.id == event2.id) { + this._markers[i].event = event2; + if (!event2.lat || !event2.lng) { + this._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]); + } else { + this._markers[i].marker.setLngLat([event2.lng, event2.lat]); } - return true; } - if ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { - if (select_id) { - isCopy = false; - var ev = scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); - scheduler2.updateEvent(ev.id); - scheduler2.callEvent("onEventCut", [ev]); - } + } + } + clearEventMarkers() { + for (let i = 0; i < this._markers.length; i++) { + this._markers[i].marker.remove(); + } + this._markers = []; + } + setView(latitude, longitude, zoom) { + this.map.setCenter([longitude, latitude]); + this.map.setZoom(zoom); + } + async resolveAddress(string) { + let response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then((response2) => response2.json()); + let position = {}; + if (response && response.features.length) { + position.lng = response.features[0].center[0]; + position.lat = response.features[0].center[1]; + } else { + console.error(`Unable recieve a position of the event's location: ${string}`); + } + return position; + } +} +function map_view(scheduler2) { + let mapAdapter = null; + let eventHandlerIds = []; + const adapters = { googleMap: new GoogleMapAdapter(scheduler2), openStreetMaps: new OpenStreetMapAdapter(scheduler2), mapbox: new MapboxAdapter(scheduler2) }; + if (!scheduler2.ext) { + scheduler2.ext = {}; + } + scheduler2.ext.mapView = { createAdapter: function() { + return adapters[scheduler2.config.map_view_provider]; + }, createMarker: function(config) { + return new google.maps.Marker(config); + }, currentAdapter: null, adapters }; + scheduler2._latLngUpdate = false; + scheduler2._eventLocationChanged = false; + scheduler2.config.map_view_provider = "googleMap"; + scheduler2.config.map_settings = { initial_position: { lat: 48.724, lng: 8.215 }, error_position: { lat: 15, lng: 15 }, initial_zoom: 1, zoom_after_resolve: 15, info_window_max_width: 300, resolve_user_location: true, resolve_event_location: true, view_provider: "googleMap" }; + if (scheduler2.config.map_initial_position) { + scheduler2.config.map_settings.initial_position = { lat: scheduler2.config.map_initial_position.lat(), lng: scheduler2.config.map_initial_position.lng() }; + } + if (scheduler2.config.map_error_position) { + scheduler2.config.map_settings.error_position = { lat: scheduler2.config.map_error_position.lat(), lng: scheduler2.config.map_error_position.lng() }; + } + scheduler2.xy.map_date_width = 188; + scheduler2.xy.map_icon_width = 25; + scheduler2.xy.map_description_width = 400; + scheduler2.date.add_map = function(date, inc, mode) { + return new Date(date.valueOf()); + }; + scheduler2.templates.map_date = function(dd, ed, mode) { + return ""; + }; + scheduler2.templates.map_time = function(start, end, ev) { + if (scheduler2.config.rtl && !ev._timed) { + return scheduler2.templates.day_date(end) + " – " + scheduler2.templates.day_date(start); + } else if (ev._timed) { + return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); + } else { + return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); + } + }; + scheduler2.templates.map_text = function(start, end, ev) { + return ev.text; + }; + scheduler2.templates.map_info_content = function(event2) { + return `
Event's text: ${event2.text} +
Location: ${event2.event_location}
+
Starts: ${scheduler2.templates.tooltip_date_format(event2.start_date)}
+
Ends: ${scheduler2.templates.tooltip_date_format(event2.end_date)}
+
`; + }; + scheduler2.date.map_start = function(d) { + return d; + }; + function setupMapView(scheduler22) { + mapAdapter = scheduler22.ext.mapView.createAdapter(); + attachSchedulerEvents(); + } + async function addEventWithLocation(event2, mapAdapter2) { + let coordinates = await mapAdapter2.resolveAddress(event2.event_location); + event2.lat = coordinates.lat; + event2.lng = coordinates.lng; + mapAdapter2.removeEventMarker(String(event2.id)); + mapAdapter2.addEventMarker(event2); + return event2; + } + function setUserLocation(options, adapter) { + if (options.resolve_user_location) { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(function(position) { + adapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom); + }); } - if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget()) { - var ev = scheduler2._buffer_event ? scheduler2.getEvent(scheduler2._buffer_event.id) : scheduler2._buffer_event; - ev = ev || scheduler2._buffer_event; - if (ev) { - var new_ev = scheduler2._make_pasted_event(ev); - if (isCopy) { - new_ev.id = scheduler2.uid(); - scheduler2._do_paste(isCopy, new_ev, ev); + } else { + adapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom); + } + } + scheduler2.dblclick_dhx_map_area = function(e) { + let eventNode = e.target.closest(`[${scheduler2.config.event_attribute}]`); + if (eventNode) { + let eventId = eventNode.getAttribute(`${scheduler2.config.event_attribute}`); + scheduler2.showLightbox(eventId); + } + if (!this.config.readonly && this.config.dblclick_create && !eventNode) { + this.addEventNow({ start_date: scheduler2.config.map_start, end_date: scheduler2.date.add(scheduler2.config.map_start, scheduler2.config.time_step, "minute") }); + } + }; + function attachSchedulerEvents() { + eventHandlerIds.push(scheduler2.attachEvent("onEventSave", function(id2, ev, is_new) { + let unmodifiedEvent = scheduler2.getEvent(id2); + if (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) { + scheduler2._eventLocationChanged = true; + } + return true; + }), scheduler2.attachEvent("onEventChanged", (id2, event2) => { + const { start_date, end_date } = event2; + const { min_date, max_date } = scheduler2.getState(); + if (start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()) { + if (mapAdapter) { + if (scheduler2.config.map_settings.resolve_event_location && event2.event_location && !scheduler2._latLngUpdate) { + addEventWithLocation(event2, mapAdapter); } else { - var res = scheduler2.callEvent("onBeforeEventChanged", [new_ev, e, false, ev]); - if (res) { - scheduler2._do_paste(isCopy, new_ev, ev); - isCopy = true; - } + mapAdapter.updateEventMarker(event2); } } - return true; } - }; - }; - scheduler2._temp_key_scope(); -} -function scheduler_handlers(scheduler2) { - scheduler2.$keyboardNavigation.attachSchedulerHandlers = function() { - var dispatcher = scheduler2.$keyboardNavigation.dispatcher; - var keyDownHandler = function(e) { - if (!scheduler2.config.key_nav) - return; - return dispatcher.keyDownHandler(e); - }; - var focusHandler = function() { - dispatcher.keepScrollPosition(function() { - dispatcher.focusGlobalNode(); - }); - }; - var waitCall; - scheduler2.attachEvent("onDataRender", function() { - if (!scheduler2.config.key_nav) - return; - if (!(dispatcher.isEnabled() && !scheduler2.getState().editor_id)) - return; - clearTimeout(waitCall); - waitCall = setTimeout(function() { - if (scheduler2.$destroyed) { - return true; + scheduler2._latLngUpdate = false; + return true; + }), scheduler2.attachEvent("onEventIdChange", function(old_id, new_id) { + let newIdEvent = scheduler2.getEvent(new_id); + mapAdapter == null ? void 0 : mapAdapter.removeEventMarker(old_id); + mapAdapter == null ? void 0 : mapAdapter.addEventMarker(newIdEvent); + }), scheduler2.attachEvent("onEventAdded", (id2, event2) => { + const { start_date, end_date } = event2; + const { min_date, max_date } = scheduler2.getState(); + if (start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()) { + if (mapAdapter) { + if (scheduler2.config.map_settings.resolve_event_location && event2.event_location && scheduler2._eventLocationChanged) { + addEventWithLocation(event2, mapAdapter); + scheduler2._eventLocationChanged = false; + } else { + mapAdapter.addEventMarker(event2); + mapAdapter.onEventClick(event2); + } } - if (!dispatcher.isEnabled()) - dispatcher.enable(); - reFocusActiveNode(); - }); - }); - var reFocusActiveNode = function() { - if (!dispatcher.isEnabled()) - return; - var activeNode = dispatcher.getActiveNode(); - if (!activeNode) - return; - if (!activeNode.isValid()) { - activeNode = activeNode.fallback(); } - if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) - return; - dispatcher.keepScrollPosition(function() { - activeNode.focus(true); - }); - }; - scheduler2.attachEvent("onSchedulerReady", function() { - var container = scheduler2.$container; - scheduler2.eventRemove(document, "keydown", keyDownHandler); - scheduler2.eventRemove(container, "mousedown", mousedownHandler); - scheduler2.eventRemove(container, "focus", focusHandler); - if (scheduler2.config.key_nav) { - scheduler2.event(document, "keydown", keyDownHandler); - scheduler2.event(container, "mousedown", mousedownHandler); - scheduler2.event(container, "focus", focusHandler); - container.setAttribute("tabindex", "0"); - } else { - container.removeAttribute("tabindex"); + }), scheduler2.attachEvent("onClick", function(id2, e) { + const event2 = scheduler2.getEvent(id2); + if (mapAdapter && event2) + mapAdapter.onEventClick(event2); + return false; + }), scheduler2.attachEvent("onBeforeEventDelete", (id2, event2) => { + if (mapAdapter) { + mapAdapter.removeEventMarker(id2); } - }); - function mousedownHandler(e) { - if (!scheduler2.config.key_nav) - return true; - const view = scheduler2.getView(); - let dataAreaClick = false; - if (scheduler2.getState().mode === "month") { - dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_cal_month_table")); - } else if (view && view.layout === "timeline") { - dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_timeline_data_col")); + return true; + })); + } + function detachSchedulerEvents() { + eventHandlerIds.forEach((id2) => scheduler2.detachEvent(id2)); + eventHandlerIds = []; + } + scheduler2.attachEvent("onSchedulerReady", function() { + if (scheduler2.config.map_initial_zoom !== void 0) { + scheduler2.config.map_settings.initial_zoom = scheduler2.config.map_initial_zoom; + } + if (scheduler2.config.map_zoom_after_resolve !== void 0) { + scheduler2.config.map_settings.zoom_after_resolve = scheduler2.config.map_zoom_after_resolve; + } + if (scheduler2.config.map_infowindow_max_width !== void 0) { + scheduler2.config.map_settings.info_window_max_width = scheduler2.config.map_infowindow_max_width; + } + if (scheduler2.config.map_resolve_user_location !== void 0) { + scheduler2.config.map_settings.resolve_user_location = scheduler2.config.map_resolve_user_location; + } + if (scheduler2.config.map_view_provider !== void 0) { + scheduler2.config.map_settings.view_provider = scheduler2.config.map_view_provider; + } + if (scheduler2.config.map_type !== void 0) { + scheduler2.config.map_settings.type = scheduler2.config.map_type; + } + if (scheduler2.config.map_resolve_event_location !== void 0) { + scheduler2.config.map_settings.resolve_event_location = scheduler2.config.map_resolve_event_location; + } + scheduler2.ext.mapView.currentAdapter = scheduler2.config.map_view_provider; + let map = document.createElement("div"); + map.className = "mapContainer"; + map.id = "mapContainer"; + map.style.display = "none"; + map.style.zIndex = "1"; + scheduler2._obj.appendChild(map); + const old = scheduler2.render_data; + scheduler2.render_data = function(evs, hold) { + if (this._mode == "map") { + fill_map_tab(); + let events = scheduler2.get_visible_events(); + if (mapAdapter) { + mapAdapter.clearEventMarkers(); + events.forEach((event2) => mapAdapter == null ? void 0 : mapAdapter.addEventMarker(event2)); + } + } else + return old.apply(this, arguments); + }; + scheduler2.map_view = function(mode) { + scheduler2._els.dhx_cal_data[0].style.width = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; + scheduler2._min_date = scheduler2.config.map_start || scheduler2._currentDate(); + scheduler2._max_date = scheduler2.config.map_end || scheduler2.date.add(scheduler2._currentDate(), 1, "year"); + scheduler2._table_view = true; + set_full_view(mode); + let mapContainer = document.getElementById("mapContainer"); + _setMapSize("mapContainer"); + if (mode && mapContainer) { + map.style.display = "block"; + fill_map_tab(); + if (scheduler2.config.map_view_provider == scheduler2.ext.mapView.currentAdapter) { + mapAdapter == null ? void 0 : mapAdapter.destroy(mapContainer); + setupMapView(scheduler2); + mapAdapter == null ? void 0 : mapAdapter.initialize(mapContainer, scheduler2.config.map_settings); + } else { + mapAdapter == null ? void 0 : mapAdapter.destroy(mapContainer); + setupMapView(scheduler2); + mapAdapter == null ? void 0 : mapAdapter.initialize(mapContainer, scheduler2.config.map_settings); + scheduler2.ext.mapView.currentAdapter = scheduler2.config.map_view_provider; + } + if (mapAdapter) { + setUserLocation(scheduler2.config.map_settings, mapAdapter); + } } else { - const listOfScales = scheduler2.$container.querySelectorAll(".dhx_scale_holder"); - const arrOfScales = Array.from(listOfScales); - dataAreaClick = arrOfScales.some((scale) => scale === e.target.parentNode); - } - var pos = scheduler2.getActionData(e); - var focusNode; - if (scheduler2._locate_event(e.target || e.srcElement)) { - focusNode = new scheduler2.$keyboardNavigation.Event(scheduler2._locate_event(e.target || e.srcElement)); - } else if (dataAreaClick) { - focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); - if (pos.date && dataAreaClick) { - focusNode = focusNode.nextSlot(new scheduler2.$keyboardNavigation.TimeSlot(pos.date, null, pos.section)); + map.style.display = "none"; + scheduler2._els.dhx_cal_data[0].style.width = "100%"; + if (mapAdapter && mapContainer) { + mapAdapter.destroy(mapContainer); + mapAdapter = null; + scheduler2.ext.mapView.currentAdapter = scheduler2.config.map_view_provider; } + detachSchedulerEvents(); } - if (focusNode) { - if (!dispatcher.isEnabled()) { - dispatcher.activeNode = focusNode; + }; + function _setMapSize(elem_id) { + let map2 = document.getElementById(elem_id); + if (map2) { + const nav_height = scheduler2.$container.querySelector(".dhx_cal_navline").offsetHeight; + let height = scheduler2.$container.querySelector(".dhx_cal_data").offsetHeight + scheduler2.$container.querySelector(".dhx_cal_header").offsetHeight; + if (height < 0) + height = 0; + let width = scheduler2._x - scheduler2.xy.map_date_width - scheduler2.xy.map_description_width - 1; + if (width < 0) + width = 0; + map2.style.height = height + "px"; + map2.style.width = width + "px"; + map2.style.position = "absolute"; + map2.style.top = nav_height + "px"; + if (scheduler2.config.rtl) { + map2.style.marginRight = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; } else { - if (pos.date && dataAreaClick) { - dispatcher.delay(function() { - dispatcher.setActiveNode(focusNode); - }); - } + map2.style.marginLeft = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; } + map2.style.marginTop = scheduler2.xy.nav_height + 2 + "px"; + } + } + function fill_map_tab() { + let events = scheduler2.get_visible_events(); + events.sort(function(a, b) { + if (a.start_date.valueOf() == b.start_date.valueOf()) + return a.id > b.id ? 1 : -1; + return a.start_date > b.start_date ? 1 : -1; + }); + let ariaAttr = scheduler2._waiAria.mapAttrString(); + let html = "
"; + for (let i = 0; i < events.length; i++) { + let ev = events[i]; + let event_class = ev.id == scheduler2._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line"; + let bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; + let color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; + let ariaAttr2 = scheduler2._waiAria.mapRowAttrString(ev); + let ariaButtonAttr = scheduler2._waiAria.mapDetailsBtnString(); + html += "
" + scheduler2.templates.map_time(ev.start_date, ev.end_date, ev) + "
"; + html += `
+ +
`; + html += "
" + scheduler2.templates.map_text(ev.start_date, ev.end_date, ev) + "
"; + } + html += "
"; + scheduler2._els["dhx_cal_data"][0].scrollTop = 0; + scheduler2._els["dhx_cal_data"][0].innerHTML = html; + let t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; + let dateElement = scheduler2._getNavDateElement(); + if (dateElement) { + dateElement.innerHTML = scheduler2.templates[scheduler2._mode + "_date"](scheduler2._min_date, scheduler2._max_date, scheduler2._mode); + } + scheduler2._rendered = []; + for (let i = 0; i < t.length - 2; i++) { + scheduler2._rendered[i] = t[i]; } } - function focusEvent(evNode) { - if (!scheduler2.config.key_nav) - return; - if (!dispatcher.isEnabled()) - return; - var prevState = evNode; - var focusNode = new scheduler2.$keyboardNavigation.Event(prevState.eventId); - if (!focusNode.isValid()) { - var lastStart = focusNode.start || prevState.start; - var lastEnd = focusNode.end || prevState.end; - var lastSection = focusNode.section || prevState.section; - focusNode = new scheduler2.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection); - if (!focusNode.isValid()) { - focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); - } - } - dispatcher.setActiveNode(focusNode); - var node = dispatcher.getActiveNode(); - if (node && node.getNode && document.activeElement != node.getNode()) { - dispatcher.focusNode(dispatcher.getActiveNode()); + function set_full_view(mode) { + if (mode) { + const l = scheduler2.locale.labels; + scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; + scheduler2._table_view = true; + scheduler2.set_sizes(); } } - var updateEvent = scheduler2.updateEvent; - scheduler2.updateEvent = function(id2) { - var res = updateEvent.apply(this, arguments); - if (scheduler2.config.key_nav && dispatcher.isEnabled()) { - if (scheduler2.getState().select_id == id2) { - var element = new scheduler2.$keyboardNavigation.Event(id2); - if (!scheduler2.getState().lightbox_id) { - focusEvent(element); - } + scheduler2.attachEvent("onLocationError", function(id2) { + alert("Location can't be found"); + return google.maps.LatLng(51.47784, -1492e-6); + }); + let _updateEventLocation = async function(event2) { + if (mapAdapter) { + const coordinates = await mapAdapter.resolveAddress(event2.event_location); + if (coordinates.lat && coordinates.lng) { + event2.lat = +coordinates.lat; + event2.lng = +coordinates.lng; + } else { + scheduler2.callEvent("onLocationError", [event2.id]); + event2.lng = scheduler2.config.map_settings.error_position.lng; + event2.lat = scheduler2.config.map_settings.error_position.lat; } + scheduler2._latLngUpdate = true; + scheduler2.callEvent("onEventChanged", [event2.id, event2]); } - return res; }; - scheduler2.attachEvent("onEventDeleted", function(id2) { - if (!scheduler2.config.key_nav) - return true; - if (dispatcher.isEnabled()) { - var activeNode = dispatcher.getActiveNode(); - if (activeNode.eventId == id2) { - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); + let _delay = function(method, object, params, delay2) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; } + let ret = method.apply(object, params); + method = object = params = null; + return ret; + }, delay2 || 1); + }; + scheduler2._event_resolve_delay = 1500; + scheduler2.attachEvent("onEventLoading", function(event2) { + if (event2.lat && event2.lng) { + event2.lat = +event2.lat; + event2.lng = +event2.lng; } - return true; - }); - scheduler2.attachEvent("onClearAll", function() { - if (!scheduler2.config.key_nav) - return true; - if (dispatcher.isEnabled()) { - if (dispatcher.getActiveNode() instanceof scheduler2.$keyboardNavigation.Event) { - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); - } + if (scheduler2.config.map_settings.resolve_event_location && event2.event_location && !event2.lat && !event2.lng) { + scheduler2._event_resolve_delay += 1500; + _delay(_updateEventLocation, this, [event2], scheduler2._event_resolve_delay); } + return true; }); - }; + }); } -function minical_handlers(scheduler2) { - scheduler2.$keyboardNavigation._minicalendars = []; - scheduler2.$keyboardNavigation.isMinical = function(node) { - var minicalendars = scheduler2.$keyboardNavigation._minicalendars; - for (var i = 0; i < minicalendars.length; i++) { - if (this.isChildOf(node, minicalendars[i])) - return true; - } - return false; - }; - scheduler2.$keyboardNavigation.isChildOf = function(child, parent) { - while (child && child !== parent) { - child = child.parentNode; - } - return !!(child === parent); - }; - scheduler2.$keyboardNavigation.patchMinicalendar = function() { - var dispatcher = scheduler2.$keyboardNavigation.dispatcher; - function focusMinical(e) { - var target = e.target; - dispatcher.enable(); - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(target, 0)); - } - function minicalClick(e) { - var target = e.target || e.srcElement; - var prev = scheduler2.utils.dom.locateCss(e, "dhx_cal_prev_button", false); - var next = scheduler2.utils.dom.locateCss(e, "dhx_cal_next_button", false); - var cell = scheduler2.utils.dom.locateCss(e, "dhx_year_body", false); - var rowIndex = 0; - var cellIndex = 0; - if (cell) { - var tr2; - var td; - var current = target; - while (current && current.tagName.toLowerCase() != "td") { - current = current.parentNode; - } - if (current) { - td = current; - tr2 = td.parentNode; - } - if (tr2 && td) { - var rows = tr2.parentNode.querySelectorAll("tr"); - for (var i = 0; i < rows.length; i++) { - if (rows[i] == tr2) { - rowIndex = i; - break; - } - } - var cells = tr2.querySelectorAll("td"); - for (var i = 0; i < cells.length; i++) { - if (cells[i] == td) { - cellIndex = i; - break; - } - } - } +function minical(scheduler2) { + const minicalDomEvents = scheduler2._createDomEventScope(); + scheduler2.config.minicalendar = { mark_events: true }; + scheduler2._synced_minicalendars = []; + scheduler2.renderCalendar = function(obj, _prev, is_refresh) { + var cal = null; + var date = obj.date || scheduler2._currentDate(); + if (typeof date == "string") + date = this.templates.api_date(date); + if (!_prev) { + var cont = obj.container; + var pos = obj.position; + if (typeof cont == "string") + cont = document.getElementById(cont); + if (typeof pos == "string") + pos = document.getElementById(pos); + if (pos && (typeof pos.left == "undefined" && typeof pos.right == "undefined")) { + var tpos = scheduler2.$domHelpers.getOffset(pos); + pos = { top: tpos.top + pos.offsetHeight, left: tpos.left }; } - var root = e.currentTarget; - dispatcher.delay(function() { - if (prev || next || cell) { - var element; - if (prev) { - element = new scheduler2.$keyboardNavigation.MinicalButton(root, 0); - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(root, 0)); - } else if (next) { - element = new scheduler2.$keyboardNavigation.MinicalButton(root, 1); - } else if (cell) { - element = new scheduler2.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex); - } - if (element) { - dispatcher.enable(); - if (element.isValid()) { - dispatcher.activeNode = null; - dispatcher.setActiveNode(element); + if (!cont) + cont = scheduler2._get_def_cont(pos); + cal = this._render_calendar(cont, date, obj); + if (!cal.$_eventAttached) { + cal.$_eventAttached = true; + minicalDomEvents.attach(cal, "click", (function(e) { + var src = e.target || e.srcElement; + var $dom = scheduler2.$domHelpers; + if ($dom.closest(src, ".dhx_month_head")) { + if (!$dom.closest(src, ".dhx_after") && !$dom.closest(src, ".dhx_before")) { + var cellRoot = $dom.closest(src, "[data-cell-date]"); + var dateAttribute = cellRoot.getAttribute("data-cell-date"); + var newDate = scheduler2.templates.parse_date(dateAttribute); + scheduler2.unmarkCalendar(this); + scheduler2.markCalendar(this, newDate, "dhx_calendar_click"); + this._last_date = newDate; + if (this.conf.handler) + this.conf.handler.call(scheduler2, newDate, this); } } - } - }); + }).bind(cal)); + } + } else { + cal = this._render_calendar(_prev.parentNode, date, obj, _prev); + scheduler2.unmarkCalendar(cal); } - if (scheduler2.renderCalendar) { - var renderMinical = scheduler2.renderCalendar; - scheduler2.renderCalendar = function() { - var cal = renderMinical.apply(this, arguments); - var minicalendars = scheduler2.$keyboardNavigation._minicalendars; - scheduler2.eventRemove(cal, "click", minicalClick); - scheduler2.event(cal, "click", minicalClick); - scheduler2.eventRemove(cal, "focus", focusMinical); - scheduler2.event(cal, "focus", focusMinical); - var added = false; - for (var i = 0; i < minicalendars.length; i++) { - if (minicalendars[i] == cal) { - added = true; - break; - } - } - if (!added) - minicalendars.push(cal); - if (dispatcher.isEnabled()) { - var node = dispatcher.getActiveNode(); - if (node && node.container == cal) { - dispatcher.focusNode(node); - } else { - cal.setAttribute("tabindex", "0"); + if (scheduler2.config.minicalendar.mark_events) { + var start = scheduler2.date.month_start(date); + var end = scheduler2.date.add(start, 1, "month"); + var evs = this.getEvents(start, end); + var filter = this["filter_" + this._mode]; + var markedDates = {}; + for (var i = 0; i < evs.length; i++) { + var ev = evs[i]; + if (filter && !filter(ev.id, ev)) + continue; + var d = ev.start_date; + if (d.valueOf() < start.valueOf()) + d = start; + d = scheduler2.date.date_part(new Date(d.valueOf())); + while (d < ev.end_date) { + if (!markedDates[+d]) { + markedDates[+d] = true; + this.markCalendar(cal, d, "dhx_year_event"); } - } else { - cal.setAttribute("tabindex", "0"); + d = this.date.add(d, 1, "day"); + if (d.valueOf() >= end.valueOf()) + break; } - return cal; - }; + } } - if (scheduler2.destroyCalendar) { - var destroyMinical = scheduler2.destroyCalendar; - scheduler2.destroyCalendar = function(cal, force) { - cal = cal || (scheduler2._def_count ? scheduler2._def_count.firstChild : null); - var res = destroyMinical.apply(this, arguments); - if (!cal || !cal.parentNode) { - var minicalendars = scheduler2.$keyboardNavigation._minicalendars; - for (var i = 0; i < minicalendars.length; i++) { - if (minicalendars[i] == cal) { - scheduler2.eventRemove(minicalendars[i], "focus", focusMinical); - minicalendars.splice(i, 1); - i--; - } - } - } - return res; - }; + this._markCalendarCurrentDate(cal); + cal.conf = obj; + if (obj.sync && !is_refresh) + this._synced_minicalendars.push(cal); + if (!cal.conf._on_xle_handler) { + cal.conf._on_xle_handler = scheduler2.attachEvent("onXLE", function refreshOnLoad() { + scheduler2.updateCalendar(cal, cal.conf.date); + }); } - }; -} -function key_nav(scheduler2) { - scheduler2.config.key_nav = true; - scheduler2.config.key_nav_step = 30; - scheduler2.addShortcut = function(shortcut, handler, scope) { - var scopeObject = getScope(scope); - if (scopeObject) { - scopeObject.prototype.bind(shortcut, handler); + if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { + cal.setAttribute("role", "application"); } + return cal; }; - scheduler2.getShortcutHandler = function(shortcut, scope) { - var scopeObject = getScope(scope); - if (scopeObject) { - var commands = scheduler2.$keyboardNavigation.shortcuts.parse(shortcut); - if (commands.length) { - return scopeObject.prototype.findHandler(commands[0]); - } + scheduler2._get_def_cont = function(pos) { + if (!this._def_count) { + this._def_count = document.createElement("div"); + this._def_count.className = "dhx_minical_popup"; + scheduler2.event(this._def_count, "click", function(e) { + e.cancelBubble = true; + }); + document.body.appendChild(this._def_count); } - }; - scheduler2.removeShortcut = function(shortcut, scope) { - var scopeObject = getScope(scope); - if (scopeObject) { - scopeObject.prototype.unbind(shortcut); + if (pos.left) { + this._def_count.style.left = pos.left + "px"; } - }; - scheduler2.focus = function() { - if (!scheduler2.config.key_nav) { - return; + if (pos.right) { + this._def_count.style.right = pos.right + "px"; } - var disp = scheduler2.$keyboardNavigation.dispatcher; - disp.enable(); - var activeNode = disp.getActiveNode(); - if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) { - disp.setDefaultNode(); - } else { - disp.focusNode(disp.getActiveNode()); + if (pos.top) { + this._def_count.style.top = pos.top + "px"; } - }; - function getScope(mode) { - var scopes = { minicalButton: scheduler2.$keyboardNavigation.MinicalButton, minicalDate: scheduler2.$keyboardNavigation.MinicalCell, scheduler: scheduler2.$keyboardNavigation.SchedulerNode, dataArea: scheduler2.$keyboardNavigation.DataArea, timeSlot: scheduler2.$keyboardNavigation.TimeSlot, event: scheduler2.$keyboardNavigation.Event }; - var searchMap = {}; - for (var i in scopes) - searchMap[i.toLowerCase()] = scopes[i]; - mode = (mode + "").toLowerCase(); - return searchMap[mode] || scopes.scheduler; - } - scheduler2.$keyboardNavigation = {}; - scheduler2._compose = function() { - var parts = Array.prototype.slice.call(arguments, 0); - var res = {}; - for (var i = 0; i < parts.length; i++) { - var obj = parts[i]; - if (typeof obj == "function") { - obj = new obj(); - } - for (var p in obj) { - res[p] = obj[p]; - } + if (pos.bottom) { + this._def_count.style.bottom = pos.bottom + "px"; } - return res; + this._def_count._created = /* @__PURE__ */ new Date(); + return this._def_count; }; - keyboard_shortcuts(scheduler2); - eventhandler(scheduler2); - trap_modal_focus(scheduler2); - marker(scheduler2); - scheduler_node(scheduler2); - nav_node(scheduler2); - header_cell(scheduler2); - event(scheduler2); - time_slot(scheduler2); - minical_button(scheduler2); - minical_cell(scheduler2); - data_area(scheduler2); - modals(scheduler2); - core(scheduler2); - key_nav_legacy(scheduler2); - (function() { - scheduler_handlers(scheduler2); - minical_handlers(scheduler2); - var dispatcher = scheduler2.$keyboardNavigation.dispatcher; - scheduler2.$keyboardNavigation.attachSchedulerHandlers(); - if (scheduler2.renderCalendar) { - scheduler2.$keyboardNavigation.patchMinicalendar(); - } else { - var attachOnce = scheduler2.attachEvent("onSchedulerReady", function() { - scheduler2.detachEvent(attachOnce); - scheduler2.$keyboardNavigation.patchMinicalendar(); - }); + scheduler2._locateCalendar = function(cal, date) { + if (typeof date == "string") + date = scheduler2.templates.api_date(date); + if (+date > +cal._max_date || +date < +cal._min_date) + return null; + var table = cal.querySelector(".dhx_year_body").childNodes[0]; + var weekNum = 0; + var dat = new Date(cal._min_date); + while (+this.date.add(dat, 1, "week") <= +date) { + dat = this.date.add(dat, 1, "week"); + weekNum++; } - function isSchedulerSelected() { - if (!scheduler2.config.key_nav) - return; - var enable; - var focusElement = document.activeElement; - if (!focusElement || scheduler2.utils.dom.locateCss(focusElement, "dhx_cal_quick_info", false)) { - enable = false; - } else { - enable = scheduler2.$keyboardNavigation.isChildOf(focusElement, scheduler2.$container) || scheduler2.$keyboardNavigation.isMinical(focusElement); - } - return enable; + var sm = scheduler2.config.start_on_monday; + var day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0); + const dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`); + if (dayCell) { + return dayCell.firstChild; + } else { + return null; } - function changeState(enable) { - if (enable && !dispatcher.isEnabled()) { - dispatcher.enable(); - } else if (!enable && dispatcher.isEnabled()) { - dispatcher.disable(); - } + }; + scheduler2.markCalendar = function(cal, date, css) { + var div = this._locateCalendar(cal, date); + if (!div) + return; + div.className += " " + css; + }; + scheduler2.unmarkCalendar = function(cal, date, css) { + date = date || cal._last_date; + css = css || "dhx_calendar_click"; + if (!date) + return; + var el2 = this._locateCalendar(cal, date); + if (!el2) + return; + el2.className = (el2.className || "").replace(RegExp(css, "g")); + }; + scheduler2._week_template = function(width) { + var summ = width || 250; + var left = 0; + var week_template = document.createElement("div"); + var dummy_date = this.date.week_start(scheduler2._currentDate()); + for (var i = 0; i < 7; i++) { + this._cols[i] = Math.floor(summ / (7 - i)); + this._render_x_header(i, left, dummy_date, week_template); + dummy_date = this.date.add(dummy_date, 1, "day"); + summ -= this._cols[i]; + left += this._cols[i]; } - const intervalId = setInterval(function() { - if (!scheduler2.$container || !scheduler2.$keyboardNavigation.isChildOf(scheduler2.$container, document.body)) { - return; - } - var enable = isSchedulerSelected(); - if (enable) { - changeState(enable); - } else if (!enable && dispatcher.isEnabled()) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return; - } - if (scheduler2.config.key_nav) { - changeState(isSchedulerSelected()); - } else { - scheduler2.$container.removeAttribute("tabindex"); - } - }, 100); - } - }, 500); - scheduler2.attachEvent("onDestroy", function() { - clearInterval(intervalId); - }); - })(); -} -function layer(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - this.layers.sort(function(a, b) { - return a.zIndex - b.zIndex; - }); - scheduler2._dp_init = function(dp) { - dp._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"]; - this.attachEvent("onEventAdded", function(id2) { - if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) - dp.setUpdated(id2, true, "inserted"); - }); - this.attachEvent("onBeforeEventDelete", function(id2) { - if (this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) { - if (!this.validId(id2)) - return; - var z = dp.getState(id2); - if (z == "inserted" || this._new_event) { - dp.setUpdated(id2, false); - return true; - } - if (z == "deleted") - return false; - if (z == "true_deleted") - return true; - dp.setUpdated(id2, true, "deleted"); - return false; - } else - return true; - }); - this.attachEvent("onEventChanged", function(id2) { - if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) - dp.setUpdated(id2, true, "updated"); - }); - dp._getRowData = function(id2, pref) { - var ev = this.obj.getEvent(id2); - var data = {}; - for (var a in ev) { - if (a.indexOf("_") === 0) - continue; - if (ev[a] && ev[a].getUTCFullYear) - data[a] = this.obj._helpers.formatDate(ev[a]); - else - data[a] = ev[a]; + week_template.lastChild.className += " dhx_scale_bar_last"; + return week_template; + }; + scheduler2.updateCalendar = function(obj, sd) { + obj.conf.date = sd; + this.renderCalendar(obj.conf, obj, true); + }; + scheduler2._mini_cal_arrows = [" ", " "]; + scheduler2._render_calendar = function(obj, sd, conf, previous) { + var ts = scheduler2.templates; + var temp = this._cols; + this._cols = []; + var temp2 = this._mode; + this._mode = "calendar"; + var temp3 = this._colsS; + this._colsS = { height: 0 }; + var temp4 = new Date(this._min_date); + var temp5 = new Date(this._max_date); + var temp6 = new Date(scheduler2._date); + var temp7 = ts.month_day; + var temp8 = this._ignores_detected; + this._ignores_detected = 0; + ts.month_day = ts.calendar_date; + sd = this.date.month_start(sd); + var week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding); + var d; + if (previous) { + d = previous; + } else { + d = document.createElement("div"); + d.className = "dhx_cal_container dhx_mini_calendar"; + } + d.setAttribute("date", this._helpers.formatDate(sd)); + d.innerHTML = "
" : "'>") + "
" + (week_template ? week_template.innerHTML : "") + "
"; + var header = d.querySelector(".dhx_year_month"); + var weekHeader = d.querySelector(".dhx_year_week"); + var body = d.querySelector(".dhx_year_body"); + header.innerHTML = this.templates.calendar_month(sd); + if (conf.navigation) { + var move_minicalendar_date = function(calendar, diff) { + var date = scheduler2.date.add(calendar._date, diff, "month"); + scheduler2.updateCalendar(calendar, date); + if (scheduler2._date.getMonth() == calendar._date.getMonth() && scheduler2._date.getFullYear() == calendar._date.getFullYear()) { + scheduler2._markCalendarCurrentDate(calendar); } - return data; - }; - dp._clearUpdateFlag = function() { }; - dp.attachEvent("insertCallback", scheduler2._update_callback); - dp.attachEvent("updateCallback", scheduler2._update_callback); - dp.attachEvent("deleteCallback", function(upd, id2) { - this.obj.setUserData(id2, this.action_param, "true_deleted"); - this.obj.deleteEvent(id2); - }); - }; - (function() { - var _cloneObj = function(obj) { - if (obj === null || typeof obj != "object") - return obj; - var temp = new obj.constructor(); - for (var key in obj) - temp[key] = _cloneObj(obj[key]); - return temp; + var css_classnames = ["dhx_cal_prev_button", "dhx_cal_next_button"]; + var css_texts = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"]; + var diffs = [-1, 1]; + var handler = function(diff) { + return function() { + if (conf.sync) { + var calendars = scheduler2._synced_minicalendars; + for (var k = 0; k < calendars.length; k++) { + move_minicalendar_date(calendars[k], diff); + } + } else { + if (scheduler2.config.rtl) { + diff = -diff; + } + move_minicalendar_date(d, diff); + } + }; }; - scheduler2._dataprocessors = []; - scheduler2._layers_zindex = {}; - for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { - scheduler2.config["lightbox_" + scheduler2.layers[i2].name] = {}; - scheduler2.config["lightbox_" + scheduler2.layers[i2].name].sections = _cloneObj(scheduler2.config.lightbox.sections); - scheduler2._layers_zindex[scheduler2.layers[i2].name] = scheduler2.config.initial_layer_zindex || 5 + i2 * 3; - if (scheduler2.layers[i2].url) { - var dp = scheduler2.createDataProcessor({ url: scheduler2.layers[i2].url }); - dp.layer = scheduler2.layers[i2].name; - scheduler2._dataprocessors.push(dp); - scheduler2._dataprocessors[i2].init(scheduler2); - } - if (scheduler2.layers[i2].isDefault) - scheduler2.defaultLayer = scheduler2.layers[i2].name; - } - })(); - scheduler2.showLayer = function(tlayer) { - this.toggleLayer(tlayer, true); - }; - scheduler2.hideLayer = function(tlayer) { - this.toggleLayer(tlayer, false); - }; - scheduler2.toggleLayer = function(tlayer, visible) { - var layer2 = this.getLayer(tlayer); - if (typeof visible != "undefined") - layer2.visible = !!visible; - else - layer2.visible = !layer2.visible; - this.setCurrentView(this._date, this._mode); - }; - scheduler2.getLayer = function(tlayer) { - var layer2, layer_name; - if (typeof tlayer == "string") - layer_name = tlayer; - if (typeof tlayer == "object") - layer_name = tlayer.layer; - for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { - if (scheduler2.layers[i2].name == layer_name) - layer2 = scheduler2.layers[i2]; - } - return layer2; - }; - scheduler2.attachEvent("onBeforeLightbox", function(event_id) { - var ev = this.getEvent(event_id); - this.config.lightbox.sections = this.config["lightbox_" + ev.layer].sections; - scheduler2.resetLightbox(); - return true; - }); - scheduler2.attachEvent("onClick", function(event_id, native_event_object) { - var ev = scheduler2.getEvent(event_id); - return !scheduler2.getLayer(ev.layer).noMenu; - }); - scheduler2.attachEvent("onEventCollision", function(ev, evs) { - var layer2 = this.getLayer(ev); - if (!layer2.checkCollision) - return false; - var count = 0; - for (var i2 = 0; i2 < evs.length; i2++) { - if (evs[i2].layer == layer2.name && evs[i2].id != ev.id) - count++; - } - return count >= scheduler2.config.collision_limit; - }); - scheduler2.addEvent = function(start_date, end_date, text, id2, extra_data) { - var ev = start_date; - if (arguments.length != 1) { - ev = extra_data || {}; - ev.start_date = start_date; - ev.end_date = end_date; - ev.text = text; - ev.id = id2; - ev.layer = this.defaultLayer; + var labels = [scheduler2.locale.labels.prev, scheduler2.locale.labels.next]; + for (var j = 0; j < 2; j++) { + var arrow = document.createElement("div"); + arrow.className = css_classnames[j]; + scheduler2._waiAria.headerButtonsAttributes(arrow, labels[j]); + arrow.style.cssText = css_texts[j]; + arrow.innerHTML = this._mini_cal_arrows[j]; + header.appendChild(arrow); + minicalDomEvents.attach(arrow, "click", handler(diffs[j])); } - ev.id = ev.id || scheduler2.uid(); - ev.text = ev.text || ""; - if (typeof ev.start_date == "string") - ev.start_date = this.templates.api_date(ev.start_date); - if (typeof ev.end_date == "string") - ev.end_date = this.templates.api_date(ev.end_date); - ev._timed = this.isOneDayEvent(ev); - var is_new = !this._events[ev.id]; - this._events[ev.id] = ev; - this.event_updated(ev); - if (!this._loading) - this.callEvent(is_new ? "onEventAdded" : "onEventChanged", [ev.id, ev]); - }; - this._evs_layer = {}; - for (var i = 0; i < this.layers.length; i++) { - this._evs_layer[this.layers[i].name] = []; } - scheduler2.addEventNow = function(start, end, e) { - var base = {}; - if (typeof start == "object") { - base = start; - start = null; - } - var d = (this.config.event_duration || this.config.time_step) * 6e4; - if (!start) - start = Math.round(scheduler2._currentDate().valueOf() / d) * d; - var start_date = new Date(start); - if (!end) { - var start_hour = this.config.first_hour; - if (start_hour > start_date.getHours()) { - start_date.setHours(start_hour); - start = start_date.valueOf(); - } - end = start + d; - } - base.start_date = base.start_date || start_date; - base.end_date = base.end_date || new Date(end); - base.text = base.text || this.locale.labels.new_event; - base.id = this._drag_id = this.uid(); - base.layer = this.defaultLayer; - this._drag_mode = "new-size"; - this._loading = true; - this.addEvent(base); - this.callEvent("onEventCreated", [this._drag_id, e]); - this._loading = false; - this._drag_event = {}; - this._on_mouse_up(e); - }; - scheduler2._t_render_view_data = function(events) { - if (this.config.multi_day && !this._table_view) { - var tvs = []; - var tvd = []; - for (var k = 0; k < events.length; k++) { - if (events[k]._timed) - tvs.push(events[k]); - else - tvd.push(events[k]); - } - this._table_view = true; - this.render_data(tvd); - this._table_view = false; - this.render_data(tvs); - } else - this.render_data(events); + d._date = new Date(sd); + d.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7; + var dd = d._min_date = this.date.week_start(sd); + d._max_date = this.date.add(d._min_date, 6, "week"); + this._reset_month_scale(body, sd, dd, 6); + if (!previous) + obj.appendChild(d); + weekHeader.style.height = weekHeader.childNodes[0].offsetHeight - 1 + "px"; + var headerId = scheduler2.uid(); + scheduler2._waiAria.minicalHeader(header, headerId); + scheduler2._waiAria.minicalGrid(d.querySelector(".dhx_year_grid"), headerId); + scheduler2._waiAria.minicalRow(weekHeader); + var dayHeaders = weekHeader.querySelectorAll(".dhx_scale_bar"); + for (var i = 0; i < dayHeaders.length; i++) { + scheduler2._waiAria.minicalHeadCell(dayHeaders[i]); + } + var dayCells = body.querySelectorAll(".dhx_cal_month_cell"); + var firstDate = new Date(dd); + for (var i = 0; i < dayCells.length; i++) { + scheduler2._waiAria.minicalDayCell(dayCells[i], new Date(firstDate)); + firstDate = scheduler2.date.add(firstDate, 1, "day"); + } + scheduler2._waiAria.minicalHeader(header, headerId); + this._cols = temp; + this._mode = temp2; + this._colsS = temp3; + this._min_date = temp4; + this._max_date = temp5; + scheduler2._date = temp6; + ts.month_day = temp7; + this._ignores_detected = temp8; + return d; + }; + scheduler2.destroyCalendar = function(cal, force) { + if (!cal && this._def_count && this._def_count.firstChild) { + if (force || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) + cal = this._def_count.firstChild; + } + if (!cal) + return; + minicalDomEvents.detachAll(); + cal.innerHTML = ""; + if (cal.parentNode) + cal.parentNode.removeChild(cal); + if (this._def_count) + this._def_count.style.top = "-1000px"; + if (cal.conf && cal.conf._on_xle_handler) + scheduler2.detachEvent(cal.conf._on_xle_handler); + }; + scheduler2.isCalendarVisible = function() { + if (this._def_count && parseInt(this._def_count.style.top, 10) > 0) + return this._def_count; + return false; + }; + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.event(document.body, "click", function() { + scheduler2.destroyCalendar(); + }); + }, { once: true }); + scheduler2.form_blocks.calendar_time = { render: function(sns) { + var html = ""; + var cfg = scheduler2.config; + var dt = this.date.date_part(scheduler2._currentDate()); + var last = 24 * 60, first = 0; + if (cfg.limit_time_select) { + first = 60 * cfg.first_hour; + last = 60 * cfg.last_hour + 1; + } + dt.setHours(first / 60); + sns._time_values = []; + html += " "; + return "
" + html + "  –  " + html + "
"; + }, set_value: function(node, value, ev, config) { + var inputs = node.getElementsByTagName("input"); + var selects = node.getElementsByTagName("select"); + var start_date, end_date; + var _init_once = function(inp, date, number) { + scheduler2.event(inp, "click", function() { + scheduler2.destroyCalendar(null, true); + scheduler2.renderCalendar({ position: inp, date: new Date(this._date), navigation: true, handler: function(new_date) { + inp.value = scheduler2.templates.calendar_time(new_date); + inp._date = new Date(new_date); + scheduler2.destroyCalendar(); + if (scheduler2.config.event_duration && scheduler2.config.auto_end_date && number === 0) { + _update_minical_select(); + } + } }); + }); }; - scheduler2.render_view_data = function() { - if (this._not_render) { - this._render_wait = true; - return; - } - this._render_wait = false; - this.clear_view(); - this._evs_layer = {}; - for (var i2 = 0; i2 < this.layers.length; i2++) { - this._evs_layer[this.layers[i2].name] = []; - } - var evs = this.get_visible_events(); - for (var i2 = 0; i2 < evs.length; i2++) { - if (this._evs_layer[evs[i2].layer]) - this._evs_layer[evs[i2].layer].push(evs[i2]); + if (scheduler2.config.full_day) { + if (!node._full_day) { + var html = ""; + if (!scheduler2.config.wide_form) + html = node.previousSibling.innerHTML + html; + node.previousSibling.innerHTML = html; + node._full_day = true; } - if (this._mode == "month") { - var tevs = []; - for (var i2 = 0; i2 < this.layers.length; i2++) { - if (this.layers[i2].visible) - tevs = tevs.concat(this._evs_layer[this.layers[i2].name]); - } - this._t_render_view_data(tevs); - } else { - for (var i2 = 0; i2 < this.layers.length; i2++) { - if (this.layers[i2].visible) { - var evs_layer = this._evs_layer[this.layers[i2].name]; - this._t_render_view_data(evs_layer); + var input = node.previousSibling.getElementsByTagName("input")[0]; + var isFulldayEvent = scheduler2.date.time_part(ev.start_date) === 0 && scheduler2.date.time_part(ev.end_date) === 0; + input.checked = isFulldayEvent; + selects[0].disabled = input.checked; + selects[1].disabled = input.checked; + if (!input.$_eventAttached) { + input.$_eventAttached = true; + scheduler2.event(input, "click", function() { + if (input.checked === true) { + var obj = {}; + scheduler2.form_blocks.calendar_time.get_value(node, obj); + start_date = scheduler2.date.date_part(obj.start_date); + end_date = scheduler2.date.date_part(obj.end_date); + if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) + end_date = scheduler2.date.add(end_date, 1, "day"); } + var start = start_date || ev.start_date; + var end = end_date || ev.end_date; + _attach_action(inputs[0], start); + _attach_action(inputs[1], end); + selects[0].value = start.getHours() * 60 + start.getMinutes(); + selects[1].value = end.getHours() * 60 + end.getMinutes(); + selects[0].disabled = input.checked; + selects[1].disabled = input.checked; + }); + } + } + if (scheduler2.config.event_duration && scheduler2.config.auto_end_date) { + var _update_minical_select = function() { + if (!(scheduler2.config.auto_end_date && scheduler2.config.event_duration)) { + return; } + start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); + end_date = new Date(start_date.getTime() + scheduler2.config.event_duration * 60 * 1e3); + inputs[1].value = scheduler2.templates.calendar_time(end_date); + inputs[1]._date = scheduler2.date.date_part(new Date(end_date)); + selects[1].value = end_date.getHours() * 60 + end_date.getMinutes(); + }; + if (!selects[0].$_eventAttached) { + selects[0].addEventListener("change", _update_minical_select); } + } + function _attach_action(inp, date, number) { + _init_once(inp, date, number); + inp.value = scheduler2.templates.calendar_time(date); + inp._date = scheduler2.date.date_part(new Date(date)); + } + _attach_action(inputs[0], ev.start_date, 0); + _attach_action(inputs[1], ev.end_date, 1); + _init_once = function() { }; - scheduler2._render_v_bar = function(ev, x, y, w, h, style, contentA, contentB, bottom) { - var id2 = ev.id; - if (contentA.indexOf("
'; - html += '
 
'; - html += '
' + contentA + "
"; - html += '
' + contentB + "
"; - html += '
'; - d.innerHTML = html; - d.style.zIndex = 100; - return d.firstChild; - }; - scheduler2.render_event_bar = function(ev) { - var parent = this._els["dhx_cal_data"][0]; - var x = this._colsS[ev._sday]; - var x2 = this._colsS[ev._eday]; - if (x2 == x) - x2 = this._colsS[ev._eday + 1]; - var hb = this.xy.bar_height; - var y = this._colsS.heights[ev._sweek] + (this._colsS.height ? this.xy.month_scale_height + 2 : 2) + ev._sorder * hb; - var d = document.createElement("div"); - var cs2 = ev._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line"; - var cse = scheduler2.templates["event_class_" + ev.layer] ? scheduler2.templates["event_class_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); - if (cse) - cs2 = cs2 + " " + cse; - var html = '
'; - if (ev._timed) - html += scheduler2.templates["event_bar_date_" + ev.layer] ? scheduler2.templates["event_bar_date_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_date(ev.start_date, ev.end_date, ev); - html += scheduler2.templates["event_bar_text_" + ev.layer] ? scheduler2.templates["event_bar_text_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_text(ev.start_date, ev.end_date, ev) + "
)"; - html += ""; - d.innerHTML = html; - this._rendered.push(d.firstChild); - parent.appendChild(d.firstChild); - }; - scheduler2.render_event = function(ev) { - var menu = scheduler2.xy.menu_width; - if (scheduler2.getLayer(ev.layer).noMenu) - menu = 0; - if (ev._sday < 0) - return; - var parent = scheduler2.locate_holder(ev._sday); - if (!parent) - return; - var sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes(); - var em = ev.end_date.getHours() * 60 + ev.end_date.getMinutes() || scheduler2.config.last_hour * 60; - var top = Math.round((sm * 60 * 1e3 - this.config.first_hour * 60 * 60 * 1e3) * this.config.hour_size_px / (60 * 60 * 1e3)) % (this.config.hour_size_px * 24) + 1; - var height = Math.max(scheduler2.xy.min_event_height, (em - sm) * this.config.hour_size_px / 60) + 1; - var width = Math.floor((parent.clientWidth - menu) / ev._count); - var left = ev._sorder * width + 1; - if (!ev._inner) - width = width * (ev._count - ev._sorder); - var d = this._render_v_bar(ev.id, menu + left, top, width, height, ev._text_style, scheduler2.templates.event_header(ev.start_date, ev.end_date, ev), scheduler2.templates.event_text(ev.start_date, ev.end_date, ev)); - this._rendered.push(d); - parent.appendChild(d); - left = left + parseInt(parent.style.left, 10) + menu; - top += this._dy_shift; - d.style.zIndex = this._layers_zindex[ev.layer]; - if (this._edit_id == ev.id) { - d.style.zIndex = parseInt(d.style.zIndex) + 1; - var new_zIndex = d.style.zIndex; - width = Math.max(width - 4, scheduler2.xy.editor_width); - var d = document.createElement("div"); - d.setAttribute("event_id", ev.id); - d.setAttribute(this.config.event_attribute, ev.id); - this.set_xy(d, width, height - 20, left, top + 14); - d.className = "dhx_cal_editor"; - d.style.zIndex = new_zIndex; - var d2 = document.createElement("div"); - this.set_xy(d2, width - 6, height - 26); - d2.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;"; - d2.style.zIndex = new_zIndex; - d.appendChild(d2); - this._els["dhx_cal_data"][0].appendChild(d); - this._rendered.push(d); - d2.innerHTML = ""; - this._editor = d2.firstChild; - this._editor.addEventListener("keypress", function(e) { - if (e.shiftKey) - return true; - var code = e.keyCode; - if (code == scheduler2.keys.edit_save) - scheduler2.editStop(true); - if (code == scheduler2.keys.edit_cancel) - scheduler2.editStop(false); - }); - this._editor.addEventListener("selectstart", function(e) { - e.cancelBubble = true; - return true; - }); - d2.firstChild.focus(); - this._els["dhx_cal_data"][0].scrollLeft = 0; - d2.firstChild.select(); + function _round_minutes(date) { + var time_values = config._time_values; + var direct_value = date.getHours() * 60 + date.getMinutes(); + var fixed_value = direct_value; + var value_found = false; + for (var k = 0; k < time_values.length; k++) { + var t_v = time_values[k]; + if (t_v === direct_value) { + value_found = true; + break; + } + if (t_v < direct_value) + fixed_value = t_v; } - if (this._select_id == ev.id) { - d.style.zIndex = parseInt(d.style.zIndex) + 1; - var icons = this.config["icons_" + (this._edit_id == ev.id ? "edit" : "select")]; - var icons_str = ""; - for (var i2 = 0; i2 < icons.length; i2++) - icons_str += "
"; - var obj = this._render_v_bar(ev.id, left - menu + 1, top, menu, icons.length * 20 + 26, "", "
", icons_str, true); - obj.style.left = left - menu + 1; - obj.style.zIndex = d.style.zIndex; - this._els["dhx_cal_data"][0].appendChild(obj); - this._rendered.push(obj); + if (!(value_found || fixed_value)) + return -1; + return value_found ? direct_value : fixed_value; + } + selects[0].value = _round_minutes(ev.start_date); + selects[1].value = _round_minutes(ev.end_date); + }, get_value: function(node, ev) { + var inputs = node.getElementsByTagName("input"); + var selects = node.getElementsByTagName("select"); + ev.start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); + ev.end_date = scheduler2.date.add(inputs[1]._date, selects[1].value, "minute"); + if (ev.end_date <= ev.start_date) + ev.end_date = scheduler2.date.add(ev.start_date, scheduler2.config.time_step, "minute"); + return { start_date: new Date(ev.start_date), end_date: new Date(ev.end_date) }; + }, focus: function(node) { + } }; + scheduler2.linkCalendar = function(calendar, datediff) { + var action = function() { + var date = scheduler2._date; + var dateNew = new Date(date.valueOf()); + if (datediff) + dateNew = datediff(dateNew); + dateNew.setDate(1); + scheduler2.updateCalendar(calendar, dateNew); + return true; + }; + scheduler2.attachEvent("onViewChange", action); + scheduler2.attachEvent("onXLE", action); + scheduler2.attachEvent("onEventAdded", action); + scheduler2.attachEvent("onEventChanged", action); + scheduler2.attachEvent("onEventDeleted", action); + action(); + }; + scheduler2._markCalendarCurrentDate = function(calendar) { + var state = scheduler2.getState(); + var from = state.min_date; + var to = state.max_date; + var mode = state.mode; + var month_start = scheduler2.date.month_start(new Date(calendar._date)); + var month_end = scheduler2.date.add(month_start, 1, "month"); + var noHighlight = { month: true, year: true, agenda: true, grid: true }; + if (noHighlight[mode] || from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf()) { + return; + } + var current = from; + while (current.valueOf() < to.valueOf()) { + if (month_start.valueOf() <= current.valueOf() && month_end > current) { + scheduler2.markCalendar(calendar, current, "dhx_calendar_click"); } + current = scheduler2.date.add(current, 1, "day"); + } + }; + scheduler2.attachEvent("onEventCancel", function() { + scheduler2.destroyCalendar(null, true); + }); + scheduler2.attachEvent("onDestroy", function() { + scheduler2.destroyCalendar(); + }); +} +function monthheight(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.xy.scroll_width = 0; + var old = scheduler2.render_view_data; + scheduler2.render_view_data = function() { + var data = this._els["dhx_cal_data"][0]; + data.firstChild._h_fix = true; + old.apply(scheduler2, arguments); + var height = parseInt(data.style.height); + data.style.height = "1px"; + data.style.height = data.scrollHeight + "px"; + this._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + "px"; }; - scheduler2.filter_agenda = function(id2, event2) { - var layer2 = scheduler2.getLayer(event2.layer); - return layer2 && layer2.visible; + var old_s = scheduler2._reset_month_scale; + scheduler2._reset_month_scale = function(a, b, c, d) { + var dummy = { clientHeight: 100 }; + old_s.apply(scheduler2, [dummy, b, c, d]); + a.innerHTML = dummy.innerHTML; }; }); } -function limit(scheduler2) { - scheduler2.config.limit_start = null; - scheduler2.config.limit_end = null; - scheduler2.config.limit_view = false; - scheduler2.config.check_limits = true; - scheduler2.config.mark_now = true; - scheduler2.config.display_marked_timespans = true; - scheduler2.config.overwrite_marked_timespans = true; - scheduler2._temp_limit_scope = function() { - var before = null; - var dhx_time_block = "dhx_time_block"; - var default_timespan_type = "default"; - var fix_options = function(options, days, zones) { - if (days instanceof Date && zones instanceof Date) { - options.start_date = days; - options.end_date = zones; - } else { - options.days = days; - options.zones = zones; +function multisection_restricted(scheduler2) { + notImplemented.alert("Multisection", scheduler2.assert); +} +function multiselect(scheduler2) { + function parseXMLOptions(loader, config) { + var items = scheduler2.ajax.xpath("//data/item", loader.xmlDoc); + var ids = {}; + for (var i = 0; i < items.length; i++) { + ids[items[i].getAttribute(config.map_to)] = true; + } + return ids; + } + function parseJSONOptions(loader, config) { + try { + var items = JSON.parse(loader.xmlDoc.responseText); + var ids = {}; + for (var i = 0; i < items.length; i++) { + var option = items[i]; + ids[option.value || option.key || option.id] = true; } - return options; - }; - var get_resulting_options = function(days, zones, sections) { - var options = typeof days == "object" ? days : { days }; - options.type = dhx_time_block; - options.css = ""; - if (zones) { - if (sections) - options.sections = sections; - options = fix_options(options, days, zones); + return ids; + } catch (e) { + return null; + } + } + scheduler2.form_blocks["multiselect"] = { render: function(sns) { + var css = "dhx_multi_select_control dhx_multi_select_" + sns.name; + if (!!sns.vertical) { + css += " dhx_multi_select_control_vertical"; + } + var _result = "
"; + for (var i = 0; i < sns.options.length; i++) { + _result += ""; + } + _result += "
"; + return _result; + }, set_value: function(node, value, ev, config) { + var _children = node.getElementsByTagName("input"); + for (var i = 0; i < _children.length; i++) { + _children[i].checked = false; + } + function _mark_inputs(ids) { + var _children2 = node.getElementsByTagName("input"); + for (var i2 = 0; i2 < _children2.length; i2++) { + _children2[i2].checked = !!ids[_children2[i2].value]; } - return options; - }; - scheduler2.blockTime = function(days, zones, sections) { - var options = get_resulting_options(days, zones, sections); - return scheduler2.addMarkedTimespan(options); - }; - scheduler2.unblockTime = function(days, zones, sections) { - zones = zones || "fullday"; - var options = get_resulting_options(days, zones, sections); - return scheduler2.deleteMarkedTimespan(options); - }; - scheduler2.attachEvent("onBeforeViewChange", function(om, od, nm, nd) { - function isBlocked(date, mode) { - var limit_start = scheduler2.config.limit_start, limit_end = scheduler2.config.limit_end, date_end = scheduler2.date.add(date, 1, mode); - return date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf(); + } + var _ids = {}; + if (ev[config.map_to]) { + var results = (ev[config.map_to] + "").split(config.delimiter || scheduler2.config.section_delimiter || ","); + for (var i = 0; i < results.length; i++) { + _ids[results[i]] = true; } - if (scheduler2.config.limit_view) { - nd = nd || od; - nm = nm || om; - if (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - var resetDate = !isBlocked(od, nm) ? od : scheduler2.config.limit_start; - scheduler2.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm); - }, 1); - return false; + _mark_inputs(_ids); + } else { + if (scheduler2._new_event || !config.script_url) + return; + var divLoading = document.createElement("div"); + divLoading.className = "dhx_loading"; + divLoading.style.cssText = "position: absolute; top: 40%; left: 40%;"; + node.appendChild(divLoading); + var url2 = [config.script_url, config.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + config.map_to + "=" + ev.id + "&uid=" + scheduler2.uid()].join(""); + scheduler2.ajax.get(url2, function(loader) { + var options = parseJSONOptions(loader); + if (!options) { + options = parseXMLOptions(loader, config); } + _mark_inputs(options); + node.removeChild(divLoading); + }); + } + }, get_value: function(node, ev, config) { + var _result = []; + var _children = node.getElementsByTagName("input"); + for (var i = 0; i < _children.length; i++) { + if (_children[i].checked) + _result.push(_children[i].value); + } + return _result.join(config.delimiter || scheduler2.config.section_delimiter || ","); + }, focus: function(node) { + } }; +} +function multisource(scheduler2) { + function backup(obj) { + var t = function() { + }; + t.prototype = obj; + return t; + } + var old = scheduler2._load; + scheduler2._load = function(url2, from) { + url2 = url2 || this._load_url; + if (typeof url2 == "object") { + var t = backup(this._loaded); + for (var i = 0; i < url2.length; i++) { + this._loaded = new t(); + old.call(this, url2[i], from); } - return true; + } else + old.apply(this, arguments); + }; +} +function mvc(scheduler2) { + var cfg = { use_id: false }; + function sanitize(ev) { + var obj = {}; + for (var key in ev) + if (key.indexOf("_") !== 0) + obj[key] = ev[key]; + if (!cfg.use_id) + delete obj.id; + return obj; + } + var update_timer; + function update_view() { + clearTimeout(update_timer); + update_timer = setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + scheduler2.updateView(); + }, 1); + } + function _start_ext_load(cal) { + cal._loading = true; + cal._not_render = true; + cal.callEvent("onXLS", []); + } + function _finish_ext_load(cal) { + cal._not_render = false; + if (cal._render_wait) + cal.render_view_data(); + cal._loading = false; + cal.callEvent("onXLE", []); + } + function _get_id(model) { + return cfg.use_id ? model.id : model.cid; + } + scheduler2.backbone = function(events, config) { + if (config) + cfg = config; + events.bind("change", function(model, info) { + var cid = _get_id(model); + var ev = scheduler2._events[cid] = model.toJSON(); + ev.id = cid; + scheduler2._init_event(ev); + update_view(); + }); + events.bind("remove", function(model, changes) { + var cid = _get_id(model); + if (scheduler2._events[cid]) + scheduler2.deleteEvent(cid); }); - scheduler2.checkInMarkedTimespan = function(ev, timespan_type, on_overlap) { - timespan_type = timespan_type || default_timespan_type; - var res = true; - var temp_start_date = new Date(ev.start_date.valueOf()); - var temp_end_date = scheduler2.date.add(temp_start_date, 1, "day"); - var timespans = scheduler2._marked_timespans; - for (; temp_start_date < ev.end_date; temp_start_date = scheduler2.date.date_part(temp_end_date), temp_end_date = scheduler2.date.add(temp_start_date, 1, "day")) { - var day_value = +scheduler2.date.date_part(new Date(temp_start_date)); - var day_index = temp_start_date.getDay(); - var zones = getZones(ev, timespans, day_index, day_value, timespan_type); - if (zones) { - for (var i = 0; i < zones.length; i += 2) { - var eventStart = scheduler2._get_zone_minutes(temp_start_date); - var eventEnd = ev.end_date > temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ? 1440 : scheduler2._get_zone_minutes(ev.end_date); - var markerStart = zones[i]; - var markerEnd = zones[i + 1]; - if (markerStart < eventEnd && markerEnd > eventStart) { - if (typeof on_overlap == "function") { - res = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd); - } else { - res = false; - } - if (!res) - break; - } - } - } - } - return !res; - }; - var blocker = scheduler2.checkLimitViolation = function(event2) { - if (!event2) - return true; - if (!scheduler2.config.check_limits) + var queue = []; + function add_from_queue() { + if (scheduler2.$destroyed) { return true; - var s = scheduler2; - var c = s.config; - var evs = []; - if (event2.rec_type) { - var dates = scheduler2.getRecDates(event2); - for (var i = 0; i < dates.length; i++) { - var ev = scheduler2._copy_event(event2); - scheduler2._lame_copy(ev, dates[i]); - evs.push(ev); - } - } else { - evs = [event2]; - } - var complete_res = true; - for (var p = 0; p < evs.length; p++) { - var res = true; - var ev = evs[p]; - ev._timed = scheduler2.isOneDayEvent(ev); - res = c.limit_start && c.limit_end ? ev.start_date.valueOf() >= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf() : true; - if (res) { - res = !scheduler2.checkInMarkedTimespan(ev, dhx_time_block, function(event3, eventStart, eventEnd, markerStart, markerEnd) { - var allow = true; - if (eventStart <= markerEnd && eventStart >= markerStart) { - if (markerEnd == 24 * 60 || eventEnd <= markerEnd) { - allow = false; - } - if (event3._timed && s._drag_id && s._drag_mode == "new-size") { - event3.start_date.setHours(0); - event3.start_date.setMinutes(markerEnd); - } else { - allow = false; - } - } - if (eventEnd >= markerStart && eventEnd <= markerEnd || eventStart < markerStart && eventEnd > markerEnd) { - if (event3._timed && s._drag_id && s._drag_mode == "new-size") { - event3.end_date.setHours(0); - event3.end_date.setMinutes(markerStart); - } else { - allow = false; - } - } - return allow; - }); - } - if (!res) { - res = s.checkEvent("onLimitViolation") ? s.callEvent("onLimitViolation", [ev.id, ev]) : res; - } - complete_res = complete_res && res; - } - if (!complete_res) { - s._drag_id = null; - s._drag_mode = null; - } - return complete_res; - }; - scheduler2._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type) { - var zones = []; - if (timespans && timespans[property]) { - var timeline_zones = timespans[property]; - var blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type); - for (var i = 0; i < blocked_timeline_zones.length; i++) { - zones = this._add_timespan_zones(zones, blocked_timeline_zones[i].zones); - } } - return zones; - }; - scheduler2._get_relevant_blocked_zones = function(day_index, day_value, zones, timespan_type) { - var resultZones; - if (scheduler2.config.overwrite_marked_timespans) { - resultZones = zones[day_value] && zones[day_value][timespan_type] ? zones[day_value][timespan_type] : zones[day_index] && zones[day_index][timespan_type] ? zones[day_index][timespan_type] : []; - } else { - resultZones = []; - if (zones[day_value] && zones[day_value][timespan_type]) { - resultZones = resultZones.concat(zones[day_value][timespan_type]); - } - if (zones[day_index] && zones[day_index][timespan_type]) { - resultZones = resultZones.concat(zones[day_index][timespan_type]); - } + if (queue.length) { + scheduler2.parse(queue, "json"); + queue = []; } - return resultZones; - }; - function getZones(ev, timespans, day_index, day_value, timespan_type) { - var s = scheduler2; - var zones = []; - var containers = { _props: "map_to", matrix: "y_property" }; - for (var container in containers) { - var property = containers[container]; - if (s[container]) { - for (var view in s[container]) { - var view_config = s[container][view]; - var linker = view_config[property]; - if (!ev[linker]) - continue; - zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans[view], ev[linker], day_index, day_value, timespan_type)); - } - } - } - zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans, "global", day_index, day_value, timespan_type)); - return zones; } - scheduler2.attachEvent("onMouseDown", function(classname) { - return !(classname == dhx_time_block); + events.bind("add", function(model, changes) { + var cid = _get_id(model); + if (!scheduler2._events[cid]) { + var ev = model.toJSON(); + ev.id = cid; + scheduler2._init_event(ev); + queue.push(ev); + if (queue.length == 1) + setTimeout(add_from_queue, 1); + } }); - scheduler2.attachEvent("onBeforeDrag", function(id2) { - if (!id2) - return true; - return blocker(scheduler2.getEvent(id2)); + events.bind("request", function(obj) { + if (obj instanceof Backbone.Collection) + _start_ext_load(scheduler2); }); - scheduler2.attachEvent("onClick", function(event_id, native_event_object) { - return blocker(scheduler2.getEvent(event_id)); + events.bind("sync", function(obj) { + if (obj instanceof Backbone.Collection) + _finish_ext_load(scheduler2); }); - scheduler2.attachEvent("onBeforeLightbox", function(id2) { - var ev = scheduler2.getEvent(id2); - before = [ev.start_date, ev.end_date]; - return blocker(ev); + events.bind("error", function(obj) { + if (obj instanceof Backbone.Collection) + _finish_ext_load(scheduler2); }); - scheduler2.attachEvent("onEventSave", function(id2, data, is_new_event) { - if (!(data.start_date && data.end_date)) { - var ev = scheduler2.getEvent(id2); - data.start_date = new Date(ev.start_date); - data.end_date = new Date(ev.end_date); - } - if (data.rec_type) { - var data_copy = scheduler2._lame_clone(data); - scheduler2._roll_back_dates(data_copy); - return blocker(data_copy); - } - return blocker(data); + scheduler2.attachEvent("onEventCreated", function(id2) { + var ev = new events.model(scheduler2.getEvent(id2)); + scheduler2._events[id2] = ev.toJSON(); + scheduler2._events[id2].id = id2; + return true; }); scheduler2.attachEvent("onEventAdded", function(id2) { - if (!id2) - return true; - var ev = scheduler2.getEvent(id2); - if (!blocker(ev) && scheduler2.config.limit_start && scheduler2.config.limit_end) { - if (ev.start_date < scheduler2.config.limit_start) { - ev.start_date = new Date(scheduler2.config.limit_start); - } - if (ev.start_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { - ev.start_date = this.date.add(scheduler2.config.limit_end, -1, "day"); - } - if (ev.end_date < scheduler2.config.limit_start) { - ev.end_date = new Date(scheduler2.config.limit_start); - } - if (ev.end_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { - ev.end_date = this.date.add(scheduler2.config.limit_end, -1, "day"); - } - if (ev.start_date.valueOf() >= ev.end_date.valueOf()) { - ev.end_date = this.date.add(ev.start_date, this.config.event_duration || this.config.time_step, "minute"); - } - ev._timed = this.isOneDayEvent(ev); + if (!events.get(id2)) { + var data = sanitize(scheduler2.getEvent(id2)); + var model = new events.model(data); + var cid = _get_id(model); + if (cid != id2) + this.changeEventId(id2, cid); + events.add(model); + events.trigger("scheduler:add", model); } return true; }); scheduler2.attachEvent("onEventChanged", function(id2) { - if (!id2) - return true; - var ev = scheduler2.getEvent(id2); - if (!blocker(ev)) { - if (!before) - return false; - ev.start_date = before[0]; - ev.end_date = before[1]; - ev._timed = this.isOneDayEvent(ev); - } + var ev = events.get(id2); + var upd = sanitize(scheduler2.getEvent(id2)); + ev.set(upd); + events.trigger("scheduler:change", ev); return true; }); - scheduler2.attachEvent("onBeforeEventChanged", function(ev, native_object, is_new) { - return blocker(ev); - }); - scheduler2.attachEvent("onBeforeEventCreated", function(ev) { - var start_date = scheduler2.getActionData(ev).date; - var event2 = { _timed: true, start_date, end_date: scheduler2.date.add(start_date, scheduler2.config.time_step, "minute") }; - return blocker(event2); - }); - scheduler2.attachEvent("onViewChange", function() { - scheduler2._mark_now(); - }); - scheduler2.attachEvent("onAfterSchedulerResize", function() { - window.setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - scheduler2._mark_now(); - }, 1); + scheduler2.attachEvent("onEventDeleted", function(id2) { + var model = events.get(id2); + if (model) { + events.trigger("scheduler:remove", model); + events.remove(id2); + } return true; }); - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2._mark_now_timer = window.setInterval(function() { - if (!scheduler2._is_initialized()) - return; - scheduler2._mark_now(); - }, 6e4); - }); - scheduler2.attachEvent("onDestroy", function() { - clearInterval(scheduler2._mark_now_timer); - }); - scheduler2._mark_now = function(hide) { - var dhx_now_time = "dhx_now_time"; - if (!this._els[dhx_now_time]) { - this._els[dhx_now_time] = []; - } - var now = scheduler2._currentDate(); - var cfg = this.config; - scheduler2._remove_mark_now(); - if (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() < cfg.last_hour) { - var day_index = this.locate_holder_day(now); - this._els[dhx_now_time] = scheduler2._append_mark_now(day_index, now); + }; +} +function outerdrag(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + var dragger = new dhtmlDragAndDropObject(); + var old = dragger.stopDrag; + var last_event; + dragger.stopDrag = function(e) { + last_event = e; + return old.apply(this, arguments); + }; + function on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { + if (scheduler2.checkEvent("onBeforeExternalDragIn") && !scheduler2.callEvent("onBeforeExternalDragIn", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event])) + return; + var temp = scheduler2.attachEvent("onEventCreated", function(id2) { + if (!scheduler2.callEvent("onExternalDragIn", [id2, sourceHtmlObject, last_event])) { + this._drag_mode = this._drag_id = null; + this.deleteEvent(id2); + } + }); + var action_data = scheduler2.getActionData(last_event); + var event_data = { start_date: new Date(action_data.date) }; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + var view_options = scheduler2.matrix[scheduler2._mode]; + event_data[view_options.y_property] = action_data.section; + var pos = scheduler2._locate_cell_timeline(last_event); + event_data.start_date = view_options._trace_x[pos.x]; + event_data.end_date = scheduler2.date.add(event_data.start_date, view_options.x_step, view_options.x_unit); + } + if (scheduler2._props && scheduler2._props[scheduler2._mode]) { + event_data[scheduler2._props[scheduler2._mode].map_to] = action_data.section; + } + scheduler2.addEventNow(event_data); + scheduler2.detachEvent(temp); + } + dragger.addDragLanding(scheduler2._els["dhx_cal_data"][0], { _drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { + on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml); + }, _dragIn: function(htmlObject, shtmlObject) { + return htmlObject; + }, _dragOut: function(htmlObject) { + return this; + } }); + if (dhtmlx.DragControl) { + dhtmlx.DragControl.addDrop(scheduler2._els["dhx_cal_data"][0], { onDrop: function(source, target, d, e) { + var sourceDhtmlx = dhtmlx.DragControl.getMaster(source); + last_event = e; + on_drop(source, sourceDhtmlx, target, e.target || e.srcElement); + }, onDragIn: function(source, target, e) { + return target; + } }, true); + } + }); +} +function pdf(scheduler2) { + var dx, dy, html_regexp = new RegExp("<[^>]*>", "g"), newline_regexp = new RegExp("]*>", "g"); + function clean_html(val) { + return val.replace(newline_regexp, "\n").replace(html_regexp, ""); + } + function x_norm(x, offset) { + x = parseFloat(x); + offset = parseFloat(offset); + if (!isNaN(offset)) + x -= offset; + var w = colsWidth(x); + x = x - w.width + w.cols * dx; + return isNaN(x) ? "auto" : 100 * x / dx; + } + function x_norm_event(x, offset, is_left) { + x = parseFloat(x); + offset = parseFloat(offset); + if (!isNaN(offset) && is_left) + x -= offset; + var w = colsWidth(x); + x = x - w.width + w.cols * dx; + return isNaN(x) ? "auto" : 100 * x / (dx - (!isNaN(offset) ? offset : 0)); + } + function colsWidth(width) { + var r = 0; + var header = scheduler2._els.dhx_cal_header[0].childNodes; + var els = header[1] ? header[1].childNodes : header[0].childNodes; + for (var i = 0; i < els.length; i++) { + var el2 = els[i].style ? els[i] : els[i].parentNode; + var w = parseFloat(el2.style.width); + if (width > w) { + width -= w + 1; + r += w + 1; + } else + break; + } + return { width: r, cols: i }; + } + function y_norm(y) { + y = parseFloat(y); + if (isNaN(y)) + return "auto"; + return 100 * y / dy; + } + function get_style(node, style) { + return (window.getComputedStyle ? window.getComputedStyle(node, null)[style] : node.currentStyle ? node.currentStyle[style] : null) || ""; + } + function de_day(node, n) { + var x = parseInt(node.style.left, 10); + for (var dx2 = 0; dx2 < scheduler2._cols.length; dx2++) { + x -= scheduler2._cols[dx2]; + if (x < 0) + return dx2; + } + return n; + } + function de_week(node, n) { + var y = parseInt(node.style.top, 10); + for (var dy2 = 0; dy2 < scheduler2._colsS.heights.length; dy2++) + if (scheduler2._colsS.heights[dy2] > y) + return dy2; + return n; + } + function xml_start(tag) { + return tag ? "<" + tag + ">" : ""; + } + function xml_end(tag) { + return tag ? "" : ""; + } + function xml_top(tag, profile, header, footer) { + var xml = "<" + tag + " profile='" + profile + "'"; + if (header) + xml += " header='" + header + "'"; + if (footer) + xml += " footer='" + footer + "'"; + xml += ">"; + return xml; + } + function xml_body_header() { + var xml = ""; + var mode = scheduler2._mode; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) + mode = scheduler2.matrix[scheduler2._mode].render == "cell" ? "matrix" : "timeline"; + xml += ""; + if (scheduler2._mode == "week_agenda") { + var xh = scheduler2._els.dhx_cal_data[0].getElementsByTagName("DIV"); + for (var i = 0; i < xh.length; i++) + if (xh[i].className == "dhx_wa_scale_bar") + xml += "" + clean_html(xh[i].innerHTML) + ""; + } else if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { + var xh = scheduler2._els.dhx_cal_header[0].childNodes[0].childNodes; + xml += "" + clean_html(xh[0].innerHTML) + "" + clean_html(xh[1].innerHTML) + ""; + } else if (scheduler2._mode == "year") { + var xh = scheduler2._els.dhx_cal_data[0].childNodes; + for (var i = 0; i < xh.length; i++) { + xml += ""; + xml += xml_month_scale(xh[i].querySelector(".dhx_year_week").childNodes); + xml += xml_month(xh[i].querySelector(".dhx_year_body")); + xml += ""; } - }; - scheduler2._append_mark_now = function(day_index, now) { - var dhx_now_time = "dhx_now_time"; - var zone_start = scheduler2._get_zone_minutes(now); - var options = { zones: [zone_start, zone_start + 1], css: dhx_now_time, type: dhx_now_time }; - if (!this._table_view) { - if (this._props && this._props[this._mode]) { - var start_index, end_index; - var view = this._props[this._mode]; - var units_l = view.size || view.options.length; - if (view.days > 1) { - if (view.size && view.options.length) { - day_index = (view.position + day_index) / view.options.length * view.size; - } - start_index = day_index; - end_index = day_index + units_l; - } else { - start_index = 0; - end_index = start_index + units_l; - } - var r_divs = []; - for (var i = start_index; i < end_index; i++) { - var t_day = i; - options.days = t_day; - var t_div = scheduler2._render_marked_timespan(options, null, t_day)[0]; - r_divs.push(t_div); - } - return r_divs; - } else { - options.days = day_index; - return scheduler2._render_marked_timespan(options, null, day_index); + } else { + xml += ""; + var xh = scheduler2._els.dhx_cal_header[0].childNodes; + xml += xml_month_scale(xh); + xml += ""; + var yh = scheduler2._els.dhx_cal_data[0]; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + xml += ""; + for (var i = 0; i < yh.firstChild.rows.length; i++) { + var el2 = yh.firstChild.rows[i]; + xml += ""; } + xml += ""; + dy = yh.firstChild.rows[0].cells[0].offsetHeight; + } else if (yh.firstChild.tagName == "TABLE") { + xml += xml_month(yh); } else { - if (this._mode == "month") { - options.days = +scheduler2.date.date_part(now); - return scheduler2._render_marked_timespan(options, null, null); - } + yh = yh.childNodes[yh.childNodes.length - 1]; + while (yh.className.indexOf("dhx_scale_holder") == -1) + yh = yh.previousSibling; + yh = yh.childNodes; + xml += ""; + for (var i = 0; i < yh.length; i++) + xml += "\n"; + xml += ""; + dy = yh[0].offsetHeight; } - }; - scheduler2._remove_mark_now = function() { - var dhx_now_time = "dhx_now_time"; - var els = this._els[dhx_now_time]; - for (var i = 0; i < els.length; i++) { - var div = els[i]; - var parent = div.parentNode; - if (parent) { - parent.removeChild(div); + } + xml += ""; + return xml; + } + function xml_month(yh) { + var xml = ""; + var r = yh.querySelectorAll("tr"); + for (var i = 0; i < r.length; i++) { + var days = []; + var cells = r[i].querySelectorAll("td"); + for (var j = 0; j < cells.length; j++) + days.push(cells[j].querySelector(".dhx_month_head").innerHTML); + xml += "\n"; + dy = cells[0].offsetHeight; + } + return xml; + } + function xml_month_scale(xh) { + var xhs, xml = ""; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + if (scheduler2.matrix[scheduler2._mode].second_scale) + xhs = xh[1].childNodes; + xh = xh[0].childNodes; + } + for (var i = 0; i < xh.length; i++) + xml += "\n"; + dx = xh[0].offsetWidth; + if (xhs) { + var width = 0; + var top_width = xh[0].offsetWidth; + var top_col = 1; + for (var i = 0; i < xhs.length; i++) { + xml += "\n"; + width += xhs[i].offsetWidth; + if (width >= top_width) { + top_width += xh[top_col] ? xh[top_col].offsetWidth : 0; + top_col++; } + dx = xhs[0].offsetWidth; } - this._els[dhx_now_time] = []; - }; - scheduler2._marked_timespans = { global: {} }; - scheduler2._get_zone_minutes = function(date) { - return date.getHours() * 60 + date.getMinutes(); - }; - scheduler2._prepare_timespan_options = function(config) { - var r_configs = []; - var temp_configs = []; - if (config.days == "fullweek") - config.days = [0, 1, 2, 3, 4, 5, 6]; - if (config.days instanceof Array) { - var t_days = config.days.slice(); - for (var i = 0; i < t_days.length; i++) { - var cloned_config = scheduler2._lame_clone(config); - cloned_config.days = t_days[i]; - r_configs.push.apply(r_configs, scheduler2._prepare_timespan_options(cloned_config)); - } - return r_configs; - } - if (!config || !(config.start_date && config.end_date && config.end_date > config.start_date || config.days !== void 0 && config.zones) && !config.type) - return r_configs; - var min = 0; - var max = 24 * 60; - if (config.zones == "fullday") - config.zones = [min, max]; - if (config.zones && config.invert_zones) { - config.zones = scheduler2.invertZones(config.zones); - } - config.id = scheduler2.uid(); - config.css = config.css || ""; - config.type = config.type || default_timespan_type; - var sections = config.sections; - if (sections) { - for (var view_key in sections) { - if (sections.hasOwnProperty(view_key)) { - var ids = sections[view_key]; - if (!(ids instanceof Array)) - ids = [ids]; - for (var i = 0; i < ids.length; i++) { - var t_config = scheduler2._lame_copy({}, config); - t_config.sections = {}; - t_config.sections[view_key] = ids[i]; - temp_configs.push(t_config); - } - } - } - } else { - temp_configs.push(config); - } - for (var k = 0; k < temp_configs.length; k++) { - var c_config = temp_configs[k]; - var start_date = c_config.start_date; - var end_date = c_config.end_date; - if (start_date && end_date) { - var t_sd = scheduler2.date.date_part(new Date(start_date)); - var t_ed = scheduler2.date.add(t_sd, 1, "day"); - while (t_sd < end_date) { - var t_config = scheduler2._lame_copy({}, c_config); - delete t_config.start_date; - delete t_config.end_date; - t_config.days = t_sd.valueOf(); - var zone_start = start_date > t_sd ? scheduler2._get_zone_minutes(start_date) : min; - var zone_end = end_date > t_ed || end_date.getDate() != t_sd.getDate() ? max : scheduler2._get_zone_minutes(end_date); - t_config.zones = [zone_start, zone_end]; - r_configs.push(t_config); - t_sd = t_ed; - t_ed = scheduler2.date.add(t_ed, 1, "day"); - } - } else { - if (c_config.days instanceof Date) - c_config.days = scheduler2.date.date_part(c_config.days).valueOf(); - c_config.zones = config.zones.slice(); - r_configs.push(c_config); + } + return xml; + } + function xml_body(colors) { + var xml = ""; + var evs = scheduler2._rendered; + var matrix = scheduler2.matrix && scheduler2.matrix[scheduler2._mode]; + if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { + for (var i = 0; i < evs.length; i++) + xml += ""; + } else if (scheduler2._mode == "week_agenda") { + for (var i = 0; i < evs.length; i++) + xml += "" + clean_html(evs[i].innerHTML) + ""; + } else if (scheduler2._mode == "year") { + var evs = scheduler2.get_visible_events(); + for (var i = 0; i < evs.length; i++) { + var d = evs[i].start_date; + if (d.valueOf() < scheduler2._min_date.valueOf()) + d = scheduler2._min_date; + while (d < evs[i].end_date) { + var m = d.getMonth() + 12 * (d.getFullYear() - scheduler2._min_date.getFullYear()) - scheduler2.week_starts._month; + var day = scheduler2.week_starts[m] + d.getDate() - 1; + var text_color = colors ? get_style(scheduler2._get_year_cell(d), "color") : ""; + var bg_color = colors ? get_style(scheduler2._get_year_cell(d), "backgroundColor") : ""; + xml += ""; + d = scheduler2.date.add(d, 1, "day"); + if (d.valueOf() >= scheduler2._max_date.valueOf()) + break; } } - return r_configs; - }; - scheduler2._get_dates_by_index = function(index, start, end) { - var dates = []; - start = scheduler2.date.date_part(new Date(start || scheduler2._min_date)); - end = new Date(end || scheduler2._max_date); - var start_day = start.getDay(); - var delta = index - start_day >= 0 ? index - start_day : 7 - start.getDay() + index; - var t_date = scheduler2.date.add(start, delta, "day"); - for (; t_date < end; t_date = scheduler2.date.add(t_date, 1, "week")) { - dates.push(t_date); - } - return dates; - }; - scheduler2._get_css_classes_by_config = function(config) { - var css_classes = []; - if (config.type == dhx_time_block) { - css_classes.push(dhx_time_block); - if (config.css) - css_classes.push(dhx_time_block + "_reset"); - } - css_classes.push("dhx_marked_timespan", config.css); - return css_classes.join(" "); - }; - scheduler2._get_block_by_config = function(config) { - var block = document.createElement("div"); - if (config.html) { - if (typeof config.html == "string") - block.innerHTML = config.html; - else - block.appendChild(config.html); - } - return block; - }; - scheduler2._render_marked_timespan = function(options, area, day) { - var blocks = []; - var c = scheduler2.config; - var min_date = this._min_date; - var max_date = this._max_date; - var day_value = false; - if (!c.display_marked_timespans) - return blocks; - if (!day && day !== 0) { - if (options.days < 7) - day = options.days; - else { - var date_to_display = new Date(options.days); - day_value = +date_to_display; - if (!(+max_date > +date_to_display && +min_date <= +date_to_display)) - return blocks; - day = date_to_display.getDay(); - } - var min_day = min_date.getDay(); - if (min_day > day) { - day = 7 - (min_day - day); - } else { - day = day - min_day; - } + } else if (matrix && matrix.render == "cell") { + var evs = scheduler2._els.dhx_cal_data[0].getElementsByTagName("TD"); + for (var i = 0; i < evs.length; i++) { + var text_color = colors ? get_style(evs[i], "color") : ""; + var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; + xml += "\n"; } - var zones = options.zones; - var css_classes = scheduler2._get_css_classes_by_config(options); - if (scheduler2._table_view && scheduler2._mode == "month") { - var areas = []; - var days = []; - if (!area) { - days = day_value ? [day_value] : scheduler2._get_dates_by_index(day); - for (var i = 0; i < days.length; i++) { - areas.push(this._scales[days[i]]); - } + } else { + for (var i = 0; i < evs.length; i++) { + var zx, zdx; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + zx = x_norm(evs[i].style.left); + zdx = x_norm(evs[i].offsetWidth) - 1; } else { - areas.push(area); - days.push(day); - } - for (var i = 0; i < areas.length; i++) { - area = areas[i]; - day = days[i]; - var sday = this.locate_holder_day(day, false) % this._cols.length; - if (this._ignores[sday]) - continue; - var block_proto = scheduler2._get_block_by_config(options); - block_proto.className = css_classes; - block_proto.style.top = "0px"; - block_proto.style.height = "100%"; - for (var k = 0; k < zones.length; k += 2) { - var start = zones[i]; - var end = zones[i + 1]; - if (end <= start) - return []; - var block = block_proto.cloneNode(true); - block.style.left = "0px"; - block.style.width = "100%"; - area.appendChild(block); - blocks.push(block); - } - } - } else { - var index = day; - if (this._ignores[this.locate_holder_day(day, false)]) - return blocks; - if (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) { - var view = this._props[this._mode]; - index = view.order[options.sections[this._mode]]; - var inner_index = view.order[options.sections[this._mode]]; - if (!(view.days > 1)) { - index = inner_index; - if (view.size && index > view.position + view.size) { - index = 0; - } - } else { - var units_l = view.size || view.options.length; - index = index * units_l + inner_index; - } - } - area = area ? area : scheduler2.locate_holder(index); - for (var i = 0; i < zones.length; i += 2) { - var start = Math.max(zones[i], c.first_hour * 60); - var end = Math.min(zones[i + 1], c.last_hour * 60); - if (end <= start) { - if (i + 2 < zones.length) - continue; - else - return []; - } - var block = scheduler2._get_block_by_config(options); - block.className = css_classes; - var all_hours_height = this.config.hour_size_px * 24 + 1; - var hour_ms = 60 * 60 * 1e3; - block.style.top = Math.round((start * 60 * 1e3 - this.config.first_hour * hour_ms) * this.config.hour_size_px / hour_ms) % all_hours_height + "px"; - block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * this.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; - area.appendChild(block); - blocks.push(block); - } - } - return blocks; - }; - scheduler2._mark_timespans = function() { - var data = this._els["dhx_cal_data"][0]; - var divs = []; - if (scheduler2._table_view && scheduler2._mode == "month") { - for (var day in this._scales) { - var date = /* @__PURE__ */ new Date(+day); - divs.push.apply(divs, scheduler2._on_scale_add_marker(this._scales[day], date)); - } - } else { - var date = new Date(scheduler2._min_date); - for (var i = 0, len = data.childNodes.length; i < len; i++) { - var area = data.childNodes[i]; - if (area.firstChild && scheduler2._getClassName(area.firstChild).indexOf("dhx_scale_hour") > -1) { - continue; - } - divs.push.apply(divs, scheduler2._on_scale_add_marker(area, date)); - date = scheduler2.date.add(date, 1, "day"); - } - } - return divs; - }; - scheduler2.markTimespan = function(configuration) { - if (!this._els) { - throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`."); - } - var rebuild_els = false; - if (!this._els["dhx_cal_data"]) { - scheduler2.get_elements(); - rebuild_els = true; - } - var timespans_ids = scheduler2._marked_timespans_ids, timespan_types = scheduler2._marked_timespans_types, timespans = scheduler2._marked_timespans; - scheduler2.deleteMarkedTimespan(); - scheduler2.addMarkedTimespan(configuration); - var divs = scheduler2._mark_timespans(); - if (rebuild_els) - scheduler2._els = []; - scheduler2._marked_timespans_ids = timespans_ids; - scheduler2._marked_timespans_types = timespan_types; - scheduler2._marked_timespans = timespans; - return divs; - }; - scheduler2.unmarkTimespan = function(divs) { - if (!divs) - return; - for (var i = 0; i < divs.length; i++) { - var div = divs[i]; - if (div.parentNode) { - div.parentNode.removeChild(div); - } - } - }; - scheduler2._addMarkerTimespanConfig = function(config) { - var global2 = "global"; - var timespans = scheduler2._marked_timespans; - var id2 = config.id; - var ids = scheduler2._marked_timespans_ids; - if (!ids[id2]) - ids[id2] = []; - var day = config.days; - var sections = config.sections; - var type = config.type; - config.id = id2; - if (sections) { - for (var view_key in sections) { - if (sections.hasOwnProperty(view_key)) { - if (!timespans[view_key]) - timespans[view_key] = {}; - var unit_id = sections[view_key]; - var timespans_view = timespans[view_key]; - if (!timespans_view[unit_id]) - timespans_view[unit_id] = {}; - if (!timespans_view[unit_id][day]) - timespans_view[unit_id][day] = {}; - if (!timespans_view[unit_id][day][type]) { - timespans_view[unit_id][day][type] = []; - if (!scheduler2._marked_timespans_types) - scheduler2._marked_timespans_types = {}; - if (!scheduler2._marked_timespans_types[type]) - scheduler2._marked_timespans_types[type] = true; - } - var day_configs = timespans_view[unit_id][day][type]; - config._array = day_configs; - day_configs.push(config); - ids[id2].push(config); - } - } - } else { - if (!timespans[global2][day]) - timespans[global2][day] = {}; - if (!timespans[global2][day][type]) - timespans[global2][day][type] = []; - if (!scheduler2._marked_timespans_types) - scheduler2._marked_timespans_types = {}; - if (!scheduler2._marked_timespans_types[type]) - scheduler2._marked_timespans_types[type] = true; - var day_configs = timespans[global2][day][type]; - config._array = day_configs; - day_configs.push(config); - ids[id2].push(config); - } - }; - scheduler2._marked_timespans_ids = {}; - scheduler2.addMarkedTimespan = function(configuration) { - var configs = scheduler2._prepare_timespan_options(configuration); - if (!configs.length) - return; - var id2 = configs[0].id; - for (var i = 0; i < configs.length; i++) { - scheduler2._addMarkerTimespanConfig(configs[i]); - } - return id2; - }; - scheduler2._add_timespan_zones = function(current_zones, zones) { - var resulting_zones = current_zones.slice(); - zones = zones.slice(); - if (!resulting_zones.length) - return zones; - for (var i = 0; i < resulting_zones.length; i += 2) { - var c_zone_start = resulting_zones[i]; - var c_zone_end = resulting_zones[i + 1]; - var isLast = i + 2 == resulting_zones.length; - for (var k = 0; k < zones.length; k += 2) { - var zone_start = zones[k]; - var zone_end = zones[k + 1]; - if (zone_end > c_zone_end && zone_start <= c_zone_end || zone_start < c_zone_start && zone_end >= c_zone_start) { - resulting_zones[i] = Math.min(c_zone_start, zone_start); - resulting_zones[i + 1] = Math.max(c_zone_end, zone_end); - i -= 2; - } else { - if (!isLast) - continue; - var offset = c_zone_start > zone_start ? 0 : 2; - resulting_zones.splice(i + offset, 0, zone_start, zone_end); - } - zones.splice(k--, 2); - break; + var left_norm = scheduler2.config.use_select_menu_space ? 0 : 26; + zx = x_norm_event(evs[i].style.left, left_norm, true); + zdx = x_norm_event(evs[i].style.width, left_norm) - 1; } - } - return resulting_zones; - }; - scheduler2._subtract_timespan_zones = function(current_zones, zones) { - var resulting_zones = current_zones.slice(); - for (var i = 0; i < resulting_zones.length; i += 2) { - var c_zone_start = resulting_zones[i]; - var c_zone_end = resulting_zones[i + 1]; - for (var k = 0; k < zones.length; k += 2) { - var zone_start = zones[k]; - var zone_end = zones[k + 1]; - if (zone_end > c_zone_start && zone_start < c_zone_end) { - var is_modified = false; - if (c_zone_start >= zone_start && c_zone_end <= zone_end) { - resulting_zones.splice(i, 2); - } - if (c_zone_start < zone_start) { - resulting_zones.splice(i, 2, c_zone_start, zone_start); - is_modified = true; - } - if (c_zone_end > zone_end) { - resulting_zones.splice(is_modified ? i + 2 : i, is_modified ? 0 : 2, zone_end, c_zone_end); - } - i -= 2; - break; - } else { + if (isNaN(zdx * 1)) + continue; + var zy = y_norm(evs[i].style.top); + var zdy = y_norm(evs[i].style.height); + var e_type = evs[i].className.split(" ")[0].replace("dhx_cal_", ""); + if (e_type === "dhx_tooltip_line") + continue; + var dets = scheduler2.getEvent(evs[i].getAttribute(scheduler2.config.event_attribute)); + if (!dets) + continue; + var day = dets._sday; + var week = dets._sweek; + var length = dets._length || 0; + if (scheduler2._mode == "month") { + zdy = parseInt(evs[i].offsetHeight, 10); + zy = parseInt(evs[i].style.top, 10) - scheduler2.xy.month_head_height; + day = de_day(evs[i], day); + week = de_week(evs[i], week); + } else if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + day = 0; + var el2 = evs[i].parentNode.parentNode.parentNode; + week = el2.rowIndex; + var dy_copy = dy; + dy = evs[i].parentNode.offsetHeight; + zy = y_norm(evs[i].style.top); + zy -= zy * 0.2; + dy = dy_copy; + } else { + if (evs[i].parentNode == scheduler2._els.dhx_cal_data[0]) continue; - } + var parent = scheduler2._els["dhx_cal_data"][0].childNodes[0]; + var offset = parseFloat(parent.className.indexOf("dhx_scale_holder") != -1 ? parent.style.left : 0); + zx += x_norm(evs[i].parentNode.style.left, offset); } - } - return resulting_zones; - }; - scheduler2.invertZones = function(zones) { - return scheduler2._subtract_timespan_zones([0, 1440], zones.slice()); - }; - scheduler2._delete_marked_timespan_by_id = function(id2) { - var configs = scheduler2._marked_timespans_ids[id2]; - if (configs) { - for (var i = 0; i < configs.length; i++) { - var config = configs[i]; - var parent_array = config._array; - for (var k = 0; k < parent_array.length; k++) { - if (parent_array[k] == config) { - parent_array.splice(k, 1); - break; - } - } + xml += "\n"; + if (e_type == "event") { + xml += "
"; + var text_color = colors ? get_style(evs[i].childNodes[2], "color") : ""; + var bg_color = colors ? get_style(evs[i].childNodes[2], "backgroundColor") : ""; + xml += ""; + } else { + var text_color = colors ? get_style(evs[i], "color") : ""; + var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; + xml += ""; } + xml += "
"; } - }; - scheduler2._delete_marked_timespan_by_config = function(config) { - var timespans = scheduler2._marked_timespans; - var sections = config.sections; - var day = config.days; - var type = config.type || default_timespan_type; - var viewspans; - if (sections) { - for (var view_key in sections) { - if (sections.hasOwnProperty(view_key) && timespans[view_key]) { - var unit_id = sections[view_key]; - if (timespans[view_key][unit_id]) { - viewspans = timespans[view_key][unit_id]; - } - } - } - } else { - viewspans = timespans.global; + } + return xml; + } + function toXML(start, end, view, mode, header, footer) { + var colors = false; + if (mode == "fullcolor") { + colors = true; + mode = "color"; + } + mode = mode || "color"; + var xml = ""; + if (start) { + var original_date = scheduler2._date; + var original_mode = scheduler2._mode; + end = scheduler2.date[view + "_start"](end); + end = scheduler2.date["get_" + view + "_end"] ? scheduler2.date["get_" + view + "_end"](end) : scheduler2.date.add(end, 1, view); + xml = xml_top("pages", mode, header, footer); + for (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) { + this.setCurrentView(temp_date, view); + xml += xml_start("page") + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("page"); } - if (viewspans) { - if (day !== void 0) { - if (viewspans[day] && viewspans[day][type]) { - scheduler2._addMarkerTimespanConfig(config); - scheduler2._delete_marked_timespans_list(viewspans[day][type], config); - } - } else { - for (var d in viewspans) { - if (viewspans[d][type]) { - var dayConfig = scheduler2._lame_clone(config); - config.days = d; - scheduler2._addMarkerTimespanConfig(dayConfig); - scheduler2._delete_marked_timespans_list(viewspans[d][type], config); - } - } + xml += xml_end("pages"); + this.setCurrentView(original_date, original_mode); + } else { + xml = xml_top("data", mode, header, footer) + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("data"); + } + return xml; + } + scheduler2.getPDFData = toXML; + function send_xml(xml, url2) { + var uid2 = scheduler2.uid(); + var d = document.createElement("div"); + d.style.display = "none"; + document.body.appendChild(d); + d.innerHTML = '
'; + document.getElementById(uid2).firstChild.value = encodeURIComponent(xml); + document.getElementById(uid2).submit(); + d.parentNode.removeChild(d); + } + function to_pdf(start, end, view, url2, mode, header, footer) { + var xml = ""; + if (typeof mode == "object") { + xml = schedulersToPdf(mode); + } else { + xml = toXML.apply(this, [start, end, view, mode, header, footer]); + } + send_xml(xml, url2); + } + function schedulersToPdf(objects) { + var xml = ""; + for (var i = 0; i < objects.length; i++) { + xml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer); + } + xml += ""; + return xml; + } + scheduler2.toPDF = function(url2, mode, header, footer) { + return to_pdf.apply(this, [null, null, null, url2, mode, header, footer]); + }; + scheduler2.toPDFRange = function(start, end, view, url2, mode, header, footer) { + if (typeof start == "string") { + start = scheduler2.templates.api_date(start); + end = scheduler2.templates.api_date(end); + } + return to_pdf.apply(this, arguments); + }; +} +function quick_info(scheduler2) { + scheduler2.config.icons_select = ["icon_form", "icon_delete"]; + scheduler2.config.details_on_create = true; + scheduler2.config.show_quick_info = true; + scheduler2.xy.menu_width = 0; + let clickedElementPosition = null; + scheduler2.attachEvent("onSchedulerReady", function() { + const container = scheduler2.$container; + if (container._$quickInfoHandler) { + return; + } else { + container._$quickInfoHandler = true; + scheduler2.event(container, "mousedown", function(e) { + const eventElement = e.target.closest(`[${scheduler2.config.event_attribute}]`); + if (eventElement) { + clickedElementPosition = { id: eventElement.getAttribute(scheduler2.config.event_attribute), position: getPositionInsideScheduler(eventElement) }; } - } + }); + scheduler2.attachEvent("onDestroy", () => { + delete container._$quickInfoHandler; + }); + } + }); + scheduler2.attachEvent("onClick", function(id2) { + if (!scheduler2.config.show_quick_info) { + return; + } + scheduler2.showQuickInfo(id2); + return true; + }); + (function() { + var events = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"]; + var hiding_function = function() { + scheduler2.hideQuickInfo(true); + return true; }; - scheduler2._delete_marked_timespans_list = function(day_timespans, config) { - for (var i = 0; i < day_timespans.length; i++) { - var d_t = day_timespans[i]; - var zones = scheduler2._subtract_timespan_zones(d_t.zones, config.zones); - if (zones.length) - d_t.zones = zones; - else { - day_timespans.splice(i, 1); - i--; - var related_zones = scheduler2._marked_timespans_ids[d_t.id]; - for (var k = 0; k < related_zones.length; k++) { - if (related_zones[k] == d_t) { - related_zones.splice(k, 1); - break; - } - } - } + for (var i = 0; i < events.length; i++) { + scheduler2.attachEvent(events[i], hiding_function); + } + })(); + scheduler2.templates.quick_info_title = function(start, end, ev) { + return ev.text.substr(0, 50); + }; + scheduler2.templates.quick_info_content = function(start, end, ev) { + return ev.details || ""; + }; + scheduler2.templates.quick_info_date = function(start, end, ev) { + if (scheduler2.isOneDayEvent(ev) && scheduler2.config.rtl) { + return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(end, start, ev); + } else if (scheduler2.isOneDayEvent(ev)) { + return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(start, end, ev); + } else if (scheduler2.config.rtl) { + return scheduler2.templates.week_date(end, start, ev); + } else { + return scheduler2.templates.week_date(start, end, ev); + } + }; + scheduler2.showQuickInfo = function(id2) { + if (id2 == this._quick_info_box_id) + return; + this.hideQuickInfo(true); + if (this.callEvent("onBeforeQuickInfo", [id2]) === false) { + return; + } + let pos; + if (clickedElementPosition && clickedElementPosition.id == id2) { + pos = clickedElementPosition.position; + } else { + pos = this._get_event_counter_part(id2); + } + if (pos) { + this._quick_info_box = this._init_quick_info(pos); + this._fill_quick_data(id2); + this._show_quick_info(pos); + this.callEvent("onQuickInfo", [id2]); + } + }; + (function() { + function cssTimeToMs(time) { + time = time || ""; + var num = parseFloat(time), unit = time.match(/m?s/), milliseconds; + if (unit) { + unit = unit[0]; } - }; - scheduler2.deleteMarkedTimespan = function(configuration) { - if (!arguments.length) { - scheduler2._marked_timespans = { global: {} }; - scheduler2._marked_timespans_ids = {}; - scheduler2._marked_timespans_types = {}; + switch (unit) { + case "s": + milliseconds = num * 1e3; + break; + case "ms": + milliseconds = num; + break; + default: + milliseconds = 0; + break; } - if (typeof configuration != "object") { - scheduler2._delete_marked_timespan_by_id(configuration); - } else { - if (!(configuration.start_date && configuration.end_date)) { - if (configuration.days === void 0 && !configuration.type) - configuration.days = "fullweek"; - if (!configuration.zones) - configuration.zones = "fullday"; + return milliseconds; + } + scheduler2.hideQuickInfo = function(forced) { + var qi = this._quick_info_box; + var eventId = this._quick_info_box_id; + this._quick_info_box_id = 0; + if (qi && qi.parentNode) { + var width = qi.offsetWidth; + if (scheduler2.config.quick_info_detached) { + this.callEvent("onAfterQuickInfo", [eventId]); + return qi.parentNode.removeChild(qi); } - var types = []; - if (!configuration.type) { - for (var type in scheduler2._marked_timespans_types) { - types.push(type); - } + if (qi.style.right == "auto") + qi.style.left = -width + "px"; + else + qi.style.right = -width + "px"; + if (forced) { + qi.parentNode.removeChild(qi); } else { - types.push(configuration.type); - } - var configs = scheduler2._prepare_timespan_options(configuration); - for (var i = 0; i < configs.length; i++) { - var config = configs[i]; - for (var t = 0; t < types.length; t++) { - var typedConfig = scheduler2._lame_clone(config); - typedConfig.type = types[t]; - scheduler2._delete_marked_timespan_by_config(typedConfig); + var style; + if (window.getComputedStyle) { + style = window.getComputedStyle(qi, null); + } else if (qi.currentStyle) { + style = qi.currentStyle; } + var delay2 = cssTimeToMs(style["transition-delay"]) + cssTimeToMs(style["transition-duration"]); + setTimeout(function() { + if (qi.parentNode) { + qi.parentNode.removeChild(qi); + } + }, delay2); } + this.callEvent("onAfterQuickInfo", [eventId]); } }; - scheduler2._get_types_to_render = function(common, specific) { - var types_to_render = common ? scheduler2._lame_copy({}, common) : {}; - for (var type in specific || {}) { - if (specific.hasOwnProperty(type)) { - types_to_render[type] = specific[type]; - } - } - return types_to_render; - }; - scheduler2._get_configs_to_render = function(types) { - var configs = []; - for (var type in types) { - if (types.hasOwnProperty(type)) { - configs.push.apply(configs, types[type]); - } - } - return configs; - }; - scheduler2._on_scale_add_marker = function(area, day) { - if (scheduler2._table_view && scheduler2._mode != "month") - return; - var day_index = day.getDay(); - var day_value = day.valueOf(); - var mode = this._mode; - var timespans = scheduler2._marked_timespans; - var r_configs = []; - var divs = []; - if (this._props && this._props[mode]) { - var view = this._props[mode]; - var units = view.options; - var index = scheduler2._get_unit_index(view, day); - var unit = units[index]; - if (!(view.days > 1)) { - day = scheduler2.date.date_part(new Date(this._date)); + })(); + scheduler2.event(window, "keydown", function(e) { + if (e.keyCode == 27) + scheduler2.hideQuickInfo(); + }); + scheduler2._show_quick_info = function(pos) { + var qi = scheduler2._quick_info_box; + scheduler2._obj.appendChild(qi); + var width = qi.offsetWidth; + var height = qi.offsetHeight; + if (scheduler2.config.quick_info_detached) { + var left = pos.left - pos.dx * (width - pos.width); + if (scheduler2.getView() && scheduler2.getView()._x_scroll) { + if (scheduler2.config.rtl) { + left += scheduler2.getView()._x_scroll; } else { - var dx = 24 * 60 * 60 * 1e3; - var day_ind = Math.round((day - scheduler2._min_date) / dx); - var unitsPerDay = view.size || units.length; - day = scheduler2.date.add(scheduler2._min_date, Math.floor(day_ind / unitsPerDay), "day"); - day = scheduler2.date.date_part(day); - } - day_index = day.getDay(); - day_value = day.valueOf(); - if (timespans[mode] && timespans[mode][unit.key]) { - var unit_zones = timespans[mode][unit.key]; - var unit_types = scheduler2._get_types_to_render(unit_zones[day_index], unit_zones[day_value]); - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(unit_types)); - } - } - var global_data = timespans["global"]; - if (scheduler2.config.overwrite_marked_timespans) { - var day_types = global_data[day_value] || global_data[day_index]; - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(day_types)); - } else { - if (global_data[day_value]) { - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_value])); - } - if (global_data[day_index]) { - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_index])); + left -= scheduler2.getView()._x_scroll; } } - for (var i = 0; i < r_configs.length; i++) { - divs.push.apply(divs, scheduler2._render_marked_timespan(r_configs[i], area, day)); + var right = left + width; + if (right > window.innerWidth) { + left = window.innerWidth - width; } - return divs; - }; - scheduler2.attachEvent("onScaleAdd", function() { - scheduler2._on_scale_add_marker.apply(scheduler2, arguments); - }); - scheduler2.dblclick_dhx_marked_timespan = function(e, src) { - scheduler2.callEvent("onScaleDblClick", [scheduler2.getActionData(e).date, src, e]); - if (scheduler2.config.dblclick_create) { - scheduler2.addEventNow(scheduler2.getActionData(e).date, null, e); + left = Math.max(0, left); + qi.style.left = left + "px"; + qi.style.top = pos.top - (pos.dy ? height : -pos.height) + "px"; + } else { + const dataPos = scheduler2.$container.querySelector(".dhx_cal_data").offsetTop; + qi.style.top = dataPos + 20 + "px"; + if (pos.dx == 1) { + qi.style.right = "auto"; + qi.style.left = -width + "px"; + setTimeout(function() { + qi.style.left = "-10px"; + }, 1); + } else { + qi.style.left = "auto"; + qi.style.right = -width + "px"; + setTimeout(function() { + qi.style.right = "-10px"; + }, 1); } + qi.className = qi.className.replace(" dhx_qi_left", "").replace(" dhx_qi_right", "") + " dhx_qi_" + (pos.dx == 1 ? "left" : "right"); + } + qi.ontransitionend = () => { + fitQIInsideWindow(qi); + qi.ontransitionend = null; }; + setTimeout(() => { + fitQIInsideWindow(qi); + }, 1); }; - scheduler2._temp_limit_scope(); -} -function map_view(scheduler2) { - if (!scheduler2.ext) { - scheduler2.ext = {}; + function fitQIInsideWindow(quickInfoPopup) { + const popupRect = quickInfoPopup.getBoundingClientRect(); + const containerRect = scheduler2.$container.getBoundingClientRect(); + const offsetBottom = containerRect.bottom - popupRect.bottom; + if (offsetBottom < 0) { + quickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`; + } } - scheduler2.ext.mapView = { geocoder: null, map: null, points: null, markers: null, infoWindow: null, createMarker: function(config) { - return new google.maps.Marker(config); - } }; - scheduler2.xy.map_date_width = 188; - scheduler2.xy.map_icon_width = 25; - scheduler2.xy.map_description_width = 400; - scheduler2.config.map_resolve_event_location = true; - scheduler2.config.map_resolve_user_location = true; - scheduler2.config.map_initial_position = new google.maps.LatLng(48.724, 8.215); - scheduler2.config.map_error_position = new google.maps.LatLng(15, 15); - scheduler2.config.map_infowindow_max_width = 300; - scheduler2.config.map_type = google.maps.MapTypeId.ROADMAP; - scheduler2.config.map_zoom_after_resolve = 15; - scheduler2.locale.labels.marker_geo_success = "It seems you are here."; - scheduler2.locale.labels.marker_geo_fail = "Sorry, could not get your current position using geolocation."; - scheduler2.templates.marker_date = scheduler2.date.date_to_str("%Y-%m-%d %H:%i"); - scheduler2.templates.marker_text = function(start, end, ev) { - return "
" + ev.text + "

" + (ev.event_location || "") + "

" + scheduler2.templates.marker_date(start) + " - " + scheduler2.templates.marker_date(end) + "
"; - }; - scheduler2.dblclick_dhx_map_area = function() { - if (!this.config.readonly && this.config.dblclick_create) - this.addEventNow({ start_date: scheduler2._date, end_date: scheduler2.date.add(scheduler2._date, scheduler2.config.time_step, "minute") }); - }; - scheduler2.templates.map_time = function(start, end, ev) { - if (scheduler2.config.rtl && !ev._timed) { - return scheduler2.templates.day_date(end) + " – " + scheduler2.templates.day_date(start); - } else if (ev._timed) { - return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); - } else { - return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.hideQuickInfo(); + if (this._quick_info_box) { + var box = this._quick_info_box; + if (box.parentNode) { + box.parentNode.removeChild(box); + } + this._quick_info_box = null; } + }); + scheduler2._quick_info_onscroll_handler = function(e) { + scheduler2.hideQuickInfo(); }; - scheduler2.templates.map_text = function(start, end, ev) { - return ev.text; - }; - scheduler2.date.map_start = function(d) { - return d; - }; - scheduler2.date.add_map = function(date, inc, mode) { - return new Date(date.valueOf()); - }; - scheduler2.templates.map_date = function(dd, ed, mode) { - return ""; - }; - scheduler2._latLngUpdate = false; - scheduler2.attachEvent("onSchedulerReady", function() { - scheduler2._isMapPositionSet = false; - const gmap = document.createElement("div"); - gmap.className = "dhx_map"; - gmap.id = "dhx_gmap"; - gmap.style.display = "none"; - scheduler2._obj.appendChild(gmap); - scheduler2._els.dhx_gmap = []; - scheduler2._els.dhx_gmap.push(gmap); - _setMapSize("dhx_gmap"); - const mapOptions = { zoom: scheduler2.config.map_initial_zoom || 10, center: scheduler2.config.map_initial_position, mapTypeId: scheduler2.config.map_type || google.maps.MapTypeId.ROADMAP }; - const map = new google.maps.Map(document.getElementById("dhx_gmap"), mapOptions); - map.disableDefaultUI = false; - map.disableDoubleClickZoom = !scheduler2.config.readonly; - google.maps.event.addListener(map, "dblclick", function(event2) { - const geocoder = scheduler2.ext.mapView.geocoder; - if (!scheduler2.config.readonly && scheduler2.config.dblclick_create) { - var point = event2.latLng; - geocoder.geocode({ latLng: point }, function(results, status) { - if (status == google.maps.GeocoderStatus.OK) { - point = results[0].geometry.location; - scheduler2.addEventNow({ lat: point.lat(), lng: point.lng(), event_location: results[0].formatted_address, start_date: scheduler2._date, end_date: scheduler2.date.add(scheduler2._date, scheduler2.config.time_step, "minute") }); - } - }); + scheduler2._init_quick_info = function() { + if (!this._quick_info_box) { + var qi = this._quick_info_box = document.createElement("div"); + this._waiAria.quickInfoAttr(qi); + qi.className = "dhx_cal_quick_info"; + if (scheduler2.$testmode) + qi.className += " dhx_no_animate"; + if (scheduler2.config.rtl) + qi.className += " dhx_quick_info_rtl"; + var ariaAttr = this._waiAria.quickInfoHeaderAttrString(); + var html = ` +
+ +
+
+ +
+
+
+
`; + html += '
'; + var buttons = scheduler2.config.icons_select; + for (var i = 0; i < buttons.length; i++) { + var ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]); + html += `
+
${scheduler2.locale.labels[buttons[i]]}
`; } - }); - var infoWindowOptions = { content: "" }; - if (scheduler2.config.map_infowindow_max_width) { - infoWindowOptions.maxWidth = scheduler2.config.map_infowindow_max_width; - } - scheduler2.map = { _points: [], _markers: [], _infowindow: new google.maps.InfoWindow(infoWindowOptions), _infowindows_content: [], _initialization_count: -1, _obj: map }; - scheduler2.ext.mapView.geocoder = new google.maps.Geocoder(); - scheduler2.ext.mapView.map = map; - scheduler2.ext.mapView.points = scheduler2.map._points; - scheduler2.ext.mapView.markers = scheduler2.map._markers; - scheduler2.ext.mapView.infoWindow = scheduler2.map._infowindow; - if (scheduler2.config.map_resolve_user_location) { - if (navigator.geolocation) { - if (!scheduler2._isMapPositionSet) { - navigator.geolocation.getCurrentPosition(function(position) { - var _userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); - map.setCenter(_userLocation); - map.setZoom(scheduler2.config.map_zoom_after_resolve || 10); - scheduler2.map._infowindow.setContent(scheduler2.locale.labels.marker_geo_success); - scheduler2.map._infowindow.position = map.getCenter(); - scheduler2.map._infowindow.open(map); - scheduler2._isMapPositionSet = true; - }, function() { - scheduler2.map._infowindow.setContent(scheduler2.locale.labels.marker_geo_fail); - scheduler2.map._infowindow.setPosition(map.getCenter()); - scheduler2.map._infowindow.open(map); - scheduler2._isMapPositionSet = true; - }); - } + html += "
"; + qi.innerHTML = html; + scheduler2.event(qi, "click", function(ev) { + scheduler2._qi_button_click(ev.target || ev.srcElement); + }); + if (scheduler2.config.quick_info_detached) { + scheduler2._detachDomEvent(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); + scheduler2.event(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); } } - google.maps.event.addListener(map, "resize", function(event2) { - gmap.style.zIndex = "5"; - map.setZoom(map.getZoom()); - }); - google.maps.event.addListener(map, "tilesloaded", function(event2) { - gmap.style.zIndex = "5"; - }); - gmap.style.display = "none"; - const old = scheduler2.render_data; - scheduler2.render_data = function(evs, hold) { - if (this._mode == "map") { - fill_map_tab(); - var events = scheduler2.get_visible_events(); - for (var i = 0; i < events.length; i++) { - if (!scheduler2.map._markers[events[i].id]) { - showAddress(events[i], false, false); - } - } - } else - return old.apply(this, arguments); - }; - function set_full_view(mode) { - if (mode) { - var l = scheduler2.locale.labels; - scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; - scheduler2._table_view = true; - scheduler2.set_sizes(); - } + return this._quick_info_box; + }; + scheduler2._qi_button_click = function(node) { + var box = scheduler2._quick_info_box; + if (!node || node == box) + return; + if (node.closest(".dhx_cal_qi_close_btn")) { + scheduler2.hideQuickInfo(); + return; } - function clear_map_tab() { - scheduler2._selected_event_id = null; - scheduler2.map._infowindow.close(); - var markers = scheduler2.map._markers; - for (var key in markers) { - if (markers.hasOwnProperty(key)) { - markers[key].setMap(null); - delete scheduler2.map._markers[key]; - if (scheduler2.map._infowindows_content[key]) - delete scheduler2.map._infowindows_content[key]; - } - } + var mask = scheduler2._getClassName(node); + if (mask.indexOf("_icon") != -1) { + var id2 = scheduler2._quick_info_box_id; + scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); + } else + scheduler2._qi_button_click(node.parentNode); + }; + function getPositionInsideScheduler(element) { + let left = 0; + let top = 0; + let node = element; + while (node && node != scheduler2._obj) { + left += node.offsetLeft; + top += node.offsetTop - node.scrollTop; + node = node.offsetParent; } - function fill_map_tab() { - var events = scheduler2.get_visible_events(); - events.sort(function(a, b) { - if (a.start_date.valueOf() == b.start_date.valueOf()) - return a.id > b.id ? 1 : -1; - return a.start_date > b.start_date ? 1 : -1; - }); - var ariaAttr = scheduler2._waiAria.mapAttrString(); - var html = "
"; - for (var i = 0; i < events.length; i++) { - var ev = events[i]; - var event_class = ev.id == scheduler2._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line"; - var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; - var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; - var ariaAttr = scheduler2._waiAria.mapRowAttrString(ev); - var ariaButtonAttr = scheduler2._waiAria.mapDetailsBtnString(); - html += "
" + scheduler2.templates.map_time(ev.start_date, ev.end_date, ev) + "
"; - html += `
- -
`; - html += "
" + scheduler2.templates.map_text(ev.start_date, ev.end_date, ev) + "
"; - } - html += "
"; - scheduler2._els["dhx_cal_data"][0].scrollTop = 0; - scheduler2._els["dhx_cal_data"][0].innerHTML = html; - var t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; - var dateElement = scheduler2._getNavDateElement(); - if (dateElement) { - dateElement.innerHTML = scheduler2.templates[scheduler2._mode + "_date"](scheduler2._min_date, scheduler2._max_date, scheduler2._mode); - } - scheduler2._rendered = []; - for (var i = 0; i < t.length - 2; i++) { - scheduler2._rendered[i] = t[i]; - } + if (node) { + let dx = left + element.offsetWidth / 2 > scheduler2._x / 2 ? 1 : 0; + let dy = top + element.offsetHeight / 2 > scheduler2._y / 2 ? 1 : 0; + return { left, top, dx, dy, width: element.offsetWidth, height: element.offsetHeight }; } - function _setMapSize(elem_id) { - var map2 = document.getElementById(elem_id); - const nav_height = scheduler2.$container.querySelector(".dhx_cal_navline").offsetHeight; - var height = scheduler2._y - nav_height; - if (height < 0) - height = 0; - var width = scheduler2._x - scheduler2.xy.map_date_width - scheduler2.xy.map_description_width - 1; - if (width < 0) - width = 0; - map2.style.height = height + "px"; - map2.style.width = width + "px"; - map2.style.position = "absolute"; - map2.style.top = nav_height + "px"; - if (scheduler2.config.rtl) { - map2.style.marginRight = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; - } else { - map2.style.marginLeft = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; - } - map2.style.marginTop = scheduler2.xy.nav_height + 2 + "px"; + return 0; + } + scheduler2._get_event_counter_part = function(id2) { + var domEv = scheduler2.getRenderedEvent(id2); + return getPositionInsideScheduler(domEv); + }; + scheduler2._fill_quick_data = function(id2) { + var ev = scheduler2.getEvent(id2); + var qi = scheduler2._quick_info_box; + scheduler2._quick_info_box_id = id2; + var header = { content: scheduler2.templates.quick_info_title(ev.start_date, ev.end_date, ev), date: scheduler2.templates.quick_info_date(ev.start_date, ev.end_date, ev) }; + var titleContent = qi.querySelector(".dhx_cal_qi_tcontent"); + titleContent.innerHTML = `${header.content}`; + var titleDate = qi.querySelector(".dhx_cal_qi_tdate"); + titleDate.innerHTML = header.date; + scheduler2._waiAria.quickInfoHeader(qi, [header.content, header.date].join(" ")); + var main = qi.querySelector(".dhx_cal_qi_content"); + const mainContent = scheduler2.templates.quick_info_content(ev.start_date, ev.end_date, ev); + if (mainContent) { + main.classList.remove("dhx_hidden"); + main.innerHTML = mainContent; + } else { + main.classList.add("dhx_hidden"); } - scheduler2.map_view = function(mode) { - scheduler2.map._initialization_count++; - var gmap2 = scheduler2._els.dhx_gmap[0]; - var temp_center; - scheduler2._min_date = scheduler2.config.map_start || scheduler2._currentDate(); - scheduler2._max_date = scheduler2.config.map_end || scheduler2.date.add(scheduler2._currentDate(), 1, "year"); - scheduler2._table_view = true; - set_full_view(mode); - if (mode) { - clear_map_tab(); - fill_map_tab(); - gmap2.style.display = "block"; - _setMapSize("dhx_gmap"); - temp_center = scheduler2.map._obj.getCenter(); - var events = scheduler2.get_visible_events(); - for (var i = 0; i < events.length; i++) { - if (!scheduler2.map._markers[events[i].id]) { - showAddress(events[i]); - } - } + }; +} +function readonly(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + var originalRecurringSetValue; + if (scheduler2.form_blocks.recurring) { + originalRecurringSetValue = scheduler2.form_blocks.recurring.set_value; + } + var original_left_buttons = scheduler2.config.buttons_left.slice(); + var original_right_buttons = scheduler2.config.buttons_right.slice(); + scheduler2.attachEvent("onBeforeLightbox", function(id2) { + if (this.config.readonly_form || this.getEvent(id2).readonly) { + this.config.readonly_active = true; } else { - gmap2.style.display = "none"; - } - google.maps.event.trigger(scheduler2.map._obj, "resize"); - if (scheduler2.map._initialization_count === 0 && temp_center) { - scheduler2.map._obj.setCenter(temp_center); - } - if (scheduler2._selected_event_id) { - selectEvent(scheduler2._selected_event_id); - } - }; - var selectEvent = function(event_id) { - scheduler2.map._obj.setCenter(scheduler2.map._points[event_id]); - scheduler2.callEvent("onClick", [event_id]); - }; - var showAddress = function(event2, setCenter, performClick) { - var point = scheduler2.config.map_error_position; - if (event2.lat && event2.lng) { - point = new google.maps.LatLng(event2.lat, event2.lng); - } - var message2 = scheduler2.templates.marker_text(event2.start_date, event2.end_date, event2); - if (!scheduler2._new_event) { - scheduler2.map._infowindows_content[event2.id] = message2; - if (scheduler2.map._markers[event2.id]) - scheduler2.map._markers[event2.id].setMap(null); - scheduler2.map._markers[event2.id] = scheduler2.ext.mapView.createMarker({ position: point, map: scheduler2.map._obj }); - google.maps.event.addListener(scheduler2.map._markers[event2.id], "click", function() { - scheduler2.map._infowindow.setContent(scheduler2.map._infowindows_content[event2.id]); - scheduler2.map._infowindow.open(scheduler2.map._obj, scheduler2.map._markers[event2.id]); - scheduler2._selected_event_id = event2.id; - scheduler2.render_data(); - }); - scheduler2.map._points[event2.id] = point; - if (setCenter) - scheduler2.map._obj.setCenter(scheduler2.map._points[event2.id]); - if (performClick) - scheduler2.callEvent("onClick", [event2.id]); + this.config.readonly_active = false; + scheduler2.config.buttons_left = original_left_buttons.slice(); + scheduler2.config.buttons_right = original_right_buttons.slice(); + if (scheduler2.form_blocks.recurring) { + scheduler2.form_blocks.recurring.set_value = originalRecurringSetValue; + } } - }; - scheduler2.attachEvent("onClick", function(id2, domEvent) { - if (this._mode == "map") { - scheduler2._selected_event_id = id2; - for (var i = 0; i < scheduler2._rendered.length; i++) { - scheduler2._rendered[i].className = "dhx_map_line"; - if (scheduler2._rendered[i].getAttribute(scheduler2.config.event_attribute) == id2) { - scheduler2._rendered[i].className += " highlight"; + var sns = this.config.lightbox.sections; + if (this.config.readonly_active) { + for (var i = 0; i < sns.length; i++) { + if (sns[i].type == "recurring") { + if (this.config.readonly_active && scheduler2.form_blocks.recurring) { + scheduler2.form_blocks.recurring.set_value = function(node, value, ev) { + var wrapper = scheduler2.$domHelpers.closest(node, ".dhx_wrap_section"); + var style = "none"; + wrapper.querySelector(".dhx_cal_lsection").display = style; + wrapper.querySelector(".dhx_form_repeat").display = style; + wrapper.style.display = style; + scheduler2.setLightboxSize(); + }; + } } } - if (scheduler2.map._points[id2] && scheduler2.map._markers[id2]) { - scheduler2.map._obj.setCenter(scheduler2.map._points[id2]); - google.maps.event.trigger(scheduler2.map._markers[id2], "click"); + var forbidden_buttons = ["dhx_delete_btn", "dhx_save_btn"]; + var button_arrays = [scheduler2.config.buttons_left, scheduler2.config.buttons_right]; + for (var i = 0; i < forbidden_buttons.length; i++) { + var forbidden_button = forbidden_buttons[i]; + for (var k = 0; k < button_arrays.length; k++) { + var button_array = button_arrays[k]; + var index = -1; + for (var p = 0; p < button_array.length; p++) { + if (button_array[p] == forbidden_button) { + index = p; + break; + } + } + if (index != -1) { + button_array.splice(index, 1); + } + } } } + this.resetLightbox(); return true; }); - var _displayEventOnMap = function(event2) { - const geocoder = scheduler2.ext.mapView.geocoder; - if (event2.event_location && geocoder) { - geocoder.geocode({ address: event2.event_location, language: scheduler2.uid().toString() }, function(results, status) { - var point = {}; - if (status != google.maps.GeocoderStatus.OK) { - point = scheduler2.callEvent("onLocationError", [event2.id]); - if (!point || point === true) - point = scheduler2.config.map_error_position; - } else { - point = results[0].geometry.location; - } - event2.lat = point.lat(); - event2.lng = point.lng(); - scheduler2._selected_event_id = event2.id; - scheduler2._latLngUpdate = true; - scheduler2.callEvent("onEventChanged", [event2.id, event2]); - showAddress(event2, true, true); - }); - } else { - showAddress(event2, true, true); - } - }; - var _updateEventLocation = function(event2) { - const geocoder = scheduler2.ext.mapView.geocoder; - if (event2.event_location && geocoder) { - geocoder.geocode({ address: event2.event_location, language: scheduler2.uid().toString() }, function(results, status) { - var point = {}; - if (status != google.maps.GeocoderStatus.OK) { - point = scheduler2.callEvent("onLocationError", [event2.id]); - if (!point || point === true) - point = scheduler2.config.map_error_position; - } else { - point = results[0].geometry.location; - } - event2.lat = point.lat(); - event2.lng = point.lng(); - scheduler2._latLngUpdate = true; - scheduler2.callEvent("onEventChanged", [event2.id, event2]); - }); - } - }; - var _delay = function(method, object, params, delay2) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - var ret = method.apply(object, params); - method = object = params = null; - return ret; - }, delay2 || 1); - }; - scheduler2.attachEvent("onEventChanged", function(id2, event2) { - if (!this._latLngUpdate) { - var event2 = scheduler2.getEvent(id2); - if (event2.start_date < scheduler2._min_date && event2.end_date > scheduler2._min_date || event2.start_date < scheduler2._max_date && event2.end_date > scheduler2._max_date || event2.start_date.valueOf() >= scheduler2._min_date && event2.end_date.valueOf() <= scheduler2._max_date) { - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - _displayEventOnMap(event2); + function txt_replace(tag, d, n, text) { + var txts = d.getElementsByTagName(tag); + var txtt = n.getElementsByTagName(tag); + for (var i = txtt.length - 1; i >= 0; i--) { + var n = txtt[i]; + if (!text) { + n.disabled = true; + if (d.checked) + n.checked = true; } else { - scheduler2._selected_event_id = null; - scheduler2.map._infowindow.close(); - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - } - } else - this._latLngUpdate = false; - return true; - }); - scheduler2.attachEvent("onEventIdChange", function(old_event_id, new_event_id) { - var event2 = scheduler2.getEvent(new_event_id); - if (event2.start_date < scheduler2._min_date && event2.end_date > scheduler2._min_date || event2.start_date < scheduler2._max_date && event2.end_date > scheduler2._max_date || event2.start_date.valueOf() >= scheduler2._min_date && event2.end_date.valueOf() <= scheduler2._max_date) { - if (scheduler2.map._markers[old_event_id]) { - scheduler2.map._markers[old_event_id].setMap(null); - delete scheduler2.map._markers[old_event_id]; + var t = document.createElement("span"); + t.className = "dhx_text_disabled"; + t.innerHTML = text(txts[i]); + n.parentNode.insertBefore(t, n); + n.parentNode.removeChild(n); } - if (scheduler2.map._infowindows_content[old_event_id]) - delete scheduler2.map._infowindows_content[old_event_id]; - _displayEventOnMap(event2); } - return true; - }); - scheduler2.attachEvent("onEventAdded", function(id2, event2) { - if (!scheduler2._dataprocessor) { - if (event2.start_date < scheduler2._min_date && event2.end_date > scheduler2._min_date || event2.start_date < scheduler2._max_date && event2.end_date > scheduler2._max_date || event2.start_date.valueOf() >= scheduler2._min_date && event2.end_date.valueOf() <= scheduler2._max_date) { - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - _displayEventOnMap(event2); - } + } + var old = scheduler2._fill_lightbox; + scheduler2._fill_lightbox = function() { + var lb = this.getLightbox(); + if (this.config.readonly_active) { + lb.style.visibility = "hidden"; + lb.style.display = "block"; } - return true; - }); - scheduler2.attachEvent("onBeforeEventDelete", function(id2, event2) { - if (scheduler2.map._markers[id2]) { - scheduler2.map._markers[id2].setMap(null); + var res = old.apply(this, arguments); + if (this.config.readonly_active) { + lb.style.visibility = ""; + lb.style.display = "none"; } - scheduler2._selected_event_id = null; - scheduler2.map._infowindow.close(); - return true; - }); - scheduler2._event_resolve_delay = 1500; - scheduler2.attachEvent("onEventLoading", function(event2) { - if (scheduler2.config.map_resolve_event_location && event2.event_location && !event2.lat && !event2.lng) { - scheduler2._event_resolve_delay += 1500; - _delay(_updateEventLocation, this, [event2], scheduler2._event_resolve_delay); + if (this.config.readonly_active) { + var originalForm = this.getLightbox(); + var readonlyForm = this._lightbox_r = originalForm.cloneNode(true); + readonlyForm.id = scheduler2.uid(); + readonlyForm.className += " dhx_cal_light_readonly"; + txt_replace("textarea", originalForm, readonlyForm, function(a) { + return a.value; + }); + txt_replace("input", originalForm, readonlyForm, false); + txt_replace("select", originalForm, readonlyForm, function(a) { + if (!a.options.length) + return ""; + return a.options[Math.max(a.selectedIndex || 0, 0)].text; + }); + originalForm.parentNode.insertBefore(readonlyForm, originalForm); + this.showCover(readonlyForm); + if (scheduler2._lightbox) + scheduler2._lightbox.parentNode.removeChild(scheduler2._lightbox); + this._lightbox = readonlyForm; + if (scheduler2.config.drag_lightbox) + scheduler2.event(readonlyForm.firstChild, "mousedown", scheduler2._ready_to_dnd); + scheduler2._init_lightbox_events(); + this.setLightboxSize(); } - return true; - }); - scheduler2.attachEvent("onEventCancel", function(id2, is_new) { - if (is_new) { - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - scheduler2.map._infowindow.close(); + return res; + }; + var hold = scheduler2.hide_lightbox; + scheduler2.hide_lightbox = function() { + if (this._lightbox_r) { + this._lightbox_r.parentNode.removeChild(this._lightbox_r); + this._lightbox_r = this._lightbox = null; } - return true; - }); + return hold.apply(this, arguments); + }; }); } -function minical(scheduler2) { - const minicalDomEvents = scheduler2._createDomEventScope(); - scheduler2.config.minicalendar = { mark_events: true }; - scheduler2._synced_minicalendars = []; - scheduler2.renderCalendar = function(obj, _prev, is_refresh) { - var cal = null; - var date = obj.date || scheduler2._currentDate(); - if (typeof date == "string") - date = this.templates.api_date(date); - if (!_prev) { - var cont = obj.container; - var pos = obj.position; - if (typeof cont == "string") - cont = document.getElementById(cont); - if (typeof pos == "string") - pos = document.getElementById(pos); - if (pos && (typeof pos.left == "undefined" && typeof pos.right == "undefined")) { - var tpos = scheduler2.$domHelpers.getOffset(pos); - pos = { top: tpos.top + pos.offsetHeight, left: tpos.left }; - } - if (!cont) - cont = scheduler2._get_def_cont(pos); - cal = this._render_calendar(cont, date, obj); - if (!cal.$_eventAttached) { - cal.$_eventAttached = true; - minicalDomEvents.attach(cal, "click", (function(e) { - var src = e.target || e.srcElement; - var $dom = scheduler2.$domHelpers; - if ($dom.closest(src, ".dhx_month_head")) { - if (!$dom.closest(src, ".dhx_after") && !$dom.closest(src, ".dhx_before")) { - var cellRoot = $dom.closest(src, "[data-cell-date]"); - var dateAttribute = cellRoot.getAttribute("data-cell-date"); - var newDate = scheduler2.templates.parse_date(dateAttribute); - scheduler2.unmarkCalendar(this); - scheduler2.markCalendar(this, newDate, "dhx_calendar_click"); - this._last_date = newDate; - if (this.conf.handler) - this.conf.handler.call(scheduler2, newDate, this); - } - } - }).bind(cal)); - } - } else { - cal = this._render_calendar(_prev.parentNode, date, obj, _prev); - scheduler2.unmarkCalendar(cal); +var ALL_WEEKDAYS = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"]; +var Weekday = function() { + function Weekday2(weekday, n) { + if (n === 0) + throw new Error("Can't create weekday with n == 0"); + this.weekday = weekday; + this.n = n; + } + Weekday2.fromStr = function(str) { + return new Weekday2(ALL_WEEKDAYS.indexOf(str)); + }; + Weekday2.prototype.nth = function(n) { + return this.n === n ? this : new Weekday2(this.weekday, n); + }; + Weekday2.prototype.equals = function(other) { + return this.weekday === other.weekday && this.n === other.n; + }; + Weekday2.prototype.toString = function() { + var s = ALL_WEEKDAYS[this.weekday]; + if (this.n) + s = (this.n > 0 ? "+" : "") + String(this.n) + s; + return s; + }; + Weekday2.prototype.getJsWeekday = function() { + return this.weekday === 6 ? 0 : this.weekday + 1; + }; + return Weekday2; +}(); +var isPresent = function(value) { + return value !== null && value !== void 0; +}; +var isNumber = function(value) { + return typeof value === "number"; +}; +var isWeekdayStr = function(value) { + return typeof value === "string" && ALL_WEEKDAYS.includes(value); +}; +var isArray = Array.isArray; +var range = function(start, end) { + if (end === void 0) { + end = start; + } + if (arguments.length === 1) { + end = start; + start = 0; + } + var rang = []; + for (var i = start; i < end; i++) + rang.push(i); + return rang; +}; +var repeat = function(value, times) { + var i = 0; + var array = []; + if (isArray(value)) { + for (; i < times; i++) + array[i] = [].concat(value); + } else { + for (; i < times; i++) + array[i] = value; + } + return array; +}; +var toArray = function(item) { + if (isArray(item)) { + return item; + } + return [item]; +}; +function padStart(item, targetLength, padString) { + if (padString === void 0) { + padString = " "; + } + var str = String(item); + targetLength = targetLength >> 0; + if (str.length > targetLength) { + return String(str); + } + targetLength = targetLength - str.length; + if (targetLength > padString.length) { + padString += repeat(padString, targetLength / padString.length); + } + return padString.slice(0, targetLength) + String(str); +} +var split = function(str, sep, num) { + var splits = str.split(sep); + return num ? splits.slice(0, num).concat([splits.slice(num).join(sep)]) : splits; +}; +var pymod = function(a, b) { + var r = a % b; + return r * b < 0 ? r + b : r; +}; +var divmod = function(a, b) { + return { div: Math.floor(a / b), mod: pymod(a, b) }; +}; +var empty = function(obj) { + return !isPresent(obj) || obj.length === 0; +}; +var notEmpty = function(obj) { + return !empty(obj); +}; +var includes = function(arr, val) { + return notEmpty(arr) && arr.indexOf(val) !== -1; +}; +var datetime = function(y, m, d, h, i, s) { + if (h === void 0) { + h = 0; + } + if (i === void 0) { + i = 0; + } + if (s === void 0) { + s = 0; + } + return new Date(Date.UTC(y, m - 1, d, h, i, s)); +}; +var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +var ONE_DAY = 1e3 * 60 * 60 * 24; +var MAXYEAR = 9999; +var ORDINAL_BASE = datetime(1970, 1, 1); +var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5]; +var isLeapYear = function(year) { + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; +}; +var isDate = function(value) { + return value instanceof Date; +}; +var isValidDate = function(value) { + return isDate(value) && !isNaN(value.getTime()); +}; +var daysBetween = function(date1, date2) { + var date1ms = date1.getTime(); + var date2ms = date2.getTime(); + var differencems = date1ms - date2ms; + return Math.round(differencems / ONE_DAY); +}; +var toOrdinal = function(date) { + return daysBetween(date, ORDINAL_BASE); +}; +var fromOrdinal = function(ordinal) { + return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY); +}; +var getMonthDays = function(date) { + var month = date.getUTCMonth(); + return month === 1 && isLeapYear(date.getUTCFullYear()) ? 29 : MONTH_DAYS[month]; +}; +var getWeekday = function(date) { + return PY_WEEKDAYS[date.getUTCDay()]; +}; +var monthRange = function(year, month) { + var date = datetime(year, month + 1, 1); + return [getWeekday(date), getMonthDays(date)]; +}; +var combine = function(date, time) { + time = time || date; + return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds())); +}; +var clone = function(date) { + var dolly = new Date(date.getTime()); + return dolly; +}; +var cloneDates = function(dates) { + var clones = []; + for (var i = 0; i < dates.length; i++) { + clones.push(clone(dates[i])); + } + return clones; +}; +var sort = function(dates) { + dates.sort(function(a, b) { + return a.getTime() - b.getTime(); + }); +}; +var timeToUntilString = function(time, utc) { + if (utc === void 0) { + utc = true; + } + var date = new Date(time); + return [padStart(date.getUTCFullYear().toString(), 4, "0"), padStart(date.getUTCMonth() + 1, 2, "0"), padStart(date.getUTCDate(), 2, "0"), "T", padStart(date.getUTCHours(), 2, "0"), padStart(date.getUTCMinutes(), 2, "0"), padStart(date.getUTCSeconds(), 2, "0"), utc ? "Z" : ""].join(""); +}; +var untilStringToDate = function(until) { + var re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/; + var bits = re.exec(until); + if (!bits) + throw new Error("Invalid UNTIL value: ".concat(until)); + return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0)); +}; +var dateTZtoISO8601 = function(date, timeZone) { + var dateStr = date.toLocaleString("sv-SE", { timeZone }); + return dateStr.replace(" ", "T") + "Z"; +}; +var dateInTimeZone = function(date, timeZone) { + var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; + var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone)); + var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : "UTC")); + var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime(); + return new Date(date.getTime() - tzOffset); +}; +var IterResult = function() { + function IterResult2(method, args) { + this.minDate = null; + this.maxDate = null; + this._result = []; + this.total = 0; + this.method = method; + this.args = args; + if (method === "between") { + this.maxDate = args.inc ? args.before : new Date(args.before.getTime() - 1); + this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1); + } else if (method === "before") { + this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1); + } else if (method === "after") { + this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1); } - if (scheduler2.config.minicalendar.mark_events) { - var start = scheduler2.date.month_start(date); - var end = scheduler2.date.add(start, 1, "month"); - var evs = this.getEvents(start, end); - var filter = this["filter_" + this._mode]; - var markedDates = {}; - for (var i = 0; i < evs.length; i++) { - var ev = evs[i]; - if (filter && !filter(ev.id, ev)) - continue; - var d = ev.start_date; - if (d.valueOf() < start.valueOf()) - d = start; - d = scheduler2.date.date_part(new Date(d.valueOf())); - while (d < ev.end_date) { - if (!markedDates[+d]) { - markedDates[+d] = true; - this.markCalendar(cal, d, "dhx_year_event"); - } - d = this.date.add(d, 1, "day"); - if (d.valueOf() >= end.valueOf()) - break; - } - } + } + IterResult2.prototype.accept = function(date) { + ++this.total; + var tooEarly = this.minDate && date < this.minDate; + var tooLate = this.maxDate && date > this.maxDate; + if (this.method === "between") { + if (tooEarly) + return true; + if (tooLate) + return false; + } else if (this.method === "before") { + if (tooLate) + return false; + } else if (this.method === "after") { + if (tooEarly) + return true; + this.add(date); + return false; + } + return this.add(date); + }; + IterResult2.prototype.add = function(date) { + this._result.push(date); + return true; + }; + IterResult2.prototype.getValue = function() { + var res = this._result; + switch (this.method) { + case "all": + case "between": + return res; + case "before": + case "after": + default: + return res.length ? res[res.length - 1] : null; + } + }; + IterResult2.prototype.clone = function() { + return new IterResult2(this.method, this.args); + }; + return IterResult2; +}(); +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) + if (Object.prototype.hasOwnProperty.call(b2, p)) + d2[p] = b2[p]; + }; + return extendStatics(d, b); +}; +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +var __assign = function() { + __assign = Object.assign || function __assign2(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; } - this._markCalendarCurrentDate(cal); - cal.conf = obj; - if (obj.sync && !is_refresh) - this._synced_minicalendars.push(cal); - if (!cal.conf._on_xle_handler) { - cal.conf._on_xle_handler = scheduler2.attachEvent("onXLE", function refreshOnLoad() { - scheduler2.updateCalendar(cal, cal.conf.date); - }); + return t; + }; + return __assign.apply(this, arguments); +}; +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar2; i < l; i++) { + if (ar2 || !(i in from)) { + if (!ar2) + ar2 = Array.prototype.slice.call(from, 0, i); + ar2[i] = from[i]; + } } - if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { - cal.setAttribute("role", "application"); + return to.concat(ar2 || Array.prototype.slice.call(from)); +} +typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message2) { + var e = new Error(message2); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; +var CallbackIterResult = function(_super) { + __extends(CallbackIterResult2, _super); + function CallbackIterResult2(method, args, iterator) { + var _this = _super.call(this, method, args) || this; + _this.iterator = iterator; + return _this; + } + CallbackIterResult2.prototype.add = function(date) { + if (this.iterator(date, this._result.length)) { + this._result.push(date); + return true; } - return cal; + return false; }; - scheduler2._get_def_cont = function(pos) { - if (!this._def_count) { - this._def_count = document.createElement("div"); - this._def_count.className = "dhx_minical_popup"; - scheduler2.event(this._def_count, "click", function(e) { - e.cancelBubble = true; + return CallbackIterResult2; +}(IterResult); +var ENGLISH = { dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], tokens: { SKIP: /^[ \r\n\t]+|^\.$/, number: /^[1-9][0-9]*/, numberAsText: /^(one|two|three)/i, every: /^every/i, "day(s)": /^days?/i, "weekday(s)": /^weekdays?/i, "week(s)": /^weeks?/i, "hour(s)": /^hours?/i, "minute(s)": /^minutes?/i, "month(s)": /^months?/i, "year(s)": /^years?/i, on: /^(on|in)/i, at: /^(at)/i, the: /^the/i, first: /^first/i, second: /^second/i, third: /^third/i, nth: /^([1-9][0-9]*)(\.|th|nd|rd|st)/i, last: /^last/i, for: /^for/i, "time(s)": /^times?/i, until: /^(un)?til/i, monday: /^mo(n(day)?)?/i, tuesday: /^tu(e(s(day)?)?)?/i, wednesday: /^we(d(n(esday)?)?)?/i, thursday: /^th(u(r(sday)?)?)?/i, friday: /^fr(i(day)?)?/i, saturday: /^sa(t(urday)?)?/i, sunday: /^su(n(day)?)?/i, january: /^jan(uary)?/i, february: /^feb(ruary)?/i, march: /^mar(ch)?/i, april: /^apr(il)?/i, may: /^may/i, june: /^june?/i, july: /^july?/i, august: /^aug(ust)?/i, september: /^sep(t(ember)?)?/i, october: /^oct(ober)?/i, november: /^nov(ember)?/i, december: /^dec(ember)?/i, comma: /^(,\s*|(and|or)\s*)+/i } }; +var contains = function(arr, val) { + return arr.indexOf(val) !== -1; +}; +var defaultGetText = function(id2) { + return id2.toString(); +}; +var defaultDateFormatter = function(year, month, day) { + return "".concat(month, " ").concat(day, ", ").concat(year); +}; +var ToText = function() { + function ToText2(rrule, gettext, language, dateFormatter) { + if (gettext === void 0) { + gettext = defaultGetText; + } + if (language === void 0) { + language = ENGLISH; + } + if (dateFormatter === void 0) { + dateFormatter = defaultDateFormatter; + } + this.text = []; + this.language = language || ENGLISH; + this.gettext = gettext; + this.dateFormatter = dateFormatter; + this.rrule = rrule; + this.options = rrule.options; + this.origOptions = rrule.origOptions; + if (this.origOptions.bymonthday) { + var bymonthday = [].concat(this.options.bymonthday); + var bynmonthday = [].concat(this.options.bynmonthday); + bymonthday.sort(function(a, b) { + return a - b; }); - document.body.appendChild(this._def_count); + bynmonthday.sort(function(a, b) { + return b - a; + }); + this.bymonthday = bymonthday.concat(bynmonthday); + if (!this.bymonthday.length) + this.bymonthday = null; + } + if (isPresent(this.origOptions.byweekday)) { + var byweekday = !isArray(this.origOptions.byweekday) ? [this.origOptions.byweekday] : this.origOptions.byweekday; + var days = String(byweekday); + this.byweekday = { allWeeks: byweekday.filter(function(weekday) { + return !weekday.n; + }), someWeeks: byweekday.filter(function(weekday) { + return Boolean(weekday.n); + }), isWeekdays: days.indexOf("MO") !== -1 && days.indexOf("TU") !== -1 && days.indexOf("WE") !== -1 && days.indexOf("TH") !== -1 && days.indexOf("FR") !== -1 && days.indexOf("SA") === -1 && days.indexOf("SU") === -1, isEveryDay: days.indexOf("MO") !== -1 && days.indexOf("TU") !== -1 && days.indexOf("WE") !== -1 && days.indexOf("TH") !== -1 && days.indexOf("FR") !== -1 && days.indexOf("SA") !== -1 && days.indexOf("SU") !== -1 }; + var sortWeekDays = function(a, b) { + return a.weekday - b.weekday; + }; + this.byweekday.allWeeks.sort(sortWeekDays); + this.byweekday.someWeeks.sort(sortWeekDays); + if (!this.byweekday.allWeeks.length) + this.byweekday.allWeeks = null; + if (!this.byweekday.someWeeks.length) + this.byweekday.someWeeks = null; + } else { + this.byweekday = null; } - if (pos.left) { - this._def_count.style.left = pos.left + "px"; + } + ToText2.isFullyConvertible = function(rrule) { + var canConvert = true; + if (!(rrule.options.freq in ToText2.IMPLEMENTED)) + return false; + if (rrule.origOptions.until && rrule.origOptions.count) + return false; + for (var key in rrule.origOptions) { + if (contains(["dtstart", "tzid", "wkst", "freq"], key)) + return true; + if (!contains(ToText2.IMPLEMENTED[rrule.options.freq], key)) + return false; } - if (pos.right) { - this._def_count.style.right = pos.right + "px"; + return canConvert; + }; + ToText2.prototype.isFullyConvertible = function() { + return ToText2.isFullyConvertible(this.rrule); + }; + ToText2.prototype.toString = function() { + var gettext = this.gettext; + if (!(this.options.freq in ToText2.IMPLEMENTED)) { + return gettext("RRule error: Unable to fully convert this rrule to text"); + } + this.text = [gettext("every")]; + this[RRule.FREQUENCIES[this.options.freq]](); + if (this.options.until) { + this.add(gettext("until")); + var until = this.options.until; + this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate())); + } else if (this.options.count) { + this.add(gettext("for")).add(this.options.count.toString()).add(this.plural(this.options.count) ? gettext("times") : gettext("time")); + } + if (!this.isFullyConvertible()) + this.add(gettext("(~ approximate)")); + return this.text.join(""); + }; + ToText2.prototype.HOURLY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) + this.add(this.options.interval.toString()); + this.add(this.plural(this.options.interval) ? gettext("hours") : gettext("hour")); + }; + ToText2.prototype.MINUTELY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) + this.add(this.options.interval.toString()); + this.add(this.plural(this.options.interval) ? gettext("minutes") : gettext("minute")); + }; + ToText2.prototype.DAILY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) + this.add(this.options.interval.toString()); + if (this.byweekday && this.byweekday.isWeekdays) { + this.add(this.plural(this.options.interval) ? gettext("weekdays") : gettext("weekday")); + } else { + this.add(this.plural(this.options.interval) ? gettext("days") : gettext("day")); } - if (pos.top) { - this._def_count.style.top = pos.top + "px"; + if (this.origOptions.bymonth) { + this.add(gettext("in")); + this._bymonth(); } - if (pos.bottom) { - this._def_count.style.bottom = pos.bottom + "px"; + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday) { + this._byweekday(); + } else if (this.origOptions.byhour) { + this._byhour(); } - this._def_count._created = /* @__PURE__ */ new Date(); - return this._def_count; }; - scheduler2._locateCalendar = function(cal, date) { - if (typeof date == "string") - date = scheduler2.templates.api_date(date); - if (+date > +cal._max_date || +date < +cal._min_date) - return null; - var table = cal.querySelector(".dhx_year_body").childNodes[0]; - var weekNum = 0; - var dat = new Date(cal._min_date); - while (+this.date.add(dat, 1, "week") <= +date) { - dat = this.date.add(dat, 1, "week"); - weekNum++; + ToText2.prototype.WEEKLY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext("weeks") : gettext("week")); } - var sm = scheduler2.config.start_on_monday; - var day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0); - const dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`); - if (dayCell) { - return dayCell.firstChild; + if (this.byweekday && this.byweekday.isWeekdays) { + if (this.options.interval === 1) { + this.add(this.plural(this.options.interval) ? gettext("weekdays") : gettext("weekday")); + } else { + this.add(gettext("on")).add(gettext("weekdays")); + } + } else if (this.byweekday && this.byweekday.isEveryDay) { + this.add(this.plural(this.options.interval) ? gettext("days") : gettext("day")); } else { - return null; + if (this.options.interval === 1) + this.add(gettext("week")); + if (this.origOptions.bymonth) { + this.add(gettext("in")); + this._bymonth(); + } + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday) { + this._byweekday(); + } + if (this.origOptions.byhour) { + this._byhour(); + } } }; - scheduler2.markCalendar = function(cal, date, css) { - var div = this._locateCalendar(cal, date); - if (!div) - return; - div.className += " " + css; + ToText2.prototype.MONTHLY = function() { + var gettext = this.gettext; + if (this.origOptions.bymonth) { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()).add(gettext("months")); + if (this.plural(this.options.interval)) + this.add(gettext("in")); + } + this._bymonth(); + } else { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()); + } + this.add(this.plural(this.options.interval) ? gettext("months") : gettext("month")); + } + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday && this.byweekday.isWeekdays) { + this.add(gettext("on")).add(gettext("weekdays")); + } else if (this.byweekday) { + this._byweekday(); + } }; - scheduler2.unmarkCalendar = function(cal, date, css) { - date = date || cal._last_date; - css = css || "dhx_calendar_click"; - if (!date) - return; - var el2 = this._locateCalendar(cal, date); - if (!el2) - return; - el2.className = (el2.className || "").replace(RegExp(css, "g")); + ToText2.prototype.YEARLY = function() { + var gettext = this.gettext; + if (this.origOptions.bymonth) { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()); + this.add(gettext("years")); + } + this._bymonth(); + } else { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()); + } + this.add(this.plural(this.options.interval) ? gettext("years") : gettext("year")); + } + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday) { + this._byweekday(); + } + if (this.options.byyearday) { + this.add(gettext("on the")).add(this.list(this.options.byyearday, this.nth, gettext("and"))).add(gettext("day")); + } + if (this.options.byweekno) { + this.add(gettext("in")).add(this.plural(this.options.byweekno.length) ? gettext("weeks") : gettext("week")).add(this.list(this.options.byweekno, void 0, gettext("and"))); + } }; - scheduler2._week_template = function(width) { - var summ = width || 250; - var left = 0; - var week_template = document.createElement("div"); - var dummy_date = this.date.week_start(scheduler2._currentDate()); - for (var i = 0; i < 7; i++) { - this._cols[i] = Math.floor(summ / (7 - i)); - this._render_x_header(i, left, dummy_date, week_template); - dummy_date = this.date.add(dummy_date, 1, "day"); - summ -= this._cols[i]; - left += this._cols[i]; + ToText2.prototype._bymonthday = function() { + var gettext = this.gettext; + if (this.byweekday && this.byweekday.allWeeks) { + this.add(gettext("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext("or"))).add(gettext("the")).add(this.list(this.bymonthday, this.nth, gettext("or"))); + } else { + this.add(gettext("on the")).add(this.list(this.bymonthday, this.nth, gettext("and"))); + } + }; + ToText2.prototype._byweekday = function() { + var gettext = this.gettext; + if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) { + this.add(gettext("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext)); + } + if (this.byweekday.someWeeks) { + if (this.byweekday.allWeeks) + this.add(gettext("and")); + this.add(gettext("on the")).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext("and"))); + } + }; + ToText2.prototype._byhour = function() { + var gettext = this.gettext; + this.add(gettext("at")).add(this.list(this.origOptions.byhour, void 0, gettext("and"))); + }; + ToText2.prototype._bymonth = function() { + this.add(this.list(this.options.bymonth, this.monthtext, this.gettext("and"))); + }; + ToText2.prototype.nth = function(n) { + n = parseInt(n.toString(), 10); + var nth; + var gettext = this.gettext; + if (n === -1) + return gettext("last"); + var npos = Math.abs(n); + switch (npos) { + case 1: + case 21: + case 31: + nth = npos + gettext("st"); + break; + case 2: + case 22: + nth = npos + gettext("nd"); + break; + case 3: + case 23: + nth = npos + gettext("rd"); + break; + default: + nth = npos + gettext("th"); } - week_template.lastChild.className += " dhx_scale_bar_last"; - return week_template; + return n < 0 ? nth + " " + gettext("last") : nth; }; - scheduler2.updateCalendar = function(obj, sd) { - obj.conf.date = sd; - this.renderCalendar(obj.conf, obj, true); + ToText2.prototype.monthtext = function(m) { + return this.language.monthNames[m - 1]; }; - scheduler2._mini_cal_arrows = [" ", " "]; - scheduler2._render_calendar = function(obj, sd, conf, previous) { - var ts = scheduler2.templates; - var temp = this._cols; - this._cols = []; - var temp2 = this._mode; - this._mode = "calendar"; - var temp3 = this._colsS; - this._colsS = { height: 0 }; - var temp4 = new Date(this._min_date); - var temp5 = new Date(this._max_date); - var temp6 = new Date(scheduler2._date); - var temp7 = ts.month_day; - var temp8 = this._ignores_detected; - this._ignores_detected = 0; - ts.month_day = ts.calendar_date; - sd = this.date.month_start(sd); - var week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding); - var d; - if (previous) { - d = previous; + ToText2.prototype.weekdaytext = function(wday) { + var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday(); + return (wday.n ? this.nth(wday.n) + " " : "") + this.language.dayNames[weekday]; + }; + ToText2.prototype.plural = function(n) { + return n % 100 !== 1; + }; + ToText2.prototype.add = function(s) { + this.text.push(" "); + this.text.push(s); + return this; + }; + ToText2.prototype.list = function(arr, callback, finalDelim, delim) { + var _this = this; + if (delim === void 0) { + delim = ","; + } + if (!isArray(arr)) { + arr = [arr]; + } + var delimJoin = function(array, delimiter, finalDelimiter) { + var list = ""; + for (var i = 0; i < array.length; i++) { + if (i !== 0) { + if (i === array.length - 1) { + list += " " + finalDelimiter + " "; + } else { + list += delimiter + " "; + } + } + list += array[i]; + } + return list; + }; + callback = callback || function(o) { + return o.toString(); + }; + var realCallback = function(arg) { + return callback && callback.call(_this, arg); + }; + if (finalDelim) { + return delimJoin(arr.map(realCallback), delim, finalDelim); } else { - d = document.createElement("div"); - d.className = "dhx_cal_container dhx_mini_calendar"; + return arr.map(realCallback).join(delim + " "); } - d.setAttribute("date", this._helpers.formatDate(sd)); - d.innerHTML = "
" : "'>") + "
" + (week_template ? week_template.innerHTML : "") + "
"; - var header = d.querySelector(".dhx_year_month"); - var weekHeader = d.querySelector(".dhx_year_week"); - var body = d.querySelector(".dhx_year_body"); - header.innerHTML = this.templates.calendar_month(sd); - if (conf.navigation) { - var move_minicalendar_date = function(calendar, diff) { - var date = scheduler2.date.add(calendar._date, diff, "month"); - scheduler2.updateCalendar(calendar, date); - if (scheduler2._date.getMonth() == calendar._date.getMonth() && scheduler2._date.getFullYear() == calendar._date.getFullYear()) { - scheduler2._markCalendarCurrentDate(calendar); + }; + return ToText2; +}(); +var Parser = function() { + function Parser2(rules) { + this.done = true; + this.rules = rules; + } + Parser2.prototype.start = function(text) { + this.text = text; + this.done = false; + return this.nextSymbol(); + }; + Parser2.prototype.isDone = function() { + return this.done && this.symbol === null; + }; + Parser2.prototype.nextSymbol = function() { + var best; + var bestSymbol; + this.symbol = null; + this.value = null; + do { + if (this.done) + return false; + var rule = void 0; + best = null; + for (var name_1 in this.rules) { + rule = this.rules[name_1]; + var match = rule.exec(this.text); + if (match) { + if (best === null || match[0].length > best[0].length) { + best = match; + bestSymbol = name_1; + } } - }; - var css_classnames = ["dhx_cal_prev_button", "dhx_cal_next_button"]; - var css_texts = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"]; - var diffs = [-1, 1]; - var handler = function(diff) { - return function() { - if (conf.sync) { - var calendars = scheduler2._synced_minicalendars; - for (var k = 0; k < calendars.length; k++) { - move_minicalendar_date(calendars[k], diff); - } - } else { - if (scheduler2.config.rtl) { - diff = -diff; - } - move_minicalendar_date(d, diff); + } + if (best != null) { + this.text = this.text.substr(best[0].length); + if (this.text === "") + this.done = true; + } + if (best == null) { + this.done = true; + this.symbol = null; + this.value = null; + return; + } + } while (bestSymbol === "SKIP"); + this.symbol = bestSymbol; + this.value = best; + return true; + }; + Parser2.prototype.accept = function(name) { + if (this.symbol === name) { + if (this.value) { + var v = this.value; + this.nextSymbol(); + return v; + } + this.nextSymbol(); + return true; + } + return false; + }; + Parser2.prototype.acceptNumber = function() { + return this.accept("number"); + }; + Parser2.prototype.expect = function(name) { + if (this.accept(name)) + return true; + throw new Error("expected " + name + " but found " + this.symbol); + }; + return Parser2; +}(); +function parseText(text, language) { + if (language === void 0) { + language = ENGLISH; + } + var options = {}; + var ttr = new Parser(language.tokens); + if (!ttr.start(text)) + return null; + S(); + return options; + function S() { + ttr.expect("every"); + var n = ttr.acceptNumber(); + if (n) + options.interval = parseInt(n[0], 10); + if (ttr.isDone()) + throw new Error("Unexpected end"); + switch (ttr.symbol) { + case "day(s)": + options.freq = RRule.DAILY; + if (ttr.nextSymbol()) { + AT(); + F(); + } + break; + case "weekday(s)": + options.freq = RRule.WEEKLY; + options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR]; + ttr.nextSymbol(); + AT(); + F(); + break; + case "week(s)": + options.freq = RRule.WEEKLY; + if (ttr.nextSymbol()) { + ON(); + AT(); + F(); + } + break; + case "hour(s)": + options.freq = RRule.HOURLY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "minute(s)": + options.freq = RRule.MINUTELY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "month(s)": + options.freq = RRule.MONTHLY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "year(s)": + options.freq = RRule.YEARLY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "monday": + case "tuesday": + case "wednesday": + case "thursday": + case "friday": + case "saturday": + case "sunday": + options.freq = RRule.WEEKLY; + var key = ttr.symbol.substr(0, 2).toUpperCase(); + options.byweekday = [RRule[key]]; + if (!ttr.nextSymbol()) + return; + while (ttr.accept("comma")) { + if (ttr.isDone()) + throw new Error("Unexpected end"); + var wkd = decodeWKD(); + if (!wkd) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected weekday"); } - }; - }; - var labels = [scheduler2.locale.labels.prev, scheduler2.locale.labels.next]; - for (var j = 0; j < 2; j++) { - var arrow = document.createElement("div"); - arrow.className = css_classnames[j]; - scheduler2._waiAria.headerButtonsAttributes(arrow, labels[j]); - arrow.style.cssText = css_texts[j]; - arrow.innerHTML = this._mini_cal_arrows[j]; - header.appendChild(arrow); - minicalDomEvents.attach(arrow, "click", handler(diffs[j])); + options.byweekday.push(RRule[wkd]); + ttr.nextSymbol(); + } + AT(); + MDAYs(); + F(); + break; + case "january": + case "february": + case "march": + case "april": + case "may": + case "june": + case "july": + case "august": + case "september": + case "october": + case "november": + case "december": + options.freq = RRule.YEARLY; + options.bymonth = [decodeM()]; + if (!ttr.nextSymbol()) + return; + while (ttr.accept("comma")) { + if (ttr.isDone()) + throw new Error("Unexpected end"); + var m = decodeM(); + if (!m) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected month"); + } + options.bymonth.push(m); + ttr.nextSymbol(); + } + ON(); + F(); + break; + default: + throw new Error("Unknown symbol"); + } + } + function ON() { + var on = ttr.accept("on"); + var the = ttr.accept("the"); + if (!(on || the)) + return; + do { + var nth = decodeNTH(); + var wkd = decodeWKD(); + var m = decodeM(); + if (nth) { + if (wkd) { + ttr.nextSymbol(); + if (!options.byweekday) + options.byweekday = []; + options.byweekday.push(RRule[wkd].nth(nth)); + } else { + if (!options.bymonthday) + options.bymonthday = []; + options.bymonthday.push(nth); + ttr.accept("day(s)"); + } + } else if (wkd) { + ttr.nextSymbol(); + if (!options.byweekday) + options.byweekday = []; + options.byweekday.push(RRule[wkd]); + } else if (ttr.symbol === "weekday(s)") { + ttr.nextSymbol(); + if (!options.byweekday) { + options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR]; + } + } else if (ttr.symbol === "week(s)") { + ttr.nextSymbol(); + var n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected week number"); + } + options.byweekno = [parseInt(n[0], 10)]; + while (ttr.accept("comma")) { + n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + "; expected monthday"); + } + options.byweekno.push(parseInt(n[0], 10)); + } + } else if (m) { + ttr.nextSymbol(); + if (!options.bymonth) + options.bymonth = []; + options.bymonth.push(m); + } else { + return; + } + } while (ttr.accept("comma") || ttr.accept("the") || ttr.accept("on")); + } + function AT() { + var at = ttr.accept("at"); + if (!at) + return; + do { + var n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected hour"); + } + options.byhour = [parseInt(n[0], 10)]; + while (ttr.accept("comma")) { + n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + "; expected hour"); + } + options.byhour.push(parseInt(n[0], 10)); + } + } while (ttr.accept("comma") || ttr.accept("at")); + } + function decodeM() { + switch (ttr.symbol) { + case "january": + return 1; + case "february": + return 2; + case "march": + return 3; + case "april": + return 4; + case "may": + return 5; + case "june": + return 6; + case "july": + return 7; + case "august": + return 8; + case "september": + return 9; + case "october": + return 10; + case "november": + return 11; + case "december": + return 12; + default: + return false; + } + } + function decodeWKD() { + switch (ttr.symbol) { + case "monday": + case "tuesday": + case "wednesday": + case "thursday": + case "friday": + case "saturday": + case "sunday": + return ttr.symbol.substr(0, 2).toUpperCase(); + default: + return false; + } + } + function decodeNTH() { + switch (ttr.symbol) { + case "last": + ttr.nextSymbol(); + return -1; + case "first": + ttr.nextSymbol(); + return 1; + case "second": + ttr.nextSymbol(); + return ttr.accept("last") ? -2 : 2; + case "third": + ttr.nextSymbol(); + return ttr.accept("last") ? -3 : 3; + case "nth": + var v = parseInt(ttr.value[1], 10); + if (v < -366 || v > 366) + throw new Error("Nth out of range: " + v); + ttr.nextSymbol(); + return ttr.accept("last") ? -v : v; + default: + return false; + } + } + function MDAYs() { + ttr.accept("on"); + ttr.accept("the"); + var nth = decodeNTH(); + if (!nth) + return; + options.bymonthday = [nth]; + ttr.nextSymbol(); + while (ttr.accept("comma")) { + nth = decodeNTH(); + if (!nth) { + throw new Error("Unexpected symbol " + ttr.symbol + "; expected monthday"); } + options.bymonthday.push(nth); + ttr.nextSymbol(); } - d._date = new Date(sd); - d.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7; - var dd = d._min_date = this.date.week_start(sd); - d._max_date = this.date.add(d._min_date, 6, "week"); - this._reset_month_scale(body, sd, dd, 6); - if (!previous) - obj.appendChild(d); - weekHeader.style.height = weekHeader.childNodes[0].offsetHeight - 1 + "px"; - var headerId = scheduler2.uid(); - scheduler2._waiAria.minicalHeader(header, headerId); - scheduler2._waiAria.minicalGrid(d.querySelector(".dhx_year_grid"), headerId); - scheduler2._waiAria.minicalRow(weekHeader); - var dayHeaders = weekHeader.querySelectorAll(".dhx_scale_bar"); - for (var i = 0; i < dayHeaders.length; i++) { - scheduler2._waiAria.minicalHeadCell(dayHeaders[i]); + } + function F() { + if (ttr.symbol === "until") { + var date = Date.parse(ttr.text); + if (!date) + throw new Error("Cannot parse until date:" + ttr.text); + options.until = new Date(date); + } else if (ttr.accept("for")) { + options.count = parseInt(ttr.value[0], 10); + ttr.expect("number"); } - var dayCells = body.querySelectorAll(".dhx_cal_month_cell"); - var firstDate = new Date(dd); - for (var i = 0; i < dayCells.length; i++) { - scheduler2._waiAria.minicalDayCell(dayCells[i], new Date(firstDate)); - firstDate = scheduler2.date.add(firstDate, 1, "day"); + } +} +var Frequency; +(function(Frequency2) { + Frequency2[Frequency2["YEARLY"] = 0] = "YEARLY"; + Frequency2[Frequency2["MONTHLY"] = 1] = "MONTHLY"; + Frequency2[Frequency2["WEEKLY"] = 2] = "WEEKLY"; + Frequency2[Frequency2["DAILY"] = 3] = "DAILY"; + Frequency2[Frequency2["HOURLY"] = 4] = "HOURLY"; + Frequency2[Frequency2["MINUTELY"] = 5] = "MINUTELY"; + Frequency2[Frequency2["SECONDLY"] = 6] = "SECONDLY"; +})(Frequency || (Frequency = {})); +function freqIsDailyOrGreater(freq) { + return freq < Frequency.HOURLY; +} +var fromText = function(text, language) { + if (language === void 0) { + language = ENGLISH; + } + return new RRule(parseText(text, language) || void 0); +}; +var common = ["count", "until", "interval", "byweekday", "bymonthday", "bymonth"]; +ToText.IMPLEMENTED = []; +ToText.IMPLEMENTED[Frequency.HOURLY] = common; +ToText.IMPLEMENTED[Frequency.MINUTELY] = common; +ToText.IMPLEMENTED[Frequency.DAILY] = ["byhour"].concat(common); +ToText.IMPLEMENTED[Frequency.WEEKLY] = common; +ToText.IMPLEMENTED[Frequency.MONTHLY] = common; +ToText.IMPLEMENTED[Frequency.YEARLY] = ["byweekno", "byyearday"].concat(common); +var toText = function(rrule, gettext, language, dateFormatter) { + return new ToText(rrule, gettext, language, dateFormatter).toString(); +}; +var isFullyConvertible = ToText.isFullyConvertible; +var Time = function() { + function Time2(hour, minute, second, millisecond) { + this.hour = hour; + this.minute = minute; + this.second = second; + this.millisecond = millisecond || 0; + } + Time2.prototype.getHours = function() { + return this.hour; + }; + Time2.prototype.getMinutes = function() { + return this.minute; + }; + Time2.prototype.getSeconds = function() { + return this.second; + }; + Time2.prototype.getMilliseconds = function() { + return this.millisecond; + }; + Time2.prototype.getTime = function() { + return (this.hour * 60 * 60 + this.minute * 60 + this.second) * 1e3 + this.millisecond; + }; + return Time2; +}(); +var DateTime = function(_super) { + __extends(DateTime2, _super); + function DateTime2(year, month, day, hour, minute, second, millisecond) { + var _this = _super.call(this, hour, minute, second, millisecond) || this; + _this.year = year; + _this.month = month; + _this.day = day; + return _this; + } + DateTime2.fromDate = function(date) { + return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1e3); + }; + DateTime2.prototype.getWeekday = function() { + return getWeekday(new Date(this.getTime())); + }; + DateTime2.prototype.getTime = function() { + return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime(); + }; + DateTime2.prototype.getDay = function() { + return this.day; + }; + DateTime2.prototype.getMonth = function() { + return this.month; + }; + DateTime2.prototype.getYear = function() { + return this.year; + }; + DateTime2.prototype.addYears = function(years) { + this.year += years; + }; + DateTime2.prototype.addMonths = function(months) { + this.month += months; + if (this.month > 12) { + var yearDiv = Math.floor(this.month / 12); + var monthMod = pymod(this.month, 12); + this.month = monthMod; + this.year += yearDiv; + if (this.month === 0) { + this.month = 12; + --this.year; + } } - scheduler2._waiAria.minicalHeader(header, headerId); - this._cols = temp; - this._mode = temp2; - this._colsS = temp3; - this._min_date = temp4; - this._max_date = temp5; - scheduler2._date = temp6; - ts.month_day = temp7; - this._ignores_detected = temp8; - return d; }; - scheduler2.destroyCalendar = function(cal, force) { - if (!cal && this._def_count && this._def_count.firstChild) { - if (force || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) - cal = this._def_count.firstChild; + DateTime2.prototype.addWeekly = function(days, wkst) { + if (wkst > this.getWeekday()) { + this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7; + } else { + this.day += -(this.getWeekday() - wkst) + days * 7; } - if (!cal) - return; - minicalDomEvents.detachAll(); - cal.innerHTML = ""; - if (cal.parentNode) - cal.parentNode.removeChild(cal); - if (this._def_count) - this._def_count.style.top = "-1000px"; - if (cal.conf && cal.conf._on_xle_handler) - scheduler2.detachEvent(cal.conf._on_xle_handler); + this.fixDay(); }; - scheduler2.isCalendarVisible = function() { - if (this._def_count && parseInt(this._def_count.style.top, 10) > 0) - return this._def_count; - return false; + DateTime2.prototype.addDaily = function(days) { + this.day += days; + this.fixDay(); }; - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.event(document.body, "click", function() { - scheduler2.destroyCalendar(); - }); - }, { once: true }); - scheduler2.form_blocks.calendar_time = { render: function(sns) { - var html = ""; - var cfg = scheduler2.config; - var dt = this.date.date_part(scheduler2._currentDate()); - var last = 24 * 60, first = 0; - if (cfg.limit_time_select) { - first = 60 * cfg.first_hour; - last = 60 * cfg.last_hour + 1; + DateTime2.prototype.addHours = function(hours, filtered, byhour) { + if (filtered) { + this.hour += Math.floor((23 - this.hour) / hours) * hours; } - dt.setHours(first / 60); - sns._time_values = []; - html += " "; - return "
" + html + "  –  " + html + "
"; - }, set_value: function(node, value, ev, config) { - var inputs = node.getElementsByTagName("input"); - var selects = node.getElementsByTagName("select"); - var start_date, end_date; - var _init_once = function(inp, date, number) { - scheduler2.event(inp, "click", function() { - scheduler2.destroyCalendar(null, true); - scheduler2.renderCalendar({ position: inp, date: new Date(this._date), navigation: true, handler: function(new_date) { - inp.value = scheduler2.templates.calendar_time(new_date); - inp._date = new Date(new_date); - scheduler2.destroyCalendar(); - if (scheduler2.config.event_duration && scheduler2.config.auto_end_date && number === 0) { - _update_minical_select(); - } - } }); - }); - }; - if (scheduler2.config.full_day) { - if (!node._full_day) { - var html = ""; - if (!scheduler2.config.wide_form) - html = node.previousSibling.innerHTML + html; - node.previousSibling.innerHTML = html; - node._full_day = true; + }; + DateTime2.prototype.addMinutes = function(minutes, filtered, byhour, byminute) { + if (filtered) { + this.minute += Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes; + } + for (; ; ) { + this.minute += minutes; + var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod; + if (hourDiv) { + this.minute = minuteMod; + this.addHours(hourDiv, false, byhour); } - var input = node.previousSibling.getElementsByTagName("input")[0]; - var isFulldayEvent = scheduler2.date.time_part(ev.start_date) === 0 && scheduler2.date.time_part(ev.end_date) === 0; - input.checked = isFulldayEvent; - selects[0].disabled = input.checked; - selects[1].disabled = input.checked; - if (!input.$_eventAttached) { - input.$_eventAttached = true; - scheduler2.event(input, "click", function() { - if (input.checked === true) { - var obj = {}; - scheduler2.form_blocks.calendar_time.get_value(node, obj); - start_date = scheduler2.date.date_part(obj.start_date); - end_date = scheduler2.date.date_part(obj.end_date); - if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) - end_date = scheduler2.date.add(end_date, 1, "day"); - } - var start = start_date || ev.start_date; - var end = end_date || ev.end_date; - _attach_action(inputs[0], start); - _attach_action(inputs[1], end); - selects[0].value = start.getHours() * 60 + start.getMinutes(); - selects[1].value = end.getHours() * 60 + end.getMinutes(); - selects[0].disabled = input.checked; - selects[1].disabled = input.checked; - }); + if ((empty(byhour) || includes(byhour, this.hour)) && (empty(byminute) || includes(byminute, this.minute))) { + break; } } - if (scheduler2.config.event_duration && scheduler2.config.auto_end_date) { - var _update_minical_select = function() { - if (!(scheduler2.config.auto_end_date && scheduler2.config.event_duration)) { - return; - } - start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); - end_date = new Date(start_date.getTime() + scheduler2.config.event_duration * 60 * 1e3); - inputs[1].value = scheduler2.templates.calendar_time(end_date); - inputs[1]._date = scheduler2.date.date_part(new Date(end_date)); - selects[1].value = end_date.getHours() * 60 + end_date.getMinutes(); - }; - if (!selects[0].$_eventAttached) { - selects[0].addEventListener("change", _update_minical_select); + }; + DateTime2.prototype.addSeconds = function(seconds, filtered, byhour, byminute, bysecond) { + if (filtered) { + this.second += Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / seconds) * seconds; + } + for (; ; ) { + this.second += seconds; + var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod; + if (minuteDiv) { + this.second = secondMod; + this.addMinutes(minuteDiv, false, byhour, byminute); + } + if ((empty(byhour) || includes(byhour, this.hour)) && (empty(byminute) || includes(byminute, this.minute)) && (empty(bysecond) || includes(bysecond, this.second))) { + break; } } - function _attach_action(inp, date, number) { - _init_once(inp, date, number); - inp.value = scheduler2.templates.calendar_time(date); - inp._date = scheduler2.date.date_part(new Date(date)); + }; + DateTime2.prototype.fixDay = function() { + if (this.day <= 28) { + return; } - _attach_action(inputs[0], ev.start_date, 0); - _attach_action(inputs[1], ev.end_date, 1); - _init_once = function() { - }; - function _round_minutes(date) { - var time_values = config._time_values; - var direct_value = date.getHours() * 60 + date.getMinutes(); - var fixed_value = direct_value; - var value_found = false; - for (var k = 0; k < time_values.length; k++) { - var t_v = time_values[k]; - if (t_v === direct_value) { - value_found = true; - break; + var daysinmonth = monthRange(this.year, this.month - 1)[1]; + if (this.day <= daysinmonth) { + return; + } + while (this.day > daysinmonth) { + this.day -= daysinmonth; + ++this.month; + if (this.month === 13) { + this.month = 1; + ++this.year; + if (this.year > MAXYEAR) { + return; } - if (t_v < direct_value) - fixed_value = t_v; } - if (!(value_found || fixed_value)) - return -1; - return value_found ? direct_value : fixed_value; + daysinmonth = monthRange(this.year, this.month - 1)[1]; + } + }; + DateTime2.prototype.add = function(options, filtered) { + var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; + switch (freq) { + case Frequency.YEARLY: + return this.addYears(interval); + case Frequency.MONTHLY: + return this.addMonths(interval); + case Frequency.WEEKLY: + return this.addWeekly(interval, wkst); + case Frequency.DAILY: + return this.addDaily(interval); + case Frequency.HOURLY: + return this.addHours(interval, filtered, byhour); + case Frequency.MINUTELY: + return this.addMinutes(interval, filtered, byhour, byminute); + case Frequency.SECONDLY: + return this.addSeconds(interval, filtered, byhour, byminute, bysecond); + } + }; + return DateTime2; +}(Time); +function initializeOptions$1(options) { + var invalid = []; + var keys = Object.keys(options); + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + if (!includes(defaultKeys, key)) + invalid.push(key); + if (isDate(options[key]) && !isValidDate(options[key])) { + invalid.push(key); } - selects[0].value = _round_minutes(ev.start_date); - selects[1].value = _round_minutes(ev.end_date); - }, get_value: function(node, ev) { - var inputs = node.getElementsByTagName("input"); - var selects = node.getElementsByTagName("select"); - ev.start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); - ev.end_date = scheduler2.date.add(inputs[1]._date, selects[1].value, "minute"); - if (ev.end_date <= ev.start_date) - ev.end_date = scheduler2.date.add(ev.start_date, scheduler2.config.time_step, "minute"); - return { start_date: new Date(ev.start_date), end_date: new Date(ev.end_date) }; - }, focus: function(node) { - } }; - scheduler2.linkCalendar = function(calendar, datediff) { - var action = function() { - var date = scheduler2._date; - var dateNew = new Date(date.valueOf()); - if (datediff) - dateNew = datediff(dateNew); - dateNew.setDate(1); - scheduler2.updateCalendar(calendar, dateNew); - return true; - }; - scheduler2.attachEvent("onViewChange", action); - scheduler2.attachEvent("onXLE", action); - scheduler2.attachEvent("onEventAdded", action); - scheduler2.attachEvent("onEventChanged", action); - scheduler2.attachEvent("onEventDeleted", action); - action(); - }; - scheduler2._markCalendarCurrentDate = function(calendar) { - var state = scheduler2.getState(); - var from = state.min_date; - var to = state.max_date; - var mode = state.mode; - var month_start = scheduler2.date.month_start(new Date(calendar._date)); - var month_end = scheduler2.date.add(month_start, 1, "month"); - var noHighlight = { month: true, year: true, agenda: true, grid: true }; - if (noHighlight[mode] || from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf()) { - return; + } + if (invalid.length) { + throw new Error("Invalid options: " + invalid.join(", ")); + } + return __assign({}, options); +} +function parseOptions(options) { + var opts = __assign(__assign({}, DEFAULT_OPTIONS$1), initializeOptions$1(options)); + if (isPresent(opts.byeaster)) + opts.freq = RRule.YEARLY; + if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) { + throw new Error("Invalid frequency: ".concat(opts.freq, " ").concat(options.freq)); + } + if (!opts.dtstart) + opts.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0)); + if (!isPresent(opts.wkst)) { + opts.wkst = RRule.MO.weekday; + } else if (isNumber(opts.wkst)) + ; + else { + opts.wkst = opts.wkst.weekday; + } + if (isPresent(opts.bysetpos)) { + if (isNumber(opts.bysetpos)) + opts.bysetpos = [opts.bysetpos]; + for (var i = 0; i < opts.bysetpos.length; i++) { + var v = opts.bysetpos[i]; + if (v === 0 || !(v >= -366 && v <= 366)) { + throw new Error("bysetpos must be between 1 and 366, or between -366 and -1"); + } + } + } + if (!(Boolean(opts.byweekno) || notEmpty(opts.byweekno) || notEmpty(opts.byyearday) || Boolean(opts.bymonthday) || notEmpty(opts.bymonthday) || isPresent(opts.byweekday) || isPresent(opts.byeaster))) { + switch (opts.freq) { + case RRule.YEARLY: + if (!opts.bymonth) + opts.bymonth = opts.dtstart.getUTCMonth() + 1; + opts.bymonthday = opts.dtstart.getUTCDate(); + break; + case RRule.MONTHLY: + opts.bymonthday = opts.dtstart.getUTCDate(); + break; + case RRule.WEEKLY: + opts.byweekday = [getWeekday(opts.dtstart)]; + break; + } + } + if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) { + opts.bymonth = [opts.bymonth]; + } + if (isPresent(opts.byyearday) && !isArray(opts.byyearday) && isNumber(opts.byyearday)) { + opts.byyearday = [opts.byyearday]; + } + if (!isPresent(opts.bymonthday)) { + opts.bymonthday = []; + opts.bynmonthday = []; + } else if (isArray(opts.bymonthday)) { + var bymonthday = []; + var bynmonthday = []; + for (var i = 0; i < opts.bymonthday.length; i++) { + var v = opts.bymonthday[i]; + if (v > 0) { + bymonthday.push(v); + } else if (v < 0) { + bynmonthday.push(v); + } + } + opts.bymonthday = bymonthday; + opts.bynmonthday = bynmonthday; + } else if (opts.bymonthday < 0) { + opts.bynmonthday = [opts.bymonthday]; + opts.bymonthday = []; + } else { + opts.bynmonthday = []; + opts.bymonthday = [opts.bymonthday]; + } + if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) { + opts.byweekno = [opts.byweekno]; + } + if (!isPresent(opts.byweekday)) { + opts.bynweekday = null; + } else if (isNumber(opts.byweekday)) { + opts.byweekday = [opts.byweekday]; + opts.bynweekday = null; + } else if (isWeekdayStr(opts.byweekday)) { + opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday]; + opts.bynweekday = null; + } else if (opts.byweekday instanceof Weekday) { + if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) { + opts.byweekday = [opts.byweekday.weekday]; + opts.bynweekday = null; + } else { + opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]]; + opts.byweekday = null; } - var current = from; - while (current.valueOf() < to.valueOf()) { - if (month_start.valueOf() <= current.valueOf() && month_end > current) { - scheduler2.markCalendar(calendar, current, "dhx_calendar_click"); + } else { + var byweekday = []; + var bynweekday = []; + for (var i = 0; i < opts.byweekday.length; i++) { + var wday = opts.byweekday[i]; + if (isNumber(wday)) { + byweekday.push(wday); + continue; + } else if (isWeekdayStr(wday)) { + byweekday.push(Weekday.fromStr(wday).weekday); + continue; + } + if (!wday.n || opts.freq > RRule.MONTHLY) { + byweekday.push(wday.weekday); + } else { + bynweekday.push([wday.weekday, wday.n]); } - current = scheduler2.date.add(current, 1, "day"); } - }; - scheduler2.attachEvent("onEventCancel", function() { - scheduler2.destroyCalendar(null, true); - }); - scheduler2.attachEvent("onDestroy", function() { - scheduler2.destroyCalendar(); + opts.byweekday = notEmpty(byweekday) ? byweekday : null; + opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null; + } + if (!isPresent(opts.byhour)) { + opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null; + } else if (isNumber(opts.byhour)) { + opts.byhour = [opts.byhour]; + } + if (!isPresent(opts.byminute)) { + opts.byminute = opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null; + } else if (isNumber(opts.byminute)) { + opts.byminute = [opts.byminute]; + } + if (!isPresent(opts.bysecond)) { + opts.bysecond = opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null; + } else if (isNumber(opts.bysecond)) { + opts.bysecond = [opts.bysecond]; + } + return { parsedOptions: opts }; +} +function buildTimeset(opts) { + var millisecondModulo = opts.dtstart.getTime() % 1e3; + if (!freqIsDailyOrGreater(opts.freq)) { + return []; + } + var timeset = []; + opts.byhour.forEach(function(hour) { + opts.byminute.forEach(function(minute) { + opts.bysecond.forEach(function(second) { + timeset.push(new Time(hour, minute, second, millisecondModulo)); + }); + }); }); + return timeset; } -function monthheight(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.xy.scroll_width = 0; - var old = scheduler2.render_view_data; - scheduler2.render_view_data = function() { - var data = this._els["dhx_cal_data"][0]; - data.firstChild._h_fix = true; - old.apply(scheduler2, arguments); - var height = parseInt(data.style.height); - data.style.height = "1px"; - data.style.height = data.scrollHeight + "px"; - this._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + "px"; - }; - var old_s = scheduler2._reset_month_scale; - scheduler2._reset_month_scale = function(a, b, c, d) { - var dummy = { clientHeight: 100 }; - old_s.apply(scheduler2, [dummy, b, c, d]); - a.innerHTML = dummy.innerHTML; - }; +function parseString(rfcString) { + var options = rfcString.split("\n").map(parseLine).filter(function(x) { + return x !== null; }); + return __assign(__assign({}, options[0]), options[1]); } -function multisection_restricted(scheduler2) { - notImplemented.alert("Multisection", scheduler2.assert); +function parseDtstart(line) { + var options = {}; + var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(line); + if (!dtstartWithZone) { + return options; + } + var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2]; + if (tzid) { + options.tzid = tzid; + } + options.dtstart = untilStringToDate(dtstart); + return options; } -function multiselect(scheduler2) { - function parseXMLOptions(loader, config) { - var items = scheduler2.ajax.xpath("//data/item", loader.xmlDoc); - var ids = {}; - for (var i = 0; i < items.length; i++) { - ids[items[i].getAttribute(config.map_to)] = true; - } - return ids; +function parseLine(rfcString) { + rfcString = rfcString.replace(/^\s+|\s+$/, ""); + if (!rfcString.length) + return null; + var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase()); + if (!header) { + return parseRrule(rfcString); } - function parseJSONOptions(loader, config) { - try { - var items = JSON.parse(loader.xmlDoc.responseText); - var ids = {}; - for (var i = 0; i < items.length; i++) { - var option = items[i]; - ids[option.value || option.key || option.id] = true; - } - return ids; - } catch (e) { - return null; - } + var key = header[1]; + switch (key.toUpperCase()) { + case "RRULE": + case "EXRULE": + return parseRrule(rfcString); + case "DTSTART": + return parseDtstart(rfcString); + default: + throw new Error("Unsupported RFC prop ".concat(key, " in ").concat(rfcString)); } - scheduler2.form_blocks["multiselect"] = { render: function(sns) { - var css = "dhx_multi_select_control dhx_multi_select_" + sns.name; - if (!!sns.vertical) { - css += " dhx_multi_select_control_vertical"; - } - var _result = "
"; - for (var i = 0; i < sns.options.length; i++) { - _result += ""; - } - _result += "
"; - return _result; - }, set_value: function(node, value, ev, config) { - var _children = node.getElementsByTagName("input"); - for (var i = 0; i < _children.length; i++) { - _children[i].checked = false; +} +function parseRrule(line) { + var strippedLine = line.replace(/^RRULE:/i, ""); + var options = parseDtstart(strippedLine); + var attrs = line.replace(/^(?:RRULE|EXRULE):/i, "").split(";"); + attrs.forEach(function(attr) { + var _a = attr.split("="), key = _a[0], value = _a[1]; + switch (key.toUpperCase()) { + case "FREQ": + options.freq = Frequency[value.toUpperCase()]; + break; + case "WKST": + options.wkst = Days[value.toUpperCase()]; + break; + case "COUNT": + case "INTERVAL": + case "BYSETPOS": + case "BYMONTH": + case "BYMONTHDAY": + case "BYYEARDAY": + case "BYWEEKNO": + case "BYHOUR": + case "BYMINUTE": + case "BYSECOND": + var num = parseNumber(value); + var optionKey = key.toLowerCase(); + options[optionKey] = num; + break; + case "BYWEEKDAY": + case "BYDAY": + options.byweekday = parseWeekday(value); + break; + case "DTSTART": + case "TZID": + var dtstart = parseDtstart(line); + options.tzid = dtstart.tzid; + options.dtstart = dtstart.dtstart; + break; + case "UNTIL": + options.until = untilStringToDate(value); + break; + case "BYEASTER": + options.byeaster = Number(value); + break; + default: + throw new Error("Unknown RRULE property '" + key + "'"); } - function _mark_inputs(ids) { - var _children2 = node.getElementsByTagName("input"); - for (var i2 = 0; i2 < _children2.length; i2++) { - _children2[i2].checked = !!ids[_children2[i2].value]; - } + }); + return options; +} +function parseNumber(value) { + if (value.indexOf(",") !== -1) { + var values = value.split(","); + return values.map(parseIndividualNumber); + } + return parseIndividualNumber(value); +} +function parseIndividualNumber(value) { + if (/^[+-]?\d+$/.test(value)) { + return Number(value); + } + return value; +} +function parseWeekday(value) { + var days = value.split(","); + return days.map(function(day) { + if (day.length === 2) { + return Days[day]; + } + var parts = day.match(/^([+-]?\d{1,2})([A-Z]{2})$/); + if (!parts || parts.length < 3) { + throw new SyntaxError("Invalid weekday string: ".concat(day)); + } + var n = Number(parts[1]); + var wdaypart = parts[2]; + var wday = Days[wdaypart].weekday; + return new Weekday(wday, n); + }); +} +var DateWithZone = function() { + function DateWithZone2(date, tzid) { + if (isNaN(date.getTime())) { + throw new RangeError("Invalid date passed to DateWithZone"); } - var _ids = {}; - if (ev[config.map_to]) { - var results = (ev[config.map_to] + "").split(config.delimiter || scheduler2.config.section_delimiter || ","); - for (var i = 0; i < results.length; i++) { - _ids[results[i]] = true; - } - _mark_inputs(_ids); - } else { - if (scheduler2._new_event || !config.script_url) - return; - var divLoading = document.createElement("div"); - divLoading.className = "dhx_loading"; - divLoading.style.cssText = "position: absolute; top: 40%; left: 40%;"; - node.appendChild(divLoading); - var url2 = [config.script_url, config.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + config.map_to + "=" + ev.id + "&uid=" + scheduler2.uid()].join(""); - scheduler2.ajax.get(url2, function(loader) { - var options = parseJSONOptions(loader); - if (!options) { - options = parseXMLOptions(loader, config); + this.date = date; + this.tzid = tzid; + } + Object.defineProperty(DateWithZone2.prototype, "isUTC", { get: function() { + return !this.tzid || this.tzid.toUpperCase() === "UTC"; + }, enumerable: false, configurable: true }); + DateWithZone2.prototype.toString = function() { + var datestr = timeToUntilString(this.date.getTime(), this.isUTC); + if (!this.isUTC) { + return ";TZID=".concat(this.tzid, ":").concat(datestr); + } + return ":".concat(datestr); + }; + DateWithZone2.prototype.getTime = function() { + return this.date.getTime(); + }; + DateWithZone2.prototype.rezonedDate = function() { + if (this.isUTC) { + return this.date; + } + return dateInTimeZone(this.date, this.tzid); + }; + return DateWithZone2; +}(); +function optionsToString(options) { + var rrule = []; + var dtstart = ""; + var keys = Object.keys(options); + var defaultKeys2 = Object.keys(DEFAULT_OPTIONS$1); + for (var i = 0; i < keys.length; i++) { + if (keys[i] === "tzid") + continue; + if (!includes(defaultKeys2, keys[i])) + continue; + var key = keys[i].toUpperCase(); + var value = options[keys[i]]; + var outValue = ""; + if (!isPresent(value) || isArray(value) && !value.length) + continue; + switch (key) { + case "FREQ": + outValue = RRule.FREQUENCIES[options.freq]; + break; + case "WKST": + if (isNumber(value)) { + outValue = new Weekday(value).toString(); + } else { + outValue = value.toString(); + } + break; + case "BYWEEKDAY": + key = "BYDAY"; + outValue = toArray(value).map(function(wday) { + if (wday instanceof Weekday) { + return wday; + } + if (isArray(wday)) { + return new Weekday(wday[0], wday[1]); + } + return new Weekday(wday); + }).toString(); + break; + case "DTSTART": + dtstart = buildDtstart(value, options.tzid); + break; + case "UNTIL": + outValue = timeToUntilString(value, !options.tzid); + break; + default: + if (isArray(value)) { + var strValues = []; + for (var j = 0; j < value.length; j++) { + strValues[j] = String(value[j]); + } + outValue = strValues.toString(); + } else { + outValue = String(value); } - _mark_inputs(options); - node.removeChild(divLoading); - }); } - }, get_value: function(node, ev, config) { - var _result = []; - var _children = node.getElementsByTagName("input"); - for (var i = 0; i < _children.length; i++) { - if (_children[i].checked) - _result.push(_children[i].value); + if (outValue) { + rrule.push([key, outValue]); } - return _result.join(config.delimiter || scheduler2.config.section_delimiter || ","); - }, focus: function(node) { - } }; + } + var rules = rrule.map(function(_a) { + var key2 = _a[0], value2 = _a[1]; + return "".concat(key2, "=").concat(value2.toString()); + }).join(";"); + var ruleString = ""; + if (rules !== "") { + ruleString = "RRULE:".concat(rules); + } + return [dtstart, ruleString].filter(function(x) { + return !!x; + }).join("\n"); } -function multisource(scheduler2) { - function backup(obj) { - var t = function() { - }; - t.prototype = obj; - return t; +function buildDtstart(dtstart, tzid) { + if (!dtstart) { + return ""; } - var old = scheduler2._load; - scheduler2._load = function(url2, from) { - url2 = url2 || this._load_url; - if (typeof url2 == "object") { - var t = backup(this._loaded); - for (var i = 0; i < url2.length; i++) { - this._loaded = new t(); - old.call(this, url2[i], from); - } - } else - old.apply(this, arguments); - }; + return "DTSTART" + new DateWithZone(new Date(dtstart), tzid).toString(); } -function mvc(scheduler2) { - var cfg = { use_id: false }; - function sanitize(ev) { - var obj = {}; - for (var key in ev) - if (key.indexOf("_") !== 0) - obj[key] = ev[key]; - if (!cfg.use_id) - delete obj.id; - return obj; +function argsMatch(left, right) { + if (Array.isArray(left)) { + if (!Array.isArray(right)) + return false; + if (left.length !== right.length) + return false; + return left.every(function(date, i) { + return date.getTime() === right[i].getTime(); + }); } - var update_timer; - function update_view() { - clearTimeout(update_timer); - update_timer = setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - scheduler2.updateView(); - }, 1); + if (left instanceof Date) { + return right instanceof Date && left.getTime() === right.getTime(); } - function _start_ext_load(cal) { - cal._loading = true; - cal._not_render = true; - cal.callEvent("onXLS", []); + return left === right; +} +var Cache = function() { + function Cache2() { + this.all = false; + this.before = []; + this.after = []; + this.between = []; } - function _finish_ext_load(cal) { - cal._not_render = false; - if (cal._render_wait) - cal.render_view_data(); - cal._loading = false; - cal.callEvent("onXLE", []); + Cache2.prototype._cacheAdd = function(what, value, args) { + if (value) { + value = value instanceof Date ? clone(value) : cloneDates(value); + } + if (what === "all") { + this.all = value; + } else { + args._value = value; + this[what].push(args); + } + }; + Cache2.prototype._cacheGet = function(what, args) { + var cached = false; + var argsKeys = args ? Object.keys(args) : []; + var findCacheDiff = function(item2) { + for (var i2 = 0; i2 < argsKeys.length; i2++) { + var key = argsKeys[i2]; + if (!argsMatch(args[key], item2[key])) { + return true; + } + } + return false; + }; + var cachedObject = this[what]; + if (what === "all") { + cached = this.all; + } else if (isArray(cachedObject)) { + for (var i = 0; i < cachedObject.length; i++) { + var item = cachedObject[i]; + if (argsKeys.length && findCacheDiff(item)) + continue; + cached = item._value; + break; + } + } + if (!cached && this.all) { + var iterResult = new IterResult(what, args); + for (var i = 0; i < this.all.length; i++) { + if (!iterResult.accept(this.all[i])) + break; + } + cached = iterResult.getValue(); + this._cacheAdd(what, cached, args); + } + return isArray(cached) ? cloneDates(cached) : cached instanceof Date ? clone(cached) : cached; + }; + return Cache2; +}(); +var M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true); +var M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true); +var M28 = range(1, 29); +var M29 = range(1, 30); +var M30 = range(1, 31); +var M31 = range(1, 32); +var MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true); +var MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true); +var NM28 = range(-28, 0); +var NM29 = range(-29, 0); +var NM30 = range(-30, 0); +var NM31 = range(-31, 0); +var NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true); +var NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true); +var M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; +var M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; +var WDAYMASK = function() { + var wdaymask = []; + for (var i = 0; i < 55; i++) + wdaymask = wdaymask.concat(range(7)); + return wdaymask; +}(); +function rebuildYear(year, options) { + var firstyday = datetime(year, 1, 1); + var yearlen = isLeapYear(year) ? 366 : 365; + var nextyearlen = isLeapYear(year + 1) ? 366 : 365; + var yearordinal = toOrdinal(firstyday); + var yearweekday = getWeekday(firstyday); + var result = __assign(__assign({ yearlen, nextyearlen, yearordinal, yearweekday }, baseYearMasks(year)), { wnomask: null }); + if (empty(options.byweekno)) { + return result; } - function _get_id(model) { - return cfg.use_id ? model.id : model.cid; + result.wnomask = repeat(0, yearlen + 7); + var firstwkst; + var wyearlen; + var no1wkst = firstwkst = pymod(7 - yearweekday + options.wkst, 7); + if (no1wkst >= 4) { + no1wkst = 0; + wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7); + } else { + wyearlen = yearlen - no1wkst; } - scheduler2.backbone = function(events, config) { - if (config) - cfg = config; - events.bind("change", function(model, info) { - var cid = _get_id(model); - var ev = scheduler2._events[cid] = model.toJSON(); - ev.id = cid; - scheduler2._init_event(ev); - update_view(); - }); - events.bind("remove", function(model, changes) { - var cid = _get_id(model); - if (scheduler2._events[cid]) - scheduler2.deleteEvent(cid); - }); - var queue = []; - function add_from_queue() { - if (scheduler2.$destroyed) { - return true; + var div = Math.floor(wyearlen / 7); + var mod = pymod(wyearlen, 7); + var numweeks = Math.floor(div + mod / 4); + for (var j = 0; j < options.byweekno.length; j++) { + var n = options.byweekno[j]; + if (n < 0) { + n += numweeks + 1; + } + if (!(n > 0 && n <= numweeks)) { + continue; + } + var i = void 0; + if (n > 1) { + i = no1wkst + (n - 1) * 7; + if (no1wkst !== firstwkst) { + i -= 7 - firstwkst; } - if (queue.length) { - scheduler2.parse(queue, "json"); - queue = []; + } else { + i = no1wkst; + } + for (var k = 0; k < 7; k++) { + result.wnomask[i] = 1; + i++; + if (result.wdaymask[i] === options.wkst) + break; + } + } + if (includes(options.byweekno, 1)) { + var i = no1wkst + numweeks * 7; + if (no1wkst !== firstwkst) + i -= 7 - firstwkst; + if (i < yearlen) { + for (var j = 0; j < 7; j++) { + result.wnomask[i] = 1; + i += 1; + if (result.wdaymask[i] === options.wkst) + break; } } - events.bind("add", function(model, changes) { - var cid = _get_id(model); - if (!scheduler2._events[cid]) { - var ev = model.toJSON(); - ev.id = cid; - scheduler2._init_event(ev); - queue.push(ev); - if (queue.length == 1) - setTimeout(add_from_queue, 1); + } + if (no1wkst) { + var lnumweeks = void 0; + if (!includes(options.byweekno, -1)) { + var lyearweekday = getWeekday(datetime(year - 1, 1, 1)); + var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7); + var lyearlen = isLeapYear(year - 1) ? 366 : 365; + var weekst = void 0; + if (lno1wkst >= 4) { + lno1wkst = 0; + weekst = lyearlen + pymod(lyearweekday - options.wkst, 7); + } else { + weekst = yearlen - no1wkst; } - }); - events.bind("request", function(obj) { - if (obj instanceof Backbone.Collection) - _start_ext_load(scheduler2); - }); - events.bind("sync", function(obj) { - if (obj instanceof Backbone.Collection) - _finish_ext_load(scheduler2); - }); - events.bind("error", function(obj) { - if (obj instanceof Backbone.Collection) - _finish_ext_load(scheduler2); - }); - scheduler2.attachEvent("onEventCreated", function(id2) { - var ev = new events.model(scheduler2.getEvent(id2)); - scheduler2._events[id2] = ev.toJSON(); - scheduler2._events[id2].id = id2; - return true; - }); - scheduler2.attachEvent("onEventAdded", function(id2) { - if (!events.get(id2)) { - var data = sanitize(scheduler2.getEvent(id2)); - var model = new events.model(data); - var cid = _get_id(model); - if (cid != id2) - this.changeEventId(id2, cid); - events.add(model); - events.trigger("scheduler:add", model); + lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4); + } else { + lnumweeks = -1; + } + if (includes(options.byweekno, lnumweeks)) { + for (var i = 0; i < no1wkst; i++) + result.wnomask[i] = 1; + } + } + return result; +} +function baseYearMasks(year) { + var yearlen = isLeapYear(year) ? 366 : 365; + var firstyday = datetime(year, 1, 1); + var wday = getWeekday(firstyday); + if (yearlen === 365) { + return { mmask: M365MASK, mdaymask: MDAY365MASK, nmdaymask: NMDAY365MASK, wdaymask: WDAYMASK.slice(wday), mrange: M365RANGE }; + } + return { mmask: M366MASK, mdaymask: MDAY366MASK, nmdaymask: NMDAY366MASK, wdaymask: WDAYMASK.slice(wday), mrange: M366RANGE }; +} +function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) { + var result = { lastyear: year, lastmonth: month, nwdaymask: [] }; + var ranges = []; + if (options.freq === RRule.YEARLY) { + if (empty(options.bymonth)) { + ranges = [[0, yearlen]]; + } else { + for (var j = 0; j < options.bymonth.length; j++) { + month = options.bymonth[j]; + ranges.push(mrange.slice(month - 1, month + 1)); } - return true; - }); - scheduler2.attachEvent("onEventChanged", function(id2) { - var ev = events.get(id2); - var upd = sanitize(scheduler2.getEvent(id2)); - ev.set(upd); - events.trigger("scheduler:change", ev); - return true; - }); - scheduler2.attachEvent("onEventDeleted", function(id2) { - var model = events.get(id2); - if (model) { - events.trigger("scheduler:remove", model); - events.remove(id2); + } + } else if (options.freq === RRule.MONTHLY) { + ranges = [mrange.slice(month - 1, month + 1)]; + } + if (empty(ranges)) { + return result; + } + result.nwdaymask = repeat(0, yearlen); + for (var j = 0; j < ranges.length; j++) { + var rang = ranges[j]; + var first = rang[0]; + var last = rang[1] - 1; + for (var k = 0; k < options.bynweekday.length; k++) { + var i = void 0; + var _a = options.bynweekday[k], wday = _a[0], n = _a[1]; + if (n < 0) { + i = last + (n + 1) * 7; + i -= pymod(wdaymask[i] - wday, 7); + } else { + i = first + (n - 1) * 7; + i += pymod(7 - wdaymask[i] + wday, 7); } - return true; + if (first <= i && i <= last) + result.nwdaymask[i] = 1; + } + } + return result; +} +function easter(y, offset) { + if (offset === void 0) { + offset = 0; + } + var a = y % 19; + var b = Math.floor(y / 100); + var c = y % 100; + var d = Math.floor(b / 4); + var e = b % 4; + var f = Math.floor((b + 8) / 25); + var g = Math.floor((b - f + 1) / 3); + var h = Math.floor(19 * a + b - d - g + 15) % 30; + var i = Math.floor(c / 4); + var k = c % 4; + var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7; + var m = Math.floor((a + 11 * h + 22 * l) / 451); + var month = Math.floor((h + l - 7 * m + 114) / 31); + var day = (h + l - 7 * m + 114) % 31 + 1; + var date = Date.UTC(y, month - 1, day + offset); + var yearStart = Date.UTC(y, 0, 1); + return [Math.ceil((date - yearStart) / (1e3 * 60 * 60 * 24))]; +} +var Iterinfo = function() { + function Iterinfo2(options) { + this.options = options; + } + Iterinfo2.prototype.rebuild = function(year, month) { + var options = this.options; + if (year !== this.lastyear) { + this.yearinfo = rebuildYear(year, options); + } + if (notEmpty(options.bynweekday) && (month !== this.lastmonth || year !== this.lastyear)) { + var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask; + this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options); + } + if (isPresent(options.byeaster)) { + this.eastermask = easter(year, options.byeaster); + } + }; + Object.defineProperty(Iterinfo2.prototype, "lastyear", { get: function() { + return this.monthinfo ? this.monthinfo.lastyear : null; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "lastmonth", { get: function() { + return this.monthinfo ? this.monthinfo.lastmonth : null; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "yearlen", { get: function() { + return this.yearinfo.yearlen; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "yearordinal", { get: function() { + return this.yearinfo.yearordinal; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "mrange", { get: function() { + return this.yearinfo.mrange; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "wdaymask", { get: function() { + return this.yearinfo.wdaymask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "mmask", { get: function() { + return this.yearinfo.mmask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "wnomask", { get: function() { + return this.yearinfo.wnomask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "nwdaymask", { get: function() { + return this.monthinfo ? this.monthinfo.nwdaymask : []; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "nextyearlen", { get: function() { + return this.yearinfo.nextyearlen; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "mdaymask", { get: function() { + return this.yearinfo.mdaymask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "nmdaymask", { get: function() { + return this.yearinfo.nmdaymask; + }, enumerable: false, configurable: true }); + Iterinfo2.prototype.ydayset = function() { + return [range(this.yearlen), 0, this.yearlen]; + }; + Iterinfo2.prototype.mdayset = function(_, month) { + var start = this.mrange[month - 1]; + var end = this.mrange[month]; + var set = repeat(null, this.yearlen); + for (var i = start; i < end; i++) + set[i] = i; + return [set, start, end]; + }; + Iterinfo2.prototype.wdayset = function(year, month, day) { + var set = repeat(null, this.yearlen + 7); + var i = toOrdinal(datetime(year, month, day)) - this.yearordinal; + var start = i; + for (var j = 0; j < 7; j++) { + set[i] = i; + ++i; + if (this.wdaymask[i] === this.options.wkst) + break; + } + return [set, start, i]; + }; + Iterinfo2.prototype.ddayset = function(year, month, day) { + var set = repeat(null, this.yearlen); + var i = toOrdinal(datetime(year, month, day)) - this.yearordinal; + set[i] = i; + return [set, i, i + 1]; + }; + Iterinfo2.prototype.htimeset = function(hour, _, second, millisecond) { + var _this = this; + var set = []; + this.options.byminute.forEach(function(minute) { + set = set.concat(_this.mtimeset(hour, minute, second, millisecond)); }); + sort(set); + return set; }; + Iterinfo2.prototype.mtimeset = function(hour, minute, _, millisecond) { + var set = this.options.bysecond.map(function(second) { + return new Time(hour, minute, second, millisecond); + }); + sort(set); + return set; + }; + Iterinfo2.prototype.stimeset = function(hour, minute, second, millisecond) { + return [new Time(hour, minute, second, millisecond)]; + }; + Iterinfo2.prototype.getdayset = function(freq) { + switch (freq) { + case Frequency.YEARLY: + return this.ydayset.bind(this); + case Frequency.MONTHLY: + return this.mdayset.bind(this); + case Frequency.WEEKLY: + return this.wdayset.bind(this); + case Frequency.DAILY: + return this.ddayset.bind(this); + default: + return this.ddayset.bind(this); + } + }; + Iterinfo2.prototype.gettimeset = function(freq) { + switch (freq) { + case Frequency.HOURLY: + return this.htimeset.bind(this); + case Frequency.MINUTELY: + return this.mtimeset.bind(this); + case Frequency.SECONDLY: + return this.stimeset.bind(this); + } + }; + return Iterinfo2; +}(); +function buildPoslist(bysetpos, timeset, start, end, ii, dayset) { + var poslist = []; + for (var j = 0; j < bysetpos.length; j++) { + var daypos = void 0; + var timepos = void 0; + var pos = bysetpos[j]; + if (pos < 0) { + daypos = Math.floor(pos / timeset.length); + timepos = pymod(pos, timeset.length); + } else { + daypos = Math.floor((pos - 1) / timeset.length); + timepos = pymod(pos - 1, timeset.length); + } + var tmp = []; + for (var k = start; k < end; k++) { + var val = dayset[k]; + if (!isPresent(val)) + continue; + tmp.push(val); + } + var i = void 0; + if (daypos < 0) { + i = tmp.slice(daypos)[0]; + } else { + i = tmp[daypos]; + } + var time = timeset[timepos]; + var date = fromOrdinal(ii.yearordinal + i); + var res = combine(date, time); + if (!includes(poslist, res)) + poslist.push(res); + } + sort(poslist); + return poslist; } -function outerdrag(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - var dragger = new dhtmlDragAndDropObject(); - var old = dragger.stopDrag; - var last_event; - dragger.stopDrag = function(e) { - last_event = e; - return old.apply(this, arguments); - }; - function on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { - if (scheduler2.checkEvent("onBeforeExternalDragIn") && !scheduler2.callEvent("onBeforeExternalDragIn", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event])) - return; - var temp = scheduler2.attachEvent("onEventCreated", function(id2) { - if (!scheduler2.callEvent("onExternalDragIn", [id2, sourceHtmlObject, last_event])) { - this._drag_mode = this._drag_id = null; - this.deleteEvent(id2); +function iter(iterResult, options) { + var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos; + var count = options.count; + if (count === 0 || interval === 0) { + return emitResult(iterResult); + } + var counterDate = DateTime.fromDate(dtstart); + var ii = new Iterinfo(options); + ii.rebuild(counterDate.year, counterDate.month); + var timeset = makeTimeset(ii, counterDate, options); + for (; ; ) { + var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2]; + var filtered = removeFilteredDays(dayset, start, end, ii, options); + if (notEmpty(bysetpos)) { + var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset); + for (var j = 0; j < poslist.length; j++) { + var res = poslist[j]; + if (until && res > until) { + return emitResult(iterResult); + } + if (res >= dtstart) { + var rezonedDate = rezoneIfNeeded(res, options); + if (!iterResult.accept(rezonedDate)) { + return emitResult(iterResult); + } + if (count) { + --count; + if (!count) { + return emitResult(iterResult); + } + } } - }); - var action_data = scheduler2.getActionData(last_event); - var event_data = { start_date: new Date(action_data.date) }; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - var view_options = scheduler2.matrix[scheduler2._mode]; - event_data[view_options.y_property] = action_data.section; - var pos = scheduler2._locate_cell_timeline(last_event); - event_data.start_date = view_options._trace_x[pos.x]; - event_data.end_date = scheduler2.date.add(event_data.start_date, view_options.x_step, view_options.x_unit); } - if (scheduler2._props && scheduler2._props[scheduler2._mode]) { - event_data[scheduler2._props[scheduler2._mode].map_to] = action_data.section; + } else { + for (var j = start; j < end; j++) { + var currentDay = dayset[j]; + if (!isPresent(currentDay)) { + continue; + } + var date = fromOrdinal(ii.yearordinal + currentDay); + for (var k = 0; k < timeset.length; k++) { + var time = timeset[k]; + var res = combine(date, time); + if (until && res > until) { + return emitResult(iterResult); + } + if (res >= dtstart) { + var rezonedDate = rezoneIfNeeded(res, options); + if (!iterResult.accept(rezonedDate)) { + return emitResult(iterResult); + } + if (count) { + --count; + if (!count) { + return emitResult(iterResult); + } + } + } + } } - scheduler2.addEventNow(event_data); - scheduler2.detachEvent(temp); } - dragger.addDragLanding(scheduler2._els["dhx_cal_data"][0], { _drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { - on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml); - }, _dragIn: function(htmlObject, shtmlObject) { - return htmlObject; - }, _dragOut: function(htmlObject) { - return this; - } }); - if (dhtmlx.DragControl) { - dhtmlx.DragControl.addDrop(scheduler2._els["dhx_cal_data"][0], { onDrop: function(source, target, d, e) { - var sourceDhtmlx = dhtmlx.DragControl.getMaster(source); - last_event = e; - on_drop(source, sourceDhtmlx, target, e.target || e.srcElement); - }, onDragIn: function(source, target, e) { - return target; - } }, true); + if (options.interval === 0) { + return emitResult(iterResult); } - }); + counterDate.add(options, filtered); + if (counterDate.year > MAXYEAR) { + return emitResult(iterResult); + } + if (!freqIsDailyOrGreater(freq)) { + timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0); + } + ii.rebuild(counterDate.year, counterDate.month); + } } -function pdf(scheduler2) { - var dx, dy, html_regexp = new RegExp("<[^>]*>", "g"), newline_regexp = new RegExp("]*>", "g"); - function clean_html(val) { - return val.replace(newline_regexp, "\n").replace(html_regexp, ""); +function isFiltered(ii, currentDay, options) { + var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday; + return notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay]) || notEmpty(byweekno) && !ii.wnomask[currentDay] || notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay]) || notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay] || byeaster !== null && !includes(ii.eastermask, currentDay) || (notEmpty(bymonthday) || notEmpty(bynmonthday)) && !includes(bymonthday, ii.mdaymask[currentDay]) && !includes(bynmonthday, ii.nmdaymask[currentDay]) || notEmpty(byyearday) && (currentDay < ii.yearlen && !includes(byyearday, currentDay + 1) && !includes(byyearday, -ii.yearlen + currentDay) || currentDay >= ii.yearlen && !includes(byyearday, currentDay + 1 - ii.yearlen) && !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)); +} +function rezoneIfNeeded(date, options) { + return new DateWithZone(date, options.tzid).rezonedDate(); +} +function emitResult(iterResult) { + return iterResult.getValue(); +} +function removeFilteredDays(dayset, start, end, ii, options) { + var filtered = false; + for (var dayCounter = start; dayCounter < end; dayCounter++) { + var currentDay = dayset[dayCounter]; + filtered = isFiltered(ii, currentDay, options); + if (filtered) + dayset[currentDay] = null; } - function x_norm(x, offset) { - x = parseFloat(x); - offset = parseFloat(offset); - if (!isNaN(offset)) - x -= offset; - var w = colsWidth(x); - x = x - w.width + w.cols * dx; - return isNaN(x) ? "auto" : 100 * x / dx; + return filtered; +} +function makeTimeset(ii, counterDate, options) { + var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; + if (freqIsDailyOrGreater(freq)) { + return buildTimeset(options); } - function x_norm_event(x, offset, is_left) { - x = parseFloat(x); - offset = parseFloat(offset); - if (!isNaN(offset) && is_left) - x -= offset; - var w = colsWidth(x); - x = x - w.width + w.cols * dx; - return isNaN(x) ? "auto" : 100 * x / (dx - (!isNaN(offset) ? offset : 0)); + if (freq >= RRule.HOURLY && notEmpty(byhour) && !includes(byhour, counterDate.hour) || freq >= RRule.MINUTELY && notEmpty(byminute) && !includes(byminute, counterDate.minute) || freq >= RRule.SECONDLY && notEmpty(bysecond) && !includes(bysecond, counterDate.second)) { + return []; } - function colsWidth(width) { - var r = 0; - var header = scheduler2._els.dhx_cal_header[0].childNodes; - var els = header[1] ? header[1].childNodes : header[0].childNodes; - for (var i = 0; i < els.length; i++) { - var el2 = els[i].style ? els[i] : els[i].parentNode; - var w = parseFloat(el2.style.width); - if (width > w) { - width -= w + 1; - r += w + 1; - } else - break; + return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond); +} +var Days = { MO: new Weekday(0), TU: new Weekday(1), WE: new Weekday(2), TH: new Weekday(3), FR: new Weekday(4), SA: new Weekday(5), SU: new Weekday(6) }; +var DEFAULT_OPTIONS$1 = { freq: Frequency.YEARLY, dtstart: null, interval: 1, wkst: Days.MO, count: null, until: null, tzid: null, bysetpos: null, bymonth: null, bymonthday: null, bynmonthday: null, byyearday: null, byweekno: null, byweekday: null, bynweekday: null, byhour: null, byminute: null, bysecond: null, byeaster: null }; +var defaultKeys = Object.keys(DEFAULT_OPTIONS$1); +var RRule = function() { + function RRule2(options, noCache) { + if (options === void 0) { + options = {}; + } + if (noCache === void 0) { + noCache = false; + } + this._cache = noCache ? null : new Cache(); + this.origOptions = initializeOptions$1(options); + var parsedOptions = parseOptions(options).parsedOptions; + this.options = parsedOptions; + } + RRule2.parseText = function(text, language) { + return parseText(text, language); + }; + RRule2.fromText = function(text, language) { + return fromText(text, language); + }; + RRule2.fromString = function(str) { + return new RRule2(RRule2.parseString(str) || void 0); + }; + RRule2.prototype._iter = function(iterResult) { + return iter(iterResult, this.options); + }; + RRule2.prototype._cacheGet = function(what, args) { + if (!this._cache) + return false; + return this._cache._cacheGet(what, args); + }; + RRule2.prototype._cacheAdd = function(what, value, args) { + if (!this._cache) + return; + return this._cache._cacheAdd(what, value, args); + }; + RRule2.prototype.all = function(iterator) { + if (iterator) { + return this._iter(new CallbackIterResult("all", {}, iterator)); } - return { width: r, cols: i }; + var result = this._cacheGet("all"); + if (result === false) { + result = this._iter(new IterResult("all", {})); + this._cacheAdd("all", result); + } + return result; + }; + RRule2.prototype.between = function(after, before, inc, iterator) { + if (inc === void 0) { + inc = false; + } + if (!isValidDate(after) || !isValidDate(before)) { + throw new Error("Invalid date passed in to RRule.between"); + } + var args = { before, after, inc }; + if (iterator) { + return this._iter(new CallbackIterResult("between", args, iterator)); + } + var result = this._cacheGet("between", args); + if (result === false) { + result = this._iter(new IterResult("between", args)); + this._cacheAdd("between", result, args); + } + return result; + }; + RRule2.prototype.before = function(dt, inc) { + if (inc === void 0) { + inc = false; + } + if (!isValidDate(dt)) { + throw new Error("Invalid date passed in to RRule.before"); + } + var args = { dt, inc }; + var result = this._cacheGet("before", args); + if (result === false) { + result = this._iter(new IterResult("before", args)); + this._cacheAdd("before", result, args); + } + return result; + }; + RRule2.prototype.after = function(dt, inc) { + if (inc === void 0) { + inc = false; + } + if (!isValidDate(dt)) { + throw new Error("Invalid date passed in to RRule.after"); + } + var args = { dt, inc }; + var result = this._cacheGet("after", args); + if (result === false) { + result = this._iter(new IterResult("after", args)); + this._cacheAdd("after", result, args); + } + return result; + }; + RRule2.prototype.count = function() { + return this.all().length; + }; + RRule2.prototype.toString = function() { + return optionsToString(this.origOptions); + }; + RRule2.prototype.toText = function(gettext, language, dateFormatter) { + return toText(this, gettext, language, dateFormatter); + }; + RRule2.prototype.isFullyConvertibleToText = function() { + return isFullyConvertible(this); + }; + RRule2.prototype.clone = function() { + return new RRule2(this.origOptions); + }; + RRule2.FREQUENCIES = ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"]; + RRule2.YEARLY = Frequency.YEARLY; + RRule2.MONTHLY = Frequency.MONTHLY; + RRule2.WEEKLY = Frequency.WEEKLY; + RRule2.DAILY = Frequency.DAILY; + RRule2.HOURLY = Frequency.HOURLY; + RRule2.MINUTELY = Frequency.MINUTELY; + RRule2.SECONDLY = Frequency.SECONDLY; + RRule2.MO = Days.MO; + RRule2.TU = Days.TU; + RRule2.WE = Days.WE; + RRule2.TH = Days.TH; + RRule2.FR = Days.FR; + RRule2.SA = Days.SA; + RRule2.SU = Days.SU; + RRule2.parseString = parseString; + RRule2.optionsToString = optionsToString; + return RRule2; +}(); +function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) { + var _exdateHash = {}; + var _accept = iterResult.accept; + function evalExdate(after, before) { + _exrule.forEach(function(rrule) { + rrule.between(after, before, true).forEach(function(date) { + _exdateHash[Number(date)] = true; + }); + }); } - function y_norm(y) { - y = parseFloat(y); - if (isNaN(y)) - return "auto"; - return 100 * y / dy; + _exdate.forEach(function(date) { + var zonedDate2 = new DateWithZone(date, tzid).rezonedDate(); + _exdateHash[Number(zonedDate2)] = true; + }); + iterResult.accept = function(date) { + var dt = Number(date); + if (isNaN(dt)) + return _accept.call(this, date); + if (!_exdateHash[dt]) { + evalExdate(new Date(dt - 1), new Date(dt + 1)); + if (!_exdateHash[dt]) { + _exdateHash[dt] = true; + return _accept.call(this, date); + } + } + return true; + }; + if (iterResult.method === "between") { + evalExdate(iterResult.args.after, iterResult.args.before); + iterResult.accept = function(date) { + var dt = Number(date); + if (!_exdateHash[dt]) { + _exdateHash[dt] = true; + return _accept.call(this, date); + } + return true; + }; } - function get_style(node, style) { - return (window.getComputedStyle ? window.getComputedStyle(node, null)[style] : node.currentStyle ? node.currentStyle[style] : null) || ""; + for (var i = 0; i < _rdate.length; i++) { + var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate(); + if (!iterResult.accept(new Date(zonedDate.getTime()))) + break; } - function de_day(node, n) { - var x = parseInt(node.style.left, 10); - for (var dx2 = 0; dx2 < scheduler2._cols.length; dx2++) { - x -= scheduler2._cols[dx2]; - if (x < 0) - return dx2; + _rrule.forEach(function(rrule) { + iter(iterResult, rrule.options); + }); + var res = iterResult._result; + sort(res); + switch (iterResult.method) { + case "all": + case "between": + return res; + case "before": + return res.length && res[res.length - 1] || null; + case "after": + default: + return res.length && res[0] || null; + } +} +var DEFAULT_OPTIONS = { dtstart: null, cache: false, unfold: false, forceset: false, compatible: false, tzid: null }; +function parseInput(s, options) { + var rrulevals = []; + var rdatevals = []; + var exrulevals = []; + var exdatevals = []; + var parsedDtstart = parseDtstart(s); + var dtstart = parsedDtstart.dtstart; + var tzid = parsedDtstart.tzid; + var lines = splitIntoLines(s, options.unfold); + lines.forEach(function(line) { + var _a; + if (!line) + return; + var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value; + switch (name.toUpperCase()) { + case "RRULE": + if (parms.length) { + throw new Error("unsupported RRULE parm: ".concat(parms.join(","))); + } + rrulevals.push(parseString(line)); + break; + case "RDATE": + var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1]; + if (rdateTzid && !tzid) { + tzid = rdateTzid; + } + rdatevals = rdatevals.concat(parseRDate(value, parms)); + break; + case "EXRULE": + if (parms.length) { + throw new Error("unsupported EXRULE parm: ".concat(parms.join(","))); + } + exrulevals.push(parseString(value)); + break; + case "EXDATE": + exdatevals = exdatevals.concat(parseRDate(value, parms)); + break; + case "DTSTART": + break; + default: + throw new Error("unsupported property: " + name); } - return n; + }); + return { dtstart, tzid, rrulevals, rdatevals, exrulevals, exdatevals }; +} +function buildRule(s, options) { + var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid; + var noCache = options.cache === false; + if (options.compatible) { + options.forceset = true; + options.unfold = true; } - function de_week(node, n) { - var y = parseInt(node.style.top, 10); - for (var dy2 = 0; dy2 < scheduler2._colsS.heights.length; dy2++) - if (scheduler2._colsS.heights[dy2] > y) - return dy2; - return n; + if (options.forceset || rrulevals.length > 1 || rdatevals.length || exrulevals.length || exdatevals.length) { + var rset_1 = new RRuleSet(noCache); + rset_1.dtstart(dtstart); + rset_1.tzid(tzid || void 0); + rrulevals.forEach(function(val2) { + rset_1.rrule(new RRule(groomRruleOptions(val2, dtstart, tzid), noCache)); + }); + rdatevals.forEach(function(date) { + rset_1.rdate(date); + }); + exrulevals.forEach(function(val2) { + rset_1.exrule(new RRule(groomRruleOptions(val2, dtstart, tzid), noCache)); + }); + exdatevals.forEach(function(date) { + rset_1.exdate(date); + }); + if (options.compatible && options.dtstart) + rset_1.rdate(dtstart); + return rset_1; } - function xml_start(tag) { - return tag ? "<" + tag + ">" : ""; + var val = rrulevals[0] || {}; + return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache); +} +function rrulestr(s, options) { + if (options === void 0) { + options = {}; } - function xml_end(tag) { - return tag ? "" : ""; + return buildRule(s, initializeOptions(options)); +} +function groomRruleOptions(val, dtstart, tzid) { + return __assign(__assign({}, val), { dtstart, tzid }); +} +function initializeOptions(options) { + var invalid = []; + var keys = Object.keys(options); + var defaultKeys2 = Object.keys(DEFAULT_OPTIONS); + keys.forEach(function(key) { + if (!includes(defaultKeys2, key)) + invalid.push(key); + }); + if (invalid.length) { + throw new Error("Invalid options: " + invalid.join(", ")); } - function xml_top(tag, profile, header, footer) { - var xml = "<" + tag + " profile='" + profile + "'"; - if (header) - xml += " header='" + header + "'"; - if (footer) - xml += " footer='" + footer + "'"; - xml += ">"; - return xml; + return __assign(__assign({}, DEFAULT_OPTIONS), options); +} +function extractName(line) { + if (line.indexOf(":") === -1) { + return { name: "RRULE", value: line }; } - function xml_body_header() { - var xml = ""; - var mode = scheduler2._mode; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) - mode = scheduler2.matrix[scheduler2._mode].render == "cell" ? "matrix" : "timeline"; - xml += ""; - if (scheduler2._mode == "week_agenda") { - var xh = scheduler2._els.dhx_cal_data[0].getElementsByTagName("DIV"); - for (var i = 0; i < xh.length; i++) - if (xh[i].className == "dhx_wa_scale_bar") - xml += "" + clean_html(xh[i].innerHTML) + ""; - } else if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { - var xh = scheduler2._els.dhx_cal_header[0].childNodes[0].childNodes; - xml += "" + clean_html(xh[0].innerHTML) + "" + clean_html(xh[1].innerHTML) + ""; - } else if (scheduler2._mode == "year") { - var xh = scheduler2._els.dhx_cal_data[0].childNodes; - for (var i = 0; i < xh.length; i++) { - xml += ""; - xml += xml_month_scale(xh[i].querySelector(".dhx_year_week").childNodes); - xml += xml_month(xh[i].querySelector(".dhx_year_body")); - xml += ""; - } + var _a = split(line, ":", 1), name = _a[0], value = _a[1]; + return { name, value }; +} +function breakDownLine(line) { + var _a = extractName(line), name = _a.name, value = _a.value; + var parms = name.split(";"); + if (!parms) + throw new Error("empty property name"); + return { name: parms[0].toUpperCase(), parms: parms.slice(1), value }; +} +function splitIntoLines(s, unfold) { + if (unfold === void 0) { + unfold = false; + } + s = s && s.trim(); + if (!s) + throw new Error("Invalid empty string"); + if (!unfold) { + return s.split(/\s/); + } + var lines = s.split("\n"); + var i = 0; + while (i < lines.length) { + var line = lines[i] = lines[i].replace(/\s+$/g, ""); + if (!line) { + lines.splice(i, 1); + } else if (i > 0 && line[0] === " ") { + lines[i - 1] += line.slice(1); + lines.splice(i, 1); } else { - xml += ""; - var xh = scheduler2._els.dhx_cal_header[0].childNodes; - xml += xml_month_scale(xh); - xml += ""; - var yh = scheduler2._els.dhx_cal_data[0]; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - xml += ""; - for (var i = 0; i < yh.firstChild.rows.length; i++) { - var el2 = yh.firstChild.rows[i]; - xml += ""; - } - xml += ""; - dy = yh.firstChild.rows[0].cells[0].offsetHeight; - } else if (yh.firstChild.tagName == "TABLE") { - xml += xml_month(yh); - } else { - yh = yh.childNodes[yh.childNodes.length - 1]; - while (yh.className.indexOf("dhx_scale_holder") == -1) - yh = yh.previousSibling; - yh = yh.childNodes; - xml += ""; - for (var i = 0; i < yh.length; i++) - xml += "\n"; - xml += ""; - dy = yh[0].offsetHeight; - } + i += 1; } - xml += ""; - return xml; } - function xml_month(yh) { - var xml = ""; - var r = yh.querySelectorAll("tr"); - for (var i = 0; i < r.length; i++) { - var days = []; - var cells = r[i].querySelectorAll("td"); - for (var j = 0; j < cells.length; j++) - days.push(cells[j].querySelector(".dhx_month_head").innerHTML); - xml += "\n"; - dy = cells[0].offsetHeight; + return lines; +} +function validateDateParm(parms) { + parms.forEach(function(parm) { + if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) { + throw new Error("unsupported RDATE/EXDATE parm: " + parm); } - return xml; - } - function xml_month_scale(xh) { - var xhs, xml = ""; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - if (scheduler2.matrix[scheduler2._mode].second_scale) - xhs = xh[1].childNodes; - xh = xh[0].childNodes; + }); +} +function parseRDate(rdateval, parms) { + validateDateParm(parms); + return rdateval.split(",").map(function(datestr) { + return untilStringToDate(datestr); + }); +} +function createGetterSetter(fieldName) { + var _this = this; + return function(field) { + if (field !== void 0) { + _this["_".concat(fieldName)] = field; } - for (var i = 0; i < xh.length; i++) - xml += "\n"; - dx = xh[0].offsetWidth; - if (xhs) { - var width = 0; - var top_width = xh[0].offsetWidth; - var top_col = 1; - for (var i = 0; i < xhs.length; i++) { - xml += "\n"; - width += xhs[i].offsetWidth; - if (width >= top_width) { - top_width += xh[top_col] ? xh[top_col].offsetWidth : 0; - top_col++; - } - dx = xhs[0].offsetWidth; + if (_this["_".concat(fieldName)] !== void 0) { + return _this["_".concat(fieldName)]; + } + for (var i = 0; i < _this._rrule.length; i++) { + var field_1 = _this._rrule[i].origOptions[fieldName]; + if (field_1) { + return field_1; } } - return xml; + }; +} +var RRuleSet = function(_super) { + __extends(RRuleSet2, _super); + function RRuleSet2(noCache) { + if (noCache === void 0) { + noCache = false; + } + var _this = _super.call(this, {}, noCache) || this; + _this.dtstart = createGetterSetter.apply(_this, ["dtstart"]); + _this.tzid = createGetterSetter.apply(_this, ["tzid"]); + _this._rrule = []; + _this._rdate = []; + _this._exrule = []; + _this._exdate = []; + return _this; } - function xml_body(colors) { - var xml = ""; - var evs = scheduler2._rendered; - var matrix = scheduler2.matrix && scheduler2.matrix[scheduler2._mode]; - if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { - for (var i = 0; i < evs.length; i++) - xml += ""; - } else if (scheduler2._mode == "week_agenda") { - for (var i = 0; i < evs.length; i++) - xml += "" + clean_html(evs[i].innerHTML) + ""; - } else if (scheduler2._mode == "year") { - var evs = scheduler2.get_visible_events(); - for (var i = 0; i < evs.length; i++) { - var d = evs[i].start_date; - if (d.valueOf() < scheduler2._min_date.valueOf()) - d = scheduler2._min_date; - while (d < evs[i].end_date) { - var m = d.getMonth() + 12 * (d.getFullYear() - scheduler2._min_date.getFullYear()) - scheduler2.week_starts._month; - var day = scheduler2.week_starts[m] + d.getDate() - 1; - var text_color = colors ? get_style(scheduler2._get_year_cell(d), "color") : ""; - var bg_color = colors ? get_style(scheduler2._get_year_cell(d), "backgroundColor") : ""; - xml += ""; - d = scheduler2.date.add(d, 1, "day"); - if (d.valueOf() >= scheduler2._max_date.valueOf()) - break; - } - } - } else if (matrix && matrix.render == "cell") { - var evs = scheduler2._els.dhx_cal_data[0].getElementsByTagName("TD"); - for (var i = 0; i < evs.length; i++) { - var text_color = colors ? get_style(evs[i], "color") : ""; - var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; - xml += "\n"; - } - } else { - for (var i = 0; i < evs.length; i++) { - var zx, zdx; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - zx = x_norm(evs[i].style.left); - zdx = x_norm(evs[i].offsetWidth) - 1; - } else { - var left_norm = scheduler2.config.use_select_menu_space ? 0 : 26; - zx = x_norm_event(evs[i].style.left, left_norm, true); - zdx = x_norm_event(evs[i].style.width, left_norm) - 1; - } - if (isNaN(zdx * 1)) - continue; - var zy = y_norm(evs[i].style.top); - var zdy = y_norm(evs[i].style.height); - var e_type = evs[i].className.split(" ")[0].replace("dhx_cal_", ""); - if (e_type === "dhx_tooltip_line") - continue; - var dets = scheduler2.getEvent(evs[i].getAttribute(scheduler2.config.event_attribute)); - if (!dets) - continue; - var day = dets._sday; - var week = dets._sweek; - var length = dets._length || 0; - if (scheduler2._mode == "month") { - zdy = parseInt(evs[i].offsetHeight, 10); - zy = parseInt(evs[i].style.top, 10) - scheduler2.xy.month_head_height; - day = de_day(evs[i], day); - week = de_week(evs[i], week); - } else if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - day = 0; - var el2 = evs[i].parentNode.parentNode.parentNode; - week = el2.rowIndex; - var dy_copy = dy; - dy = evs[i].parentNode.offsetHeight; - zy = y_norm(evs[i].style.top); - zy -= zy * 0.2; - dy = dy_copy; - } else { - if (evs[i].parentNode == scheduler2._els.dhx_cal_data[0]) - continue; - var parent = scheduler2._els["dhx_cal_data"][0].childNodes[0]; - var offset = parseFloat(parent.className.indexOf("dhx_scale_holder") != -1 ? parent.style.left : 0); - zx += x_norm(evs[i].parentNode.style.left, offset); + RRuleSet2.prototype._iter = function(iterResult) { + return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid()); + }; + RRuleSet2.prototype.rrule = function(rrule) { + _addRule(rrule, this._rrule); + }; + RRuleSet2.prototype.exrule = function(rrule) { + _addRule(rrule, this._exrule); + }; + RRuleSet2.prototype.rdate = function(date) { + _addDate(date, this._rdate); + }; + RRuleSet2.prototype.exdate = function(date) { + _addDate(date, this._exdate); + }; + RRuleSet2.prototype.rrules = function() { + return this._rrule.map(function(e) { + return rrulestr(e.toString()); + }); + }; + RRuleSet2.prototype.exrules = function() { + return this._exrule.map(function(e) { + return rrulestr(e.toString()); + }); + }; + RRuleSet2.prototype.rdates = function() { + return this._rdate.map(function(e) { + return new Date(e.getTime()); + }); + }; + RRuleSet2.prototype.exdates = function() { + return this._exdate.map(function(e) { + return new Date(e.getTime()); + }); + }; + RRuleSet2.prototype.valueOf = function() { + var result = []; + if (!this._rrule.length && this._dtstart) { + result = result.concat(optionsToString({ dtstart: this._dtstart })); + } + this._rrule.forEach(function(rrule) { + result = result.concat(rrule.toString().split("\n")); + }); + this._exrule.forEach(function(exrule) { + result = result.concat(exrule.toString().split("\n").map(function(line) { + return line.replace(/^RRULE:/, "EXRULE:"); + }).filter(function(line) { + return !/^DTSTART/.test(line); + })); + }); + if (this._rdate.length) { + result.push(rdatesToString("RDATE", this._rdate, this.tzid())); + } + if (this._exdate.length) { + result.push(rdatesToString("EXDATE", this._exdate, this.tzid())); + } + return result; + }; + RRuleSet2.prototype.toString = function() { + return this.valueOf().join("\n"); + }; + RRuleSet2.prototype.clone = function() { + var rrs = new RRuleSet2(!!this._cache); + this._rrule.forEach(function(rule) { + return rrs.rrule(rule.clone()); + }); + this._exrule.forEach(function(rule) { + return rrs.exrule(rule.clone()); + }); + this._rdate.forEach(function(date) { + return rrs.rdate(new Date(date.getTime())); + }); + this._exdate.forEach(function(date) { + return rrs.exdate(new Date(date.getTime())); + }); + return rrs; + }; + return RRuleSet2; +}(RRule); +function _addRule(rrule, collection) { + if (!(rrule instanceof RRule)) { + throw new TypeError(String(rrule) + " is not RRule instance"); + } + if (!includes(collection.map(String), String(rrule))) { + collection.push(rrule); + } +} +function _addDate(date, collection) { + if (!(date instanceof Date)) { + throw new TypeError(String(date) + " is not Date instance"); + } + if (!includes(collection.map(Number), Number(date))) { + collection.push(date); + sort(collection); + } +} +function rdatesToString(param, rdates, tzid) { + var isUTC = !tzid || tzid.toUpperCase() === "UTC"; + var header = isUTC ? "".concat(param, ":") : "".concat(param, ";TZID=").concat(tzid, ":"); + var dateString = rdates.map(function(rdate) { + return timeToUntilString(rdate.valueOf(), isUTC); + }).join(","); + return "".concat(header).concat(dateString); +} +function recurring(scheduler2) { + function clearMilliseconds(date) { + return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0); + } + function isDeletedOccurrence(event2) { + return !!event2.deleted; + } + function isSeries(event2) { + return !!event2.rrule && !event2.recurring_event_id; + } + function clearRecurringProperties(event2) { + event2.rrule = ""; + event2.original_start = null; + event2.recurring_event_id = null; + event2.duration = null; + event2.deleted = null; + } + function createException(ev) { + let id2 = ev.id.split("#"); + let nid = scheduler2.uid(); + scheduler2._not_render = true; + let nev = scheduler2._copy_event(ev); + nev.id = nid; + nev.recurring_event_id = id2[0]; + let timestamp = id2[1]; + nev.original_start = new Date(Number(timestamp)); + scheduler2._add_rec_marker(nev, timestamp); + scheduler2.addEvent(nev); + scheduler2._not_render = false; + } + scheduler2._rec_temp = []; + scheduler2._rec_markers_pull = {}; + scheduler2._rec_markers = {}; + scheduler2._add_rec_marker = function(ev, time) { + ev._pid_time = time; + this._rec_markers[ev.id] = ev; + if (!this._rec_markers_pull[ev.event_pid]) + this._rec_markers_pull[ev.event_pid] = {}; + this._rec_markers_pull[ev.event_pid][time] = ev; + }; + scheduler2._get_rec_marker = function(time, id2) { + let ch = this._rec_markers_pull[id2]; + if (ch) + return ch[time]; + return null; + }; + scheduler2._get_rec_markers = function(id2) { + return this._rec_markers_pull[id2] || []; + }; + (function() { + var old_add_event = scheduler2.addEvent; + scheduler2.addEvent = function(start_date, end_date, text, id2, extra_data) { + var ev_id = old_add_event.apply(this, arguments); + if (ev_id && scheduler2.getEvent(ev_id)) { + var ev = scheduler2.getEvent(ev_id); + if (ev.start_date) { + ev.start_date = clearMilliseconds(ev.start_date); } - xml += "\n"; - if (e_type == "event") { - xml += "
"; - var text_color = colors ? get_style(evs[i].childNodes[2], "color") : ""; - var bg_color = colors ? get_style(evs[i].childNodes[2], "backgroundColor") : ""; - xml += ""; - } else { - var text_color = colors ? get_style(evs[i], "color") : ""; - var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; - xml += ""; + if (ev.end_date) { + ev.end_date = clearMilliseconds(ev.end_date); } - xml += "
"; } + return ev_id; + }; + })(); + scheduler2.attachEvent("onEventLoading", function(event2) { + if (event2.original_start) { + event2.original_start = scheduler2.templates.parse_date(event2.original_start); } - return xml; - } - function toXML(start, end, view, mode, header, footer) { - var colors = false; - if (mode == "fullcolor") { - colors = true; - mode = "color"; + return true; + }); + scheduler2.attachEvent("onEventIdChange", function(id2, new_id) { + if (this._ignore_call) + return; + this._ignore_call = true; + if (scheduler2._rec_markers[id2]) { + scheduler2._rec_markers[new_id] = scheduler2._rec_markers[id2]; + delete scheduler2._rec_markers[id2]; } - mode = mode || "color"; - var xml = ""; - if (start) { - var original_date = scheduler2._date; - var original_mode = scheduler2._mode; - end = scheduler2.date[view + "_start"](end); - end = scheduler2.date["get_" + view + "_end"] ? scheduler2.date["get_" + view + "_end"](end) : scheduler2.date.add(end, 1, view); - xml = xml_top("pages", mode, header, footer); - for (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) { - this.setCurrentView(temp_date, view); - xml += xml_start("page") + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("page"); + if (scheduler2._rec_markers_pull[id2]) { + scheduler2._rec_markers_pull[new_id] = scheduler2._rec_markers_pull[id2]; + delete scheduler2._rec_markers_pull[id2]; + } + for (var i = 0; i < this._rec_temp.length; i++) { + var tev = this._rec_temp[i]; + if (tev.recurring_event_id == id2) { + tev.recurring_event_id = new_id; + this.changeEventId(tev.id, new_id + "#" + tev.id.split("#")[1]); } - xml += xml_end("pages"); - this.setCurrentView(original_date, original_mode); - } else { - xml = xml_top("data", mode, header, footer) + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("data"); } - return xml; - } - scheduler2.getPDFData = toXML; - function send_xml(xml, url2) { - var uid2 = scheduler2.uid(); - var d = document.createElement("div"); - d.style.display = "none"; - document.body.appendChild(d); - d.innerHTML = '
'; - document.getElementById(uid2).firstChild.value = encodeURIComponent(xml); - document.getElementById(uid2).submit(); - d.parentNode.removeChild(d); + for (var i in this._rec_markers) { + var tev = this._rec_markers[i]; + if (tev.recurring_event_id == id2) { + tev.recurring_event_id = new_id; + tev._pid_changed = true; + } + } + var el2 = scheduler2._rec_markers[new_id]; + if (el2 && el2._pid_changed) { + delete el2._pid_changed; + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + scheduler2.callEvent("onEventChanged", [new_id, scheduler2.getEvent(new_id)]); + }, 1); + } + delete this._ignore_call; + }); + function deleteEventFromSeries(idTimestamp, ev) { + let id2 = idTimestamp; + idTimestamp = id2.split("#"); + let nid = scheduler2.uid(); + let tid = idTimestamp[1] ? idTimestamp[1] : ev._pid_time; + let nev = scheduler2._copy_event(ev); + nev.id = nid; + nev.recurring_event_id = ev.recurring_event_id || idTimestamp[0]; + nev.original_start = new Date(Number(tid)); + nev.deleted = true; + scheduler2.addEvent(nev); } - function to_pdf(start, end, view, url2, mode, header, footer) { - var xml = ""; - if (typeof mode == "object") { - xml = schedulersToPdf(mode); + scheduler2.attachEvent("onConfirmedBeforeEventDelete", function(id2) { + var ev = this.getEvent(id2); + if (this._is_virtual_event(id2) || this._is_modified_occurence(ev) && !isDeletedOccurrence(ev)) { + deleteEventFromSeries(id2, ev); } else { - xml = toXML.apply(this, [start, end, view, mode, header, footer]); + if (isSeries(ev) && this._lightbox_id) + this._roll_back_dates(ev); + var sub = this._get_rec_markers(id2); + for (var i in sub) { + if (sub.hasOwnProperty(i)) { + id2 = sub[i].id; + if (this.getEvent(id2)) + this.deleteEvent(id2, true); + } + } } - send_xml(xml, url2); - } - function schedulersToPdf(objects) { - var xml = ""; - for (var i = 0; i < objects.length; i++) { - xml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer); + return true; + }); + scheduler2.attachEvent("onEventDeleted", function(id2, ev) { + if (!this._is_virtual_event(id2) && this._is_modified_occurence(ev)) { + if (!scheduler2._events[id2]) { + ev.deleted = true; + this.setEvent(id2, ev); + } } - xml += ""; - return xml; - } - scheduler2.toPDF = function(url2, mode, header, footer) { - return to_pdf.apply(this, [null, null, null, url2, mode, header, footer]); - }; - scheduler2.toPDFRange = function(start, end, view, url2, mode, header, footer) { - if (typeof start == "string") { - start = scheduler2.templates.api_date(start); - end = scheduler2.templates.api_date(end); + }); + scheduler2.attachEvent("onEventChanged", function(id2, event2) { + if (this._loading) + return true; + var ev = this.getEvent(id2); + if (this._is_virtual_event(id2)) { + createException(ev); + } else { + if (ev.start_date) { + ev.start_date = clearMilliseconds(ev.start_date); + } + if (ev.end_date) { + ev.end_date = clearMilliseconds(ev.end_date); + } + if (isSeries(ev) && this._lightbox_id) { + this._roll_back_dates(ev); + } + var sub = this._get_rec_markers(id2); + for (var i in sub) { + if (sub.hasOwnProperty(i)) { + delete this._rec_markers[sub[i].id]; + this.deleteEvent(sub[i].id, true); + } + } + delete this._rec_markers_pull[id2]; + var isEventFound = false; + for (var k = 0; k < this._rendered.length; k++) { + if (this._rendered[k].getAttribute(this.config.event_attribute) == id2) + isEventFound = true; + } + if (!isEventFound) + this._select_id = null; } - return to_pdf.apply(this, arguments); - }; -} -function quick_info(scheduler2) { - scheduler2.config.icons_select = ["icon_form", "icon_delete"]; - scheduler2.config.details_on_create = true; - scheduler2.config.show_quick_info = true; - scheduler2.xy.menu_width = 0; - scheduler2.attachEvent("onClick", function(id2) { - if (!scheduler2.config.show_quick_info) { - return; + return true; + }); + scheduler2.attachEvent("onEventAdded", function(id2) { + if (!this._loading) { + var ev = this.getEvent(id2); + if (isSeries(ev)) { + this._roll_back_dates(ev); + } } - scheduler2.showQuickInfo(id2); return true; }); - (function() { - var events = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"]; - var hiding_function = function() { - scheduler2.hideQuickInfo(true); - return true; - }; - for (var i = 0; i < events.length; i++) { - scheduler2.attachEvent(events[i], hiding_function); + scheduler2.attachEvent("onEventSave", function(id2, data, is_new_event) { + var ev = this.getEvent(id2); + if (isSeries(ev)) + this._select_id = null; + return true; + }); + scheduler2.attachEvent("onEventCreated", function(id2) { + var ev = this.getEvent(id2); + if (!isSeries(ev)) { + clearRecurringProperties(ev); + } + return true; + }); + scheduler2.attachEvent("onEventCancel", function(id2) { + var ev = this.getEvent(id2); + if (isSeries(ev)) { + this._roll_back_dates(ev); + this.render_view_data(); + } + }); + scheduler2._roll_back_dates = function(ev) { + if (ev.start_date) { + ev.start_date = clearMilliseconds(ev.start_date); + } + if (ev.end_date) { + ev.end_date = clearMilliseconds(ev.end_date); + } + ev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1e3); + ev.end_date = ev._end_date; + if (ev._start_date) { + ev.start_date.setMonth(0); + ev.start_date.setDate(ev._start_date.getDate()); + ev.start_date.setMonth(ev._start_date.getMonth()); + ev.start_date.setFullYear(ev._start_date.getFullYear()); } - })(); - scheduler2.templates.quick_info_title = function(start, end, ev) { - return ev.text.substr(0, 50); }; - scheduler2.templates.quick_info_content = function(start, end, ev) { - return ev.details || ""; + scheduler2._is_virtual_event = function(id2) { + return id2.toString().indexOf("#") != -1; }; - scheduler2.templates.quick_info_date = function(start, end, ev) { - if (scheduler2.isOneDayEvent(ev) && scheduler2.config.rtl) { - return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(end, start, ev); - } else if (scheduler2.isOneDayEvent(ev)) { - return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(start, end, ev); - } else if (scheduler2.config.rtl) { - return scheduler2.templates.week_date(end, start, ev); - } else { - return scheduler2.templates.week_date(start, end, ev); + scheduler2._is_modified_occurence = function(ev) { + return ev.recurring_event_id && ev.recurring_event_id != "0"; + }; + scheduler2.showLightbox_rec = scheduler2.showLightbox; + scheduler2.showLightbox = function(id2) { + var locale = this.locale; + var c = scheduler2.config.lightbox_recurring; + var ev = this.getEvent(id2); + var pid = ev.recurring_event_id; + var isVirtual = this._is_virtual_event(id2); + if (isVirtual) + pid = id2.split("#")[0]; + var showSeries = function(id3) { + var event2 = scheduler2.getEvent(id3); + event2._end_date = event2.end_date; + event2.end_date = new Date(event2.start_date.valueOf() + event2.duration * 1e3); + return scheduler2.showLightbox_rec(id3); + }; + if ((pid || pid * 1 === 0) && isSeries(ev)) { + return showSeries(id2); } - }; - scheduler2.showQuickInfo = function(id2) { - if (id2 == this._quick_info_box_id) - return; - this.hideQuickInfo(true); - if (this.callEvent("onBeforeQuickInfo", [id2]) === false) { - return; + if (!pid || pid === "0" || (!locale.labels.confirm_recurring || c == "instance" || c == "series" && !isVirtual)) { + return this.showLightbox_rec(id2); } - var pos = this._get_event_counter_part(id2); - if (pos) { - this._quick_info_box = this._init_quick_info(pos); - this._fill_quick_data(id2); - this._show_quick_info(pos); - this.callEvent("onQuickInfo", [id2]); + if (c == "ask") { + var that = this; + scheduler2.modalbox({ text: locale.labels.confirm_recurring, title: locale.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel], callback: function(index) { + switch (+index) { + case 0: + return showSeries(pid); + case 1: + return that.showLightbox_rec(id2); + case 2: + return; + } + } }); + } else { + showSeries(pid); } }; - (function() { - function cssTimeToMs(time) { - time = time || ""; - var num = parseFloat(time), unit = time.match(/m?s/), milliseconds; - if (unit) { - unit = unit[0]; + function groupExceptions() { + const exceptions = {}; + for (const i in scheduler2._events) { + const ev = scheduler2._events[i]; + if (ev.recurring_event_id) { + if (!exceptions[ev.recurring_event_id]) { + exceptions[ev.recurring_event_id] = {}; + } + exceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev; } - switch (unit) { - case "s": - milliseconds = num * 1e3; - break; - case "ms": - milliseconds = num; - break; - default: - milliseconds = 0; - break; + } + return exceptions; + } + scheduler2.get_visible_events_rec = scheduler2.get_visible_events; + scheduler2.get_visible_events = function(only_timed) { + for (var i = 0; i < this._rec_temp.length; i++) + delete this._events[this._rec_temp[i].id]; + this._rec_temp = []; + const exceptions = groupExceptions(); + var stack = this.get_visible_events_rec(only_timed); + var out = []; + for (var i = 0; i < stack.length; i++) { + if (stack[i].deleted || stack[i].recurring_event_id) { + continue; + } + if (isSeries(stack[i])) { + this.repeat_date(stack[i], out, void 0, void 0, void 0, void 0, exceptions); + } else { + out.push(stack[i]); } - return milliseconds; } - scheduler2.hideQuickInfo = function(forced) { - var qi = this._quick_info_box; - var eventId = this._quick_info_box_id; - this._quick_info_box_id = 0; - if (qi && qi.parentNode) { - var width = qi.offsetWidth; - if (scheduler2.config.quick_info_detached) { - this.callEvent("onAfterQuickInfo", [eventId]); - return qi.parentNode.removeChild(qi); - } - if (qi.style.right == "auto") - qi.style.left = -width + "px"; - else - qi.style.right = -width + "px"; - if (forced) { - qi.parentNode.removeChild(qi); - } else { - var style; - if (window.getComputedStyle) { - style = window.getComputedStyle(qi, null); - } else if (qi.currentStyle) { - style = qi.currentStyle; - } - var delay2 = cssTimeToMs(style["transition-delay"]) + cssTimeToMs(style["transition-duration"]); - setTimeout(function() { - if (qi.parentNode) { - qi.parentNode.removeChild(qi); - } - }, delay2); - } - this.callEvent("onAfterQuickInfo", [eventId]); + return out; + }; + (function() { + var old = scheduler2.isOneDayEvent; + scheduler2.isOneDayEvent = function(ev) { + if (isSeries(ev)) + return true; + return old.call(this, ev); + }; + var old_update_event = scheduler2.updateEvent; + scheduler2.updateEvent = function(id2) { + var ev = scheduler2.getEvent(id2); + if (ev && isSeries(ev) && !this._is_virtual_event(id2)) { + scheduler2.update_view(); + } else { + old_update_event.call(this, id2); } }; })(); - scheduler2.event(window, "keydown", function(e) { - if (e.keyCode == 27) - scheduler2.hideQuickInfo(); - }); - scheduler2._show_quick_info = function(pos) { - var qi = scheduler2._quick_info_box; - scheduler2._obj.appendChild(qi); - var width = qi.offsetWidth; - var height = qi.offsetHeight; - if (scheduler2.config.quick_info_detached) { - var left = pos.left - pos.dx * (width - pos.width); - if (scheduler2.getView() && scheduler2.getView()._x_scroll) { - if (scheduler2.config.rtl) { - left += scheduler2.getView()._x_scroll; + const toIcalString = scheduler2.date.date_to_str("%Y%m%dT%H%i%s"); + scheduler2.repeat_date = function(ev, stack, non_render, from, to, maxCount, exceptions) { + if (!ev.rrule) { + return; + } + let seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id]; + if (!seriesExceptions) { + seriesExceptions = {}; + } + if (!from) { + from = scheduler2._min_date; + } + if (!to) { + to = scheduler2._max_date; + } + const utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds())); + const parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart }); + const repeatedDates = parsedRRule.between(from, to).map((date) => { + const adjustedDate = new Date(date); + adjustedDate.setHours(ev.start_date.getHours()); + adjustedDate.setMinutes(ev.start_date.getMinutes()); + adjustedDate.setSeconds(ev.start_date.getSeconds()); + return adjustedDate; + }); + let visibleCount = 0; + const eventDuration = ev.duration; + for (let i = 0; i < repeatedDates.length; i++) { + if (maxCount && visibleCount >= maxCount) { + break; + } + const date = repeatedDates[i]; + let exception = seriesExceptions[date.valueOf()]; + if (exception) { + if (exception.deleted) { + continue; } else { - left -= scheduler2.getView()._x_scroll; + visibleCount++; + stack.push(exception); } + } else { + const copy2 = scheduler2._copy_event(ev); + copy2.text = ev.text; + copy2.start_date = date; + copy2.id = ev.id + "#" + Math.ceil(date.valueOf()); + copy2.end_date = new Date(date.valueOf() + eventDuration * 1e3); + copy2.end_date = scheduler2._fix_daylight_saving_date(copy2.start_date, copy2.end_date, ev, date, copy2.end_date); + copy2._timed = scheduler2.isOneDayEvent(copy2); + if (!copy2._timed && !scheduler2._table_view && !scheduler2.config.multi_day) + continue; + stack.push(copy2); + if (!non_render) { + scheduler2._events[copy2.id] = copy2; + scheduler2._rec_temp.push(copy2); + } + visibleCount++; } - var right = left + width; - if (right > window.innerWidth) { - left = window.innerWidth - width; - } - left = Math.max(0, left); - qi.style.left = left + "px"; - qi.style.top = pos.top - (pos.dy ? height : -pos.height) + "px"; - } else { - const dataPos = scheduler2.$container.querySelector(".dhx_cal_data").offsetTop; - qi.style.top = dataPos + 20 + "px"; - if (pos.dx == 1) { - qi.style.right = "auto"; - qi.style.left = -width + "px"; - setTimeout(function() { - qi.style.left = "-10px"; - }, 1); + } + }; + scheduler2._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) { + var shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset(); + if (shift) { + if (shift > 0) { + return new Date(counter.valueOf() + ev.duration * 1e3 - shift * 60 * 1e3); } else { - qi.style.left = "auto"; - qi.style.right = -width + "px"; - setTimeout(function() { - qi.style.right = "-10px"; - }, 1); + return new Date(end_date.valueOf() - shift * 60 * 1e3); } - qi.className = qi.className.replace(" dhx_qi_left", "").replace(" dhx_qi_right", "") + " dhx_qi_" + (pos.dx == 1 ? "left" : "right"); } + return new Date(default_date.valueOf()); }; - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.hideQuickInfo(); - if (this._quick_info_box) { - var box = this._quick_info_box; - if (box.parentNode) { - box.parentNode.removeChild(box); + scheduler2.getRecDates = function(id2, max) { + var ev = typeof id2 == "object" ? id2 : scheduler2.getEvent(id2); + var recurrings = []; + max = max || 100; + if (!isSeries(ev)) { + return [{ start_date: ev.start_date, end_date: ev.end_date }]; + } + if (ev.deleted) { + return []; + } + scheduler2.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max); + var result = []; + for (var i = 0; i < recurrings.length; i++) { + if (!recurrings[i].deleted) { + result.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date }); } - this._quick_info_box = null; } - }); - scheduler2._quick_info_onscroll_handler = function(e) { - scheduler2.hideQuickInfo(); + return result; }; - scheduler2._init_quick_info = function() { - if (!this._quick_info_box) { - var qi = this._quick_info_box = document.createElement("div"); - this._waiAria.quickInfoAttr(qi); - qi.className = "dhx_cal_quick_info"; - if (scheduler2.$testmode) - qi.className += " dhx_no_animate"; - if (scheduler2.config.rtl) - qi.className += " dhx_quick_info_rtl"; - var ariaAttr = this._waiAria.quickInfoHeaderAttrString(); - var html = ` -
- -
-
- -
-
-
-
`; - html += '
'; - var buttons = scheduler2.config.icons_select; - for (var i = 0; i < buttons.length; i++) { - var ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]); - html += `
-
${scheduler2.locale.labels[buttons[i]]}
`; + scheduler2.getEvents = function(from, to) { + var result = []; + const exceptions = groupExceptions(); + for (var a in this._events) { + var ev = this._events[a]; + if (ev.recurring_event_id) { + continue; } - html += "
"; - qi.innerHTML = html; - scheduler2.event(qi, "click", function(ev) { - scheduler2._qi_button_click(ev.target || ev.srcElement); - }); - if (scheduler2.config.quick_info_detached) { - scheduler2._detachDomEvent(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); - scheduler2.event(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); + if (isSeries(ev)) { + if (from && to && ev.start_date < to && ev.end_date > from) { + var sev = []; + this.repeat_date(ev, sev, true, from, to, void 0, exceptions); + sev.forEach(function(occurence) { + if (occurence.start_date < to && occurence.end_date > from) { + result.push(occurence); + } + }); + } else if (!from && !to) { + result.push(ev); + } + } else if (!this._is_virtual_event(ev.id)) { + result.push(ev); } } - return this._quick_info_box; - }; - scheduler2._qi_button_click = function(node) { - var box = scheduler2._quick_info_box; - if (!node || node == box) - return; - if (node.closest(".dhx_cal_qi_close_btn")) { - scheduler2.hideQuickInfo(); - return; + return result; + }; + scheduler2._copy_dummy = function(ev) { + var start_date = new Date(this.start_date); + var end_date = new Date(this.end_date); + this.start_date = start_date; + this.end_date = end_date; + this.duration = this.rrule = null; + }; + scheduler2.config.include_end_by = false; + scheduler2.config.lightbox_recurring = "ask"; + scheduler2.config.recurring_workdays = [RRule.MO.weekday, RRule.TU.weekday, RRule.WE.weekday, RRule.TH.weekday, RRule.FR.weekday]; + scheduler2.config.repeat_date = "%m.%d.%Y"; + scheduler2.config.lightbox.sections = [{ name: "description", map_to: "text", type: "textarea", focus: true }, { name: "recurring", type: "recurring", map_to: "rec_type" }, { name: "time", height: 72, type: "time", map_to: "auto" }]; + scheduler2.attachEvent("onClearAll", function() { + scheduler2._rec_markers = {}; + scheduler2._rec_markers_pull = {}; + scheduler2._rec_temp = []; + }); + function getTopLevelOption(rruleObj, untilDate) { + const options = rruleObj.options; + const until = options.until || untilDate; + const hasEndCondition = options.count || until && until.getFullYear() !== 9999; + if (hasEndCondition) { + return "CUSTOM"; + } + if (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) { + return "DAILY"; + } else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) { + return "WEEKLY"; + } else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) { + return "MONTHLY"; + } else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) { + return "YEARLY"; + } else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler2.config.recurring_workdays.length && options.byweekday.includes(RRule.MO) && options.byweekday.includes(RRule.TU) && options.byweekday.includes(RRule.WE) && options.byweekday.includes(RRule.TH) && options.byweekday.includes(RRule.FR)) { + return "WORKDAYS"; + } else { + return "CUSTOM"; + } + } + function getWeekdayOfMonth(date) { + const dayOfWeek = date.getDay(); + const dayOfMonth = date.getDate(); + const dayNumber = Math.ceil(dayOfMonth / 7); + return { dayOfWeek, dayNumber }; + } + const jsDaysToRRULEDays = { 0: "SU", 1: "MO", 2: "TU", 3: "WE", 4: "TH", 5: "FR", 6: "SA" }; + const RruleDayNumsToJs = { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0 }; + function fillCustomDaily(node, rule) { + node.querySelector("[name='repeat_interval_value']").value = (rule ? rule.interval : 1) || 1; + } + function fillCustomWeekly(node, rule, event2) { + node.querySelector("[name='repeat_interval_value']").value = (rule ? rule.interval : 1) || 1; + const dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`); + dayCheckboxes.forEach((ch) => ch.checked = false); + if (rule && rule.byweekday) { + rule.byweekday.forEach((day) => { + const dayNum = RruleDayNumsToJs[day.weekday]; + const dayLabel = jsDaysToRRULEDays[dayNum]; + node.querySelector(`.dhx_form_repeat_custom_week input[value="${dayLabel}"]`).checked = true; + }); + } else { + const dayLabel = jsDaysToRRULEDays[event2.start_date.getDay()]; + node.querySelector(`.dhx_form_repeat_custom_week input[value="${dayLabel}"]`).checked = true; } - var mask = scheduler2._getClassName(node); - if (mask.indexOf("_icon") != -1) { - var id2 = scheduler2._quick_info_box_id; - scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); - } else - scheduler2._qi_button_click(node.parentNode); - }; - scheduler2._get_event_counter_part = function(id2) { - var domEv = scheduler2.getRenderedEvent(id2); - var left = 0; - var top = 0; - var node = domEv; - while (node && node != scheduler2._obj) { - left += node.offsetLeft; - top += node.offsetTop - node.scrollTop; - node = node.offsetParent; + } + function fillCustomMonthly(node, rule, event2) { + node.querySelector("[name='repeat_interval_value']").value = (rule ? rule.interval : 1) || 1; + const dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value="month_date"]`); + const nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value="month_nth_weekday"]`); + dateOfMonth.innerText = scheduler2.templates.repeat_monthly_date(event2.start_date, event2); + nthWeekDayOfMonth.innerText = scheduler2.templates.repeat_monthly_weekday(event2.start_date, event2); + if (!rule || rule.bysetpos && !(rule.byweekday && rule.byweekday.length)) { + node.querySelector(`[name="dhx_custom_month_option"]`).value = "month_date"; + } else { + node.querySelector(`[name="dhx_custom_month_option"]`).value = "month_nth_weekday"; } - if (node) { - var dx = left + domEv.offsetWidth / 2 > scheduler2._x / 2 ? 1 : 0; - var dy = top + domEv.offsetHeight / 2 > scheduler2._y / 2 ? 1 : 0; - return { left, top, dx, dy, width: domEv.offsetWidth, height: domEv.offsetHeight }; + } + function formatDayNumber(date) { + switch (date) { + case 1: + case 31: + return `${date}st`; + case 2: + return `${date}nd`; + case 3: + return `${date}rd`; + default: + return `${date}th`; } - return 0; - }; - scheduler2._fill_quick_data = function(id2) { - var ev = scheduler2.getEvent(id2); - var qi = scheduler2._quick_info_box; - scheduler2._quick_info_box_id = id2; - var header = { content: scheduler2.templates.quick_info_title(ev.start_date, ev.end_date, ev), date: scheduler2.templates.quick_info_date(ev.start_date, ev.end_date, ev) }; - var titleContent = qi.querySelector(".dhx_cal_qi_tcontent"); - titleContent.innerHTML = `${header.content}`; - var titleDate = qi.querySelector(".dhx_cal_qi_tdate"); - titleDate.innerHTML = header.date; - scheduler2._waiAria.quickInfoHeader(qi, [header.content, header.date].join(" ")); - var main = qi.querySelector(".dhx_cal_qi_content"); - const mainContent = scheduler2.templates.quick_info_content(ev.start_date, ev.end_date, ev); - if (mainContent) { - main.classList.remove("dhx_hidden"); - main.innerHTML = mainContent; + } + scheduler2.templates.repeat_monthly_date = function(startDate, event2) { + const date = startDate.getDate(); + return `Every ${formatDayNumber(date)}`; + }; + scheduler2.templates.repeat_monthly_weekday = function(startDate, event2) { + const nthDayOfMonth = getWeekdayOfMonth(startDate); + return `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler2.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`; + }; + scheduler2.templates.repeat_yearly_month_date = function(startDate, event2) { + const date = startDate.getDate(); + const monthLabel = scheduler2.locale.date.month_full[startDate.getMonth()]; + return `Every ${formatDayNumber(date)} day of ${monthLabel}`; + }; + scheduler2.templates.repeat_yearly_month_weekday = function(startDate, event2) { + const nthDayOfMonth = getWeekdayOfMonth(startDate); + const monthLabel = scheduler2.locale.date.month_full[startDate.getMonth()]; + return `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler2.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`; + }; + function fillCustomYearly(node, rule, event2) { + const dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value="month_date"]`); + const nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value="month_nth_weekday"]`); + dateOfYear.innerText = scheduler2.templates.repeat_yearly_month_date(event2.start_date, event2); + nthWeekDayOfYear.innerText = scheduler2.templates.repeat_yearly_month_weekday(event2.start_date, event2); + if (!rule || rule.bysetpos && !(rule.byweekday && rule.byweekday.length)) { + node.querySelector(`[name="dhx_custom_year_option"]`).value = "month_date"; } else { - main.classList.add("dhx_hidden"); + node.querySelector(`[name="dhx_custom_year_option"]`).value = "month_nth_weekday"; } - }; -} -function readonly(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - var originalRecurringSetValue; - if (scheduler2.form_blocks.recurring) { - originalRecurringSetValue = scheduler2.form_blocks.recurring.set_value; + } + function fillEndRule(node, rule, event2) { + const countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_after"]`); + const ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_ondate"]`); + const endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`); + countInput.value = 1; + let formatter = scheduler2.date.date_to_str("%Y-%m-%d"); + if (!scheduler2.config.repeat_date_of_end) { + scheduler2.config.repeat_date_of_end = formatter(scheduler2.date.add(scheduler2._currentDate(), 30, "day")); } - var original_left_buttons = scheduler2.config.buttons_left.slice(); - var original_right_buttons = scheduler2.config.buttons_right.slice(); - scheduler2.attachEvent("onBeforeLightbox", function(id2) { - if (this.config.readonly_form || this.getEvent(id2).readonly) { - this.config.readonly_active = true; - } else { - this.config.readonly_active = false; - scheduler2.config.buttons_left = original_left_buttons.slice(); - scheduler2.config.buttons_right = original_right_buttons.slice(); - if (scheduler2.form_blocks.recurring) { - scheduler2.form_blocks.recurring.set_value = originalRecurringSetValue; - } - } - var sns = this.config.lightbox.sections; - if (this.config.readonly_active) { - for (var i = 0; i < sns.length; i++) { - if (sns[i].type == "recurring") { - if (this.config.readonly_active && scheduler2.form_blocks.recurring) { - scheduler2.form_blocks.recurring.set_value = function(node, value, ev) { - var wrapper = scheduler2.$domHelpers.closest(node, ".dhx_wrap_section"); - var style = "none"; - wrapper.querySelector(".dhx_cal_lsection").display = style; - wrapper.querySelector(".dhx_form_repeat").display = style; - wrapper.style.display = style; - scheduler2.setLightboxSize(); - }; - } + ondateInput.value = scheduler2.config.repeat_date_of_end; + if (rule && rule.count) { + endOptionSelect.value = "AFTER"; + countInput.value = rule.count; + } else if (event2._end_date && event2._end_date.getFullYear() !== 9999) { + endOptionSelect.value = "ON"; + ondateInput.value = formatter(event2._end_date); + } else { + endOptionSelect.value = "NEVER"; + } + endOptionSelect.dispatchEvent(new Event("change")); + } + const getRecValue = { MONTHLY: function(dates) { + const rrule = { freq: RRule.MONTHLY, interval: 1, bymonthday: dates.start.getDate() }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, WEEKLY: function(dates) { + let day = dates.start.getDay() - 1; + if (day == -1) + day = 6; + const rrule = { freq: RRule.WEEKLY, interval: 1, byweekday: [day] }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, DAILY: function(dates) { + const rrule = { freq: RRule.DAILY, interval: 1 }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, YEARLY: function(dates) { + const rrule = { freq: RRule.YEARLY, bymonth: dates.start.getMonth() + 1, interval: 1, bymonthday: dates.start.getDate() }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, WORKDAYS: function(dates) { + const rrule = { freq: RRule.WEEKLY, interval: 1, byweekday: scheduler2.config.recurring_workdays }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, CUSTOM: function(dates, node) { + const rrule = {}; + const freq = node.querySelector(`[name="repeat_interval_unit"]`).value; + const interval = Math.max(1, node.querySelector(`[name="repeat_interval_value"]`).value); + const monthRepeat = node.querySelector(`[name="dhx_custom_month_option"]`).value; + const yearRepeat = node.querySelector(`[name="dhx_custom_year_option"]`).value; + rrule.interval = interval; + let days; + let day; + switch (freq) { + case "DAILY": + rrule.freq = RRule.DAILY; + break; + case "WEEKLY": + rrule.freq = RRule.WEEKLY; + days = []; + node.querySelectorAll(`.dhx_form_repeat_custom_week [name="week_day"]`).forEach((ch) => { + if (ch.checked) { + days.push(ch.value); } - } - var forbidden_buttons = ["dhx_delete_btn", "dhx_save_btn"]; - var button_arrays = [scheduler2.config.buttons_left, scheduler2.config.buttons_right]; - for (var i = 0; i < forbidden_buttons.length; i++) { - var forbidden_button = forbidden_buttons[i]; - for (var k = 0; k < button_arrays.length; k++) { - var button_array = button_arrays[k]; - var index = -1; - for (var p = 0; p < button_array.length; p++) { - if (button_array[p] == forbidden_button) { - index = p; - break; - } - } - if (index != -1) { - button_array.splice(index, 1); - } + }); + rrule.byweekday = days.map((day2) => { + switch (day2) { + case "MO": + return RRule.MO.weekday; + case "TU": + return RRule.TU.weekday; + case "WE": + return RRule.WE.weekday; + case "TH": + return RRule.TH.weekday; + case "FR": + return RRule.FR.weekday; + case "SA": + return RRule.SA.weekday; + case "SU": + return RRule.SU.weekday; } + }); + break; + case "MONTHLY": + rrule.freq = RRule.MONTHLY; + if (monthRepeat === "month_date") { + rrule.bymonthday = dates.start.getDate(); + } else { + day = dates.start.getDay() - 1; + if (day == -1) + day = 6; + rrule.byweekday = [day]; + rrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber; } - } - this.resetLightbox(); - return true; - }); - function txt_replace(tag, d, n, text) { - var txts = d.getElementsByTagName(tag); - var txtt = n.getElementsByTagName(tag); - for (var i = txtt.length - 1; i >= 0; i--) { - var n = txtt[i]; - if (!text) { - n.disabled = true; - if (d.checked) - n.checked = true; + break; + case "YEARLY": + rrule.freq = RRule.YEARLY; + rrule.bymonth = dates.start.getMonth() + 1; + if (yearRepeat == "month_date") { + rrule.bymonthday = dates.start.getDate(); } else { - var t = document.createElement("span"); - t.className = "dhx_text_disabled"; - t.innerHTML = text(txts[i]); - n.parentNode.insertBefore(t, n); - n.parentNode.removeChild(n); + day = dates.start.getDay() - 1; + if (day == -1) + day = 6; + rrule.byweekday = [day]; + rrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber; } + break; + } + let until = new Date(9999, 1, 1); + const endRule = node.querySelector(`[name="dhx_custom_repeat_ends"]`); + if (endRule === "ON") { + until = node.querySelector(`[name="dhx_form_repeat_ends_ondate"]`).value; + } else if (endRule === "AFTER") { + rrule.count = Math.max(1, node.querySelector(`[name="dhx_form_repeat_ends_after"]`).value); + } + return { rrule, until }; + }, NEVER: function() { + } }; + function fillInDefaults(node, rule, event2) { + fillCustomDaily(node, rule); + fillCustomWeekly(node, rule, event2); + fillCustomMonthly(node, rule, event2); + fillCustomYearly(node, rule, event2); + fillEndRule(node, rule, event2); + } + scheduler2.form_blocks["recurring"] = { render: function(sns) { + if (sns.form) { + let rec = scheduler2.form_blocks["recurring"]; + let form = rec._get_node(sns.form); + let html = rec._outer_html(form); + form.style.display = "none"; + return html; + } + let loc = scheduler2.locale.labels; + return `
+
+ +
+
+
+ + +
+ +
+
+ + + + + + + +
+ +
+ +
+ +
+ +
+
+ +
+
${loc.repeat_ends}
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
`; + }, _init_set_value: function(node, value, event2) { + scheduler2.form_blocks["recurring"]._ds = { start: event2.start_date, end: event2.end_date }; + function hide(node2) { + node2.classList.add("dhx_hidden"); + } + function show(node2) { + node2.classList.remove("dhx_hidden"); + } + function onRepeatOptionChange(value2) { + const repeat2 = node.querySelector(".dhx_form_repeat_custom"); + if (value2 === "CUSTOM") { + show(repeat2); + } else { + hide(repeat2); } } - var old = scheduler2._fill_lightbox; - scheduler2._fill_lightbox = function() { - var lb = this.getLightbox(); - if (this.config.readonly_active) { - lb.style.visibility = "hidden"; - lb.style.display = "block"; + function onCustomRepeatIntervalChange(value2) { + const nodes = { weekly: node.querySelector(".dhx_form_repeat_custom_week"), monthly: node.querySelector(".dhx_form_repeat_custom_month"), yearly: node.querySelector(".dhx_form_repeat_custom_year") }; + switch (value2) { + case "DAILY": + hide(nodes.weekly); + hide(nodes.monthly); + hide(nodes.yearly); + break; + case "WEEKLY": + show(nodes.weekly); + hide(nodes.monthly); + hide(nodes.yearly); + break; + case "MONTHLY": + hide(nodes.weekly); + show(nodes.monthly); + hide(nodes.yearly); + break; + case "YEARLY": + hide(nodes.weekly); + hide(nodes.monthly); + show(nodes.yearly); + break; } - var res = old.apply(this, arguments); - if (this.config.readonly_active) { - lb.style.visibility = ""; - lb.style.display = "none"; + } + function onCustomRepeatEndRule(value2) { + const nodes = { after: node.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after"), on: node.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on") }; + switch (value2) { + case "NEVER": + hide(nodes.after); + hide(nodes.on); + break; + case "AFTER": + show(nodes.after); + hide(nodes.on); + break; + case "ON": + hide(nodes.after); + show(nodes.on); + break; } - if (this.config.readonly_active) { - var originalForm = this.getLightbox(); - var readonlyForm = this._lightbox_r = originalForm.cloneNode(true); - readonlyForm.id = scheduler2.uid(); - readonlyForm.className += " dhx_cal_light_readonly"; - txt_replace("textarea", originalForm, readonlyForm, function(a) { - return a.value; - }); - txt_replace("input", originalForm, readonlyForm, false); - txt_replace("select", originalForm, readonlyForm, function(a) { - if (!a.options.length) - return ""; - return a.options[Math.max(a.selectedIndex || 0, 0)].text; - }); - originalForm.parentNode.insertBefore(readonlyForm, originalForm); - this.showCover(readonlyForm); - if (scheduler2._lightbox) - scheduler2._lightbox.parentNode.removeChild(scheduler2._lightbox); - this._lightbox = readonlyForm; - if (scheduler2.config.drag_lightbox) - scheduler2.event(readonlyForm.firstChild, "mousedown", scheduler2._ready_to_dnd); - scheduler2._init_lightbox_events(); - this.setLightboxSize(); + } + node.querySelector(".dhx_form_repeat_pattern select").addEventListener("change", function() { + onRepeatOptionChange(this.value); + }); + node.querySelector(".dhx_form_repeat_custom_interval [name='repeat_interval_unit']").addEventListener("change", function() { + onCustomRepeatIntervalChange(this.value); + }); + node.querySelector(".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']").addEventListener("change", function() { + onCustomRepeatEndRule(this.value); + }); + scheduler2._lightbox._rec_init_done = true; + }, button_click: function() { + }, set_value: function(node, value, ev) { + let rf = scheduler2.form_blocks["recurring"]; + if (!scheduler2._lightbox._rec_init_done) + rf._init_set_value(node, value, ev); + node.open = !ev.rrule; + node.blocked = this._is_modified_occurence(ev); + let ds = rf._ds; + ds.start = ev.start_date; + ds.end = ev._end_date; + if (ev.rrule) { + const rruleset = rrulestr(ev.rrule); + fillInDefaults(node, rruleset.origOptions, ev); + const topOption = getTopLevelOption(rruleset, ev._end_date); + node.querySelector(".dhx_form_repeat_pattern select").value = topOption; + if (topOption === "CUSTOM") { + let customFreq; + switch (rruleset.origOptions.freq) { + case RRule.DAILY: + customFreq = "DAILY"; + break; + case RRule.WEEKLY: + customFreq = "WEEKLY"; + break; + case RRule.MONTHLY: + customFreq = "MONTHLY"; + break; + case RRule.YEARLY: + customFreq = "YEARLY"; + break; + } + if (customFreq) { + node.querySelector(`[name="repeat_interval_unit"]`).value = customFreq; + node.querySelector(`[name="repeat_interval_unit"]`).dispatchEvent(new Event("change")); + } } - return res; - }; - var hold = scheduler2.hide_lightbox; - scheduler2.hide_lightbox = function() { - if (this._lightbox_r) { - this._lightbox_r.parentNode.removeChild(this._lightbox_r); - this._lightbox_r = this._lightbox = null; + } else { + fillInDefaults(node, null, ev); + node.querySelector(".dhx_form_repeat_pattern select").value = "NEVER"; + } + node.querySelector(".dhx_form_repeat_pattern select").dispatchEvent(new Event("change")); + }, get_value: function(node, ev) { + if (!node.blocked && node.querySelector(".dhx_form_repeat_pattern select").value !== "NEVER") { + let ds = scheduler2.form_blocks["recurring"]._ds; + let actual_dates = {}; + let timeControl = getTimeSection(); + timeControl.getValue(actual_dates); + ds.start = actual_dates.start_date; + const pattern = node.querySelector(".dhx_form_repeat_pattern select").value; + const recurrence = getRecValue[pattern](ds, node); + ev.rrule = new RRule(recurrence.rrule).toString().replace("RRULE:", ""); + ds.end = recurrence.until; + ev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1e3); + if (ds._start) { + ev.start_date = new Date(ds.start); + ev._start_date = new Date(ds.start); + ds._start = false; + } else + ev._start_date = null; + ev._end_date = ds.end; + } else { + ev.rrule = ev.rrule = ""; + ev._end_date = ev.end_date; + } + return ev.rrule; + }, focus: function(node) { + } }; + function getTimeSection() { + let timeControl = scheduler2.formSection("time"); + if (!timeControl) { + timeControl = getFirstSectionOfType("time"); + } + if (!timeControl) { + timeControl = getFirstSectionOfType("calendar_time"); + } + if (!timeControl) { + throw new Error(["Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.", "You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. ", 'In the latter case, make sure the control is named "time":', "", "scheduler.config.lightbox.sections = [", '{name:"time", height:72, type:"YOU CONTROL", map_to:"auto" }];'].join("\n")); + } + return timeControl; + } + function getFirstSectionOfType(type) { + for (let i = 0; i < scheduler2.config.lightbox.sections.length; i++) { + let section = scheduler2.config.lightbox.sections[i]; + if (section.type === type) { + return scheduler2.formSection(section.name); } - return hold.apply(this, arguments); - }; - }); + } + return null; + } } -function recurring(scheduler2) { +function recurring_legacy(scheduler2) { scheduler2.config.occurrence_timestamp_in_utc = false; scheduler2.config.recurring_workdays = [1, 2, 3, 4, 5]; scheduler2.form_blocks["recurring"] = { _get_node: function(node) { @@ -14552,20 +18670,20 @@ function recurring(scheduler2) { get_rcode[code[0]](code, dates); while (code.length < 5) code.push(""); - var repeat = ""; + var repeat2 = ""; var end = get_end_rule(els); if (end == "no") { dates.end = new Date(9999, 1, 1); - repeat = "no"; + repeat2 = "no"; } else if (end == "date_of_end") { dates.end = str_date(get_value(els, "date_of_end")); } else { scheduler2.transpose_type(code.join("_")); - repeat = Math.max(1, get_value(els, "occurences_count")); + repeat2 = Math.max(1, get_value(els, "occurences_count")); var transp = 0; - dates.end = scheduler2.date["add_" + code.join("_")](new Date(dates.start), repeat + transp, { start_date: dates.start }) || dates.start; + dates.end = scheduler2.date["add_" + code.join("_")](new Date(dates.start), repeat2 + transp, { start_date: dates.start }) || dates.start; } - return code.join("_") + "#" + repeat; + return code.join("_") + "#" + repeat2; } function get_end_rule(els2) { var end = els2["end"]; @@ -15631,11 +19749,11 @@ class TooltipManager { } tooltipFor(config) { const cloneDomEvent = (event2) => { - let clone = event2; + let clone2 = event2; if (document["createEventObject"] && !document.createEvent) { - clone = document["createEventObject"](event2); + clone2 = document["createEventObject"](event2); } - return clone; + return clone2; }; this._initDelayedFunctions(); this.attach({ selector: config.selector, global: config.global, onmouseenter: (event2, node) => { @@ -15826,7 +19944,7 @@ function year_view(scheduler2) { return null; return scheduler2.templates.parse_date(day.getAttribute("data-cell-date")); }; - scheduler2.dblclick_dhx_month_head = function(e) { + scheduler2.dblclick_dhx_year_grid = function(e) { if (isYearMode()) { const target = e.target; if (scheduler2.$domHelpers.closest(target, ".dhx_before") || scheduler2.$domHelpers.closest(target, ".dhx_after")) { @@ -16310,7 +20428,7 @@ function export_api(scheduler2) { add_export_methods(scheduler2); })(); } -const gplExtensions = { active_links, agenda_legacy, agenda_view, all_timed, collision, container_autoresize, cookie, daytimeline: daytimeline_restricted, drag_between: drag_between_restricted, editors, expand, export_api, grid_view, html_templates, key_nav, layer, limit, map_view, minical, monthheight, multisection: multisection_restricted, multiselect, multisource, mvc, outerdrag, pdf, quick_info, readonly, recurring, serialize, timeline: timeline_restricted, tooltip, treetimeline: treetimeline_restricted, units: units_restricted, url, week_agenda: week_agenda_restricted, wp, year_view }; +const gplExtensions = { active_links, agenda_legacy, agenda_view, all_timed, collision, container_autoresize, cookie, daytimeline: daytimeline_restricted, drag_between: drag_between_restricted, editors, expand, export_api, grid_view, html_templates, key_nav, layer, limit, map_view, minical, monthheight, multisection: multisection_restricted, multiselect, multisource, mvc, outerdrag, pdf, quick_info, readonly, recurring, recurring_legacy, serialize, timeline: timeline_restricted, tooltip, treetimeline: treetimeline_restricted, units: units_restricted, url, week_agenda: week_agenda_restricted, wp, year_view }; const factory = new SchedulerFactory(gplExtensions); const scheduler = factory.getSchedulerInstance(); const Scheduler$1 = { plugin: scheduler.bind(factory.plugin, factory) }; diff --git a/codebase/sources/dhtmlxscheduler.es.js.map b/codebase/sources/dhtmlxscheduler.es.js.map index cdc9b65..91c2e96 100644 --- a/codebase/sources/dhtmlxscheduler.es.js.map +++ b/codebase/sources/dhtmlxscheduler.es.js.map @@ -1 +1 @@ -{"version":3,"file":"dhtmlxscheduler.es.js","sources":["../../sources/dhtmlx_hook.js","../../sources/global.js","../../sources/core/common/assert.js","../../sources/core/common_errors.js","../../sources/core/connector.js","../../sources/core/nav_bar.js","../../sources/core/scheduler_resize_listener.js","../../sources/utils/eventable.js","../../sources/core/scheduler.js","../../sources/core/utils/event.js","../../sources/core/utils/scoped_event.js","../../sources/core/common.js","../../sources/core/wai_aria.js","../../sources/core/utils/utils.js","../../sources/core/utils/dom_helpers.js","../../sources/utils/env.js","../../sources/core/destructor.js","../../sources/core/common/url_serialize.js","../../sources/core/utils/ajax.js","../../sources/core/base.js","../../sources/core/config.js","../../sources/core/event.js","../../sources/core/event_highlight.js","../../sources/core/loaders/xml.js","../../sources/core/loaders/json.js","../../sources/core/loaders/ical.js","../../sources/core/common/get_serializable_events.js","../../sources/core/load.js","../../sources/core/lightbox.js","../../sources/core/touch.js","../../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../../sources/core/skins.js","../../sources/core/jquery.js","../../sources/core/delay_render.js","../../sources/core/dataprocessor/dataprocessor_hooks.js","../../sources/core/dataprocessor/dataprocessor.js","../../sources/core/message.js","../../sources/locale/locale_ar.js","../../sources/locale/locale_be.js","../../sources/locale/locale_ca.js","../../sources/locale/locale_cn.js","../../sources/locale/locale_cs.js","../../sources/locale/locale_da.js","../../sources/locale/locale_de.js","../../sources/locale/locale_el.js","../../sources/locale/locale_en.js","../../sources/locale/locale_es.js","../../sources/locale/locale_fi.js","../../sources/locale/locale_fr.js","../../sources/locale/locale_he.js","../../sources/locale/locale_hu.js","../../sources/locale/locale_id.js","../../sources/locale/locale_it.js","../../sources/locale/locale_jp.js","../../sources/locale/locale_manager.js","../../sources/locale/locale_nb.js","../../sources/locale/locale_nl.js","../../sources/locale/locale_no.js","../../sources/locale/locale_pl.js","../../sources/locale/locale_pt.js","../../sources/locale/locale_ro.js","../../sources/locale/locale_ru.js","../../sources/locale/locale_si.js","../../sources/locale/locale_sk.js","../../sources/locale/locale_sv.js","../../sources/locale/locale_tr.js","../../sources/locale/locale_ua.js","../../sources/locale/index.js","../../sources/core/datepicker.js","../../sources/scheduler_factory_method.js","../../sources/ext/extension_manager.js","../../sources/scheduler_factory.js","../../sources/ext/active_links.js","../../sources/ext/agenda_legacy_view.js","../../sources/ext/agenda.js","../../sources/ext/all_timed.js","../../sources/ext/collision.js","../../sources/ext/container_autoresize.js","../../sources/ext/cookie.js","../../sources/ext/restricted_extensions/not_implemented_extension.js","../../sources/ext/restricted_extensions/daytimeline.js","../../sources/ext/restricted_extensions/drag_between.js","../../sources/ext/editors.js","../../sources/ext/expand.js","../../sources/ext/restricted_extensions/grid_view.js","../../sources/ext/html_templates.js","../../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../../sources/ext/keyboard_navigation/common/eventhandler.js","../../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../../sources/ext/keyboard_navigation/marker.js","../../sources/ext/keyboard_navigation/elements/scheduler_node.js","../../sources/ext/keyboard_navigation/elements/nav_node.js","../../sources/ext/keyboard_navigation/elements/header_cell.js","../../sources/ext/keyboard_navigation/elements/event.js","../../sources/ext/keyboard_navigation/elements/time_slot.js","../../sources/ext/keyboard_navigation/elements/minical_button.js","../../sources/ext/keyboard_navigation/elements/minical_cell.js","../../sources/ext/keyboard_navigation/elements/data_area.js","../../sources/ext/keyboard_navigation/modals.js","../../sources/ext/keyboard_navigation/core.js","../../sources/ext/keyboard_navigation/key_nav_legacy.js","../../sources/ext/keyboard_navigation/scheduler_handlers.js","../../sources/ext/keyboard_navigation/minical_handlers.js","../../sources/ext/key_nav.js","../../sources/ext/layer.js","../../sources/ext/limit.js","../../sources/ext/map_view.js","../../sources/ext/minical.js","../../sources/ext/monthheight.js","../../sources/ext/restricted_extensions/multisection.js","../../sources/ext/multiselect.js","../../sources/ext/multisource.js","../../sources/ext/mvc.js","../../sources/ext/outerdrag.js","../../sources/ext/pdf.js","../../sources/ext/quick_info.js","../../sources/ext/readonly.js","../../sources/ext/recurring.js","../../sources/ext/serialize.js","../../sources/ext/restricted_extensions/timeline.js","../../sources/ext/tooltip/tooltip.ts","../../sources/ext/tooltip/tooltipManager.ts","../../sources/ext/tooltip/index.ts","../../sources/ext/restricted_extensions/treetimeline.js","../../sources/ext/restricted_extensions/units.js","../../sources/ext/url.js","../../sources/ext/restricted_extensions/week_agenda.js","../../sources/ext/wp.js","../../sources/ext/year_view.js","../../sources/ext/export_api/index.js","../../sources/ext/extensions_gpl.js","../../sources/dhtmlxscheduler.gpl.js"],"sourcesContent":["\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.getState=function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n};\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX + d.scrollLeft - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY + d.scrollTop - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\t\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\r\n\tvar html = '
';\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"\";\r\n\t\thtml+=\"\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function () {\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\n\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\nscheduler.config.mark_now = true;\r\nscheduler.config.display_marked_timespans = true;\r\nscheduler.config.overwrite_marked_timespans = true;\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tvar blocker = scheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif (event.rec_type) {\r\n\t\t\tvar dates = scheduler.getRecDates(event);\r\n\t\t\tfor(var i=0; i < dates.length; i++){\r\n\t\t\t\tvar ev = scheduler._copy_event(event);\r\n\t\t\t\tscheduler._lame_copy(ev, dates[i]);\r\n\t\t\t\tevs.push(ev);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!blocker(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn blocker(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn blocker(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\tscheduler._mark_now = function(hide) {\r\n\t\t// day, week, units views\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tif (!this._els[dhx_now_time]) {\r\n\t\t\tthis._els[dhx_now_time] = [];\r\n\t\t}\r\n\t\tvar now = scheduler._currentDate();\r\n\t\tvar cfg = this.config;\r\n\t\tscheduler._remove_mark_now(); // delete previous marks if they exist\r\n\t\tif (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i\" + ev.text + \"

\" + (ev.event_location || '') + \"

\" + scheduler.templates.marker_date(start) + \" - \" + scheduler.templates.marker_date(end) + \"
\";\r\n};\r\nscheduler.dblclick_dhx_map_area = function() {\r\n\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler._date,\r\n\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t});\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\n\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\n\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\n\r\nscheduler._latLngUpdate = false; // flag for not displaying event second time in case of coordinates update\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\tscheduler._isMapPositionSet = false; // if user actual (geolocation) position was set on the map\r\n\r\n\tconst gmap = document.createElement('div');\r\n\tgmap.className = 'dhx_map';\r\n\tgmap.id = 'dhx_gmap';\r\n\tgmap.style.display = \"none\";\r\n\r\n\tscheduler._obj.appendChild(gmap);\r\n\r\n\tscheduler._els.dhx_gmap = [];\r\n\tscheduler._els.dhx_gmap.push(gmap);\r\n\r\n\t_setMapSize('dhx_gmap');\r\n\r\n\tconst mapOptions = {\r\n\t\tzoom: scheduler.config.map_initial_zoom || 10,\r\n\t\tcenter: scheduler.config.map_initial_position,\r\n\t\tmapTypeId: scheduler.config.map_type || google.maps.MapTypeId.ROADMAP\r\n\t};\r\n\tconst map = new google.maps.Map(document.getElementById('dhx_gmap'), mapOptions);\r\n\tmap.disableDefaultUI = false;\r\n\tmap.disableDoubleClickZoom = !scheduler.config.readonly;\r\n\r\n\tgoogle.maps.event.addListener(map, \"dblclick\", function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\r\n\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\tvar point = event.latLng;\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'latLng': point },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\tstart_date: scheduler._date,\r\n\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n\r\n\tvar infoWindowOptions = {\r\n\t\tcontent: ''\r\n\t};\r\n\r\n\tif (scheduler.config.map_infowindow_max_width) {\r\n\t\tinfoWindowOptions.maxWidth = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\r\n\tscheduler.map = {\r\n\t\t_points: [],\r\n\t\t_markers: [],\r\n\t\t_infowindow: new google.maps.InfoWindow(infoWindowOptions),\r\n\t\t_infowindows_content: [],\r\n\t\t_initialization_count: -1,\r\n\t\t_obj: map\r\n\t};\r\n\r\n\tscheduler.ext.mapView.geocoder = new google.maps.Geocoder();\r\n\tscheduler.ext.mapView.map = map;\r\n\tscheduler.ext.mapView.points = scheduler.map._points;\r\n\tscheduler.ext.mapView.markers = scheduler.map._markers;\r\n\tscheduler.ext.mapView.infoWindow = scheduler.map._infowindow;\r\n\r\n\tif (scheduler.config.map_resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tif (!scheduler._isMapPositionSet) {\r\n\t\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\t\tvar _userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\r\n\t\t\t\t\tmap.setCenter(_userLocation);\r\n\t\t\t\t\tmap.setZoom(scheduler.config.map_zoom_after_resolve || 10);\r\n\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);\r\n\t\t\t\t\tscheduler.map._infowindow.position = map.getCenter();\r\n\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\r\n\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t},\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setPosition(map.getCenter());\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\t\t\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tgoogle.maps.event.addListener(map, \"resize\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t\tmap.setZoom(map.getZoom());\r\n\r\n\t});\r\n\tgoogle.maps.event.addListener(map, \"tilesloaded\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t});\r\n\r\n\tgmap.style.display = 'none'; // property was changed after attaching map\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i], false, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clear_map_tab() {\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\tvar markers = scheduler.map._markers;\r\n\t\tfor (var key in markers) {\r\n\t\t\tif (markers.hasOwnProperty(key)) {\r\n\t\t\t\tmarkers[key].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[key];\r\n\t\t\t\tif (scheduler.map._infowindows_content[key])\r\n\t\t\t\t\tdelete scheduler.map._infowindows_content[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tvar ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tvar html = \"
\";\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar ev = events[i];\r\n\t\t\tvar event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tvar ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tvar ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tvar t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (var i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tvar map = document.getElementById(elem_id);\r\n\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\tvar height = scheduler._y - nav_height;\r\n\t\tif (height < 0)\r\n\t\t\theight = 0;\r\n\t\tvar width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\tif (width < 0)\r\n\t\t\twidth = 0;\r\n\t\tmap.style.height = height + 'px';\r\n\t\tmap.style.width = width + 'px';\r\n\t\tmap.style.position = \"absolute\";\r\n\t\tmap.style.top = nav_height + \"px\";\r\n\t\tif (scheduler.config.rtl) {\r\n\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t} else {\r\n\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t}\r\n\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t}\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler.map._initialization_count++;\r\n\t\tvar gmap = scheduler._els.dhx_gmap[0];\r\n\t\tvar temp_center;\r\n\t\t//scheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\r\n\t\tif (mode) { //map tab activated\r\n\t\t\tclear_map_tab();\r\n\t\t\tfill_map_tab();\r\n\t\t\tgmap.style.display = 'block';\r\n\r\n\t\t\t// need to resize block every time window is resized\r\n\t\t\t_setMapSize('dhx_gmap');\r\n\t\t\ttemp_center = scheduler.map._obj.getCenter();\r\n\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else { //map tab de-activated\r\n\t\t\tgmap.style.display = 'none';\r\n\t\t}\r\n\t\tgoogle.maps.event.trigger(scheduler.map._obj, 'resize');\r\n\r\n\t\tif (scheduler.map._initialization_count === 0 && temp_center) { // if tab is activated for the first time need to fix position\r\n\t\t\tscheduler.map._obj.setCenter(temp_center);\r\n\t\t}\r\n\r\n\t\tif (scheduler._selected_event_id) {\r\n\t\t\tselectEvent(scheduler._selected_event_id);\r\n\t\t}\r\n\t};\r\n\r\n\tvar selectEvent = function(event_id) {\r\n\t\tscheduler.map._obj.setCenter(scheduler.map._points[event_id]);\r\n\t\tscheduler.callEvent(\"onClick\", [event_id]);\r\n\t};\r\n\r\n\tvar showAddress = function(event, setCenter, performClick) { // what if event have incorrect position from the start?\r\n\t\tvar point = scheduler.config.map_error_position;\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tpoint = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t}\r\n\t\tvar message = scheduler.templates.marker_text(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._new_event) {\r\n\r\n\t\t\tscheduler.map._infowindows_content[event.id] = message;\r\n\r\n\t\t\tif (scheduler.map._markers[event.id])\r\n\t\t\t\tscheduler.map._markers[event.id].setMap(null);\r\n\r\n\t\t\tscheduler.map._markers[event.id] = scheduler.ext.mapView.createMarker({\r\n\t\t\t\tposition: point,\r\n\t\t\t\tmap: scheduler.map._obj\r\n\t\t\t});\r\n\r\n\t\t\tgoogle.maps.event.addListener(scheduler.map._markers[event.id], 'click', function() {\r\n\t\t\t\tscheduler.map._infowindow.setContent(scheduler.map._infowindows_content[event.id]);\r\n\t\t\t\tscheduler.map._infowindow.open(scheduler.map._obj, scheduler.map._markers[event.id]);\r\n\t\t\t\tscheduler._selected_event_id = event.id;\r\n\t\t\t\tscheduler.render_data();\r\n\t\t\t});\r\n\t\t\tscheduler.map._points[event.id] = point;\r\n\r\n\t\t\tif (setCenter) scheduler.map._obj.setCenter(scheduler.map._points[event.id]);\r\n\t\t\tif (performClick) scheduler.callEvent(\"onClick\", [event.id]);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onClick\", function(id, domEvent) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tscheduler._selected_event_id = id;\r\n\t\t\tfor (var i = 0; i < scheduler._rendered.length; i++) {\r\n\t\t\t\tscheduler._rendered[i].className = 'dhx_map_line';\r\n\t\t\t\tif (scheduler._rendered[i].getAttribute(scheduler.config.event_attribute) == id) {\r\n\t\t\t\t\tscheduler._rendered[i].className += \" highlight\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._points[id] && scheduler.map._markers[id]) {\r\n\t\t\t\tscheduler.map._obj.setCenter(scheduler.map._points[id]); // was panTo\r\n\t\t\t\tgoogle.maps.event.trigger(scheduler.map._markers[id], 'click');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tvar _displayEventOnMap = function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\r\n\t\t\t\t\tscheduler._selected_event_id = event.id;\r\n\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t\tshowAddress(event, true, true);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tshowAddress(event, true, true);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _updateEventLocation = function(event) { // update lat and lng in database\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tvar ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\t\tif (!this._latLngUpdate) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t} else { // event no longer should be displayed on the map view\r\n\t\t\t\tscheduler._selected_event_id = null;\r\n\t\t\t\tscheduler.map._infowindow.close();\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis._latLngUpdate = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_event_id, new_event_id) {\r\n\t\tvar event = scheduler.getEvent(new_event_id);\r\n\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\tif (scheduler.map._markers[old_event_id]) {\r\n\t\t\t\tscheduler.map._markers[old_event_id].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[old_event_id];\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._infowindows_content[old_event_id])\r\n\t\t\t\tdelete scheduler.map._infowindows_content[old_event_id];\r\n\t\t\t_displayEventOnMap(event);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id, event) {\r\n\t\tif (!scheduler._dataprocessor) {\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\t/* Test/example\r\n\t scheduler.attachEvent(\"onLocationError\", function(event_id,event_object){\r\n\t return new google.maps.LatLng(8, 8);\r\n\t });\r\n\t */\r\n\r\n\tscheduler.attachEvent(\"onBeforeEventDelete\", function(id, event) {\r\n\t\tif (scheduler.map._markers[id]) {\r\n\t\t\tscheduler.map._markers[id].setMap(null); // if new event is deleted tab != map then it doesn't have marker yet\r\n\t\t}\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (scheduler.config.map_resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventCancel\", function(id, is_new) {\r\n\t\tif (is_new) {\r\n\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\tscheduler.map._infowindow.close();\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\r\n\tvar node = domEv;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tvar dx = (left + domEv.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tvar dy = (top + domEv.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:domEv.offsetWidth, height:domEv.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'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\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_month_head = function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };"],"names":["dhtmlxHook","dhtmlx","attaches","attachScheduler","day","mode","tabs","scheduler","obj","document","createElement","id","this","_genStr","innerHTML","body","appendChild","firstChild","attachObject","vs","av","sched","schedId","setSizes","updateView","destructor","init","_viewRestore","globalScope","window","global","global$1","assert","check","message","config","show_errors","callEvent","type","text","expire","console","log","extend","commonViews","agenda","grid","map","unit","timeline","week_agenda","year","anythingElse","requiredExtensions","limit","_commonErrorMessages","unknownView","view","relatedDoc","relatedExtension","collapsedContainer","div","createTimelineView","Error","createUnitsView","createGridView","addMarkedTimespan","renderCalendar","exportToPNG","join","exportToPDF","attachEvent","dhtmlxError","catchError","a","b","c","responseText","ajax_error","alert","className","element","classes","split","forEach","cssClass","classList","add","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","date","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","event","isCalendarVisible","destroyCalendar","position","getState","navigation","handler","calendar","setCurrentView","html_element","findRenderer","renderer","rows","cols","renderElement","css","width","value","style","height","html","align","justifyContent","prepareConfig","renderLayout","fragment","createDocumentFragment","items","Array","isArray","i","length","next","_init_nav_bar","navBar","$container","querySelector","_update_nav_bar","previousHeight","container","heightChanged","configChanged","newHeight","xy","nav_height","unset_actions","_els","get_elements","set_actions","display","isAttachedNode","root","parentNode","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","equals","listenWindowResize","oldSize","resizeDelay","clearTimeout","setTimeout","$destroyed","newSize","triggerSchedulerResize","$root","watchNodeResize","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","addResizeListener","containerStyles","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","salesforce_environment","contentWindow","removeChild","EventHost","_silent_mode","listeners","_silentStart","_silentEnd","createEventStorage","handlers","index","eventStorage","combinedResult","handlerResult","apply","arguments","addEvent","settings","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","innerId","attachAll","callback","name","eventArguments","handlerName","concat","checkEvent","detachEvent","list","eventId","detachAllEvents","eventable","nav_bar","_detachDomEvent","el","removeEventListener","_init_once","scheduler_resize_listener","layout","navbar","render","header","dataArea","hasSchedulerMarkup","createDefaultHeader","views","nav","matrix","push","_props","_grid","names","optionalViews","viewName","_currentDate","_obj","getElementById","error","wai_aria_application_role","JSON","stringify","rtl","_skin_init","_scroll","init_templates","_init_touch_events","set_sizes","$initialized","min_event_height","bar_height","scale_width","scroll_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","keys","edit_save","edit_cancel","functor","object","_x","scale_x","_table_view","materialScalePlaceholder","_is_material_skin","insertBefore","set_xy","offsetTop","_lightbox","_setLbPosition","_data_width","left","right","node","x","y","prepareValue","val","prepared","isNaN","Number","Math","max","direction","undefined","top","els","getElementsByTagName","class_name","_getClassName","attr_value","getAttribute","label","locale","labels","_waiAria","labelAttr","domEventsScope","_createDomEventScope","detachAll","_click","attach","e","preventDefault","_temp_touch_block","_on_mouse_move","_ignore_next_click","_on_mouse_down","_on_mouse_up","_on_dbl_click","returnValue","_locate_event","target","select","_select_id","_close_not_saved","editStop","unselect","updateEvent","previousSelection","getEvent","_mode","Date","_date","min_date","_min_date","max_date","_max_date","editor_id","_edit_id","lightbox_id","_lightbox_id","new_event","_new_event","select_id","expanded","drag_id","_drag_id","drag_mode","_drag_mode","dhx_cal_data","cancelBubble","getActionData","readonly","icon","closest","mask","indexOf","buttons","replace","valueOf","dhx_cal_prev_button","dhx_cal_next_button","dummy","step","def_step","dhx_cal_today_button","dhx_cal_tab","deprecated_name","substring","search","delete","confirm_deleting","_dhtmlx_confirm","title","title_confirm_deleting","deleteEvent","ok","icon_delete","edit","save","details","showLightbox","form","cancel","opts","result","confirm","addEventNow","start","end","base","_isObject","_isDate","duration","event_duration","time_step","start_date","round","start_hour","first_hour","getHours","setHours","end_date","setTime","uid","_loading","_drag_event","src","dblclick_create","details_on_dblclick","_timed","viewHandler","call","_get_column_index","x_pos","column","_cols","_ignores","floor","_week_indexes_from_pos","pos","min","ceil","hour_size_px","_mouse_coords","ev","$env","isIE","pageX","pageY","clientX","scrollLeft","clientLeft","clientY","scrollTop","clientTop","_colsS","$domHelpers","getAbsoluteLeft","getAbsoluteTop","dy","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","confirm_closing","title_confirm_closing","positive_closing","_drag_pos","_correct_shift","back","getTimezoneOffset","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","acc","abs","delay","d_pos","has_moved","_correct_drag_start_date","len","_start_correction","_end_correction","last_hour","getMinutes","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","res","fields","timeStep","custom","time_part","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","date_part","resize_from_start","end_day_start","end_day_date","firstHour","lastHour","maxY","precisePos","minDate","maxDate","preciseDate","cursor","shift","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","getView","getDate","_allow_dnd","update_render","sx","update_view","for_rendered","r","srcElement","classname","drag_event_body","fullClass","_lame_clone","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","_mobile","moved","_dhx_changed","is_new","_lame_copy","edit_on_create","details_on_create","isOneDayEvent","render_view_data","_trigger_dyn_loading","_load_mode","_load","_render_wait","_reset_ignores","_reset_scale","isViewExists","templates","_set_aria_buttons_attrs","buttonGroups","group","j","prev","headerButtonsAttributes","icon_form","icon_edit","oldClass","newClass","dhx_multi_day","prev_scroll","preserve_scroll","multidayScroll","_dy_shift","tab","headerToggleState","remove","_render_x_header","offset_top","head","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","from","to","count","count_n","_get_timeunit_start","_get_view_end","dd","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","parseInt","d","scales","cls","firstHalf","slotDate","getFullYear","getMonth","format_date","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","day_start","_getNavDateElement","str","drag_resize","drag_move","_scales","week_start","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","visibility","totalWidth","col_length","offset","hiddenWidth","c2","cloneNode","cc","content","hour_scale","hourScaleAttr","scroll_hour","now_date","n","preserve","ignore","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","month_day","cellBody","bf1","cells","querySelectorAll","parse_date","getLabel","property","key","sections","lightbox","map_to","options","updateCollection","list_name","collection","serverList","splice","resetLightbox","hideCover","cache","t","Object","create","String","Boolean","prototype","hasOwnProperty","source","n_ev","section","_focus","focus","getDaysDifference","startDate","endDate","differenceInTime","getTime","differenceInDays","eventLength","startColumnIndex","endColumnIndex","_get_date_index","last_column","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","days","fd","start_slot","end_slot","_get_section_property","y_property","_is_initialized","state","_is_lightbox_open","defaultDomEvents","addEventListener","eventRemove","createEventScope","domEvents","eventScope","capture","detach","staticArray","slice","_eventRemoveAll","_trim","func","trim","htmlTags","RegExp","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","attr","attributes","setAttributes","values","day_date","role","isActive","getHeaderCellAttr","dateString","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","attrs","agendaDetailsBtnString","icon_details","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","month","hour","minute","messageButtonAttrString","buttonLabel","messageInfoAttr","messageModalAttr","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","isDisabled","payload","uidSeed","now","pop","isStringObject","Function","toString","constructor","isNumberObject","isBooleanObject","isDate","defined","timeout","timer","$cancelTimeout","$pending","args","$execute","utils","mixin","force","f","copy","varType","elementPosition","elem","bottom","getBoundingClientRect","box","docElem","pageYOffset","pageXOffset","offsetLeft","offsetParent","getRelativeEventPosition","getNodePosition","getClassName","baseVal","getTargetNode","trg","tagName","shadowRoot","composedPath","locateCss","strict","ind","charAt","isVisible","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","hasHref","canHaveHref","area","nodeName","loLowerCase","isEnabled","canDisable","input","textarea","hasAttribute","getFocusableNodes","nodes","nodesArray","$position","sort","isValid","isShadowDomSupported","createShadowRoot","attachShadow","getActiveElement","activeElement","getSelection","focusNode","getRootNode","ShadowRoot","host","hasShadowParent","dom_helpers","htmlObject","getOffset","getOffsetSum","getOffsetRect","test","navigator","userAgent","dummyBox","selector","insertAfter","newNode","referenceNode","nextSibling","isChildOf","child","parent","contains","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isOpera","isChrome","isKHTML","isFF","isIPad","isEdge","isNode","clearAll","_dp","serialize$1","data","serialized","encodeURIComponent","Promise","createConfig","method","url","async","headers","serialize","ajax","serializeRequestParams","parse","DOMParser","parseFromString","ActiveXObject","loadXML","xmltop","tagname","xhr","status","xml","responseXML","xpath","xpathExp","docObj","selectNodes","first","col","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","query","_call","get","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","match","readyState","xmlDoc","filePath","open","setRequestHeader","toUpperCase","send","urlSeparator","$ajax","generateStringToDate","format","utc","splt","code","csp_date_to_str","to_fixed","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","getDay","day_full","month_short","month_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","csp_str_to_date","set","temp","month_short_hash","month_full_hash","UTC","cspEnabled","checkIfCSPEnabled","useCsp","csp","s","old","setMinutes","setSeconds","setMilliseconds","start_on_monday","month_start","setDate","year_start","setMonth","_add_days","inc","ndate","datesDiff","rest","hours","setYear","num","date_to_str","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","isYMDDate","datestr","isMDYDate","isDMYDate","isISO8601","parseYMD","parseMDY","parseDMY","parse_exact_format","nday","first_thursday","year_number","ordinal_date","week_number","convert_to_utc","default_date","month_date","load_date","week_date","hour_date","date_format","api_date","displayed_event_color","displayed_event_text_color","wide_form","day_column_padding","use_select_menu_space","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_display","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","server_utc","touch","touch_tip","touch_drag","touch_swipe_dates","quick_info_detached","drag_highlight","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","delay_render","timeline_swap_resize","event_attribute","$initial","_helpers","parseDate","xml_date","formatDate","xml_format","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","load_format","event_header","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","_events","_loaded","clear_view","extra_data","event_updated","silent","setEvent","hash","_rendered","changeEventId","new_id","create_getter","create_setter","_changed","is_visible_events","clear_event","in_visible_range","evFirstHour","evLastHour","end_dates_visible","hidden_duration","checkEndDate","get_visible_events","only_timed","stack","filter_event","filter","_is_main_area_event","evs","hold","full","_not_render","_recalculate_timed","tvs","tvd","_rendered_location","render_data","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","getEvents","_get_event_bar_pos","widt","x2","_pre_render_events","containers","render_event_bar","max_evs","max_month_events","_sorder","locate_holder","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_line","_pre_render_events_table","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","t_end_date","slot_index","sorderSet","_is_sorder","k","_max_sorder","max_count","_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","cellIndex","locate_holder_day","weekCellIndex","out","weeks","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","parentPosition","zIndex","color","setProperty","tplClass","cssText","_editor","shiftKey","keyCode","icons","icons_str","ariaAttr","currentIcon","textColor","highlightEventPosition","contentA","contentB","cs","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","childNodes","past","_get_dnd_order","order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","restoreOriginalColors","section_delimiter","getSectionTop","posFromDate","dx","_smartRenderingEnabled","scrollTo","_append_drag_marker","m","zone","scale","lastChild","previousSibling","_update_marker_position","size","_parsers","canParse","topElement","loader","csrfToken","security_key","arr","itms","itm","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","err","events","dhx_security","collections","collections_loaded","option","option_key","ical","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","dh","dm","utcMark","dn","getSerializator","_load_url","prevent_cache","ajaxCallback","response","on_load","lf","cache_line","temp_to","xmlLoaded","jsonLoader","iCalLoader","foundParser","parser","_process","_process_loading","_after_call","_tagvalue","_init_date","getSerializableData","createSerializator","dataset","allEvents","exportedEvent","exportValue","rawValue","load","setLoadMode","array","show_loading","_y","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","time","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","cfg","dt","last","limit_time_select","p","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","full_day","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","getLightboxRoot","cspEnvironment","salesforceEnvironment","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","block","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","action","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","labelBlock","inputBlock","fallback","inputId","old_id","mobile","MSStream","platform","maxTouchPoints","touchEventsSupported","createEvent","_touch_events","touches","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","accessor","tracker","scroll_mode","action_mode","dblclicktime","attachTouchEvent","passive","check_direction_swipe","s_ev","e_ev","max_dy","scrollable","doMouseMove","dnd","original_render","_update_global_tip","drag_cancel","_pointerDragId","pointerId","fake_event","_block_next_stop","actTask","fakeTask","sourceTask","_show_global_tip","_hide_global_tip","toptip","_global_tip","drag_to_create","drag_to_move","getRootView","tag","hooks","didInsert","cmp","_addThemeClass","skin","_skin_settings","_skin_xy","lightbox_additional_height","checkIfMaterialSkin","themeNameFromFile","links","href","_build_skin_info","monitorThemeChange","styles","themeVar","isCssVarTheme","themeName","cssValues","oldMaterialTheme","_theme_info","theme","cssVarTheme","themeVariables","calculatedMaterial","probe","cachedBorderBoxValue","checkIfBorderBoxStyling","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","newStyling","_configure","setSkin","flatSkinHourScale","monitorIntervalId","clearInterval","setInterval","csstheme","_old_month_day","old_month_day","reorderTabs","specialTabs","tabName","find","firstTab","reverse","jQuery","$","counter","methods","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","self","oldDate","oldMode","updateFlags","lazy_updateView","ars","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","_add_rec_marker","extendScheduler","_is_virtual_event","getUserData","_set_event_text_style","rec_type","rec_pattern","_dp_change_event_id","_dp_hook_delete","setDp","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","updateMode","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","setTransactionMode","total","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","_columns","getSyncState","enableDataNames","enablePartialDataSend","setUpdateMode","master","rowId","findRow","existing","set_invalid","is_invalid","markRow","sendData","_methods","getActionByState","checkBeforeUpdate","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","pref","_applyPayload","dataToSend","_onResolvedCreateUpdate","resultState","sid","tid","afterUpdateCallback","routerMode","actionPromise","update","then","catch","queryParams","ids","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","preprocessedData","_cleanupItemBeforeSend","valid","_forEachUpdatedRow","_getAllData","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","processedData","updatedItem","output","_prepareDataItem","item","processedItem","dataItem","createDataProcessor","tMode","batchUpdate","boxAttribute","_dhx_msg_cfg","usercall","modalBox","hide","modal_key","which","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","buttonCss","info","timers","pull","getFirstDefined","_boxStructure","contentId","inner","message_ok","message_cancel","btn","_createBox","hidden","alertPopup","confirmPopup","boxPopup","box_params","params","alertBox","confirmBox","focusable","subtype","seed","hideAll","popups","modalbox","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","section_description","section_time","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","be","agenda_tab","description","year_tab","week_agenda_tab","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","month_for_recurring","day_for_recurring","ca","cn","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","i18nFactory","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","labelFormat","dayElement","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","dayStart","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","currDate","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","common_errors","common","schedulerCore","wai_aria","dom","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","event_highlight","dhtmlx_suite_hooks","skins","jquery","dataProcessorExtend","connector","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","ext","activePlugins","plugins","extensionList","getExtensionList","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","ExtensionsManager","_extensions","SchedulerFactory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","calendars","addCalendar","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","_agendaScrollTop","set_full_view","l","rowAttr","dateHeader","descriptionHeader","tableAttr","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","agenda_area","v_border","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","eventStart","renderEmptyView","renderDay","calendarEvent","renderOneEvent","dates","selectedId","bg","all_timed_month","is_event_short","_safe_copy","proto","event_pid","isPrototypeOf","event_length","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","before","collision_limit","_setTempSection","event_id","checked_mode","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","second","evs_dates","getRecDates","tevs","concurrent","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","rows_length","year_y","week_agenda_scale_height","cur_height","eventsContainer","g","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","setCookie","cookie_param","getCookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","old_load","notImplemented","daytimeline_restricted","drag_between_restricted","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","all_options","single_option","addOption","getIndexByValue","selectOption","selected_id","disable","setComboValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","grid_view","html_templates","all","keyboard_shortcuts","$keyboardNavigation","shortcuts","createCommand","modifiers","alt","ctrl","meta","shortcut","commands","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","ctrlKey","metaKey","printableKey","fromCharCode","getHashFromEvent","getHash","parts","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","eventhandler","EventHandler","_handlers","findHandler","doAction","unbind","bindAll","initKeys","trap_modal_focus","trapFocus","currentFocus","currentIndex","nextIndex","nextItem","divs","renderMultiple","currentStart","currentEnd","TimeSlot","_modes","_getMode","units","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","areas","round_position","blocks","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","_timeline_getX","tempStart","tempEnd","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","inner_index","all_hours_height","hour_ms","lineHeight","scheduler_node","SchedulerNode","_compose","getDefaultNode","getMode","blur","enable","removeAttribute","_compareEvents","_pickEvent","startId","eventElement","Event","getNode","nextEventHandler","activeNode","dispatcher","nextEvent","currEvent","visibleDates","nextEv","setActiveNode","prevEventHandler","HeaderCell","getNodes","_key_nav_copy_paste","nav_node","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","header_cell","defaultCell","_getSection","_getNodes","eventNode","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","keepScrollPosition","_moveToSlot","slot","nextSlot","time_slot","movingDate","getDefaultDate","key_nav_step","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","clone","timeslot","_getMultisectionView","_getNextSection","sectionId","isInRange","defaultSlot","DataArea","smart_rendering","_pasteDate","_pasteSection","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","minutes","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","minical_button","MinicalButton","globalNode","MinicalCell","minical_cell","_getGrid","_getNode","enabled","newRow","newCol","modals","modalsStack","isModal","afterPopup","startModal","endModal","isTopModal","currentTarget","traceLightbox","_keyNavMessagePopup","focusElement","backupFocus","core","getActiveNode","setDefaultNode","focusGlobalNode","blurNode","editor","keyDownHandler","defaultPrevented","schedulerNode","_timeout","key_nav_legacy","_temp_key_scope","key_nav","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","clear_event_after","copyEvent","_make_pasted_event","multisection","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","getSelectedEvent","_buffer_event","new_ev","scheduler_handlers","attachSchedulerHandlers","focusHandler","waitCall","reFocusActiveNode","mousedownHandler","dataAreaClick","listOfScales","arrOfScales","some","focusEvent","evNode","prevState","lastStart","lastEnd","lastSection","minical_handlers","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","td","renderMinical","cal","added","destroyMinical","_def_count","addShortcut","scope","scopeObject","getScope","getShortcutHandler","removeShortcut","disp","scopes","minicalButton","minicalDate","timeSlot","searchMap","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_start","limit_end","limit_view","check_limits","mark_now","display_marked_timespans","overwrite_marked_timespans","_temp_limit_scope","dhx_time_block","default_timespan_type","fix_options","zones","get_resulting_options","blockTime","unblockTime","deleteMarkedTimespan","om","od","nm","nd","isBlocked","date_end","resetDate","checkInMarkedTimespan","timespan_type","on_overlap","temp_start_date","temp_end_date","timespans","_marked_timespans","day_value","day_index","getZones","_get_zone_minutes","eventEnd","markerStart","markerEnd","blocker","checkLimitViolation","complete_res","allow","_get_blocked_zones","timeline_zones","blocked_timeline_zones","_get_relevant_blocked_zones","_add_timespan_zones","resultZones","view_config","linker","is_new_event","data_copy","native_object","_mark_now","_mark_now_timer","dhx_now_time","_remove_mark_now","_append_mark_now","zone_start","start_index","end_index","units_l","r_divs","t_day","t_div","_render_marked_timespan","_prepare_timespan_options","r_configs","temp_configs","t_days","cloned_config","invert_zones","invertZones","view_key","t_config","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","start_day","delta","t_date","_get_css_classes_by_config","css_classes","_get_block_by_config","date_to_display","min_day","sday","block_proto","_mark_timespans","_on_scale_add_marker","markTimespan","configuration","rebuild_els","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","unmarkTimespan","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","_subtract_timespan_zones","is_modified","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","types","typedConfig","_get_types_to_render","specific","types_to_render","_get_configs_to_render","_get_unit_index","day_ind","unitsPerDay","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","map_view","mapView","geocoder","points","markers","infoWindow","createMarker","google","maps","Marker","map_date_width","map_icon_width","map_description_width","map_resolve_event_location","map_resolve_user_location","map_initial_position","LatLng","map_error_position","map_infowindow_max_width","map_type","MapTypeId","ROADMAP","map_zoom_after_resolve","marker_geo_success","marker_geo_fail","marker_date","marker_text","event_location","dblclick_dhx_map_area","map_time","map_text","map_start","add_map","map_date","_latLngUpdate","_isMapPositionSet","gmap","dhx_gmap","_setMapSize","mapOptions","zoom","map_initial_zoom","center","mapTypeId","Map","disableDefaultUI","disableDoubleClickZoom","addListener","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","lat","lng","formatted_address","infoWindowOptions","maxWidth","_points","_markers","_infowindow","InfoWindow","_infowindows_content","_initialization_count","Geocoder","geolocation","getCurrentPosition","_userLocation","coords","latitude","longitude","setCenter","setZoom","setContent","getCenter","setPosition","getZoom","fill_map_tab","showAddress","clear_map_tab","_selected_event_id","close","setMap","ariaButtonAttr","elem_id","marginRight","marginLeft","marginTop","temp_center","map_end","trigger","selectEvent","performClick","_displayEventOnMap","address","language","_updateEventLocation","_delay","ret","old_event_id","new_event_id","_event_resolve_delay","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","cont","tpos","_get_def_cont","_render_calendar","$dom","cellRoot","dateAttribute","unmarkCalendar","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","refreshOnLoad","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","arrow","dayHeaders","dayCells","inputs","selects","inp","number","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","noHighlight","monthheight","old_s","multisection_restricted","multiselect","parseXMLOptions","parseJSONOptions","_result","_children","_mark_inputs","_ids","delimiter","script_url","divLoading","multisource","backup","mvc","use_id","sanitize","update_timer","_start_ext_load","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","dragger","dhtmlDragAndDropObject","stopDrag","last_event","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","parseFloat","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_start","xml_end","xml_top","profile","footer","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","getPDFData","send_xml","submit","to_pdf","schedulersToPdf","objects","toPDF","toPDFRange","quick_info","show_quick_info","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","_quick_info_onscroll_handler","$testmode","_qi_button_click","domEv","titleContent","titleDate","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","txt_replace","txts","txtt","originalForm","readonlyForm","_lightbox_r","occurrence_timestamp_in_utc","recurring_workdays","_get_node","_outer_html","outerHTML","getOuterHTML","rec","loc","repeat_date_of_end","_ds","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","_init_set_value","_end_date","str_date_format","repeat_date","str_date","include_end_by","date_str","register_els","inps","formatter","change_current_view","get_repeat_code","get_rcode","repeat","get_end_rule","transpose_type","transp","set_end_rule","has_values","_get_repeat_code","get_numeric_value","repeat_precise","_start","start_exists","transpose_day_week","set_rcode","set_repeat_code","dispatchEvent","MouseEvent","_set_repeat_code","elements","_rec_init_done","rf","blocked","_is_modified_occurence","_toggle_block","actual_dates","timeControl","getTimeSection","_start_date","_get_button","getRecurringSection","_get_form","backgroundPosition","getFirstSectionOfType","_rec_markers","_rec_markers_pull","_pid_time","_get_rec_marker","ch","_get_rec_markers","clearMilliseconds","_rec_temp","old_add_event","ev_id","_ignore_call","tev","_pid_changed","nid","nev","sub","isEventFound","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","old_update_event","transponse_size","day_week","originalMonth","cday","newMonth","cor","cor2","transposeRecurring","recurringParts","dayDurationMs","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","maxCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","getMilliseconds","non_render","startHour","visibleCount","_fix_daylight_saving_date","ted","recurrings","sev","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","timeline_restricted","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","_getViewPort","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","delayShow","utils.default","show","tooltip_timeout","tooltip_hide_timeout","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","hideTooltip","treetimeline_restricted","units_restricted","s2d","d2s","select_event","week_agenda_restricted","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_month_head","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","yearStart","datepicker","locateEvent","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","add_export_methods","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","fail","_plain_export_copy","$text","_create_hidden_form","_hidden_export_form","_get_export_size","A5","A4","A3","A2","A1","A0","dataX","dataY","headY","multY","cSize","getTimeline","getInitialSizes","smartRendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","setExportSizes","initialSizes","setInitialSizes","gplExtensions","drag_between","factory","$dhx"],"mappings":"AACe,SAAAA,aAE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A;AAAAA,OAAOtB,YAAYA;AACnBsB,OAAOiiD,YAAYA;AAEnB,IAAIjiD,CAAAA,OAAOsnG,MAAM;AAChBtnG,SAAOsnG,OAAO;AACf;AAEAtnG,OAAOsnG,KAAK5oG,YAAYA;AACxBsB,OAAOsnG,KAAKrlD,YAAYA;"} \ No newline at end of file +{"version":3,"file":"dhtmlxscheduler.es.js","sources":["../../sources/dhtmlx_hook.js","../../sources/global.js","../../sources/plugins/drag_highlight_pos.js","../../sources/plugins/undo_delete.js","../../sources/plugins/limit.js","../../sources/plugins/batch_update.js","../../sources/plugins/index.js","../../sources/core/utils/utils.js","../../sources/core/state.js","../../sources/core/common/assert.js","../../sources/core/common_errors.js","../../sources/core/connector.js","../../sources/core/nav_bar.js","../../sources/core/scheduler_resize_listener.js","../../sources/utils/eventable.js","../../sources/core/scheduler.js","../../sources/core/utils/event.js","../../sources/core/utils/scoped_event.js","../../sources/core/common.js","../../sources/core/wai_aria.js","../../sources/core/utils/dom_helpers.js","../../sources/utils/env.js","../../sources/core/destructor.js","../../sources/core/common/url_serialize.js","../../sources/core/utils/ajax.js","../../sources/core/base.js","../../sources/core/config.js","../../sources/core/event.js","../../sources/core/event_highlight.js","../../sources/core/loaders/xml.js","../../sources/core/loaders/json.js","../../sources/core/loaders/ical.js","../../sources/core/common/get_serializable_events.js","../../sources/core/load.js","../../sources/core/lightbox.js","../../sources/core/touch.js","../../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../../sources/core/skins.js","../../sources/core/jquery.js","../../sources/core/delay_render.js","../../sources/core/dataprocessor/dataprocessor_hooks.js","../../sources/core/dataprocessor/dataprocessor.js","../../sources/core/message.js","../../sources/locale/locale_ar.js","../../sources/locale/locale_be.js","../../sources/locale/locale_ca.js","../../sources/locale/locale_cn.js","../../sources/locale/locale_cs.js","../../sources/locale/locale_da.js","../../sources/locale/locale_de.js","../../sources/locale/locale_el.js","../../sources/locale/locale_en.js","../../sources/locale/locale_es.js","../../sources/locale/locale_fi.js","../../sources/locale/locale_fr.js","../../sources/locale/locale_he.js","../../sources/locale/locale_hu.js","../../sources/locale/locale_id.js","../../sources/locale/locale_it.js","../../sources/locale/locale_jp.js","../../sources/locale/locale_manager.js","../../sources/locale/locale_nb.js","../../sources/locale/locale_nl.js","../../sources/locale/locale_no.js","../../sources/locale/locale_pl.js","../../sources/locale/locale_pt.js","../../sources/locale/locale_ro.js","../../sources/locale/locale_ru.js","../../sources/locale/locale_si.js","../../sources/locale/locale_sk.js","../../sources/locale/locale_sv.js","../../sources/locale/locale_tr.js","../../sources/locale/locale_ua.js","../../sources/locale/index.js","../../sources/core/datepicker.js","../../sources/scheduler_factory_method.js","../../sources/ext/extension_manager.js","../../sources/scheduler_factory.js","../../sources/ext/active_links.js","../../sources/ext/agenda_legacy_view.js","../../sources/ext/agenda.js","../../sources/ext/all_timed.js","../../sources/ext/collision.js","../../sources/ext/container_autoresize.js","../../sources/ext/cookie.js","../../sources/ext/restricted_extensions/not_implemented_extension.js","../../sources/ext/restricted_extensions/daytimeline.js","../../sources/ext/restricted_extensions/drag_between.js","../../sources/ext/editors.js","../../sources/ext/expand.js","../../sources/ext/restricted_extensions/grid_view.js","../../sources/ext/html_templates.js","../../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../../sources/ext/keyboard_navigation/common/eventhandler.js","../../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../../sources/ext/keyboard_navigation/marker.js","../../sources/ext/keyboard_navigation/elements/scheduler_node.js","../../sources/ext/keyboard_navigation/elements/nav_node.js","../../sources/ext/keyboard_navigation/elements/header_cell.js","../../sources/ext/keyboard_navigation/elements/event.js","../../sources/ext/keyboard_navigation/elements/time_slot.js","../../sources/ext/keyboard_navigation/elements/minical_button.js","../../sources/ext/keyboard_navigation/elements/minical_cell.js","../../sources/ext/keyboard_navigation/elements/data_area.js","../../sources/ext/keyboard_navigation/modals.js","../../sources/ext/keyboard_navigation/core.js","../../sources/ext/keyboard_navigation/key_nav_legacy.js","../../sources/ext/keyboard_navigation/scheduler_handlers.js","../../sources/ext/keyboard_navigation/minical_handlers.js","../../sources/ext/key_nav.js","../../sources/ext/layer.js","../../sources/ext/limit.js","../../sources/ext/map_view/gMapAdapter.ts","../../sources/ext/map_view/osmMapAdapter.ts","../../sources/ext/map_view/mapboxAdapter.ts","../../sources/ext/map_view/index.ts","../../sources/ext/minical.js","../../sources/ext/monthheight.js","../../sources/ext/restricted_extensions/multisection.js","../../sources/ext/multiselect.js","../../sources/ext/multisource.js","../../sources/ext/mvc.js","../../sources/ext/outerdrag.js","../../sources/ext/pdf.js","../../sources/ext/quick_info.js","../../sources/ext/readonly.js","../../node_modules/rrule/dist/esm/weekday.js","../../node_modules/rrule/dist/esm/helpers.js","../../node_modules/rrule/dist/esm/dateutil.js","../../node_modules/rrule/dist/esm/iterresult.js","../../node_modules/rrule/node_modules/tslib/tslib.es6.mjs","../../node_modules/rrule/dist/esm/callbackiterresult.js","../../node_modules/rrule/dist/esm/nlp/i18n.js","../../node_modules/rrule/dist/esm/nlp/totext.js","../../node_modules/rrule/dist/esm/nlp/parsetext.js","../../node_modules/rrule/dist/esm/types.js","../../node_modules/rrule/dist/esm/nlp/index.js","../../node_modules/rrule/dist/esm/datetime.js","../../node_modules/rrule/dist/esm/parseoptions.js","../../node_modules/rrule/dist/esm/parsestring.js","../../node_modules/rrule/dist/esm/datewithzone.js","../../node_modules/rrule/dist/esm/optionstostring.js","../../node_modules/rrule/dist/esm/cache.js","../../node_modules/rrule/dist/esm/masks.js","../../node_modules/rrule/dist/esm/iterinfo/yearinfo.js","../../node_modules/rrule/dist/esm/iterinfo/monthinfo.js","../../node_modules/rrule/dist/esm/iterinfo/easter.js","../../node_modules/rrule/dist/esm/iterinfo/index.js","../../node_modules/rrule/dist/esm/iter/poslist.js","../../node_modules/rrule/dist/esm/iter/index.js","../../node_modules/rrule/dist/esm/rrule.js","../../node_modules/rrule/dist/esm/iterset.js","../../node_modules/rrule/dist/esm/rrulestr.js","../../node_modules/rrule/dist/esm/rruleset.js","../../sources/ext/recurring.js","../../sources/ext/recurring_legacy.js","../../sources/ext/serialize.js","../../sources/ext/restricted_extensions/timeline.js","../../sources/ext/tooltip/tooltip.ts","../../sources/ext/tooltip/tooltipManager.ts","../../sources/ext/tooltip/index.ts","../../sources/ext/restricted_extensions/treetimeline.js","../../sources/ext/restricted_extensions/units.js","../../sources/ext/url.js","../../sources/ext/restricted_extensions/week_agenda.js","../../sources/ext/wp.js","../../sources/ext/year_view.js","../../sources/ext/export_api/index.js","../../sources/ext/extensions_gpl.js","../../sources/dhtmlxscheduler.gpl.js"],"sourcesContent":["\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function dragHighlightPos(scheduler){\r\n let dndMarkers = [];\r\n let dragStarted = false;\r\n let eventNode = null;\r\n let event = null;\r\n\r\n function isEnabled() { \r\n return scheduler.config.drag_highlight && scheduler.markTimespan;\r\n }\r\n\r\n function checkViewName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj){\r\n return viewObj.layout;\r\n }\r\n return viewName;\r\n }\r\n\r\n function checkSectionPropertyName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj.y_property){\r\n return viewObj.y_property;\r\n }\r\n if(viewObj.map_to){\r\n return viewObj.map_to;\r\n }\r\n }\r\n\r\n function setRequiredStylesToMarker(eventNode, layout){\r\n switch (layout) {\r\n case \"month\":\r\n eventNode.style.top = \"\";\r\n eventNode.style.left = \"\";\r\n break;\r\n case \"timeline\":\r\n eventNode.style.left = \"\";\r\n eventNode.style.marginLeft = \"1px\";\r\n break;\r\n default:\r\n eventNode.style.top = \"\";\r\n break;\r\n }\r\n }\r\n \r\n function createMarkerConfig(configSettings){\r\n const { event, layout, viewName, sectionId, eventNode } = configSettings;\r\n setRequiredStylesToMarker(eventNode, layout);\r\n const sections = {};\r\n let markerObject = {\r\n start_date: event.start_date,\r\n end_date: event.end_date,\r\n css: \"dhx_scheduler_dnd_marker\",\r\n html: eventNode\r\n };\r\n if (layout == \"timeline\" || layout == \"month\" ){\r\n // we need to set end date less than 24 hours of the views to avoid receiving multiple marktimespans\r\n markerObject = {...markerObject, end_date: scheduler.date.add(event.start_date, 1, 'minute')};\r\n }\r\n if (sectionId){\r\n sections[viewName] = sectionId;\r\n markerObject.sections = sections;\r\n }\r\n return markerObject;\r\n }\r\n\r\n function createViewMarker(settings){\r\n const { layout } = settings;\r\n let markerConfigs;\r\n switch (layout) {\r\n case \"month\": \r\n markerConfigs = getMonthViewMarkers(settings);\r\n break;\r\n case 'timeline':\r\n case 'units':\r\n markerConfigs = getTimelineAndUnitsViewMarkers(settings);\r\n break;\r\n default: \r\n markerConfigs = getColumnViewMarkers(settings);\r\n break;\r\n }\r\n markerConfigs.forEach((cfg) => {\r\n dndMarkers.push(scheduler.markTimespan(cfg));\r\n });\r\n }\r\n\r\n function getColumnViewMarkers(settings){\r\n const {event, layout, viewName, sectionId} = settings;\r\n let columnViewMarkersArray = [];\r\n let eventNodes = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);\r\n if(eventNodes){\r\n for (let i = 0; i < eventNodes.length; i++) {\r\n let eventNodeClone = eventNodes[i].cloneNode(true);\r\n let startDate = new Date(+eventNodeClone.getAttribute(\"data-bar-start\"));\r\n let endDate = new Date(+eventNodeClone.getAttribute(\"data-bar-end\"));\r\n let dates = {start_date: startDate, end_date: endDate};\r\n const configSettings = {\r\n event: dates, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode:eventNodeClone\r\n };\r\n columnViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\t\r\n }\r\n return columnViewMarkersArray;\r\n }\r\n\r\n function getMonthViewMarkers(settings){\r\n let monthViewMarkersArray = [];\r\n const {event, layout, viewName, sectionId} = settings;\r\n const weekDates = [];\r\n let currDate = new Date(event.start_date);\r\n while(currDate.valueOf() < event.end_date.valueOf()){\r\n let obj = {start_date: currDate};\r\n weekDates.push(obj);\r\n currDate = scheduler.date.week_start(scheduler.date.add(currDate, 1, \"week\"));\r\n }\r\n let cells = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']`);\r\n for (let i = 0; i < cells.length; i++) {\r\n const configSettings = {\r\n event: weekDates[i], \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode: cells[i].cloneNode(true)\r\n };\r\n monthViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n return monthViewMarkersArray;\r\n }\r\n\r\n function getTimelineAndUnitsViewMarkers(settings){\r\n let unitMarkersArray = [];\r\n const {event, layout, viewName, eventNode} = settings;\r\n let sectionPropertyName = checkSectionPropertyName(viewName);\r\n if (scheduler.config.multisection && sectionPropertyName){\r\n const sections = String(event[sectionPropertyName]).split(scheduler.config.section_delimiter);\r\n const formatedSections = sections.map(element => String(element));\r\n const elems = [];\r\n for (let i = 0; i < formatedSections.length; i++) {\r\n elems[i] = eventNode.cloneNode(true);\r\n const configSettings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId: formatedSections[i],\r\n eventNode: elems[i]\r\n };\r\n unitMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n }\r\n return unitMarkersArray;\r\n }\r\n \r\n scheduler.attachEvent(\"onBeforeDrag\", function (id, mode, e){\r\n if (isEnabled()) {\r\n dragStarted = true;\r\n event = scheduler.getEvent(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n // to avoid incorrect eventNode and marker creation when scheduler.config.cascade_event_display included\r\n if (layout == \"units\" && scheduler.config.cascade_event_display ) {\r\n scheduler.unselect(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n scheduler.attachEvent(\"onEventDrag\", function (id, mode, e){\r\n if(dragStarted && isEnabled()){\r\n dragStarted = false;// insert element only once after dnd start\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n const sectionId = scheduler.getActionData(e).section;\r\n if (event) {\r\n const settings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode\r\n };\r\n createViewMarker(settings);\r\n }\r\n }\r\n });\r\n\r\n scheduler.attachEvent(\"onDragEnd\", function(id, mode, e){\r\n for (let i = 0; i < dndMarkers.length; i++) {\r\n scheduler.unmarkTimespan(dndMarkers[i]);\r\n }\r\n dndMarkers = [];\r\n eventNode = null;\r\n event = null;\r\n });\r\n}","export default function undoDelete(scheduler) {\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tlet deletedEvent = scheduler.copy(ev);\r\n\t\tif (scheduler.config.undo_deleted && !scheduler.getState().new_event) {\r\n\t\t\tscheduler.message({\r\n\t\t\t\ttext: `
\r\n Event deleted\r\n \r\n
`,\r\n\t\t\t\texpire: 10000,\r\n\t\t\t\ttype: \"popup_after_delete\",\r\n\t\t\t\tcallback: function (e) {\r\n\t\t\t\t\tlet undoBtn = e.target.closest(\r\n\t\t\t\t\t\t`[data-deleted-event-id=\"${ev.id}\"]`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (undoBtn) {\r\n\t\t\t\t\t\tscheduler.addEvent(deletedEvent);\r\n\t\t\t\t\t\tscheduler.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n","export default function limitPlugin(scheduler){\r\n\r\n\r\n\tscheduler.config.mark_now = true;\r\n\tscheduler.config.display_marked_timespans = true;\r\n\tscheduler.config.overwrite_marked_timespans = true;\r\n\r\n\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tscheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif ((event.rec_type && event._end_date) || (event.rrule)) {\r\n\t\t\tconst seriesEnd = event._end_date || event.end_date;\r\n\t\t\t// GS-2482 need to take into account that a part of recurring events might be outside the limits\r\n\t\t\tif ((c.limit_start && c.limit_end)) {\r\n\t\t\t\tvar recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event.start_date.valueOf() <= c.limit_end.valueOf();\r\n\t\t\t\treturn recEventInLimits;\r\n\t\t\t} else return true;\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i {\r\n\t\t\tif(date){\r\n\t\t\t\tcalls.setModeDate.date = date;\r\n\t\t\t}\r\n\t\t\tif(mode){\r\n\t\t\t\tcalls.setModeDate.mode = mode;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar methods = {\r\n\t\t\trender:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tsetCurrentView:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tupdateView:(date, mode) => {calls.needUpdateView = true; rememberModeDate(date, mode);},\r\n\t\t\trender_data:() => calls.needRender = true,\r\n\t\t\trender_view_data:(evs) => { \r\n\t\t\t\tif(evs && evs.length){\r\n\t\t\t\t\tevs.forEach((e) => calls.repaintEvents[e.id] = true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcalls.needRender = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\tisActive = false;\r\n\t\tif(!noRedraw){\r\n\t\t\tif(calls.needRender){\r\n\t\t\t\tscheduler.render(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else if(calls.needUpdateView){\r\n\t\t\t\tscheduler.updateView(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else{\r\n\t\t\t\tfor(const i in calls.repaintEvents){\r\n\t\t\t\t\tscheduler.updateEvent(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default function(scheduler){\r\n\tscheduler.batchUpdate = createMethod(scheduler);\r\n}","import dragHighlightPos from \"./drag_highlight_pos\";\r\nimport undoDelete from \"./undo_delete\";\r\nimport limit from \"./limit\";\r\nimport batchUpdate from \"./batch_update\";\r\n\r\nexport default function initPlugins(scheduler){\r\n undoDelete(scheduler);\r\n dragHighlightPos(scheduler);\r\n limit(scheduler);\r\n batchUpdate(scheduler);\r\n}","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","import utils from \"./utils/utils\";\r\n\r\nconst StateService = (function(){\r\n\tconst stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tconst provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tconst res = {};\r\n\t\t\tfor(const i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.$stateProvider.registerProvider(\"global\", (function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n}).bind(scheduler));\r\n\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\tundo_deleted: true,\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\tvar html = `
\r\n\t\t\t\t
`;\r\n\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"\";\r\n\t\thtml+=\"\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function (e) {\r\n if(text.callback) {\r\n text.callback.call(this, e);\r\n }\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id, callback) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id, callback: callback};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"يومي\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"أسبوعي\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"شهري\",\r\n\t\trepeat_radio_year: \"سنوي\",\r\n\t\trepeat_radio_day_type: \"كل\",\r\n\t\trepeat_text_day_count: \"يوم\",\r\n\t\trepeat_radio_day_type2: \"كل يوم عمل\",\r\n\t\trepeat_week: \" تكرار كل\",\r\n\t\trepeat_text_week_count: \"أسبوع في الأيام التالية:\",\r\n\t\trepeat_radio_month_type: \"تكرار\",\r\n\t\trepeat_radio_month_start: \"في\",\r\n\t\trepeat_text_month_day: \"يوم كل\",\r\n\t\trepeat_text_month_count: \"شهر\",\r\n\t\trepeat_text_month_count2_before: \"كل\",\r\n\t\trepeat_text_month_count2_after: \"شهر\",\r\n\t\trepeat_year_label: \"في\",\r\n\t\tselect_year_day2: \"من\",\r\n\t\trepeat_text_year_day: \"يوم\",\r\n\t\tselect_year_month: \"شهر\",\r\n\t\trepeat_radio_end: \"بدون تاريخ انتهاء\",\r\n\t\trepeat_text_occurences_count: \"تكرارات\",\r\n\t\trepeat_radio_end2: \"بعد\",\r\n\t\trepeat_radio_end3: \"ينتهي في\",\r\n\r\n\t\trepeat_never: \"أبداً\",\r\n\t\trepeat_daily: \"كل يوم\",\r\n\t\trepeat_workdays: \"كل يوم عمل\",\r\n\t\trepeat_weekly: \"كل أسبوع\",\r\n\t\trepeat_monthly: \"كل شهر\",\r\n\t\trepeat_yearly: \"كل سنة\",\r\n\t\trepeat_custom: \"تخصيص\",\r\n\t\trepeat_freq_day: \"يوم\",\r\n\t\trepeat_freq_week: \"أسبوع\",\r\n\t\trepeat_freq_month: \"شهر\",\r\n\t\trepeat_freq_year: \"سنة\",\r\n\t\trepeat_on_date: \"في التاريخ\",\r\n\t\trepeat_ends: \"ينتهي\",\r\n\r\n\t\tmonth_for_recurring: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_for_recurring: [\"الأحد\", \"الإثنين\", \"الثلاثاء\", \"الأربعاء\", \"الخميس\", \"الجمعة\", \"السبت\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\r\n\t\trepeat_never: \"Ніколі\",\r\n\t\trepeat_daily: \"Кожны дзень\",\r\n\t\trepeat_workdays: \"Кожны працоўны дзень\",\r\n\t\trepeat_weekly: \"Кожны тыдзень\",\r\n\t\trepeat_monthly: \"Кожны месяц\",\r\n\t\trepeat_yearly: \"Кожны год\",\r\n\t\trepeat_custom: \"Наладжвальны\",\r\n\t\trepeat_freq_day: \"Дзень\",\r\n\t\trepeat_freq_week: \"Тыдзень\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Заканчваецца\",\r\n\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diari\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Setmanal\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mensual\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada dia laborable\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"setmana els dies següents:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada\",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"de\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sense data de finalització\",\r\n\t\trepeat_text_occurences_count: \"ocurrències\",\r\n\t\trepeat_radio_end2: \"Després\",\r\n\t\trepeat_radio_end3: \"Finalitzar el\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Cada dia\",\r\n\t\trepeat_workdays: \"Cada dia laborable\",\r\n\t\trepeat_weekly: \"Cada setmana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada any\",\r\n\t\trepeat_custom: \"Personalitzat\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Setmana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Any\",\r\n\t\trepeat_on_date: \"En la data\",\r\n\t\trepeat_ends: \"Finalitza\",\r\n\r\n\t\tmonth_for_recurring: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tday_for_recurring: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"]\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\t\r\n\t\trepeat_never: \"从不\",\r\n\t\trepeat_daily: \"每天\",\r\n\t\trepeat_workdays: \"每个工作日\",\r\n\t\trepeat_weekly: \"每周\",\r\n\t\trepeat_monthly: \"每月\",\r\n\t\trepeat_yearly: \"每年\",\r\n\t\trepeat_custom: \"自定义\",\r\n\t\trepeat_freq_day: \"天\",\r\n\t\trepeat_freq_week: \"周\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"在日期\",\r\n\t\trepeat_ends: \"结束\",\r\n\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý den\",\r\n\t\trepeat_workdays: \"Každý pracovní den\",\r\n\t\trepeat_weekly: \"Každý týden\",\r\n\t\trepeat_monthly: \"Každý měsíc\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastní\",\r\n\t\trepeat_freq_day: \"Den\",\r\n\t\trepeat_freq_week: \"Týden\",\r\n\t\trepeat_freq_month: \"Měsíc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Končí\",\r\n\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver hverdag\",\r\n\t\trepeat_weekly: \"Hver uge\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Brugerdefineret\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uge\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\r\n\t\trepeat_never: \"Nie\",\r\n\t\trepeat_daily: \"Jeden Tag\",\r\n\t\trepeat_workdays: \"Jeden Werktag\",\r\n\t\trepeat_weekly: \"Jede Woche\",\r\n\t\trepeat_monthly: \"Jeden Monat\",\r\n\t\trepeat_yearly: \"Jedes Jahr\",\r\n\t\trepeat_custom: \"Benutzerdefiniert\",\r\n\t\trepeat_freq_day: \"Tag\",\r\n\t\trepeat_freq_week: \"Woche\",\r\n\t\trepeat_freq_month: \"Monat\",\r\n\t\trepeat_freq_year: \"Jahr\",\r\n\t\trepeat_on_date: \"Am Datum\",\r\n\t\trepeat_ends: \"Endet\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\r\n\t\trepeat_never: \"Ποτέ\",\r\n\t\trepeat_daily: \"Κάθε μέρα\",\r\n\t\trepeat_workdays: \"Κάθε εργάσιμη μέρα\",\r\n\t\trepeat_weekly: \"Κάθε εβδομάδα\",\r\n\t\trepeat_monthly: \"Κάθε μήνα\",\r\n\t\trepeat_yearly: \"Κάθε χρόνο\",\r\n\t\trepeat_custom: \"Προσαρμοσμένο\",\r\n\t\trepeat_freq_day: \"Ημέρα\",\r\n\t\trepeat_freq_week: \"Εβδομάδα\",\r\n\t\trepeat_freq_month: \"Μήνας\",\r\n\t\trepeat_freq_year: \"Χρόνος\",\r\n\t\trepeat_on_date: \"Σε ημερομηνία\",\r\n\t\trepeat_ends: \"Λήγει\",\r\n\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\r\n\t\trepeat_never: \"Never\",\r\n\t\trepeat_daily: \"Every day\",\r\n\t\trepeat_workdays: \"Every weekday\",\r\n\t\trepeat_weekly: \"Every week\",\r\n\t\trepeat_monthly: \"Every month\",\r\n\t\trepeat_yearly: \"Every year\",\r\n\t\trepeat_custom: \"Custom\",\r\n\t\trepeat_freq_day: \"Day\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Month\",\r\n\t\trepeat_freq_year: \"Year\",\r\n\t\trepeat_on_date: \"On date\",\r\n\t\trepeat_ends: \"Ends\",\r\n\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Cada día\",\r\n\t\trepeat_workdays: \"Cada día laborable\",\r\n\t\trepeat_weekly: \"Cada semana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada año\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Día\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Año\",\r\n\t\trepeat_on_date: \"En la fecha\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ei koskaan\",\r\n\t\trepeat_daily: \"Joka päivä\",\r\n\t\trepeat_workdays: \"Joka arkipäivä\",\r\n\t\trepeat_weekly: \"Joka viikko\",\r\n\t\trepeat_monthly: \"Joka kuukausi\",\r\n\t\trepeat_yearly: \"Joka vuosi\",\r\n\t\trepeat_custom: \"Mukautettu\",\r\n\t\trepeat_freq_day: \"Päivä\",\r\n\t\trepeat_freq_week: \"Viikko\",\r\n\t\trepeat_freq_month: \"Kuukausi\",\r\n\t\trepeat_freq_year: \"Vuosi\",\r\n\t\trepeat_on_date: \"Tiettynä päivänä\",\r\n\t\trepeat_ends: \"Päättyy\",\r\n\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\r\n\t\trepeat_never: \"Jamais\",\r\n\t\trepeat_daily: \"Chaque jour\",\r\n\t\trepeat_workdays: \"Chaque jour ouvrable\",\r\n\t\trepeat_weekly: \"Chaque semaine\",\r\n\t\trepeat_monthly: \"Chaque mois\",\r\n\t\trepeat_yearly: \"Chaque année\",\r\n\t\trepeat_custom: \"Personnalisé\",\r\n\t\trepeat_freq_day: \"Jour\",\r\n\t\trepeat_freq_week: \"Semaine\",\r\n\t\trepeat_freq_month: \"Mois\",\r\n\t\trepeat_freq_year: \"Année\",\r\n\t\trepeat_on_date: \"À la date\",\r\n\t\trepeat_ends: \"Se termine\",\r\n\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\r\n\t\trepeat_never: \"אף פעם\",\r\n\t\trepeat_daily: \"כל יום\",\r\n\t\trepeat_workdays: \"כל יום עבודה\",\r\n\t\trepeat_weekly: \"כל שבוע\",\r\n\t\trepeat_monthly: \"כל חודש\",\r\n\t\trepeat_yearly: \"כל שנה\",\r\n\t\trepeat_custom: \"מותאם אישית\",\r\n\t\trepeat_freq_day: \"יום\",\r\n\t\trepeat_freq_week: \"שבוע\",\r\n\t\trepeat_freq_month: \"חודש\",\r\n\t\trepeat_freq_year: \"שנה\",\r\n\t\trepeat_on_date: \"בתאריך\",\r\n\t\trepeat_ends: \"מסתיים\",\r\n\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Napi\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Heti\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Havi\",\r\n\t\trepeat_radio_year: \"Éves\",\r\n\t\trepeat_radio_day_type: \"Minden\",\r\n\t\trepeat_text_day_count: \"nap\",\r\n\t\trepeat_radio_day_type2: \"Minden munkanap\",\r\n\t\trepeat_week: \" Ismételje meg minden\",\r\n\t\trepeat_text_week_count: \"héten a következő napokon:\",\r\n\t\trepeat_radio_month_type: \"Ismétlés\",\r\n\t\trepeat_radio_month_start: \"Ekkor\",\r\n\t\trepeat_text_month_day: \"nap minden\",\r\n\t\trepeat_text_month_count: \"hónapban\",\r\n\t\trepeat_text_month_count2_before: \"minden\",\r\n\t\trepeat_text_month_count2_after: \"hónapban\",\r\n\t\trepeat_year_label: \"Ekkor\",\r\n\t\tselect_year_day2: \"-án/-én\",\r\n\t\trepeat_text_year_day: \"nap\",\r\n\t\tselect_year_month: \"hónap\",\r\n\t\trepeat_radio_end: \"Nincs befejezési dátum\",\r\n\t\trepeat_text_occurences_count: \"esemény\",\r\n\t\trepeat_radio_end2: \"Után\",\r\n\t\trepeat_radio_end3: \"Befejező dátum\",\r\n\r\n\t\trepeat_never: \"Soha\",\r\n\t\trepeat_daily: \"Minden nap\",\r\n\t\trepeat_workdays: \"Minden munkanap\",\r\n\t\trepeat_weekly: \"Minden héten\",\r\n\t\trepeat_monthly: \"Minden hónapban\",\r\n\t\trepeat_yearly: \"Minden évben\",\r\n\t\trepeat_custom: \"Egyedi\",\r\n\t\trepeat_freq_day: \"Nap\",\r\n\t\trepeat_freq_week: \"Hét\",\r\n\t\trepeat_freq_month: \"Hónap\",\r\n\t\trepeat_freq_year: \"Év\",\r\n\t\trepeat_on_date: \"Dátum szerint\",\r\n\t\trepeat_ends: \"Befejeződik\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Harian\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Mingguan\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Bulanan\",\r\n\t\trepeat_radio_year: \"Tahunan\",\r\n\t\trepeat_radio_day_type: \"Setiap\",\r\n\t\trepeat_text_day_count: \"hari\",\r\n\t\trepeat_radio_day_type2: \"Setiap hari kerja\",\r\n\t\trepeat_week: \" Ulangi setiap\",\r\n\t\trepeat_text_week_count: \"minggu pada hari berikut:\",\r\n\t\trepeat_radio_month_type: \"Ulangi\",\r\n\t\trepeat_radio_month_start: \"Pada\",\r\n\t\trepeat_text_month_day: \"hari setiap\",\r\n\t\trepeat_text_month_count: \"bulan\",\r\n\t\trepeat_text_month_count2_before: \"setiap\",\r\n\t\trepeat_text_month_count2_after: \"bulan\",\r\n\t\trepeat_year_label: \"Pada\",\r\n\t\tselect_year_day2: \"dari\",\r\n\t\trepeat_text_year_day: \"hari\",\r\n\t\tselect_year_month: \"bulan\",\r\n\t\trepeat_radio_end: \"Tanpa tanggal akhir\",\r\n\t\trepeat_text_occurences_count: \"kejadian\",\r\n\t\trepeat_radio_end2: \"Setelah\",\r\n\t\trepeat_radio_end3: \"Berakhir pada\",\r\n\r\n\t\trepeat_never: \"Tidak pernah\",\r\n\t\trepeat_daily: \"Setiap hari\",\r\n\t\trepeat_workdays: \"Setiap hari kerja\",\r\n\t\trepeat_weekly: \"Setiap minggu\",\r\n\t\trepeat_monthly: \"Setiap bulan\",\r\n\t\trepeat_yearly: \"Setiap tahun\",\r\n\t\trepeat_custom: \"Kustom\",\r\n\t\trepeat_freq_day: \"Hari\",\r\n\t\trepeat_freq_week: \"Minggu\",\r\n\t\trepeat_freq_month: \"Bulan\",\r\n\t\trepeat_freq_year: \"Tahun\",\r\n\t\trepeat_on_date: \"Pada tanggal\",\r\n\t\trepeat_ends: \"Berakhir\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Ogni giorno\",\r\n\t\trepeat_workdays: \"Ogni giorno feriale\",\r\n\t\trepeat_weekly: \"Ogni settimana\",\r\n\t\trepeat_monthly: \"Ogni mese\",\r\n\t\trepeat_yearly: \"Ogni anno\",\r\n\t\trepeat_custom: \"Personalizzato\",\r\n\t\trepeat_freq_day: \"Giorno\",\r\n\t\trepeat_freq_week: \"Settimana\",\r\n\t\trepeat_freq_month: \"Mese\",\r\n\t\trepeat_freq_year: \"Anno\",\r\n\t\trepeat_on_date: \"Alla data\",\r\n\t\trepeat_ends: \"Finisce\",\r\n\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"毎日\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"毎週\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"毎月\",\r\n\t\trepeat_radio_year: \"毎年\",\r\n\t\trepeat_radio_day_type: \"毎\",\r\n\t\trepeat_text_day_count: \"日\",\r\n\t\trepeat_radio_day_type2: \"毎営業日\",\r\n\t\trepeat_week: \" 繰り返し毎\",\r\n\t\trepeat_text_week_count: \"週 次の日:\",\r\n\t\trepeat_radio_month_type: \"繰り返し\",\r\n\t\trepeat_radio_month_start: \"オン\",\r\n\t\trepeat_text_month_day: \"日毎\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"毎\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"オン\",\r\n\t\tselect_year_day2: \"の\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"終了日なし\",\r\n\t\trepeat_text_occurences_count: \"回数\",\r\n\t\trepeat_radio_end2: \"後\",\r\n\t\trepeat_radio_end3: \"終了日まで\",\r\n\r\n\t\trepeat_never: \"決して\",\r\n\t\trepeat_daily: \"毎日\",\r\n\t\trepeat_workdays: \"毎営業日\",\r\n\t\trepeat_weekly: \"毎週\",\r\n\t\trepeat_monthly: \"毎月\",\r\n\t\trepeat_yearly: \"毎年\",\r\n\t\trepeat_custom: \"カスタム\",\r\n\t\trepeat_freq_day: \"日\",\r\n\t\trepeat_freq_week: \"週\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"日にち\",\r\n\t\trepeat_ends: \"終了\",\r\n\r\n\t\tmonth_for_recurring: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_for_recurring: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\r\n\t\trepeat_never: \"Nooit\",\r\n\t\trepeat_daily: \"Elke dag\",\r\n\t\trepeat_workdays: \"Elke werkdag\",\r\n\t\trepeat_weekly: \"Elke week\",\r\n\t\trepeat_monthly: \"Elke maand\",\r\n\t\trepeat_yearly: \"Elk jaar\",\r\n\t\trepeat_custom: \"Aangepast\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Maand\",\r\n\t\trepeat_freq_year: \"Jaar\",\r\n\t\trepeat_on_date: \"Op datum\",\r\n\t\trepeat_ends: \"Eindigt\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Ukentlig\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Hver arbeidsdag\",\r\n\t\trepeat_week: \" Gjenta hver\",\r\n\t\trepeat_text_week_count: \"uke neste dager:\",\r\n\t\trepeat_radio_month_type: \"Gjenta\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"På\",\r\n\t\tselect_year_day2: \"av\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"måned\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomster\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\trepeat_radio_end3: \"Slutt innen\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nigdy\",\r\n\t\trepeat_daily: \"Codziennie\",\r\n\t\trepeat_workdays: \"Każdy dzień roboczy\",\r\n\t\trepeat_weekly: \"Co tydzień\",\r\n\t\trepeat_monthly: \"Co miesiąc\",\r\n\t\trepeat_yearly: \"Co rok\",\r\n\t\trepeat_custom: \"Niestandardowy\",\r\n\t\trepeat_freq_day: \"Dzień\",\r\n\t\trepeat_freq_week: \"Tydzień\",\r\n\t\trepeat_freq_month: \"Miesiąc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"W dniu\",\r\n\t\trepeat_ends: \"Kończy się\",\r\n\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Todos os dias\",\r\n\t\trepeat_workdays: \"Todos os dias úteis\",\r\n\t\trepeat_weekly: \"Toda semana\",\r\n\t\trepeat_monthly: \"Todo mês\",\r\n\t\trepeat_yearly: \"Todo ano\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mês\",\r\n\t\trepeat_freq_year: \"Ano\",\r\n\t\trepeat_on_date: \"Na data\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\r\n\t\trepeat_never: \"Niciodată\",\r\n\t\trepeat_daily: \"În fiecare zi\",\r\n\t\trepeat_workdays: \"În fiecare zi lucrătoare\",\r\n\t\trepeat_weekly: \"În fiecare săptămână\",\r\n\t\trepeat_monthly: \"În fiecare lună\",\r\n\t\trepeat_yearly: \"În fiecare an\",\r\n\t\trepeat_custom: \"Personalizat\",\r\n\t\trepeat_freq_day: \"Zi\",\r\n\t\trepeat_freq_week: \"Săptămână\",\r\n\t\trepeat_freq_month: \"Lună\",\r\n\t\trepeat_freq_year: \"An\",\r\n\t\trepeat_on_date: \"La data\",\r\n\t\trepeat_ends: \"Se termină\",\r\n\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Никогда\",\r\n\t\trepeat_daily: \"Каждый день\",\r\n\t\trepeat_workdays: \"Каждый будний день\",\r\n\t\trepeat_weekly: \"Каждую неделю\",\r\n\t\trepeat_monthly: \"Каждый месяц\",\r\n\t\trepeat_yearly: \"Каждый год\",\r\n\t\trepeat_custom: \"Настроить\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Неделя\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"В дату\",\r\n\t\trepeat_ends: \"Заканчивается\",\r\n\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dnevno\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Tedensko\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mesečno\",\r\n\t\trepeat_radio_year: \"Letno\",\r\n\t\trepeat_radio_day_type: \"Vsak\",\r\n\t\trepeat_text_day_count: \"dan\",\r\n\t\trepeat_radio_day_type2: \"Vsak delovni dan\",\r\n\t\trepeat_week: \" Ponavljaj vsak\",\r\n\t\trepeat_text_week_count: \"teden na naslednje dni:\",\r\n\t\trepeat_radio_month_type: \"Ponavljaj\",\r\n\t\trepeat_radio_month_start: \"Na\",\r\n\t\trepeat_text_month_day: \"dan vsak\",\r\n\t\trepeat_text_month_count: \"mesec\",\r\n\t\trepeat_text_month_count2_before: \"vsak\",\r\n\t\trepeat_text_month_count2_after: \"mesec\",\r\n\t\trepeat_year_label: \"Na\",\r\n\t\tselect_year_day2: \"od\",\r\n\t\trepeat_text_year_day: \"dan\",\r\n\t\tselect_year_month: \"mesec\",\r\n\t\trepeat_radio_end: \"Brez končnega datuma\",\r\n\t\trepeat_text_occurences_count: \"pojavitve\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\trepeat_radio_end3: \"Končaj do\",\r\n\r\n\t\trepeat_never: \"Nikoli\",\r\n\t\trepeat_daily: \"Vsak dan\",\r\n\t\trepeat_workdays: \"Vsak delovni dan\",\r\n\t\trepeat_weekly: \"Vsak teden\",\r\n\t\trepeat_monthly: \"Vsak mesec\",\r\n\t\trepeat_yearly: \"Vsako leto\",\r\n\t\trepeat_custom: \"Po meri\",\r\n\t\trepeat_freq_day: \"Dan\",\r\n\t\trepeat_freq_week: \"Teden\",\r\n\t\trepeat_freq_month: \"Mesec\",\r\n\t\trepeat_freq_year: \"Leto\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Konča se\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý deň\",\r\n\t\trepeat_workdays: \"Každý pracovný deň\",\r\n\t\trepeat_weekly: \"Každý týždeň\",\r\n\t\trepeat_monthly: \"Každý mesiac\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastné\",\r\n\t\trepeat_freq_day: \"Deň\",\r\n\t\trepeat_freq_week: \"Týždeň\",\r\n\t\trepeat_freq_month: \"Mesiac\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na dátum\",\r\n\t\trepeat_ends: \"Koniec\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Varje dag\",\r\n\t\trepeat_workdays: \"Varje vardag\",\r\n\t\trepeat_weekly: \"Varje vecka\",\r\n\t\trepeat_monthly: \"Varje månad\",\r\n\t\trepeat_yearly: \"Varje år\",\r\n\t\trepeat_custom: \"Anpassad\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Vecka\",\r\n\t\trepeat_freq_month: \"Månad\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På datum\",\r\n\t\trepeat_ends: \"Slutar\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Günlük\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Haftalık\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Aylık\",\r\n\t\trepeat_radio_year: \"Yıllık\",\r\n\t\trepeat_radio_day_type: \"Her\",\r\n\t\trepeat_text_day_count: \"gün\",\r\n\t\trepeat_radio_day_type2: \"Her iş günü\",\r\n\t\trepeat_week: \" Tekrar her\",\r\n\t\trepeat_text_week_count: \"hafta şu günlerde:\",\r\n\t\trepeat_radio_month_type: \"Tekrar et\",\r\n\t\trepeat_radio_month_start: \"Tarihinde\",\r\n\t\trepeat_text_month_day: \"gün her\",\r\n\t\trepeat_text_month_count: \"ay\",\r\n\t\trepeat_text_month_count2_before: \"her\",\r\n\t\trepeat_text_month_count2_after: \"ay\",\r\n\t\trepeat_year_label: \"Tarihinde\",\r\n\t\tselect_year_day2: \"ayın\",\r\n\t\trepeat_text_year_day: \"günü\",\r\n\t\tselect_year_month: \"ay\",\r\n\t\trepeat_radio_end: \"Bitiş tarihi yok\",\r\n\t\trepeat_text_occurences_count: \"olay\",\r\n\t\trepeat_radio_end2: \"Sonra\",\r\n\t\trepeat_radio_end3: \"Tarihinde bitir\",\r\n\r\n\t\trepeat_never: \"Asla\",\r\n\t\trepeat_daily: \"Her gün\",\r\n\t\trepeat_workdays: \"Her iş günü\",\r\n\t\trepeat_weekly: \"Her hafta\",\r\n\t\trepeat_monthly: \"Her ay\",\r\n\t\trepeat_yearly: \"Her yıl\",\r\n\t\trepeat_custom: \"Özel\",\r\n\t\trepeat_freq_day: \"Gün\",\r\n\t\trepeat_freq_week: \"Hafta\",\r\n\t\trepeat_freq_month: \"Ay\",\r\n\t\trepeat_freq_year: \"Yıl\",\r\n\t\trepeat_on_date: \"Tarihinde\",\r\n\t\trepeat_ends: \"Biter\",\r\n\r\n\t\tmonth_for_recurring: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tday_for_recurring: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ніколи\",\r\n\t\trepeat_daily: \"Щодня\",\r\n\t\trepeat_workdays: \"Щодня в робочі дні\",\r\n\t\trepeat_weekly: \"Щотижня\",\r\n\t\trepeat_monthly: \"Щомісяця\",\r\n\t\trepeat_yearly: \"Щороку\",\r\n\t\trepeat_custom: \"Налаштоване\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Тиждень\",\r\n\t\trepeat_freq_month: \"Місяць\",\r\n\t\trepeat_freq_year: \"Рік\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Закінчується\",\r\n\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\nimport addPlugins from \"./plugins\";\r\nimport stateProvider from \"./core/state\";\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tscheduler.$stateProvider = stateProvider();\r\n\r\n\tscheduler.getState = scheduler.$stateProvider.getState;\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\taddPlugins(scheduler);\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\n\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onMouseDown\", function(classname) {\r\n\t\treturn !(classname == dhx_time_block);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t\tif (!id) return true;\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(id));\r\n\t});\r\n\tscheduler.attachEvent(\"onClick\", function (event_id, native_event_object){\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(event_id));\r\n });\r\n\tscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tbefore = [ev.start_date, ev.end_date];\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\r\n\t\t//lightbox may not have 'time' section\r\n\t\tif(!(data.start_date && data.end_date)){\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tdata.start_date = new Date(ev.start_date);\r\n\t\t\tdata.end_date = new Date(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif(data.rec_type){\r\n\t\t\t//_roll_back_dates modifies start_date of recurring event, need to check limits after modification\r\n\t\t\t// use a copy to keep original event unchanged\r\n\t\t\tvar data_copy = scheduler._lame_clone(data);\r\n\t\t\tscheduler._roll_back_dates(data_copy);\r\n\t\t\treturn scheduler.checkLimitViolation(data_copy);\r\n\t\t}\r\n\t\treturn scheduler.checkLimitViolation(data);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {\r\n\t\t\t//if newly created event is outside of limited time - crop it, leaving only allowed time\r\n\t\t\tif (ev.start_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.start_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn scheduler.checkLimitViolation(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\r\n};\r\nscheduler._temp_limit_scope();\r\n\r\n\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\ndeclare let google: any;\r\n\r\nexport class GoogleMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tprivate infoWindow: any;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tlet zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom;\r\n\t\t\t\t\tif (event.lat && event.lng){\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: event.lat, \r\n\t\t\t\t\t\t\tlng: event.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: this.settings.error_position.lat, \r\n\t\t\t\t\t\t\tlng: this.settings.error_position.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoogle.maps.event.trigger(this._markers[i].marker, 'click');\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tthis.settings = options;\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapOptions = {\r\n\t\t\tcenter: { lat: options.initial_position.lat, lng: options.initial_position.lng },\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tmapId: container.id,\r\n\t\t\tscrollwheel: true,\r\n\t\t\tmapTypeId: options.type\r\n\t\t}\r\n\t\t// we need to reuse the google map to avoid leak memory\r\n\t\tif (this.map === null) {\r\n\t\t\tthis.map = new google.maps.Map(container, mapOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet map = this.map;\r\n\t\t\tcontainer.appendChild(this.map.__gm.messageOverlay);\r\n\t\t\tcontainer.appendChild(this.map.__gm.outerContainer);\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tmap.setOptions({container: container.id});\r\n\t\t\t}, 500);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(this.map, \"dblclick\", function(event) {\r\n\t\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\r\n\t\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\t\tlet point = event.latLng;\r\n\t\t\t\tgeocoder.geocode(\r\n\t\t\t\t\t{ 'latLng': point },\r\n\t\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tgoogle.maps.event.clearInstanceListeners(window);\r\n\t\tgoogle.maps.event.clearInstanceListeners(document);\r\n\t\tgoogle.maps.event.clearInstanceListeners(container);\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\tasync addEventMarker(event: ICalendarEvent): Promise {\r\n\t\tlet config = {\r\n\t\t\ttitle: event.text,\r\n\t\t\tposition: {},\r\n\t\t\tmap: {}\r\n\t\t}\r\n\t\t\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tconfig.position = { lat: event.lat, lng: event.lng };\r\n\t\t} else {\r\n\t\t\tconfig.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }\r\n\t\t}\r\n\t\tconst { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\t\tlet marker;\r\n\t\tif (this.scheduler.ext.mapView.createMarker) {\r\n\t\t\tconfig.map = this.map;\r\n\t\t\tmarker = this.scheduler.ext.mapView.createMarker(config);\r\n\t\t} else {\r\n\t\t\tmarker = new AdvancedMarkerElement(config);\r\n\t\t\tmarker.map = this.map;\r\n\t\t}\r\n\t\tmarker.setMap(this.map);\r\n\t\t//case for markeks which were deleted with DataProcessor\r\n\t\tif (event[\"!nativeeditor_status\"] == \"true_deleted\"){\r\n\t\t\tmarker.setMap(null);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(marker, \"click\", () => {\r\n\t\t\tif (this.infoWindow) {\r\n\t\t\t\tthis.infoWindow.close();\r\n\t\t\t}\r\n\t\t\tthis.infoWindow = new google.maps.InfoWindow({maxWidth: this.settings.info_window_max_width});\r\n\t\t\tthis.infoWindow.setContent(this.scheduler.templates.map_info_content(event));\r\n\t\t\tthis.infoWindow.open({\r\n\t\t\t\tanchor: marker,\r\n\t\t\t\tmap: this.map,\r\n\t\t\t});\r\n\t\t});\r\n\t\tlet markerInfo = {event, ...config, marker};\r\n\t\tthis._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.setVisible(false);\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t\tthis._markers[i].marker.setPosition(null);\r\n\t\t\t\tthis._markers[i].marker = null;\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tthis._markers[i].position.lat = event.lat;\r\n\t\t\t\tthis._markers[i].position.lng = event.lng;\r\n\t\t\t\tthis._markers[i].text = event.text;\r\n\t\t\t\tlet latlng = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t\t\tthis._markers[i].marker.setPosition(latlng);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif (this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setCenter({\r\n\t\t\tlat: latitude, \r\n\t\t\tlng: longitude,\r\n\t\t});\r\n\t\tthis.map.setZoom(zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\tlet position: any = await new Promise((resolve) => {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'address': string },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tresolve({\r\n\t\t\t\t\t\t lat: results[0].geometry.location.lat(),\r\n\t\t\t\t\t\t lng: results[0].geometry.location.lng()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\tresolve({});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\t\treturn position;\r\n\t}\r\n\t\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let L: any\r\n\r\nexport class OpenStreetMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate _markers: any[];\r\n\tprivate settings: IMapSettings;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.openPopup();\r\n\t\t\t\t\tthis._markers[i].marker.closeTooltip();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapWrapper = document.createElement('div');\r\n\t\tmapWrapper.className = 'mapWrapper';\r\n\t\tmapWrapper.id = 'mapWrapper';\r\n\t\tmapWrapper.style.width = container.style.width;\r\n\t\tmapWrapper.style.height = container.style.height;\r\n\t\tcontainer.appendChild(mapWrapper);\r\n\r\n\t\tlet map = L.map(mapWrapper, {\r\n\t\t\tcenter: L.latLng(options.initial_position.lat, options.initial_position.lng),\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tkeyboard: false // need to set false, due to bug with moving window\r\n\t\t});\r\n\t\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);\r\n\t\tmap.on(\"dblclick\", async function(e){\r\n\t\t\tconst settings = {\r\n\t\t\t\t\"method\": \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then(response => response.json());\r\n\t\t\tif (response.address) {\r\n\t\t\t\tlet address = response.address.country;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.latlng.lat,\r\n\t\t\t\t\tlng: e.latlng.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\", response.error);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.map = map;\r\n\t\tthis.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n\t\tconst myIcon = L.icon({\r\n\t\t\ticonUrl: 'https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png',\r\n\t\t\ticonSize: [25, 41],\r\n\t\t\tshadowSize: [30, 65],\r\n\t\t\ticonAnchor: [12, 41],\r\n\t\t\tshadowAnchor: [7, 65]\r\n\t\t});\r\n\t\tlet popupConfig = {\r\n\t\t\tminWidth: 180,\r\n\t\t\tmaxWidth: this.settings.info_window_max_width,\r\n\t\t}\r\n\t\tconst markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event));\r\n\t\tconst tooltip = L.tooltip().setContent(event.text);\r\n\r\n\t\tlet markerConfig = [\r\n\t\t\tevent.lat,\r\n\t\t\tevent.lng\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tmarkerConfig = [this.settings.error_position.lat, this.settings.error_position.lng];\r\n\t\t}\r\n\t\tconst marker = L.marker(markerConfig, {\r\n\t\t\ticon: myIcon\r\n\t\t}).bindPopup(markerPopup).bindTooltip(tooltip).addTo(this.map);\r\n\t\tconst markerInfo = {event, marker};\r\n\t\tthis._markers.push(markerInfo);\t\t\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker);\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([event.lat, event.lng]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif(this._markers) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker); \r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setView([latitude, longitude], zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst settings = {\r\n\t\t\t\"method\": \"GET\",\r\n\t\t\theaders: {\r\n\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t},\r\n\t\t};\r\n\t\tlet position:any = {};\r\n\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then(response => response.json());\r\n\t\tif (response && response.length) {\r\n\t\t\tposition.lat = +response[0].lat;\r\n\t\t\tposition.lng = +response[0].lon;\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let mapboxgl: any;\r\ndeclare let MapboxGeocoder: any;\r\n\r\nexport class MapboxAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n const popup = this._markers[i].marker.getPopup();\r\n if (popup.isOpen()){\r\n popup.remove();\r\n }\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.togglePopup();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n let scheduler = this.scheduler;\r\n\r\n\t\tmapboxgl.accessToken = options.accessToken;\r\n const map = new mapboxgl.Map({\r\n container: container, \r\n center: [options.initial_position.lng, options.initial_position.lat], \r\n zoom: options.initial_zoom + 1, // problems with coordinates if zoom = 1\r\n });\r\n map.on(\"dblclick\",async function(e){\r\n\t\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${ e.lngLat.lat}.json?access_token=${options.accessToken}`).then(response => response.json());\r\n\t\t\tif (response.features){\r\n\t\t\t\tlet address = response.features[0].place_name;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.lngLat.lat,\r\n\t\t\t\t\tlng: e.lngLat.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\");\r\n\t\t\t}\r\n\t\t});\r\n this.map = map;\r\n this.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n while (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n container.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n let config = [\r\n\t\t\tevent.lng,\r\n\t\t\tevent.lat\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tconfig = [this.settings.error_position.lng, this.settings.error_position.lat];\r\n\t\t} \r\n\r\n\t\tconst popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false})\r\n .setMaxWidth(`${this.settings.info_window_max_width}px`) \r\n .setHTML(this.scheduler.templates.map_info_content(event));\r\n const marker = new mapboxgl.Marker()\r\n .setLngLat(config)\r\n .setPopup(popup)\r\n .addTo(this.map);\r\n const markerInfo = {event, marker}; \r\n this._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.remove();\r\n this._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([event.lng, event.lat]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tfor (let i = 0; i {\r\n\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then(response => response.json());\r\n\t\tlet position:any = {};\r\n\t\tif (response && response.features.length) {\r\n\t\t\tposition.lng = response.features[0].center[0];\r\n\t\t\tposition.lat = response.features[0].center[1];\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { GoogleMapAdapter } from \"./gMapAdapter\";\r\nimport { OpenStreetMapAdapter } from \"./osmMapAdapter\";\r\nimport { MapboxAdapter } from \"./mapboxAdapter\";\r\nimport { IMapAdapter, ICalendarEvent, IMapSettings } from \"./types\";\r\n\r\ndeclare let google: any;\r\n\r\nexport default function(scheduler: any){\r\n\t\r\nlet mapAdapter: IMapAdapter | null = null;\r\nlet eventHandlerIds: number[] = [];\r\nconst adapters: { [name:string]: IMapAdapter } = {\r\n\tgoogleMap: new GoogleMapAdapter(scheduler),\r\n\topenStreetMaps: new OpenStreetMapAdapter(scheduler),\r\n\tmapbox: new MapboxAdapter(scheduler)\r\n}\r\n\r\nif(!scheduler.ext){\r\n\tscheduler.ext = {};\r\n}\r\nscheduler.ext.mapView = {\r\n\tcreateAdapter: function():IMapAdapter{\r\n\t\treturn adapters[scheduler.config.map_view_provider];\r\n\t},\r\n\tcreateMarker: function(config){\r\n\t\treturn new google.maps.Marker(config);\r\n\t},\r\n\tcurrentAdapter: null,\r\n\tadapters\r\n};\r\nscheduler._latLngUpdate = false; // flag for updating events which don't have event.lat and event.lng\r\nscheduler._eventLocationChanged = false; // flag for checking if the location of the event is changed\r\nscheduler.config.map_view_provider = \"googleMap\";\r\nscheduler.config.map_settings = {\r\n\tinitial_position: {\r\n\t lat: 48.724,\r\n\t lng: 8.215\r\n\t},\r\n\terror_position: {\r\n\t lat: 15,\r\n\t lng: 15\r\n\t},\r\n\tinitial_zoom: 1,\r\n\tzoom_after_resolve: 15,\r\n\tinfo_window_max_width: 300,\r\n\tresolve_user_location: true,\r\n\tresolve_event_location: true,\r\n\tview_provider: \"googleMap\"\r\n}\r\nif (scheduler.config.map_initial_position) {\r\n\tscheduler.config.map_settings.initial_position = {\r\n\t\tlat: scheduler.config.map_initial_position.lat(),\r\n\t\tlng: scheduler.config.map_initial_position.lng(), \r\n\t};\r\n}\r\n\r\nif (scheduler.config.map_error_position) {\r\n\tscheduler.config.map_settings.error_position = {\r\n\t\tlat: scheduler.config.map_error_position.lat(),\r\n\t\tlng: scheduler.config.map_error_position.lng(), \r\n\t};\r\n}\r\n\r\nscheduler.xy.map_date_width = 188; // date column width\r\nscheduler.xy.map_icon_width = 25; // event details icon width\r\nscheduler.xy.map_description_width = 400; // description column width\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\nscheduler.templates.map_info_content = function(event){\r\n return `
Event's text: ${event.text}\r\n\t\t\t\t
Location: ${event.event_location}
\r\n\t\t\t\t
Starts: ${scheduler.templates.tooltip_date_format(event.start_date)}
\r\n\t\t\t\t
Ends: ${scheduler.templates.tooltip_date_format(event.end_date)}
\r\n\t\t\t
`;\r\n};\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\n\r\nfunction setupMapView(scheduler) {\r\n\t// Initialization logic, possibly including creation of a new mapAdapter\r\n\tmapAdapter = scheduler.ext.mapView.createAdapter();\r\n\tattachSchedulerEvents();\r\n}\r\nasync function addEventWithLocation(event: ICalendarEvent, mapAdapter: IMapAdapter){\r\n\tlet coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\tevent.lat = coordinates.lat;\r\n\tevent.lng = coordinates.lng;\r\n\tmapAdapter.removeEventMarker(String(event.id));\r\n\tmapAdapter.addEventMarker(event);\r\n\treturn event;\r\n}\r\nfunction setUserLocation(options: IMapSettings, adapter: IMapAdapter): void{\r\n\tif (options.resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\tadapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tadapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom);\r\n\t}\r\n}\r\nscheduler.dblclick_dhx_map_area = function(e) {\r\n\tlet eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\tif (eventNode){\r\n\t\tlet eventId = eventNode.getAttribute(`${scheduler.config.event_attribute}`);\r\n\t\tscheduler.showLightbox(eventId);\r\n\t}\r\n\tif (!this.config.readonly && this.config.dblclick_create && !eventNode) {\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler.config.map_start,\r\n\t\t\tend_date: scheduler.date.add( scheduler.config.map_start, scheduler.config.time_step, \"minute\"),\r\n\t\t});\r\n\t}\t\r\n};\r\n\r\nfunction attachSchedulerEvents() { \r\n eventHandlerIds.push(\r\n\tscheduler.attachEvent(\"onEventSave\",function(id,ev,is_new){\r\n\t\tlet unmodifiedEvent = scheduler.getEvent(id);\r\n\t\tif (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) {\r\n\t\t\tscheduler._eventLocationChanged = true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}),\r\n scheduler.attachEvent(\"onEventChanged\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !scheduler._latLngUpdate ) {\r\n\t\t\t\t \taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.updateEventMarker(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._latLngUpdate = false;\r\n\t\treturn true;\r\n }),\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_id,new_id){\r\n\t\tlet newIdEvent = scheduler.getEvent(new_id);\r\n\t\tmapAdapter?.removeEventMarker(old_id);\r\n\t\tmapAdapter?.addEventMarker(newIdEvent);\r\n\t}),\r\n scheduler.attachEvent(\"onEventAdded\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n \t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && scheduler._eventLocationChanged) {\r\n\t\t\t\t\taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t\tscheduler._eventLocationChanged = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.addEventMarker(event);\r\n\t\t\t\t\tmapAdapter.onEventClick(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }),\r\n scheduler.attachEvent(\"onClick\", function (id, e){\r\n\t\tconst event = scheduler.getEvent(id);\r\n\t\tif (mapAdapter && event) mapAdapter.onEventClick(event);\r\n\t\treturn false;\r\n }),\r\n scheduler.attachEvent(\"onBeforeEventDelete\", (id, event) => {\r\n\t\tif (mapAdapter) {\r\n\t\t\tmapAdapter.removeEventMarker(id);\r\n\t\t}\r\n\t\treturn true;\r\n })\r\n );\r\n}\r\nfunction detachSchedulerEvents() {\r\n\teventHandlerIds.forEach(id => scheduler.detachEvent(id));\r\n\teventHandlerIds = [];\r\n}\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\r\n\tif(scheduler.config.map_initial_zoom !== undefined){\r\n\t\tscheduler.config.map_settings.initial_zoom = scheduler.config.map_initial_zoom;\r\n\t}\r\n\tif(scheduler.config.map_zoom_after_resolve !== undefined){\r\n\t\tscheduler.config.map_settings.zoom_after_resolve = scheduler.config.map_zoom_after_resolve;\r\n\t}\r\n\tif(scheduler.config.map_infowindow_max_width !== undefined){\r\n\t\tscheduler.config.map_settings.info_window_max_width = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\tif(scheduler.config.map_resolve_user_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_user_location = scheduler.config.map_resolve_user_location;\r\n\t}\r\n\tif(scheduler.config.map_view_provider !== undefined){\r\n\t\tscheduler.config.map_settings.view_provider = scheduler.config.map_view_provider;\r\n\t}\r\n\tif(scheduler.config.map_type !== undefined){\r\n\t\tscheduler.config.map_settings.type = scheduler.config.map_type;\r\n\t}\r\n\tif(scheduler.config.map_resolve_event_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_event_location = scheduler.config.map_resolve_event_location;\r\n\t}\r\n\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\r\n\tlet map = document.createElement('div');\r\n\tmap.className = 'mapContainer';\r\n\tmap.id = 'mapContainer';\r\n\tmap.style.display = \"none\";\r\n\tmap.style.zIndex = \"1\";\r\n\tscheduler._obj.appendChild(map);\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tlet events = scheduler.get_visible_events();\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tmapAdapter.clearEventMarkers();\r\n\t\t\t\tevents.forEach((event) => mapAdapter?.addEventMarker(event));\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\t\tlet mapContainer = document.getElementById('mapContainer');\r\n\t\t_setMapSize('mapContainer');\r\n\r\n\t\t// creating the new logic\r\n\t\tif (mode && mapContainer) {\r\n\t\t\tmap.style.display = 'block';\r\n\t\t\tfill_map_tab();\r\n\t\t\t// case to display several maps and has the opportunity to switch between them\r\n\t\t\tif (scheduler.config.map_view_provider == scheduler.ext.mapView.currentAdapter) {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t} else {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t \tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t\t}\r\n\t\t\tif(mapAdapter) {\r\n\t\t\t\tsetUserLocation(scheduler.config.map_settings, mapAdapter);\r\n\t\t\t}\t\r\n\t\t} else {\r\n\t\t\tmap.style.display = 'none';\r\n\t\t\tscheduler._els.dhx_cal_data[0].style.width = \"100%\";\r\n\t\t \tif (mapAdapter && mapContainer ) {\r\n\t\t\t\tmapAdapter.destroy(mapContainer);\r\n\t\t\t\tmapAdapter = null;\r\n\t\t\t\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t }\r\n\t\t \tdetachSchedulerEvents();\r\n\t\t}\r\n\t};\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tlet map = document.getElementById(elem_id);\r\n\t\tif (map) {\r\n\t\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\t\tlet height = scheduler.$container.querySelector(\".dhx_cal_data\").offsetHeight + scheduler.$container.querySelector(\".dhx_cal_header\").offsetHeight;\r\n\t\t\tif (height < 0)\r\n\t\t\t\theight = 0;\r\n\t\t\tlet width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\t\tif (width < 0)\r\n\t\t\t\twidth = 0;\r\n\t\t\tmap.style.height = height + 'px';\r\n\t\t\tmap.style.width = width + 'px';\r\n\t\t\tmap.style.position = \"absolute\";\r\n\t\t\tmap.style.top = nav_height + \"px\";\r\n\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t} else {\r\n\t\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t}\r\n\t\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t\t}\r\n\t}\t\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tlet events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tlet ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tlet html = \"
\";\r\n\t\tfor (let i = 0; i < events.length; i++) {\r\n\t\t\tlet ev = events[i];\r\n\t\t\tlet event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tlet bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tlet color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tlet ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tlet ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tlet dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (let i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tconst l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\t\r\n\tscheduler.attachEvent(\"onLocationError\", function (id){\r\n\t\talert(\"Location can't be found\");\r\n\t\treturn google.maps.LatLng(51.477840, -0.001492); \r\n\t\t//the coordinates of the Greenwich Royal Observatory\r\n\t})\r\n\tlet _updateEventLocation = async function(event) {\r\n\t\tif (mapAdapter){\r\n\t\t\tconst coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\t\t\tif (coordinates.lat && coordinates.lng) {\r\n\t\t\t\tevent.lat = +coordinates.lat;\r\n\t\t\t\tevent.lng = +coordinates.lng;\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\tevent.lng = scheduler.config.map_settings.error_position.lng;\r\n\t\t\t\tevent.lat = scheduler.config.map_settings.error_position.lat;\r\n\t\t\t}\r\n\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t}\r\n\t};\r\n\tlet _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tevent.lat = +event.lat;\r\n\t\t\tevent.lng = +event.lng;\r\n\t\t}\r\n\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n})\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\n\r\n\r\nlet clickedElementPosition = null;\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tconst container = scheduler.$container;\r\n\tif(container._$quickInfoHandler){\r\n\t\treturn;\r\n\t}else{\r\n\t\tcontainer._$quickInfoHandler = true;\r\n\t\t// store coordinates of clicked segment of an event\r\n\t\t// in case multi section events or multi-line month events\r\n\t\tscheduler.event(container, \"mousedown\", function(e){\r\n\t\t\tconst eventElement = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\t\t\tif (eventElement) {\r\n\t\t\t\tclickedElementPosition = {\r\n\t\t\t\t\tid: eventElement.getAttribute(scheduler.config.event_attribute),\r\n\t\t\t\t\tposition: getPositionInsideScheduler(eventElement)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.attachEvent(\"onDestroy\", () => {\r\n\t\t\tdelete container._$quickInfoHandler;\r\n\t\t});\r\n\t}\r\n});\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n\r\n\tqi.ontransitionend = () => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t\tqi.ontransitionend = null;\r\n\t};\r\n\tsetTimeout(() => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t}, 1);\r\n};\r\n\r\nfunction fitQIInsideWindow(quickInfoPopup){\r\n\tconst popupRect = quickInfoPopup.getBoundingClientRect();\r\n\tconst containerRect = scheduler.$container.getBoundingClientRect();\r\n\r\n\t// calculate the bottom offset of the Quick Info relative to the scheduler container\r\n\tconst offsetBottom = containerRect.bottom - popupRect.bottom;\r\n\r\n\t// If the popup extends outside the scheduler container, adjust its top position\r\n\tif (offsetBottom < 0) {\r\n\t\tquickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`;\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\n\r\nfunction getPositionInsideScheduler(element){\r\n\tlet left = 0;\r\n\tlet top = 0;\r\n\r\n\tlet node = element;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tlet dx = (left + element.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tlet dy = (top + element.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:element.offsetWidth, height:element.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\treturn getPositionInsideScheduler(domEv);\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","// =============================================================================\n// Weekday\n// =============================================================================\nexport var ALL_WEEKDAYS = [\n 'MO',\n 'TU',\n 'WE',\n 'TH',\n 'FR',\n 'SA',\n 'SU',\n];\nvar Weekday = /** @class */ (function () {\n function Weekday(weekday, n) {\n if (n === 0)\n throw new Error(\"Can't create weekday with n == 0\");\n this.weekday = weekday;\n this.n = n;\n }\n Weekday.fromStr = function (str) {\n return new Weekday(ALL_WEEKDAYS.indexOf(str));\n };\n // __call__ - Cannot call the object directly, do it through\n // e.g. RRule.TH.nth(-1) instead,\n Weekday.prototype.nth = function (n) {\n return this.n === n ? this : new Weekday(this.weekday, n);\n };\n // __eq__\n Weekday.prototype.equals = function (other) {\n return this.weekday === other.weekday && this.n === other.n;\n };\n // __repr__\n Weekday.prototype.toString = function () {\n var s = ALL_WEEKDAYS[this.weekday];\n if (this.n)\n s = (this.n > 0 ? '+' : '') + String(this.n) + s;\n return s;\n };\n Weekday.prototype.getJsWeekday = function () {\n return this.weekday === 6 ? 0 : this.weekday + 1;\n };\n return Weekday;\n}());\nexport { Weekday };\n//# sourceMappingURL=weekday.js.map","// =============================================================================\n// Helper functions\n// =============================================================================\nimport { ALL_WEEKDAYS } from './weekday';\nexport var isPresent = function (value) {\n return value !== null && value !== undefined;\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isWeekdayStr = function (value) {\n return typeof value === 'string' && ALL_WEEKDAYS.includes(value);\n};\nexport var isArray = Array.isArray;\n/**\n * Simplified version of python's range()\n */\nexport var range = function (start, end) {\n if (end === void 0) { end = start; }\n if (arguments.length === 1) {\n end = start;\n start = 0;\n }\n var rang = [];\n for (var i = start; i < end; i++)\n rang.push(i);\n return rang;\n};\nexport var clone = function (array) {\n return [].concat(array);\n};\nexport var repeat = function (value, times) {\n var i = 0;\n var array = [];\n if (isArray(value)) {\n for (; i < times; i++)\n array[i] = [].concat(value);\n }\n else {\n for (; i < times; i++)\n array[i] = value;\n }\n return array;\n};\nexport var toArray = function (item) {\n if (isArray(item)) {\n return item;\n }\n return [item];\n};\nexport function padStart(item, targetLength, padString) {\n if (padString === void 0) { padString = ' '; }\n var str = String(item);\n targetLength = targetLength >> 0;\n if (str.length > targetLength) {\n return String(str);\n }\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += repeat(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(str);\n}\n/**\n * Python like split\n */\nexport var split = function (str, sep, num) {\n var splits = str.split(sep);\n return num\n ? splits.slice(0, num).concat([splits.slice(num).join(sep)])\n : splits;\n};\n/**\n * closure/goog/math/math.js:modulo\n * Copyright 2006 The Closure Library Authors.\n * The % operator in JavaScript returns the remainder of a / b, but differs from\n * some other languages in that the result will have the same sign as the\n * dividend. For example, -1 % 8 == -1, whereas in some other languages\n * (such as Python) the result would be 7. This function emulates the more\n * correct modulo behavior, which is useful for certain applications such as\n * calculating an offset index in a circular list.\n *\n * @param {number} a The dividend.\n * @param {number} b The divisor.\n * @return {number} a % b where the result is between 0 and b (either 0 <= x < b\n * or b < x <= 0, depending on the sign of b).\n */\nexport var pymod = function (a, b) {\n var r = a % b;\n // If r and b differ in sign, add b to wrap the result to the correct sign.\n return r * b < 0 ? r + b : r;\n};\n/**\n * @see: \n */\nexport var divmod = function (a, b) {\n return { div: Math.floor(a / b), mod: pymod(a, b) };\n};\nexport var empty = function (obj) {\n return !isPresent(obj) || obj.length === 0;\n};\n/**\n * Python-like boolean\n *\n * @return {Boolean} value of an object/primitive, taking into account\n * the fact that in Python an empty list's/tuple's\n * boolean value is False, whereas in JS it's true\n */\nexport var notEmpty = function (obj) {\n return !empty(obj);\n};\n/**\n * Return true if a value is in an array\n */\nexport var includes = function (arr, val) {\n return notEmpty(arr) && arr.indexOf(val) !== -1;\n};\n//# sourceMappingURL=helpers.js.map","import { padStart } from './helpers';\nexport var datetime = function (y, m, d, h, i, s) {\n if (h === void 0) { h = 0; }\n if (i === void 0) { i = 0; }\n if (s === void 0) { s = 0; }\n return new Date(Date.UTC(y, m - 1, d, h, i, s));\n};\n/**\n * General date-related utilities.\n * Also handles several incompatibilities between JavaScript and Python\n *\n */\nexport var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/**\n * Number of milliseconds of one day\n */\nexport var ONE_DAY = 1000 * 60 * 60 * 24;\n/**\n * @see: \n */\nexport var MAXYEAR = 9999;\n/**\n * Python uses 1-Jan-1 as the base for calculating ordinals but we don't\n * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,\n * therefore we use 1-Jan-1970 instead\n */\nexport var ORDINAL_BASE = datetime(1970, 1, 1);\n/**\n * Python: MO-SU: 0 - 6\n * JS: SU-SAT 0 - 6\n */\nexport var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];\n/**\n * py_date.timetuple()[7]\n */\nexport var getYearDay = function (date) {\n var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /\n ONE_DAY) + 1);\n};\nexport var isLeapYear = function (year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n};\nexport var isDate = function (value) {\n return value instanceof Date;\n};\nexport var isValidDate = function (value) {\n return isDate(value) && !isNaN(value.getTime());\n};\n/**\n * @return {Number} the date's timezone offset in ms\n */\nexport var tzOffset = function (date) {\n return date.getTimezoneOffset() * 60 * 1000;\n};\n/**\n * @see: \n */\nexport var daysBetween = function (date1, date2) {\n // The number of milliseconds in one day\n // Convert both dates to milliseconds\n var date1ms = date1.getTime();\n var date2ms = date2.getTime();\n // Calculate the difference in milliseconds\n var differencems = date1ms - date2ms;\n // Convert back to days and return\n return Math.round(differencems / ONE_DAY);\n};\n/**\n * @see: \n */\nexport var toOrdinal = function (date) {\n return daysBetween(date, ORDINAL_BASE);\n};\n/**\n * @see - \n */\nexport var fromOrdinal = function (ordinal) {\n return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);\n};\nexport var getMonthDays = function (date) {\n var month = date.getUTCMonth();\n return month === 1 && isLeapYear(date.getUTCFullYear())\n ? 29\n : MONTH_DAYS[month];\n};\n/**\n * @return {Number} python-like weekday\n */\nexport var getWeekday = function (date) {\n return PY_WEEKDAYS[date.getUTCDay()];\n};\n/**\n * @see: \n */\nexport var monthRange = function (year, month) {\n var date = datetime(year, month + 1, 1);\n return [getWeekday(date), getMonthDays(date)];\n};\n/**\n * @see: \n */\nexport var combine = function (date, time) {\n time = time || date;\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));\n};\nexport var clone = function (date) {\n var dolly = new Date(date.getTime());\n return dolly;\n};\nexport var cloneDates = function (dates) {\n var clones = [];\n for (var i = 0; i < dates.length; i++) {\n clones.push(clone(dates[i]));\n }\n return clones;\n};\n/**\n * Sorts an array of Date or Time objects\n */\nexport var sort = function (dates) {\n dates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n};\nexport var timeToUntilString = function (time, utc) {\n if (utc === void 0) { utc = true; }\n var date = new Date(time);\n return [\n padStart(date.getUTCFullYear().toString(), 4, '0'),\n padStart(date.getUTCMonth() + 1, 2, '0'),\n padStart(date.getUTCDate(), 2, '0'),\n 'T',\n padStart(date.getUTCHours(), 2, '0'),\n padStart(date.getUTCMinutes(), 2, '0'),\n padStart(date.getUTCSeconds(), 2, '0'),\n utc ? 'Z' : '',\n ].join('');\n};\nexport var untilStringToDate = function (until) {\n var re = /^(\\d{4})(\\d{2})(\\d{2})(T(\\d{2})(\\d{2})(\\d{2})Z?)?$/;\n var bits = re.exec(until);\n if (!bits)\n throw new Error(\"Invalid UNTIL value: \".concat(until));\n return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));\n};\nvar dateTZtoISO8601 = function (date, timeZone) {\n // date format for sv-SE is almost ISO8601\n var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });\n // '2023-02-07 10:41:36'\n return dateStr.replace(' ', 'T') + 'Z';\n};\nexport var dateInTimeZone = function (date, timeZone) {\n var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // Date constructor can only reliably parse dates in ISO8601 format\n var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));\n var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));\n var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();\n return new Date(date.getTime() - tzOffset);\n};\n//# sourceMappingURL=dateutil.js.map","/**\n * This class helps us to emulate python's generators, sorta.\n */\nvar IterResult = /** @class */ (function () {\n function IterResult(method, args) {\n this.minDate = null;\n this.maxDate = null;\n this._result = [];\n this.total = 0;\n this.method = method;\n this.args = args;\n if (method === 'between') {\n this.maxDate = args.inc\n ? args.before\n : new Date(args.before.getTime() - 1);\n this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1);\n }\n else if (method === 'before') {\n this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1);\n }\n else if (method === 'after') {\n this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1);\n }\n }\n /**\n * Possibly adds a date into the result.\n *\n * @param {Date} date - the date isn't necessarly added to the result\n * list (if it is too late/too early)\n * @return {Boolean} true if it makes sense to continue the iteration\n * false if we're done.\n */\n IterResult.prototype.accept = function (date) {\n ++this.total;\n var tooEarly = this.minDate && date < this.minDate;\n var tooLate = this.maxDate && date > this.maxDate;\n if (this.method === 'between') {\n if (tooEarly)\n return true;\n if (tooLate)\n return false;\n }\n else if (this.method === 'before') {\n if (tooLate)\n return false;\n }\n else if (this.method === 'after') {\n if (tooEarly)\n return true;\n this.add(date);\n return false;\n }\n return this.add(date);\n };\n /**\n *\n * @param {Date} date that is part of the result.\n * @return {Boolean} whether we are interested in more values.\n */\n IterResult.prototype.add = function (date) {\n this._result.push(date);\n return true;\n };\n /**\n * 'before' and 'after' return only one date, whereas 'all'\n * and 'between' an array.\n *\n * @return {Date,Array?}\n */\n IterResult.prototype.getValue = function () {\n var res = this._result;\n switch (this.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n case 'after':\n default:\n return (res.length ? res[res.length - 1] : null);\n }\n };\n IterResult.prototype.clone = function () {\n return new IterResult(this.method, this.args);\n };\n return IterResult;\n}());\nexport default IterResult;\n//# sourceMappingURL=iterresult.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nimport IterResult from './iterresult';\n/**\n * IterResult subclass that calls a callback function on each add,\n * and stops iterating when the callback returns false.\n */\nvar CallbackIterResult = /** @class */ (function (_super) {\n __extends(CallbackIterResult, _super);\n function CallbackIterResult(method, args, iterator) {\n var _this = _super.call(this, method, args) || this;\n _this.iterator = iterator;\n return _this;\n }\n CallbackIterResult.prototype.add = function (date) {\n if (this.iterator(date, this._result.length)) {\n this._result.push(date);\n return true;\n }\n return false;\n };\n return CallbackIterResult;\n}(IterResult));\nexport default CallbackIterResult;\n//# sourceMappingURL=callbackiterresult.js.map","// =============================================================================\n// i18n\n// =============================================================================\nvar ENGLISH = {\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ],\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n tokens: {\n SKIP: /^[ \\r\\n\\t]+|^\\.$/,\n number: /^[1-9][0-9]*/,\n numberAsText: /^(one|two|three)/i,\n every: /^every/i,\n 'day(s)': /^days?/i,\n 'weekday(s)': /^weekdays?/i,\n 'week(s)': /^weeks?/i,\n 'hour(s)': /^hours?/i,\n 'minute(s)': /^minutes?/i,\n 'month(s)': /^months?/i,\n 'year(s)': /^years?/i,\n on: /^(on|in)/i,\n at: /^(at)/i,\n the: /^the/i,\n first: /^first/i,\n second: /^second/i,\n third: /^third/i,\n nth: /^([1-9][0-9]*)(\\.|th|nd|rd|st)/i,\n last: /^last/i,\n for: /^for/i,\n 'time(s)': /^times?/i,\n until: /^(un)?til/i,\n monday: /^mo(n(day)?)?/i,\n tuesday: /^tu(e(s(day)?)?)?/i,\n wednesday: /^we(d(n(esday)?)?)?/i,\n thursday: /^th(u(r(sday)?)?)?/i,\n friday: /^fr(i(day)?)?/i,\n saturday: /^sa(t(urday)?)?/i,\n sunday: /^su(n(day)?)?/i,\n january: /^jan(uary)?/i,\n february: /^feb(ruary)?/i,\n march: /^mar(ch)?/i,\n april: /^apr(il)?/i,\n may: /^may/i,\n june: /^june?/i,\n july: /^july?/i,\n august: /^aug(ust)?/i,\n september: /^sep(t(ember)?)?/i,\n october: /^oct(ober)?/i,\n november: /^nov(ember)?/i,\n december: /^dec(ember)?/i,\n comma: /^(,\\s*|(and|or)\\s*)+/i,\n },\n};\nexport default ENGLISH;\n//# sourceMappingURL=i18n.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\nimport { isArray, isNumber, isPresent } from '../helpers';\n// =============================================================================\n// Helper functions\n// =============================================================================\n/**\n * Return true if a value is in an array\n */\nvar contains = function (arr, val) {\n return arr.indexOf(val) !== -1;\n};\nvar defaultGetText = function (id) { return id.toString(); };\nvar defaultDateFormatter = function (year, month, day) { return \"\".concat(month, \" \").concat(day, \", \").concat(year); };\n/**\n *\n * @param {RRule} rrule\n * Optional:\n * @param {Function} gettext function\n * @param {Object} language definition\n * @constructor\n */\nvar ToText = /** @class */ (function () {\n function ToText(rrule, gettext, language, dateFormatter) {\n if (gettext === void 0) { gettext = defaultGetText; }\n if (language === void 0) { language = ENGLISH; }\n if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; }\n this.text = [];\n this.language = language || ENGLISH;\n this.gettext = gettext;\n this.dateFormatter = dateFormatter;\n this.rrule = rrule;\n this.options = rrule.options;\n this.origOptions = rrule.origOptions;\n if (this.origOptions.bymonthday) {\n var bymonthday = [].concat(this.options.bymonthday);\n var bynmonthday = [].concat(this.options.bynmonthday);\n bymonthday.sort(function (a, b) { return a - b; });\n bynmonthday.sort(function (a, b) { return b - a; });\n // 1, 2, 3, .., -5, -4, -3, ..\n this.bymonthday = bymonthday.concat(bynmonthday);\n if (!this.bymonthday.length)\n this.bymonthday = null;\n }\n if (isPresent(this.origOptions.byweekday)) {\n var byweekday = !isArray(this.origOptions.byweekday)\n ? [this.origOptions.byweekday]\n : this.origOptions.byweekday;\n var days = String(byweekday);\n this.byweekday = {\n allWeeks: byweekday.filter(function (weekday) {\n return !weekday.n;\n }),\n someWeeks: byweekday.filter(function (weekday) {\n return Boolean(weekday.n);\n }),\n isWeekdays: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') === -1 &&\n days.indexOf('SU') === -1,\n isEveryDay: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') !== -1 &&\n days.indexOf('SU') !== -1,\n };\n var sortWeekDays = function (a, b) {\n return a.weekday - b.weekday;\n };\n this.byweekday.allWeeks.sort(sortWeekDays);\n this.byweekday.someWeeks.sort(sortWeekDays);\n if (!this.byweekday.allWeeks.length)\n this.byweekday.allWeeks = null;\n if (!this.byweekday.someWeeks.length)\n this.byweekday.someWeeks = null;\n }\n else {\n this.byweekday = null;\n }\n }\n /**\n * Test whether the rrule can be fully converted to text.\n *\n * @param {RRule} rrule\n * @return {Boolean}\n */\n ToText.isFullyConvertible = function (rrule) {\n var canConvert = true;\n if (!(rrule.options.freq in ToText.IMPLEMENTED))\n return false;\n if (rrule.origOptions.until && rrule.origOptions.count)\n return false;\n for (var key in rrule.origOptions) {\n if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))\n return true;\n if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))\n return false;\n }\n return canConvert;\n };\n ToText.prototype.isFullyConvertible = function () {\n return ToText.isFullyConvertible(this.rrule);\n };\n /**\n * Perform the conversion. Only some of the frequencies are supported.\n * If some of the rrule's options aren't supported, they'll\n * be omitted from the output an \"(~ approximate)\" will be appended.\n *\n * @return {*}\n */\n ToText.prototype.toString = function () {\n var gettext = this.gettext;\n if (!(this.options.freq in ToText.IMPLEMENTED)) {\n return gettext('RRule error: Unable to fully convert this rrule to text');\n }\n this.text = [gettext('every')];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[RRule.FREQUENCIES[this.options.freq]]();\n if (this.options.until) {\n this.add(gettext('until'));\n var until = this.options.until;\n this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate()));\n }\n else if (this.options.count) {\n this.add(gettext('for'))\n .add(this.options.count.toString())\n .add(this.plural(this.options.count) ? gettext('times') : gettext('time'));\n }\n if (!this.isFullyConvertible())\n this.add(gettext('(~ approximate)'));\n return this.text.join('');\n };\n ToText.prototype.HOURLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour'));\n };\n ToText.prototype.MINUTELY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval)\n ? gettext('minutes')\n : gettext('minute'));\n };\n ToText.prototype.DAILY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n else if (this.origOptions.byhour) {\n this._byhour();\n }\n };\n ToText.prototype.WEEKLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week'));\n }\n if (this.byweekday && this.byweekday.isWeekdays) {\n if (this.options.interval === 1) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n }\n else if (this.byweekday && this.byweekday.isEveryDay) {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n else {\n if (this.options.interval === 1)\n this.add(gettext('week'));\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.origOptions.byhour) {\n this._byhour();\n }\n }\n };\n ToText.prototype.MONTHLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(gettext('months'));\n if (this.plural(this.options.interval))\n this.add(gettext('in'));\n }\n else {\n // this.add(gettext('MONTH'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval)\n ? gettext('months')\n : gettext('month'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n };\n ToText.prototype.YEARLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n this.add(gettext('years'));\n }\n else {\n // this.add(gettext('YEAR'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.options.byyearday) {\n this.add(gettext('on the'))\n .add(this.list(this.options.byyearday, this.nth, gettext('and')))\n .add(gettext('day'));\n }\n if (this.options.byweekno) {\n this.add(gettext('in'))\n .add(this.plural(this.options.byweekno.length)\n ? gettext('weeks')\n : gettext('week'))\n .add(this.list(this.options.byweekno, undefined, gettext('and')));\n }\n };\n ToText.prototype._bymonthday = function () {\n var gettext = this.gettext;\n if (this.byweekday && this.byweekday.allWeeks) {\n this.add(gettext('on'))\n .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')))\n .add(gettext('the'))\n .add(this.list(this.bymonthday, this.nth, gettext('or')));\n }\n else {\n this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and')));\n }\n // this.add(gettext('DAY'))\n };\n ToText.prototype._byweekday = function () {\n var gettext = this.gettext;\n if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext));\n }\n if (this.byweekday.someWeeks) {\n if (this.byweekday.allWeeks)\n this.add(gettext('and'));\n this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and')));\n }\n };\n ToText.prototype._byhour = function () {\n var gettext = this.gettext;\n this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and')));\n };\n ToText.prototype._bymonth = function () {\n this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and')));\n };\n ToText.prototype.nth = function (n) {\n n = parseInt(n.toString(), 10);\n var nth;\n var gettext = this.gettext;\n if (n === -1)\n return gettext('last');\n var npos = Math.abs(n);\n switch (npos) {\n case 1:\n case 21:\n case 31:\n nth = npos + gettext('st');\n break;\n case 2:\n case 22:\n nth = npos + gettext('nd');\n break;\n case 3:\n case 23:\n nth = npos + gettext('rd');\n break;\n default:\n nth = npos + gettext('th');\n }\n return n < 0 ? nth + ' ' + gettext('last') : nth;\n };\n ToText.prototype.monthtext = function (m) {\n return this.language.monthNames[m - 1];\n };\n ToText.prototype.weekdaytext = function (wday) {\n var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday();\n return ((wday.n ? this.nth(wday.n) + ' ' : '') +\n this.language.dayNames[weekday]);\n };\n ToText.prototype.plural = function (n) {\n return n % 100 !== 1;\n };\n ToText.prototype.add = function (s) {\n this.text.push(' ');\n this.text.push(s);\n return this;\n };\n ToText.prototype.list = function (arr, callback, finalDelim, delim) {\n var _this = this;\n if (delim === void 0) { delim = ','; }\n if (!isArray(arr)) {\n arr = [arr];\n }\n var delimJoin = function (array, delimiter, finalDelimiter) {\n var list = '';\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n if (i === array.length - 1) {\n list += ' ' + finalDelimiter + ' ';\n }\n else {\n list += delimiter + ' ';\n }\n }\n list += array[i];\n }\n return list;\n };\n callback =\n callback ||\n function (o) {\n return o.toString();\n };\n var realCallback = function (arg) {\n return callback && callback.call(_this, arg);\n };\n if (finalDelim) {\n return delimJoin(arr.map(realCallback), delim, finalDelim);\n }\n else {\n return arr.map(realCallback).join(delim + ' ');\n }\n };\n return ToText;\n}());\nexport default ToText;\n//# sourceMappingURL=totext.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\n// =============================================================================\n// Parser\n// =============================================================================\nvar Parser = /** @class */ (function () {\n function Parser(rules) {\n this.done = true;\n this.rules = rules;\n }\n Parser.prototype.start = function (text) {\n this.text = text;\n this.done = false;\n return this.nextSymbol();\n };\n Parser.prototype.isDone = function () {\n return this.done && this.symbol === null;\n };\n Parser.prototype.nextSymbol = function () {\n var best;\n var bestSymbol;\n this.symbol = null;\n this.value = null;\n do {\n if (this.done)\n return false;\n var rule = void 0;\n best = null;\n for (var name_1 in this.rules) {\n rule = this.rules[name_1];\n var match = rule.exec(this.text);\n if (match) {\n if (best === null || match[0].length > best[0].length) {\n best = match;\n bestSymbol = name_1;\n }\n }\n }\n if (best != null) {\n this.text = this.text.substr(best[0].length);\n if (this.text === '')\n this.done = true;\n }\n if (best == null) {\n this.done = true;\n this.symbol = null;\n this.value = null;\n return;\n }\n } while (bestSymbol === 'SKIP');\n this.symbol = bestSymbol;\n this.value = best;\n return true;\n };\n Parser.prototype.accept = function (name) {\n if (this.symbol === name) {\n if (this.value) {\n var v = this.value;\n this.nextSymbol();\n return v;\n }\n this.nextSymbol();\n return true;\n }\n return false;\n };\n Parser.prototype.acceptNumber = function () {\n return this.accept('number');\n };\n Parser.prototype.expect = function (name) {\n if (this.accept(name))\n return true;\n throw new Error('expected ' + name + ' but found ' + this.symbol);\n };\n return Parser;\n}());\nexport default function parseText(text, language) {\n if (language === void 0) { language = ENGLISH; }\n var options = {};\n var ttr = new Parser(language.tokens);\n if (!ttr.start(text))\n return null;\n S();\n return options;\n function S() {\n // every [n]\n ttr.expect('every');\n var n = ttr.acceptNumber();\n if (n)\n options.interval = parseInt(n[0], 10);\n if (ttr.isDone())\n throw new Error('Unexpected end');\n switch (ttr.symbol) {\n case 'day(s)':\n options.freq = RRule.DAILY;\n if (ttr.nextSymbol()) {\n AT();\n F();\n }\n break;\n // FIXME Note: every 2 weekdays != every two weeks on weekdays.\n // DAILY on weekdays is not a valid rule\n case 'weekday(s)':\n options.freq = RRule.WEEKLY;\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n ttr.nextSymbol();\n AT();\n F();\n break;\n case 'week(s)':\n options.freq = RRule.WEEKLY;\n if (ttr.nextSymbol()) {\n ON();\n AT();\n F();\n }\n break;\n case 'hour(s)':\n options.freq = RRule.HOURLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'minute(s)':\n options.freq = RRule.MINUTELY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'month(s)':\n options.freq = RRule.MONTHLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'year(s)':\n options.freq = RRule.YEARLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n options.freq = RRule.WEEKLY;\n var key = ttr.symbol\n .substr(0, 2)\n .toUpperCase();\n options.byweekday = [RRule[key]];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var wkd = decodeWKD();\n if (!wkd) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday');\n }\n options.byweekday.push(RRule[wkd]);\n ttr.nextSymbol();\n }\n AT();\n MDAYs();\n F();\n break;\n case 'january':\n case 'february':\n case 'march':\n case 'april':\n case 'may':\n case 'june':\n case 'july':\n case 'august':\n case 'september':\n case 'october':\n case 'november':\n case 'december':\n options.freq = RRule.YEARLY;\n options.bymonth = [decodeM()];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var m = decodeM();\n if (!m) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month');\n }\n options.bymonth.push(m);\n ttr.nextSymbol();\n }\n ON();\n F();\n break;\n default:\n throw new Error('Unknown symbol');\n }\n }\n function ON() {\n var on = ttr.accept('on');\n var the = ttr.accept('the');\n if (!(on || the))\n return;\n do {\n var nth = decodeNTH();\n var wkd = decodeWKD();\n var m = decodeM();\n // nth | \n if (nth) {\n // ttr.nextSymbol()\n if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd].nth(nth));\n }\n else {\n if (!options.bymonthday)\n options.bymonthday = [];\n options.bymonthday.push(nth);\n ttr.accept('day(s)');\n }\n // \n }\n else if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd]);\n }\n else if (ttr.symbol === 'weekday(s)') {\n ttr.nextSymbol();\n if (!options.byweekday) {\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n }\n }\n else if (ttr.symbol === 'week(s)') {\n ttr.nextSymbol();\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number');\n }\n options.byweekno = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.byweekno.push(parseInt(n[0], 10));\n }\n }\n else if (m) {\n ttr.nextSymbol();\n if (!options.bymonth)\n options.bymonth = [];\n options.bymonth.push(m);\n }\n else {\n return;\n }\n } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on'));\n }\n function AT() {\n var at = ttr.accept('at');\n if (!at)\n return;\n do {\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour');\n }\n options.byhour = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour');\n }\n options.byhour.push(parseInt(n[0], 10));\n }\n } while (ttr.accept('comma') || ttr.accept('at'));\n }\n function decodeM() {\n switch (ttr.symbol) {\n case 'january':\n return 1;\n case 'february':\n return 2;\n case 'march':\n return 3;\n case 'april':\n return 4;\n case 'may':\n return 5;\n case 'june':\n return 6;\n case 'july':\n return 7;\n case 'august':\n return 8;\n case 'september':\n return 9;\n case 'october':\n return 10;\n case 'november':\n return 11;\n case 'december':\n return 12;\n default:\n return false;\n }\n }\n function decodeWKD() {\n switch (ttr.symbol) {\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n return ttr.symbol.substr(0, 2).toUpperCase();\n default:\n return false;\n }\n }\n function decodeNTH() {\n switch (ttr.symbol) {\n case 'last':\n ttr.nextSymbol();\n return -1;\n case 'first':\n ttr.nextSymbol();\n return 1;\n case 'second':\n ttr.nextSymbol();\n return ttr.accept('last') ? -2 : 2;\n case 'third':\n ttr.nextSymbol();\n return ttr.accept('last') ? -3 : 3;\n case 'nth':\n var v = parseInt(ttr.value[1], 10);\n if (v < -366 || v > 366)\n throw new Error('Nth out of range: ' + v);\n ttr.nextSymbol();\n return ttr.accept('last') ? -v : v;\n default:\n return false;\n }\n }\n function MDAYs() {\n ttr.accept('on');\n ttr.accept('the');\n var nth = decodeNTH();\n if (!nth)\n return;\n options.bymonthday = [nth];\n ttr.nextSymbol();\n while (ttr.accept('comma')) {\n nth = decodeNTH();\n if (!nth) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.bymonthday.push(nth);\n ttr.nextSymbol();\n }\n }\n function F() {\n if (ttr.symbol === 'until') {\n var date = Date.parse(ttr.text);\n if (!date)\n throw new Error('Cannot parse until date:' + ttr.text);\n options.until = new Date(date);\n }\n else if (ttr.accept('for')) {\n options.count = parseInt(ttr.value[0], 10);\n ttr.expect('number');\n // ttr.expect('times')\n }\n }\n}\n//# sourceMappingURL=parsetext.js.map","export var Frequency;\n(function (Frequency) {\n Frequency[Frequency[\"YEARLY\"] = 0] = \"YEARLY\";\n Frequency[Frequency[\"MONTHLY\"] = 1] = \"MONTHLY\";\n Frequency[Frequency[\"WEEKLY\"] = 2] = \"WEEKLY\";\n Frequency[Frequency[\"DAILY\"] = 3] = \"DAILY\";\n Frequency[Frequency[\"HOURLY\"] = 4] = \"HOURLY\";\n Frequency[Frequency[\"MINUTELY\"] = 5] = \"MINUTELY\";\n Frequency[Frequency[\"SECONDLY\"] = 6] = \"SECONDLY\";\n})(Frequency || (Frequency = {}));\nexport function freqIsDailyOrGreater(freq) {\n return freq < Frequency.HOURLY;\n}\n//# sourceMappingURL=types.js.map","import ToText from './totext';\nimport parseText from './parsetext';\nimport { RRule } from '../rrule';\nimport { Frequency } from '../types';\nimport ENGLISH from './i18n';\n/* !\n * rrule.js - Library for working with recurrence rules for calendar dates.\n * https://github.com/jakubroztocil/rrule\n *\n * Copyright 2010, Jakub Roztocil and Lars Schoning\n * Licenced under the BSD licence.\n * https://github.com/jakubroztocil/rrule/blob/master/LICENCE\n *\n */\n/**\n *\n * Implementation of RRule.fromText() and RRule::toText().\n *\n *\n * On the client side, this file needs to be included\n * when those functions are used.\n *\n */\n// =============================================================================\n// fromText\n// =============================================================================\n/**\n * Will be able to convert some of the below described rules from\n * text format to a rule object.\n *\n *\n * RULES\n *\n * Every ([n])\n * day(s)\n * | [weekday], ..., (and) [weekday]\n * | weekday(s)\n * | week(s)\n * | month(s)\n * | [month], ..., (and) [month]\n * | year(s)\n *\n *\n * Plus 0, 1, or multiple of these:\n *\n * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday]\n *\n * on [weekday], ..., (and) [weekday]\n *\n * on the [monthday], [monthday], ... (and) [monthday] (day of the month)\n *\n * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year)\n *\n *\n * Plus 0 or 1 of these:\n *\n * for [n] time(s)\n *\n * until [date]\n *\n * Plus (.)\n *\n *\n * Definitely no supported for parsing:\n *\n * (for year):\n * in week(s) [n], ..., (and) [n]\n *\n * on the [yearday], ..., (and) [n] day of the year\n * on day [yearday], ..., (and) [n]\n *\n *\n * NON-TERMINALS\n *\n * [n]: 1, 2 ..., one, two, three ..\n * [month]: January, February, March, April, May, ... December\n * [weekday]: Monday, ... Sunday\n * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ...\n * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, ..\n * [date]:\n * - [month] (0-31(,) ([year])),\n * - (the) 0-31.(1-12.([year])),\n * - (the) 0-31/(1-12/([year])),\n * - [weekday]\n *\n * [year]: 0000, 0001, ... 01, 02, ..\n *\n * Definitely not supported for parsing:\n *\n * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, ..\n *\n * @param {String} text\n * @return {Object, Boolean} the rule, or null.\n */\nvar fromText = function (text, language) {\n if (language === void 0) { language = ENGLISH; }\n return new RRule(parseText(text, language) || undefined);\n};\nvar common = [\n 'count',\n 'until',\n 'interval',\n 'byweekday',\n 'bymonthday',\n 'bymonth',\n];\nToText.IMPLEMENTED = [];\nToText.IMPLEMENTED[Frequency.HOURLY] = common;\nToText.IMPLEMENTED[Frequency.MINUTELY] = common;\nToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common);\nToText.IMPLEMENTED[Frequency.WEEKLY] = common;\nToText.IMPLEMENTED[Frequency.MONTHLY] = common;\nToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common);\n// =============================================================================\n// Export\n// =============================================================================\nvar toText = function (rrule, gettext, language, dateFormatter) {\n return new ToText(rrule, gettext, language, dateFormatter).toString();\n};\nvar isFullyConvertible = ToText.isFullyConvertible;\nexport { fromText, parseText, isFullyConvertible, toText };\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { Frequency } from './types';\nimport { pymod, divmod, empty, includes } from './helpers';\nimport { getWeekday, MAXYEAR, monthRange } from './dateutil';\nvar Time = /** @class */ (function () {\n function Time(hour, minute, second, millisecond) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond || 0;\n }\n Time.prototype.getHours = function () {\n return this.hour;\n };\n Time.prototype.getMinutes = function () {\n return this.minute;\n };\n Time.prototype.getSeconds = function () {\n return this.second;\n };\n Time.prototype.getMilliseconds = function () {\n return this.millisecond;\n };\n Time.prototype.getTime = function () {\n return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 +\n this.millisecond);\n };\n return Time;\n}());\nexport { Time };\nvar DateTime = /** @class */ (function (_super) {\n __extends(DateTime, _super);\n function DateTime(year, month, day, hour, minute, second, millisecond) {\n var _this = _super.call(this, hour, minute, second, millisecond) || this;\n _this.year = year;\n _this.month = month;\n _this.day = day;\n return _this;\n }\n DateTime.fromDate = function (date) {\n return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000);\n };\n DateTime.prototype.getWeekday = function () {\n return getWeekday(new Date(this.getTime()));\n };\n DateTime.prototype.getTime = function () {\n return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();\n };\n DateTime.prototype.getDay = function () {\n return this.day;\n };\n DateTime.prototype.getMonth = function () {\n return this.month;\n };\n DateTime.prototype.getYear = function () {\n return this.year;\n };\n DateTime.prototype.addYears = function (years) {\n this.year += years;\n };\n DateTime.prototype.addMonths = function (months) {\n this.month += months;\n if (this.month > 12) {\n var yearDiv = Math.floor(this.month / 12);\n var monthMod = pymod(this.month, 12);\n this.month = monthMod;\n this.year += yearDiv;\n if (this.month === 0) {\n this.month = 12;\n --this.year;\n }\n }\n };\n DateTime.prototype.addWeekly = function (days, wkst) {\n if (wkst > this.getWeekday()) {\n this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7;\n }\n else {\n this.day += -(this.getWeekday() - wkst) + days * 7;\n }\n this.fixDay();\n };\n DateTime.prototype.addDaily = function (days) {\n this.day += days;\n this.fixDay();\n };\n DateTime.prototype.addHours = function (hours, filtered, byhour) {\n if (filtered) {\n // Jump to one iteration before next day\n this.hour += Math.floor((23 - this.hour) / hours) * hours;\n }\n for (;;) {\n this.hour += hours;\n var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod;\n if (dayDiv) {\n this.hour = hourMod;\n this.addDaily(dayDiv);\n }\n if (empty(byhour) || includes(byhour, this.hour))\n break;\n }\n };\n DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) {\n if (filtered) {\n // Jump to one iteration before next day\n this.minute +=\n Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes;\n }\n for (;;) {\n this.minute += minutes;\n var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod;\n if (hourDiv) {\n this.minute = minuteMod;\n this.addHours(hourDiv, false, byhour);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute))) {\n break;\n }\n }\n };\n DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) {\n if (filtered) {\n // Jump to one iteration before next day\n this.second +=\n Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) /\n seconds) * seconds;\n }\n for (;;) {\n this.second += seconds;\n var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod;\n if (minuteDiv) {\n this.second = secondMod;\n this.addMinutes(minuteDiv, false, byhour, byminute);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute)) &&\n (empty(bysecond) || includes(bysecond, this.second))) {\n break;\n }\n }\n };\n DateTime.prototype.fixDay = function () {\n if (this.day <= 28) {\n return;\n }\n var daysinmonth = monthRange(this.year, this.month - 1)[1];\n if (this.day <= daysinmonth) {\n return;\n }\n while (this.day > daysinmonth) {\n this.day -= daysinmonth;\n ++this.month;\n if (this.month === 13) {\n this.month = 1;\n ++this.year;\n if (this.year > MAXYEAR) {\n return;\n }\n }\n daysinmonth = monthRange(this.year, this.month - 1)[1];\n }\n };\n DateTime.prototype.add = function (options, filtered) {\n var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n switch (freq) {\n case Frequency.YEARLY:\n return this.addYears(interval);\n case Frequency.MONTHLY:\n return this.addMonths(interval);\n case Frequency.WEEKLY:\n return this.addWeekly(interval, wkst);\n case Frequency.DAILY:\n return this.addDaily(interval);\n case Frequency.HOURLY:\n return this.addHours(interval, filtered, byhour);\n case Frequency.MINUTELY:\n return this.addMinutes(interval, filtered, byhour, byminute);\n case Frequency.SECONDLY:\n return this.addSeconds(interval, filtered, byhour, byminute, bysecond);\n }\n };\n return DateTime;\n}(Time));\nexport { DateTime };\n//# sourceMappingURL=datetime.js.map","import { __assign } from \"tslib\";\nimport { freqIsDailyOrGreater } from './types';\nimport { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr, } from './helpers';\nimport { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';\nimport { getWeekday, isDate, isValidDate } from './dateutil';\nimport { Weekday } from './weekday';\nimport { Time } from './datetime';\nexport function initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n // Shallow copy for options and origOptions and check for invalid\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!includes(defaultKeys, key))\n invalid.push(key);\n if (isDate(options[key]) && !isValidDate(options[key])) {\n invalid.push(key);\n }\n }\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign({}, options);\n}\nexport function parseOptions(options) {\n var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options));\n if (isPresent(opts.byeaster))\n opts.freq = RRule.YEARLY;\n if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) {\n throw new Error(\"Invalid frequency: \".concat(opts.freq, \" \").concat(options.freq));\n }\n if (!opts.dtstart)\n opts.dtstart = new Date(new Date().setMilliseconds(0));\n if (!isPresent(opts.wkst)) {\n opts.wkst = RRule.MO.weekday;\n }\n else if (isNumber(opts.wkst)) {\n // cool, just keep it like that\n }\n else {\n opts.wkst = opts.wkst.weekday;\n }\n if (isPresent(opts.bysetpos)) {\n if (isNumber(opts.bysetpos))\n opts.bysetpos = [opts.bysetpos];\n for (var i = 0; i < opts.bysetpos.length; i++) {\n var v = opts.bysetpos[i];\n if (v === 0 || !(v >= -366 && v <= 366)) {\n throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1');\n }\n }\n }\n if (!(Boolean(opts.byweekno) ||\n notEmpty(opts.byweekno) ||\n notEmpty(opts.byyearday) ||\n Boolean(opts.bymonthday) ||\n notEmpty(opts.bymonthday) ||\n isPresent(opts.byweekday) ||\n isPresent(opts.byeaster))) {\n switch (opts.freq) {\n case RRule.YEARLY:\n if (!opts.bymonth)\n opts.bymonth = opts.dtstart.getUTCMonth() + 1;\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.MONTHLY:\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.WEEKLY:\n opts.byweekday = [getWeekday(opts.dtstart)];\n break;\n }\n }\n // bymonth\n if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) {\n opts.bymonth = [opts.bymonth];\n }\n // byyearday\n if (isPresent(opts.byyearday) &&\n !isArray(opts.byyearday) &&\n isNumber(opts.byyearday)) {\n opts.byyearday = [opts.byyearday];\n }\n // bymonthday\n if (!isPresent(opts.bymonthday)) {\n opts.bymonthday = [];\n opts.bynmonthday = [];\n }\n else if (isArray(opts.bymonthday)) {\n var bymonthday = [];\n var bynmonthday = [];\n for (var i = 0; i < opts.bymonthday.length; i++) {\n var v = opts.bymonthday[i];\n if (v > 0) {\n bymonthday.push(v);\n }\n else if (v < 0) {\n bynmonthday.push(v);\n }\n }\n opts.bymonthday = bymonthday;\n opts.bynmonthday = bynmonthday;\n }\n else if (opts.bymonthday < 0) {\n opts.bynmonthday = [opts.bymonthday];\n opts.bymonthday = [];\n }\n else {\n opts.bynmonthday = [];\n opts.bymonthday = [opts.bymonthday];\n }\n // byweekno\n if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) {\n opts.byweekno = [opts.byweekno];\n }\n // byweekday / bynweekday\n if (!isPresent(opts.byweekday)) {\n opts.bynweekday = null;\n }\n else if (isNumber(opts.byweekday)) {\n opts.byweekday = [opts.byweekday];\n opts.bynweekday = null;\n }\n else if (isWeekdayStr(opts.byweekday)) {\n opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday];\n opts.bynweekday = null;\n }\n else if (opts.byweekday instanceof Weekday) {\n if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) {\n opts.byweekday = [opts.byweekday.weekday];\n opts.bynweekday = null;\n }\n else {\n opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]];\n opts.byweekday = null;\n }\n }\n else {\n var byweekday = [];\n var bynweekday = [];\n for (var i = 0; i < opts.byweekday.length; i++) {\n var wday = opts.byweekday[i];\n if (isNumber(wday)) {\n byweekday.push(wday);\n continue;\n }\n else if (isWeekdayStr(wday)) {\n byweekday.push(Weekday.fromStr(wday).weekday);\n continue;\n }\n if (!wday.n || opts.freq > RRule.MONTHLY) {\n byweekday.push(wday.weekday);\n }\n else {\n bynweekday.push([wday.weekday, wday.n]);\n }\n }\n opts.byweekday = notEmpty(byweekday) ? byweekday : null;\n opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null;\n }\n // byhour\n if (!isPresent(opts.byhour)) {\n opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null;\n }\n else if (isNumber(opts.byhour)) {\n opts.byhour = [opts.byhour];\n }\n // byminute\n if (!isPresent(opts.byminute)) {\n opts.byminute =\n opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null;\n }\n else if (isNumber(opts.byminute)) {\n opts.byminute = [opts.byminute];\n }\n // bysecond\n if (!isPresent(opts.bysecond)) {\n opts.bysecond =\n opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null;\n }\n else if (isNumber(opts.bysecond)) {\n opts.bysecond = [opts.bysecond];\n }\n return { parsedOptions: opts };\n}\nexport function buildTimeset(opts) {\n var millisecondModulo = opts.dtstart.getTime() % 1000;\n if (!freqIsDailyOrGreater(opts.freq)) {\n return [];\n }\n var timeset = [];\n opts.byhour.forEach(function (hour) {\n opts.byminute.forEach(function (minute) {\n opts.bysecond.forEach(function (second) {\n timeset.push(new Time(hour, minute, second, millisecondModulo));\n });\n });\n });\n return timeset;\n}\n//# sourceMappingURL=parseoptions.js.map","import { __assign } from \"tslib\";\nimport { Frequency } from './types';\nimport { Weekday } from './weekday';\nimport { untilStringToDate } from './dateutil';\nimport { Days } from './rrule';\nexport function parseString(rfcString) {\n var options = rfcString\n .split('\\n')\n .map(parseLine)\n .filter(function (x) { return x !== null; });\n return __assign(__assign({}, options[0]), options[1]);\n}\nexport function parseDtstart(line) {\n var options = {};\n var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\\s]+)/i.exec(line);\n if (!dtstartWithZone) {\n return options;\n }\n var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2];\n if (tzid) {\n options.tzid = tzid;\n }\n options.dtstart = untilStringToDate(dtstart);\n return options;\n}\nfunction parseLine(rfcString) {\n rfcString = rfcString.replace(/^\\s+|\\s+$/, '');\n if (!rfcString.length)\n return null;\n var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());\n if (!header) {\n return parseRrule(rfcString);\n }\n var key = header[1];\n switch (key.toUpperCase()) {\n case 'RRULE':\n case 'EXRULE':\n return parseRrule(rfcString);\n case 'DTSTART':\n return parseDtstart(rfcString);\n default:\n throw new Error(\"Unsupported RFC prop \".concat(key, \" in \").concat(rfcString));\n }\n}\nfunction parseRrule(line) {\n var strippedLine = line.replace(/^RRULE:/i, '');\n var options = parseDtstart(strippedLine);\n var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';');\n attrs.forEach(function (attr) {\n var _a = attr.split('='), key = _a[0], value = _a[1];\n switch (key.toUpperCase()) {\n case 'FREQ':\n options.freq = Frequency[value.toUpperCase()];\n break;\n case 'WKST':\n options.wkst = Days[value.toUpperCase()];\n break;\n case 'COUNT':\n case 'INTERVAL':\n case 'BYSETPOS':\n case 'BYMONTH':\n case 'BYMONTHDAY':\n case 'BYYEARDAY':\n case 'BYWEEKNO':\n case 'BYHOUR':\n case 'BYMINUTE':\n case 'BYSECOND':\n var num = parseNumber(value);\n var optionKey = key.toLowerCase();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n options[optionKey] = num;\n break;\n case 'BYWEEKDAY':\n case 'BYDAY':\n options.byweekday = parseWeekday(value);\n break;\n case 'DTSTART':\n case 'TZID':\n // for backwards compatibility\n var dtstart = parseDtstart(line);\n options.tzid = dtstart.tzid;\n options.dtstart = dtstart.dtstart;\n break;\n case 'UNTIL':\n options.until = untilStringToDate(value);\n break;\n case 'BYEASTER':\n options.byeaster = Number(value);\n break;\n default:\n throw new Error(\"Unknown RRULE property '\" + key + \"'\");\n }\n });\n return options;\n}\nfunction parseNumber(value) {\n if (value.indexOf(',') !== -1) {\n var values = value.split(',');\n return values.map(parseIndividualNumber);\n }\n return parseIndividualNumber(value);\n}\nfunction parseIndividualNumber(value) {\n if (/^[+-]?\\d+$/.test(value)) {\n return Number(value);\n }\n return value;\n}\nfunction parseWeekday(value) {\n var days = value.split(',');\n return days.map(function (day) {\n if (day.length === 2) {\n // MO, TU, ...\n return Days[day]; // wday instanceof Weekday\n }\n // -1MO, +3FR, 1SO, 13TU ...\n var parts = day.match(/^([+-]?\\d{1,2})([A-Z]{2})$/);\n if (!parts || parts.length < 3) {\n throw new SyntaxError(\"Invalid weekday string: \".concat(day));\n }\n var n = Number(parts[1]);\n var wdaypart = parts[2];\n var wday = Days[wdaypart].weekday;\n return new Weekday(wday, n);\n });\n}\n//# sourceMappingURL=parsestring.js.map","import { dateInTimeZone, timeToUntilString } from './dateutil';\nvar DateWithZone = /** @class */ (function () {\n function DateWithZone(date, tzid) {\n if (isNaN(date.getTime())) {\n throw new RangeError('Invalid date passed to DateWithZone');\n }\n this.date = date;\n this.tzid = tzid;\n }\n Object.defineProperty(DateWithZone.prototype, \"isUTC\", {\n get: function () {\n return !this.tzid || this.tzid.toUpperCase() === 'UTC';\n },\n enumerable: false,\n configurable: true\n });\n DateWithZone.prototype.toString = function () {\n var datestr = timeToUntilString(this.date.getTime(), this.isUTC);\n if (!this.isUTC) {\n return \";TZID=\".concat(this.tzid, \":\").concat(datestr);\n }\n return \":\".concat(datestr);\n };\n DateWithZone.prototype.getTime = function () {\n return this.date.getTime();\n };\n DateWithZone.prototype.rezonedDate = function () {\n if (this.isUTC) {\n return this.date;\n }\n return dateInTimeZone(this.date, this.tzid);\n };\n return DateWithZone;\n}());\nexport { DateWithZone };\n//# sourceMappingURL=datewithzone.js.map","import { RRule, DEFAULT_OPTIONS } from './rrule';\nimport { includes, isPresent, isArray, isNumber, toArray } from './helpers';\nimport { Weekday } from './weekday';\nimport { timeToUntilString } from './dateutil';\nimport { DateWithZone } from './datewithzone';\nexport function optionsToString(options) {\n var rrule = [];\n var dtstart = '';\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === 'tzid')\n continue;\n if (!includes(defaultKeys, keys[i]))\n continue;\n var key = keys[i].toUpperCase();\n var value = options[keys[i]];\n var outValue = '';\n if (!isPresent(value) || (isArray(value) && !value.length))\n continue;\n switch (key) {\n case 'FREQ':\n outValue = RRule.FREQUENCIES[options.freq];\n break;\n case 'WKST':\n if (isNumber(value)) {\n outValue = new Weekday(value).toString();\n }\n else {\n outValue = value.toString();\n }\n break;\n case 'BYWEEKDAY':\n /*\n NOTE: BYWEEKDAY is a special case.\n RRule() deconstructs the rule.options.byweekday array\n into an array of Weekday arguments.\n On the other hand, rule.origOptions is an array of Weekdays.\n We need to handle both cases here.\n It might be worth change RRule to keep the Weekdays.\n \n Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC)\n \n */\n key = 'BYDAY';\n outValue = toArray(value)\n .map(function (wday) {\n if (wday instanceof Weekday) {\n return wday;\n }\n if (isArray(wday)) {\n return new Weekday(wday[0], wday[1]);\n }\n return new Weekday(wday);\n })\n .toString();\n break;\n case 'DTSTART':\n dtstart = buildDtstart(value, options.tzid);\n break;\n case 'UNTIL':\n outValue = timeToUntilString(value, !options.tzid);\n break;\n default:\n if (isArray(value)) {\n var strValues = [];\n for (var j = 0; j < value.length; j++) {\n strValues[j] = String(value[j]);\n }\n outValue = strValues.toString();\n }\n else {\n outValue = String(value);\n }\n }\n if (outValue) {\n rrule.push([key, outValue]);\n }\n }\n var rules = rrule\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value.toString());\n })\n .join(';');\n var ruleString = '';\n if (rules !== '') {\n ruleString = \"RRULE:\".concat(rules);\n }\n return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\\n');\n}\nfunction buildDtstart(dtstart, tzid) {\n if (!dtstart) {\n return '';\n }\n return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString();\n}\n//# sourceMappingURL=optionstostring.js.map","import IterResult from './iterresult';\nimport { clone, cloneDates } from './dateutil';\nimport { isArray } from './helpers';\nfunction argsMatch(left, right) {\n if (Array.isArray(left)) {\n if (!Array.isArray(right))\n return false;\n if (left.length !== right.length)\n return false;\n return left.every(function (date, i) { return date.getTime() === right[i].getTime(); });\n }\n if (left instanceof Date) {\n return right instanceof Date && left.getTime() === right.getTime();\n }\n return left === right;\n}\nvar Cache = /** @class */ (function () {\n function Cache() {\n this.all = false;\n this.before = [];\n this.after = [];\n this.between = [];\n }\n /**\n * @param {String} what - all/before/after/between\n * @param {Array,Date} value - an array of dates, one date, or null\n * @param {Object?} args - _iter arguments\n */\n Cache.prototype._cacheAdd = function (what, value, args) {\n if (value) {\n value = value instanceof Date ? clone(value) : cloneDates(value);\n }\n if (what === 'all') {\n this.all = value;\n }\n else {\n args._value = value;\n this[what].push(args);\n }\n };\n /**\n * @return false - not in the cache\n * @return null - cached, but zero occurrences (before/after)\n * @return Date - cached (before/after)\n * @return [] - cached, but zero occurrences (all/between)\n * @return [Date1, DateN] - cached (all/between)\n */\n Cache.prototype._cacheGet = function (what, args) {\n var cached = false;\n var argsKeys = args ? Object.keys(args) : [];\n var findCacheDiff = function (item) {\n for (var i = 0; i < argsKeys.length; i++) {\n var key = argsKeys[i];\n if (!argsMatch(args[key], item[key])) {\n return true;\n }\n }\n return false;\n };\n var cachedObject = this[what];\n if (what === 'all') {\n cached = this.all;\n }\n else if (isArray(cachedObject)) {\n // Let's see whether we've already called the\n // 'what' method with the same 'args'\n for (var i = 0; i < cachedObject.length; i++) {\n var item = cachedObject[i];\n if (argsKeys.length && findCacheDiff(item))\n continue;\n cached = item._value;\n break;\n }\n }\n if (!cached && this.all) {\n // Not in the cache, but we already know all the occurrences,\n // so we can find the correct dates from the cached ones.\n var iterResult = new IterResult(what, args);\n for (var i = 0; i < this.all.length; i++) {\n if (!iterResult.accept(this.all[i]))\n break;\n }\n cached = iterResult.getValue();\n this._cacheAdd(what, cached, args);\n }\n return isArray(cached)\n ? cloneDates(cached)\n : cached instanceof Date\n ? clone(cached)\n : cached;\n };\n return Cache;\n}());\nexport { Cache };\n//# sourceMappingURL=cache.js.map","import { __spreadArray } from \"tslib\";\nimport { range, repeat } from './helpers';\n// =============================================================================\n// Date masks\n// =============================================================================\n// Every mask is 7 days longer to handle cross-year weekly periods.\nvar M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M28 = range(1, 29);\nvar M29 = range(1, 30);\nvar M30 = range(1, 31);\nvar M31 = range(1, 32);\nvar MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar NM28 = range(-28, 0);\nvar NM29 = range(-29, 0);\nvar NM30 = range(-30, 0);\nvar NM31 = range(-31, 0);\nvar NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];\nvar M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];\nvar WDAYMASK = (function () {\n var wdaymask = [];\n for (var i = 0; i < 55; i++)\n wdaymask = wdaymask.concat(range(7));\n return wdaymask;\n})();\nexport { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK, };\n//# sourceMappingURL=masks.js.map","import { __assign } from \"tslib\";\nimport { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';\nimport { empty, repeat, pymod, includes } from '../helpers';\nimport { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';\nexport function rebuildYear(year, options) {\n var firstyday = datetime(year, 1, 1);\n var yearlen = isLeapYear(year) ? 366 : 365;\n var nextyearlen = isLeapYear(year + 1) ? 366 : 365;\n var yearordinal = toOrdinal(firstyday);\n var yearweekday = getWeekday(firstyday);\n var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });\n if (empty(options.byweekno)) {\n return result;\n }\n result.wnomask = repeat(0, yearlen + 7);\n var firstwkst;\n var wyearlen;\n var no1wkst = (firstwkst = pymod(7 - yearweekday + options.wkst, 7));\n if (no1wkst >= 4) {\n no1wkst = 0;\n // Number of days in the year, plus the days we got\n // from last year.\n wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7);\n }\n else {\n // Number of days in the year, minus the days we\n // left in last year.\n wyearlen = yearlen - no1wkst;\n }\n var div = Math.floor(wyearlen / 7);\n var mod = pymod(wyearlen, 7);\n var numweeks = Math.floor(div + mod / 4);\n for (var j = 0; j < options.byweekno.length; j++) {\n var n = options.byweekno[j];\n if (n < 0) {\n n += numweeks + 1;\n }\n if (!(n > 0 && n <= numweeks)) {\n continue;\n }\n var i = void 0;\n if (n > 1) {\n i = no1wkst + (n - 1) * 7;\n if (no1wkst !== firstwkst) {\n i -= 7 - firstwkst;\n }\n }\n else {\n i = no1wkst;\n }\n for (var k = 0; k < 7; k++) {\n result.wnomask[i] = 1;\n i++;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n if (includes(options.byweekno, 1)) {\n // Check week number 1 of next year as well\n // orig-TODO : Check -numweeks for next year.\n var i = no1wkst + numweeks * 7;\n if (no1wkst !== firstwkst)\n i -= 7 - firstwkst;\n if (i < yearlen) {\n // If week starts in next year, we\n // don't care about it.\n for (var j = 0; j < 7; j++) {\n result.wnomask[i] = 1;\n i += 1;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n }\n if (no1wkst) {\n // Check last week number of last year as\n // well. If no1wkst is 0, either the year\n // started on week start, or week number 1\n // got days from last year, so there are no\n // days from last year's last week number in\n // this year.\n var lnumweeks = void 0;\n if (!includes(options.byweekno, -1)) {\n var lyearweekday = getWeekday(datetime(year - 1, 1, 1));\n var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);\n var lyearlen = isLeapYear(year - 1) ? 366 : 365;\n var weekst = void 0;\n if (lno1wkst >= 4) {\n lno1wkst = 0;\n weekst = lyearlen + pymod(lyearweekday - options.wkst, 7);\n }\n else {\n weekst = yearlen - no1wkst;\n }\n lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4);\n }\n else {\n lnumweeks = -1;\n }\n if (includes(options.byweekno, lnumweeks)) {\n for (var i = 0; i < no1wkst; i++)\n result.wnomask[i] = 1;\n }\n }\n return result;\n}\nfunction baseYearMasks(year) {\n var yearlen = isLeapYear(year) ? 366 : 365;\n var firstyday = datetime(year, 1, 1);\n var wday = getWeekday(firstyday);\n if (yearlen === 365) {\n return {\n mmask: M365MASK,\n mdaymask: MDAY365MASK,\n nmdaymask: NMDAY365MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M365RANGE,\n };\n }\n return {\n mmask: M366MASK,\n mdaymask: MDAY366MASK,\n nmdaymask: NMDAY366MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M366RANGE,\n };\n}\n//# sourceMappingURL=yearinfo.js.map","import { RRule } from '../rrule';\nimport { empty, repeat, pymod } from '../helpers';\nexport function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) {\n var result = {\n lastyear: year,\n lastmonth: month,\n nwdaymask: [],\n };\n var ranges = [];\n if (options.freq === RRule.YEARLY) {\n if (empty(options.bymonth)) {\n ranges = [[0, yearlen]];\n }\n else {\n for (var j = 0; j < options.bymonth.length; j++) {\n month = options.bymonth[j];\n ranges.push(mrange.slice(month - 1, month + 1));\n }\n }\n }\n else if (options.freq === RRule.MONTHLY) {\n ranges = [mrange.slice(month - 1, month + 1)];\n }\n if (empty(ranges)) {\n return result;\n }\n // Weekly frequency won't get here, so we may not\n // care about cross-year weekly periods.\n result.nwdaymask = repeat(0, yearlen);\n for (var j = 0; j < ranges.length; j++) {\n var rang = ranges[j];\n var first = rang[0];\n var last = rang[1] - 1;\n for (var k = 0; k < options.bynweekday.length; k++) {\n var i = void 0;\n var _a = options.bynweekday[k], wday = _a[0], n = _a[1];\n if (n < 0) {\n i = last + (n + 1) * 7;\n i -= pymod(wdaymask[i] - wday, 7);\n }\n else {\n i = first + (n - 1) * 7;\n i += pymod(7 - wdaymask[i] + wday, 7);\n }\n if (first <= i && i <= last)\n result.nwdaymask[i] = 1;\n }\n }\n return result;\n}\n//# sourceMappingURL=monthinfo.js.map","export function easter(y, offset) {\n if (offset === void 0) { offset = 0; }\n var a = y % 19;\n var b = Math.floor(y / 100);\n var c = y % 100;\n var d = Math.floor(b / 4);\n var e = b % 4;\n var f = Math.floor((b + 8) / 25);\n var g = Math.floor((b - f + 1) / 3);\n var h = Math.floor(19 * a + b - d - g + 15) % 30;\n var i = Math.floor(c / 4);\n var k = c % 4;\n var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;\n var m = Math.floor((a + 11 * h + 22 * l) / 451);\n var month = Math.floor((h + l - 7 * m + 114) / 31);\n var day = ((h + l - 7 * m + 114) % 31) + 1;\n var date = Date.UTC(y, month - 1, day + offset);\n var yearStart = Date.UTC(y, 0, 1);\n return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];\n}\n//# sourceMappingURL=easter.js.map","import { notEmpty, repeat, range, isPresent } from '../helpers';\nimport { Frequency } from '../types';\nimport { rebuildYear } from './yearinfo';\nimport { rebuildMonth } from './monthinfo';\nimport { easter } from './easter';\nimport { Time } from '../datetime';\nimport { datetime, sort, toOrdinal } from '../dateutil';\n// =============================================================================\n// Iterinfo\n// =============================================================================\nvar Iterinfo = /** @class */ (function () {\n // eslint-disable-next-line no-empty-function\n function Iterinfo(options) {\n this.options = options;\n }\n Iterinfo.prototype.rebuild = function (year, month) {\n var options = this.options;\n if (year !== this.lastyear) {\n this.yearinfo = rebuildYear(year, options);\n }\n if (notEmpty(options.bynweekday) &&\n (month !== this.lastmonth || year !== this.lastyear)) {\n var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask;\n this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options);\n }\n if (isPresent(options.byeaster)) {\n this.eastermask = easter(year, options.byeaster);\n }\n };\n Object.defineProperty(Iterinfo.prototype, \"lastyear\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastyear : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"lastmonth\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastmonth : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearlen\", {\n get: function () {\n return this.yearinfo.yearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearordinal\", {\n get: function () {\n return this.yearinfo.yearordinal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mrange\", {\n get: function () {\n return this.yearinfo.mrange;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wdaymask\", {\n get: function () {\n return this.yearinfo.wdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mmask\", {\n get: function () {\n return this.yearinfo.mmask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wnomask\", {\n get: function () {\n return this.yearinfo.wnomask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nwdaymask\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.nwdaymask : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nextyearlen\", {\n get: function () {\n return this.yearinfo.nextyearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mdaymask\", {\n get: function () {\n return this.yearinfo.mdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nmdaymask\", {\n get: function () {\n return this.yearinfo.nmdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Iterinfo.prototype.ydayset = function () {\n return [range(this.yearlen), 0, this.yearlen];\n };\n Iterinfo.prototype.mdayset = function (_, month) {\n var start = this.mrange[month - 1];\n var end = this.mrange[month];\n var set = repeat(null, this.yearlen);\n for (var i = start; i < end; i++)\n set[i] = i;\n return [set, start, end];\n };\n Iterinfo.prototype.wdayset = function (year, month, day) {\n // We need to handle cross-year weeks here.\n var set = repeat(null, this.yearlen + 7);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n var start = i;\n for (var j = 0; j < 7; j++) {\n set[i] = i;\n ++i;\n if (this.wdaymask[i] === this.options.wkst)\n break;\n }\n return [set, start, i];\n };\n Iterinfo.prototype.ddayset = function (year, month, day) {\n var set = repeat(null, this.yearlen);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n set[i] = i;\n return [set, i, i + 1];\n };\n Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) {\n var _this = this;\n var set = [];\n this.options.byminute.forEach(function (minute) {\n set = set.concat(_this.mtimeset(hour, minute, second, millisecond));\n });\n sort(set);\n return set;\n };\n Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) {\n var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });\n sort(set);\n return set;\n };\n Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) {\n return [new Time(hour, minute, second, millisecond)];\n };\n Iterinfo.prototype.getdayset = function (freq) {\n switch (freq) {\n case Frequency.YEARLY:\n return this.ydayset.bind(this);\n case Frequency.MONTHLY:\n return this.mdayset.bind(this);\n case Frequency.WEEKLY:\n return this.wdayset.bind(this);\n case Frequency.DAILY:\n return this.ddayset.bind(this);\n default:\n return this.ddayset.bind(this);\n }\n };\n Iterinfo.prototype.gettimeset = function (freq) {\n switch (freq) {\n case Frequency.HOURLY:\n return this.htimeset.bind(this);\n case Frequency.MINUTELY:\n return this.mtimeset.bind(this);\n case Frequency.SECONDLY:\n return this.stimeset.bind(this);\n }\n };\n return Iterinfo;\n}());\nexport default Iterinfo;\n//# sourceMappingURL=index.js.map","import { combine, fromOrdinal, sort } from '../dateutil';\nimport { pymod, isPresent, includes } from '../helpers';\nexport function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {\n var poslist = [];\n for (var j = 0; j < bysetpos.length; j++) {\n var daypos = void 0;\n var timepos = void 0;\n var pos = bysetpos[j];\n if (pos < 0) {\n daypos = Math.floor(pos / timeset.length);\n timepos = pymod(pos, timeset.length);\n }\n else {\n daypos = Math.floor((pos - 1) / timeset.length);\n timepos = pymod(pos - 1, timeset.length);\n }\n var tmp = [];\n for (var k = start; k < end; k++) {\n var val = dayset[k];\n if (!isPresent(val))\n continue;\n tmp.push(val);\n }\n var i = void 0;\n if (daypos < 0) {\n i = tmp.slice(daypos)[0];\n }\n else {\n i = tmp[daypos];\n }\n var time = timeset[timepos];\n var date = fromOrdinal(ii.yearordinal + i);\n var res = combine(date, time);\n // XXX: can this ever be in the array?\n // - compare the actual date instead?\n if (!includes(poslist, res))\n poslist.push(res);\n }\n sort(poslist);\n return poslist;\n}\n//# sourceMappingURL=poslist.js.map","import { freqIsDailyOrGreater } from '../types';\nimport { combine, fromOrdinal, MAXYEAR } from '../dateutil';\nimport Iterinfo from '../iterinfo/index';\nimport { RRule } from '../rrule';\nimport { buildTimeset } from '../parseoptions';\nimport { notEmpty, includes, isPresent } from '../helpers';\nimport { DateWithZone } from '../datewithzone';\nimport { buildPoslist } from './poslist';\nimport { DateTime } from '../datetime';\nexport function iter(iterResult, options) {\n var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;\n var count = options.count;\n if (count === 0 || interval === 0) {\n return emitResult(iterResult);\n }\n var counterDate = DateTime.fromDate(dtstart);\n var ii = new Iterinfo(options);\n ii.rebuild(counterDate.year, counterDate.month);\n var timeset = makeTimeset(ii, counterDate, options);\n for (;;) {\n var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2];\n var filtered = removeFilteredDays(dayset, start, end, ii, options);\n if (notEmpty(bysetpos)) {\n var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset);\n for (var j = 0; j < poslist.length; j++) {\n var res = poslist[j];\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n else {\n for (var j = start; j < end; j++) {\n var currentDay = dayset[j];\n if (!isPresent(currentDay)) {\n continue;\n }\n var date = fromOrdinal(ii.yearordinal + currentDay);\n for (var k = 0; k < timeset.length; k++) {\n var time = timeset[k];\n var res = combine(date, time);\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n }\n if (options.interval === 0) {\n return emitResult(iterResult);\n }\n // Handle frequency and interval\n counterDate.add(options, filtered);\n if (counterDate.year > MAXYEAR) {\n return emitResult(iterResult);\n }\n if (!freqIsDailyOrGreater(freq)) {\n timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0);\n }\n ii.rebuild(counterDate.year, counterDate.month);\n }\n}\nfunction isFiltered(ii, currentDay, options) {\n var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday;\n return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) ||\n (notEmpty(byweekno) && !ii.wnomask[currentDay]) ||\n (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) ||\n (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) ||\n (byeaster !== null && !includes(ii.eastermask, currentDay)) ||\n ((notEmpty(bymonthday) || notEmpty(bynmonthday)) &&\n !includes(bymonthday, ii.mdaymask[currentDay]) &&\n !includes(bynmonthday, ii.nmdaymask[currentDay])) ||\n (notEmpty(byyearday) &&\n ((currentDay < ii.yearlen &&\n !includes(byyearday, currentDay + 1) &&\n !includes(byyearday, -ii.yearlen + currentDay)) ||\n (currentDay >= ii.yearlen &&\n !includes(byyearday, currentDay + 1 - ii.yearlen) &&\n !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))));\n}\nfunction rezoneIfNeeded(date, options) {\n return new DateWithZone(date, options.tzid).rezonedDate();\n}\nfunction emitResult(iterResult) {\n return iterResult.getValue();\n}\nfunction removeFilteredDays(dayset, start, end, ii, options) {\n var filtered = false;\n for (var dayCounter = start; dayCounter < end; dayCounter++) {\n var currentDay = dayset[dayCounter];\n filtered = isFiltered(ii, currentDay, options);\n if (filtered)\n dayset[currentDay] = null;\n }\n return filtered;\n}\nfunction makeTimeset(ii, counterDate, options) {\n var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n if (freqIsDailyOrGreater(freq)) {\n return buildTimeset(options);\n }\n if ((freq >= RRule.HOURLY &&\n notEmpty(byhour) &&\n !includes(byhour, counterDate.hour)) ||\n (freq >= RRule.MINUTELY &&\n notEmpty(byminute) &&\n !includes(byminute, counterDate.minute)) ||\n (freq >= RRule.SECONDLY &&\n notEmpty(bysecond) &&\n !includes(bysecond, counterDate.second))) {\n return [];\n }\n return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond);\n}\n//# sourceMappingURL=index.js.map","import { isValidDate } from './dateutil';\nimport IterResult from './iterresult';\nimport CallbackIterResult from './callbackiterresult';\nimport { fromText, parseText, toText, isFullyConvertible } from './nlp/index';\nimport { Frequency, } from './types';\nimport { parseOptions, initializeOptions } from './parseoptions';\nimport { parseString } from './parsestring';\nimport { optionsToString } from './optionstostring';\nimport { Cache } from './cache';\nimport { Weekday } from './weekday';\nimport { iter } from './iter/index';\n// =============================================================================\n// RRule\n// =============================================================================\nexport var Days = {\n MO: new Weekday(0),\n TU: new Weekday(1),\n WE: new Weekday(2),\n TH: new Weekday(3),\n FR: new Weekday(4),\n SA: new Weekday(5),\n SU: new Weekday(6),\n};\nexport var DEFAULT_OPTIONS = {\n freq: Frequency.YEARLY,\n dtstart: null,\n interval: 1,\n wkst: Days.MO,\n count: null,\n until: null,\n tzid: null,\n bysetpos: null,\n bymonth: null,\n bymonthday: null,\n bynmonthday: null,\n byyearday: null,\n byweekno: null,\n byweekday: null,\n bynweekday: null,\n byhour: null,\n byminute: null,\n bysecond: null,\n byeaster: null,\n};\nexport var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n/**\n *\n * @param {Options?} options - see \n * - The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...\n * @constructor\n */\nvar RRule = /** @class */ (function () {\n function RRule(options, noCache) {\n if (options === void 0) { options = {}; }\n if (noCache === void 0) { noCache = false; }\n // RFC string\n this._cache = noCache ? null : new Cache();\n // used by toString()\n this.origOptions = initializeOptions(options);\n var parsedOptions = parseOptions(options).parsedOptions;\n this.options = parsedOptions;\n }\n RRule.parseText = function (text, language) {\n return parseText(text, language);\n };\n RRule.fromText = function (text, language) {\n return fromText(text, language);\n };\n RRule.fromString = function (str) {\n return new RRule(RRule.parseString(str) || undefined);\n };\n RRule.prototype._iter = function (iterResult) {\n return iter(iterResult, this.options);\n };\n RRule.prototype._cacheGet = function (what, args) {\n if (!this._cache)\n return false;\n return this._cache._cacheGet(what, args);\n };\n RRule.prototype._cacheAdd = function (what, value, args) {\n if (!this._cache)\n return;\n return this._cache._cacheAdd(what, value, args);\n };\n /**\n * @param {Function} iterator - optional function that will be called\n * on each date that is added. It can return false\n * to stop the iteration.\n * @return Array containing all recurrences.\n */\n RRule.prototype.all = function (iterator) {\n if (iterator) {\n return this._iter(new CallbackIterResult('all', {}, iterator));\n }\n var result = this._cacheGet('all');\n if (result === false) {\n result = this._iter(new IterResult('all', {}));\n this._cacheAdd('all', result);\n }\n return result;\n };\n /**\n * Returns all the occurrences of the rrule between after and before.\n * The inc keyword defines what happens if after and/or before are\n * themselves occurrences. With inc == True, they will be included in the\n * list, if they are found in the recurrence set.\n *\n * @return Array\n */\n RRule.prototype.between = function (after, before, inc, iterator) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(after) || !isValidDate(before)) {\n throw new Error('Invalid date passed in to RRule.between');\n }\n var args = {\n before: before,\n after: after,\n inc: inc,\n };\n if (iterator) {\n return this._iter(new CallbackIterResult('between', args, iterator));\n }\n var result = this._cacheGet('between', args);\n if (result === false) {\n result = this._iter(new IterResult('between', args));\n this._cacheAdd('between', result, args);\n }\n return result;\n };\n /**\n * Returns the last recurrence before the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.before = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.before');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('before', args);\n if (result === false) {\n result = this._iter(new IterResult('before', args));\n this._cacheAdd('before', result, args);\n }\n return result;\n };\n /**\n * Returns the first recurrence after the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.after = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.after');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('after', args);\n if (result === false) {\n result = this._iter(new IterResult('after', args));\n this._cacheAdd('after', result, args);\n }\n return result;\n };\n /**\n * Returns the number of recurrences in this set. It will have go trough\n * the whole recurrence, if this hasn't been done before.\n */\n RRule.prototype.count = function () {\n return this.all().length;\n };\n /**\n * Converts the rrule into its string representation\n *\n * @see \n * @return String\n */\n RRule.prototype.toString = function () {\n return optionsToString(this.origOptions);\n };\n /**\n * Will convert all rules described in nlp:ToText\n * to text.\n */\n RRule.prototype.toText = function (gettext, language, dateFormatter) {\n return toText(this, gettext, language, dateFormatter);\n };\n RRule.prototype.isFullyConvertibleToText = function () {\n return isFullyConvertible(this);\n };\n /**\n * @return a RRule instance with the same freq and options\n * as this one (cache is not cloned)\n */\n RRule.prototype.clone = function () {\n return new RRule(this.origOptions);\n };\n // RRule class 'constants'\n RRule.FREQUENCIES = [\n 'YEARLY',\n 'MONTHLY',\n 'WEEKLY',\n 'DAILY',\n 'HOURLY',\n 'MINUTELY',\n 'SECONDLY',\n ];\n RRule.YEARLY = Frequency.YEARLY;\n RRule.MONTHLY = Frequency.MONTHLY;\n RRule.WEEKLY = Frequency.WEEKLY;\n RRule.DAILY = Frequency.DAILY;\n RRule.HOURLY = Frequency.HOURLY;\n RRule.MINUTELY = Frequency.MINUTELY;\n RRule.SECONDLY = Frequency.SECONDLY;\n RRule.MO = Days.MO;\n RRule.TU = Days.TU;\n RRule.WE = Days.WE;\n RRule.TH = Days.TH;\n RRule.FR = Days.FR;\n RRule.SA = Days.SA;\n RRule.SU = Days.SU;\n RRule.parseString = parseString;\n RRule.optionsToString = optionsToString;\n return RRule;\n}());\nexport { RRule };\n//# sourceMappingURL=rrule.js.map","import { DateWithZone } from './datewithzone';\nimport { iter } from './iter';\nimport { sort } from './dateutil';\nexport function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {\n var _exdateHash = {};\n var _accept = iterResult.accept;\n function evalExdate(after, before) {\n _exrule.forEach(function (rrule) {\n rrule.between(after, before, true).forEach(function (date) {\n _exdateHash[Number(date)] = true;\n });\n });\n }\n _exdate.forEach(function (date) {\n var zonedDate = new DateWithZone(date, tzid).rezonedDate();\n _exdateHash[Number(zonedDate)] = true;\n });\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (isNaN(dt))\n return _accept.call(this, date);\n if (!_exdateHash[dt]) {\n evalExdate(new Date(dt - 1), new Date(dt + 1));\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n }\n return true;\n };\n if (iterResult.method === 'between') {\n evalExdate(iterResult.args.after, iterResult.args.before);\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n return true;\n };\n }\n for (var i = 0; i < _rdate.length; i++) {\n var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate();\n if (!iterResult.accept(new Date(zonedDate.getTime())))\n break;\n }\n _rrule.forEach(function (rrule) {\n iter(iterResult, rrule.options);\n });\n var res = iterResult._result;\n sort(res);\n switch (iterResult.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n return ((res.length && res[res.length - 1]) || null);\n case 'after':\n default:\n return ((res.length && res[0]) || null);\n }\n}\n//# sourceMappingURL=iterset.js.map","import { __assign } from \"tslib\";\nimport { RRule } from './rrule';\nimport { RRuleSet } from './rruleset';\nimport { untilStringToDate } from './dateutil';\nimport { includes, split } from './helpers';\nimport { parseString, parseDtstart } from './parsestring';\n/**\n * RRuleStr\n * To parse a set of rrule strings\n */\nvar DEFAULT_OPTIONS = {\n dtstart: null,\n cache: false,\n unfold: false,\n forceset: false,\n compatible: false,\n tzid: null,\n};\nexport function parseInput(s, options) {\n var rrulevals = [];\n var rdatevals = [];\n var exrulevals = [];\n var exdatevals = [];\n var parsedDtstart = parseDtstart(s);\n var dtstart = parsedDtstart.dtstart;\n var tzid = parsedDtstart.tzid;\n var lines = splitIntoLines(s, options.unfold);\n lines.forEach(function (line) {\n var _a;\n if (!line)\n return;\n var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value;\n switch (name.toUpperCase()) {\n case 'RRULE':\n if (parms.length) {\n throw new Error(\"unsupported RRULE parm: \".concat(parms.join(',')));\n }\n rrulevals.push(parseString(line));\n break;\n case 'RDATE':\n var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1];\n if (rdateTzid && !tzid) {\n tzid = rdateTzid;\n }\n rdatevals = rdatevals.concat(parseRDate(value, parms));\n break;\n case 'EXRULE':\n if (parms.length) {\n throw new Error(\"unsupported EXRULE parm: \".concat(parms.join(',')));\n }\n exrulevals.push(parseString(value));\n break;\n case 'EXDATE':\n exdatevals = exdatevals.concat(parseRDate(value, parms));\n break;\n case 'DTSTART':\n break;\n default:\n throw new Error('unsupported property: ' + name);\n }\n });\n return {\n dtstart: dtstart,\n tzid: tzid,\n rrulevals: rrulevals,\n rdatevals: rdatevals,\n exrulevals: exrulevals,\n exdatevals: exdatevals,\n };\n}\nfunction buildRule(s, options) {\n var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid;\n var noCache = options.cache === false;\n if (options.compatible) {\n options.forceset = true;\n options.unfold = true;\n }\n if (options.forceset ||\n rrulevals.length > 1 ||\n rdatevals.length ||\n exrulevals.length ||\n exdatevals.length) {\n var rset_1 = new RRuleSet(noCache);\n rset_1.dtstart(dtstart);\n rset_1.tzid(tzid || undefined);\n rrulevals.forEach(function (val) {\n rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n rdatevals.forEach(function (date) {\n rset_1.rdate(date);\n });\n exrulevals.forEach(function (val) {\n rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n exdatevals.forEach(function (date) {\n rset_1.exdate(date);\n });\n if (options.compatible && options.dtstart)\n rset_1.rdate(dtstart);\n return rset_1;\n }\n var val = rrulevals[0] || {};\n return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache);\n}\nexport function rrulestr(s, options) {\n if (options === void 0) { options = {}; }\n return buildRule(s, initializeOptions(options));\n}\nfunction groomRruleOptions(val, dtstart, tzid) {\n return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid });\n}\nfunction initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n keys.forEach(function (key) {\n if (!includes(defaultKeys, key))\n invalid.push(key);\n });\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign(__assign({}, DEFAULT_OPTIONS), options);\n}\nfunction extractName(line) {\n if (line.indexOf(':') === -1) {\n return {\n name: 'RRULE',\n value: line,\n };\n }\n var _a = split(line, ':', 1), name = _a[0], value = _a[1];\n return {\n name: name,\n value: value,\n };\n}\nfunction breakDownLine(line) {\n var _a = extractName(line), name = _a.name, value = _a.value;\n var parms = name.split(';');\n if (!parms)\n throw new Error('empty property name');\n return {\n name: parms[0].toUpperCase(),\n parms: parms.slice(1),\n value: value,\n };\n}\nfunction splitIntoLines(s, unfold) {\n if (unfold === void 0) { unfold = false; }\n s = s && s.trim();\n if (!s)\n throw new Error('Invalid empty string');\n // More info about 'unfold' option\n // Go head to http://www.ietf.org/rfc/rfc2445.txt\n if (!unfold) {\n return s.split(/\\s/);\n }\n var lines = s.split('\\n');\n var i = 0;\n while (i < lines.length) {\n // TODO\n var line = (lines[i] = lines[i].replace(/\\s+$/g, ''));\n if (!line) {\n lines.splice(i, 1);\n }\n else if (i > 0 && line[0] === ' ') {\n lines[i - 1] += line.slice(1);\n lines.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n return lines;\n}\nfunction validateDateParm(parms) {\n parms.forEach(function (parm) {\n if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {\n throw new Error('unsupported RDATE/EXDATE parm: ' + parm);\n }\n });\n}\nfunction parseRDate(rdateval, parms) {\n validateDateParm(parms);\n return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });\n}\n//# sourceMappingURL=rrulestr.js.map","import { __extends } from \"tslib\";\nimport { RRule } from './rrule';\nimport { sort, timeToUntilString } from './dateutil';\nimport { includes } from './helpers';\nimport { iterSet } from './iterset';\nimport { rrulestr } from './rrulestr';\nimport { optionsToString } from './optionstostring';\nfunction createGetterSetter(fieldName) {\n var _this = this;\n return function (field) {\n if (field !== undefined) {\n _this[\"_\".concat(fieldName)] = field;\n }\n if (_this[\"_\".concat(fieldName)] !== undefined) {\n return _this[\"_\".concat(fieldName)];\n }\n for (var i = 0; i < _this._rrule.length; i++) {\n var field_1 = _this._rrule[i].origOptions[fieldName];\n if (field_1) {\n return field_1;\n }\n }\n };\n}\nvar RRuleSet = /** @class */ (function (_super) {\n __extends(RRuleSet, _super);\n /**\n *\n * @param {Boolean?} noCache\n * The same stratagy as RRule on cache, default to false\n * @constructor\n */\n function RRuleSet(noCache) {\n if (noCache === void 0) { noCache = false; }\n var _this = _super.call(this, {}, noCache) || this;\n _this.dtstart = createGetterSetter.apply(_this, ['dtstart']);\n _this.tzid = createGetterSetter.apply(_this, ['tzid']);\n _this._rrule = [];\n _this._rdate = [];\n _this._exrule = [];\n _this._exdate = [];\n return _this;\n }\n RRuleSet.prototype._iter = function (iterResult) {\n return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());\n };\n /**\n * Adds an RRule to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.rrule = function (rrule) {\n _addRule(rrule, this._rrule);\n };\n /**\n * Adds an EXRULE to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.exrule = function (rrule) {\n _addRule(rrule, this._exrule);\n };\n /**\n * Adds an RDate to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.rdate = function (date) {\n _addDate(date, this._rdate);\n };\n /**\n * Adds an EXDATE to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.exdate = function (date) {\n _addDate(date, this._exdate);\n };\n /**\n * Get list of included rrules in this recurrence set.\n *\n * @return List of rrules\n */\n RRuleSet.prototype.rrules = function () {\n return this._rrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of excluded rrules in this recurrence set.\n *\n * @return List of exrules\n */\n RRuleSet.prototype.exrules = function () {\n return this._exrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of rdates\n */\n RRuleSet.prototype.rdates = function () {\n return this._rdate.map(function (e) { return new Date(e.getTime()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of exdates\n */\n RRuleSet.prototype.exdates = function () {\n return this._exdate.map(function (e) { return new Date(e.getTime()); });\n };\n RRuleSet.prototype.valueOf = function () {\n var result = [];\n if (!this._rrule.length && this._dtstart) {\n result = result.concat(optionsToString({ dtstart: this._dtstart }));\n }\n this._rrule.forEach(function (rrule) {\n result = result.concat(rrule.toString().split('\\n'));\n });\n this._exrule.forEach(function (exrule) {\n result = result.concat(exrule\n .toString()\n .split('\\n')\n .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); })\n .filter(function (line) { return !/^DTSTART/.test(line); }));\n });\n if (this._rdate.length) {\n result.push(rdatesToString('RDATE', this._rdate, this.tzid()));\n }\n if (this._exdate.length) {\n result.push(rdatesToString('EXDATE', this._exdate, this.tzid()));\n }\n return result;\n };\n /**\n * to generate recurrence field such as:\n * DTSTART:19970902T010000Z\n * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n */\n RRuleSet.prototype.toString = function () {\n return this.valueOf().join('\\n');\n };\n /**\n * Create a new RRuleSet Object completely base on current instance\n */\n RRuleSet.prototype.clone = function () {\n var rrs = new RRuleSet(!!this._cache);\n this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); });\n this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); });\n this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); });\n this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); });\n return rrs;\n };\n return RRuleSet;\n}(RRule));\nexport { RRuleSet };\nfunction _addRule(rrule, collection) {\n if (!(rrule instanceof RRule)) {\n throw new TypeError(String(rrule) + ' is not RRule instance');\n }\n if (!includes(collection.map(String), String(rrule))) {\n collection.push(rrule);\n }\n}\nfunction _addDate(date, collection) {\n if (!(date instanceof Date)) {\n throw new TypeError(String(date) + ' is not Date instance');\n }\n if (!includes(collection.map(Number), Number(date))) {\n collection.push(date);\n sort(collection);\n }\n}\nfunction rdatesToString(param, rdates, tzid) {\n var isUTC = !tzid || tzid.toUpperCase() === 'UTC';\n var header = isUTC ? \"\".concat(param, \":\") : \"\".concat(param, \";TZID=\").concat(tzid, \":\");\n var dateString = rdates\n .map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })\n .join(',');\n return \"\".concat(header).concat(dateString);\n}\n//# sourceMappingURL=rruleset.js.map","import { RRule, rrulestr } from 'rrule';\r\n\r\nexport default function (scheduler) {\r\n\r\n\tfunction clearMilliseconds(date) {\r\n\t\treturn new Date(\r\n\t\t\tdate.getFullYear(),\r\n\t\t\tdate.getMonth(),\r\n\t\t\tdate.getDate(),\r\n\t\t\tdate.getHours(),\r\n\t\t\tdate.getMinutes(),\r\n\t\t\tdate.getSeconds(),\r\n\t\t\t0\r\n\t\t);\r\n\t}\r\n\r\n\tfunction isDeletedOccurrence(event) {\r\n\t\treturn !!event.deleted;\r\n\t}\r\n\r\n\tfunction isSeries(event) {\r\n\t\treturn !!event.rrule && !event.recurring_event_id;\r\n\t}\r\n\r\n\tfunction clearRecurringProperties(event) {\r\n\t\tevent.rrule = \"\";\r\n\t\tevent.original_start = null;\r\n\t\tevent.recurring_event_id = null;\r\n\t\tevent.duration = null;\r\n\t\tevent.deleted = null;\r\n\t}\r\n\r\n\tfunction createException(ev) {\r\n\t\tlet id = ev.id.split(\"#\");\r\n\r\n\t\tlet nid = scheduler.uid();\r\n\t\tscheduler._not_render = true;\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = id[0];\r\n\r\n\t\tlet timestamp = id[1];\r\n\r\n\t\tnev.original_start = new Date(Number(timestamp));\r\n\r\n\t\tscheduler._add_rec_marker(nev, timestamp);\r\n\t\tscheduler.addEvent(nev);\r\n\t\tscheduler._not_render = false;\r\n\t}\r\n\r\n\tscheduler._rec_temp = [];\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_markers = {};\r\n\tscheduler._add_rec_marker = function (ev, time) {\r\n\t\tev._pid_time = time;\r\n\t\tthis._rec_markers[ev.id] = ev;\r\n\t\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\t\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n\t};\r\n\tscheduler._get_rec_marker = function (time, id) {\r\n\t\tlet ch = this._rec_markers_pull[id];\r\n\t\tif (ch) return ch[time];\r\n\t\treturn null;\r\n\t};\r\n\tscheduler._get_rec_markers = function (id) {\r\n\t\treturn (this._rec_markers_pull[id] || []);\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old_add_event = scheduler.addEvent;\r\n\t\tscheduler.addEvent = function (start_date, end_date, text, id, extra_data) {\r\n\t\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\r\n\t\t\t\tif (ev.start_date) {\r\n\t\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t\t}\r\n\t\t\t\tif (ev.end_date) {\r\n\t\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn ev_id;\r\n\t\t};\r\n\t})();\r\n\r\n\tscheduler.attachEvent(\"onEventLoading\", function (event) {\r\n\r\n\t\tif (event.original_start) {\r\n\t\t\tevent.original_start = scheduler.templates.parse_date(event.original_start);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function (id, new_id) {\r\n\t\tif (this._ignore_call) return;\r\n\t\tthis._ignore_call = true;\r\n\r\n\t\tif (scheduler._rec_markers[id]) {\r\n\t\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\t\tdelete scheduler._rec_markers[id];\r\n\t\t}\r\n\r\n\t\tif (scheduler._rec_markers_pull[id]) {\r\n\t\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\t\tdelete scheduler._rec_markers_pull[id];\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\t\tvar tev = this._rec_temp[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i in this._rec_markers) {\r\n\t\t\tvar tev = this._rec_markers[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\ttev._pid_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar el = scheduler._rec_markers[new_id];\r\n\t\tif (el && el._pid_changed) {\r\n\t\t\tdelete el._pid_changed;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (scheduler.$destroyed) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tdelete this._ignore_call;\r\n\t});\r\n\r\n\tfunction deleteEventFromSeries(idTimestamp, ev) {\r\n\t\tlet id = idTimestamp;\r\n\t\tidTimestamp = id.split(\"#\");\r\n\t\tlet nid = scheduler.uid();\r\n\t\tlet tid = (idTimestamp[1]) ? idTimestamp[1] : (ev._pid_time);\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = ev.recurring_event_id || idTimestamp[0];\r\n\t\tnev.original_start = new Date(Number(tid));\r\n\t\tnev.deleted = true;\r\n\t\tscheduler.addEvent(nev);\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && !isDeletedOccurrence(ev))) {\r\n\t\t\tdeleteEventFromSeries(id, ev);\r\n\t\t} else {\r\n\t\t\tif (isSeries(ev) && this._lightbox_id)\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tid = sub[i].id;\r\n\t\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tif (!this._is_virtual_event(id) && this._is_modified_occurence(ev)) {\r\n\t\t\tif (!scheduler._events[id]) {\r\n\t\t\t\tev.deleted = true;\r\n\t\t\t\tthis.setEvent(id, ev);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function (id, event) {\r\n\t\tif (this._loading) return true;\r\n\r\n\t\tvar ev = this.getEvent(id);\r\n\r\n\t\tif (this._is_virtual_event(id)) {\r\n\t\t\tcreateException(ev);\r\n\r\n\t\t} else {\r\n\t\t\tif (ev.start_date) {\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date) {\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev) && this._lightbox_id) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t\t//scheduler.recurrings.rollbackDates(ev);\r\n\t\t\t}\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\t\tvar isEventFound = false;\r\n\t\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\t\tisEventFound = true;\r\n\t\t\t}\r\n\t\t\tif (!isEventFound)\r\n\t\t\t\tthis._select_id = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\", function (id) {\r\n\t\tif (!this._loading) {\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function (id, data, is_new_event) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev))\r\n\t\t\tthis._select_id = null;\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\tclearRecurringProperties(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCancel\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev)) {\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\t\tthis.render_view_data();\r\n\t\t}\r\n\t});\r\n\tscheduler._roll_back_dates = function (ev) {\r\n\t\t//// !!!!! calc temp properties\r\n\t\tif (ev.start_date) {\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif (ev.end_date) {\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\t\tev.end_date = ev._end_date;\r\n\t\tif (ev._start_date) {\r\n\t\t\tev.start_date.setMonth(0);\r\n\t\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._is_virtual_event = function (id) {\r\n\t\treturn id.toString().indexOf(\"#\") != -1;\r\n\t};\r\n\tscheduler._is_modified_occurence = function (ev) {\r\n\t\treturn (ev.recurring_event_id && ev.recurring_event_id != \"0\");\r\n\t};\r\n\r\n\tscheduler.showLightbox_rec = scheduler.showLightbox;\r\n\tscheduler.showLightbox = function (id) {\r\n\t\tvar locale = this.locale;\r\n\t\tvar c = scheduler.config.lightbox_recurring;\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tvar pid = ev.recurring_event_id;\r\n\t\tvar isVirtual = this._is_virtual_event(id);\r\n\t\tif (isVirtual)\r\n\t\t\tpid = id.split(\"#\")[0];\r\n\r\n\t\t// show series\r\n\t\tvar showSeries = function (id) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tevent._end_date = event.end_date;\r\n\t\t\tevent.end_date = new Date(event.start_date.valueOf() + event.duration * 1000);\r\n\t\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t\t};\r\n\r\n\t\tif ((pid || pid * 1 === 0) && isSeries(ev)) {\r\n\t\t\t// direct API call on series id\r\n\t\t\treturn showSeries(id);\r\n\t\t}\r\n\t\tif (!pid || pid === '0' || ((!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual))) {\r\n\t\t\t// editing instance or non recurring event\r\n\t\t\treturn this.showLightbox_rec(id);\r\n\t\t}\r\n\t\tif (c == 'ask') {\r\n\t\t\tvar that = this;\r\n\t\t\tscheduler.modalbox({\r\n\t\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\t\twidth: \"500px\",\r\n\t\t\t\tposition: \"middle\",\r\n\t\t\t\tbuttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\t\tcallback: function (index) {\r\n\t\t\t\t\tswitch (+index) {\r\n\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tshowSeries(pid);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction groupExceptions() {\r\n\t\tconst exceptions = {};\r\n\t\tfor (const i in scheduler._events) {\r\n\t\t\tconst ev = scheduler._events[i];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tif (!exceptions[ev.recurring_event_id]) {\r\n\t\t\t\t\texceptions[ev.recurring_event_id] = {};\r\n\t\t\t\t}\r\n\t\t\t\texceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn exceptions;\r\n\t}\r\n\r\n\tscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function (only_timed) {\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\t\tdelete this._events[this._rec_temp[i].id];\r\n\t\tthis._rec_temp = [];\r\n\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tvar stack = this.get_visible_events_rec(only_timed);\r\n\t\tvar out = [];\r\n\t\tfor (var i = 0; i < stack.length; i++) {\r\n\t\t\tif (stack[i].deleted || stack[i].recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(stack[i])) {\r\n\t\t\t\tthis.repeat_date(stack[i], out, undefined, undefined, undefined, undefined, exceptions);\r\n\t\t\t} else {\r\n\t\t\t\tout.push(stack[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old = scheduler.isOneDayEvent;\r\n\t\tscheduler.isOneDayEvent = function (ev) {\r\n\t\t\tif (isSeries(ev)) return true;\r\n\t\t\treturn old.call(this, ev);\r\n\t\t};\r\n\t\tvar old_update_event = scheduler.updateEvent;\r\n\t\tscheduler.updateEvent = function (id) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\r\n\t\t\tif (ev && isSeries(ev) && !this._is_virtual_event(id)) {\r\n\t\t\t\tscheduler.update_view();\r\n\t\t\t} else {\r\n\t\t\t\told_update_event.call(this, id);\r\n\t\t\t}\r\n\t\t};\r\n\t})();\r\n\r\n\tconst toIcalString = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\r\n\tscheduler.repeat_date = function (ev, stack, non_render, from, to, maxCount, exceptions) {\r\n\t\tif (!ev.rrule) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id];\r\n\t\tif (!seriesExceptions) {\r\n\t\t\tseriesExceptions = {};\r\n\t\t}\r\n\r\n\t\tif (!from) {\r\n\t\t\tfrom = scheduler._min_date;\r\n\t\t}\r\n\t\tif (!to) {\r\n\t\t\tto = scheduler._max_date;\r\n\t\t}\r\n\r\n\t\tconst utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds()));\r\n\t\tconst parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart/*ev.start_date*/ });\r\n\r\n\t\tconst repeatedDates = parsedRRule.between(from, to).map(date => {\r\n\t\t\tconst adjustedDate = new Date(date);\r\n\t\t\tadjustedDate.setHours(ev.start_date.getHours());\r\n\t\t\tadjustedDate.setMinutes(ev.start_date.getMinutes());\r\n\t\t\tadjustedDate.setSeconds(ev.start_date.getSeconds());\r\n\t\t\treturn adjustedDate;\r\n\t\t});\r\n\t\tlet visibleCount = 0;\r\n\r\n\t\tconst eventDuration = ev.duration;\r\n\r\n\t\tfor (let i = 0; i < repeatedDates.length; i++) {\r\n\t\t\tif (maxCount && visibleCount >= maxCount) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst date = repeatedDates[i];\r\n\r\n\t\t\tlet exception = seriesExceptions[date.valueOf()];\r\n\t\t\tif (exception) {\r\n\t\t\t\tif (exception.deleted) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvisibleCount++;\r\n\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst copy = scheduler._copy_event(ev);\r\n\t\t\t\t//copy._timed = ev._timed;\r\n\t\t\t\tcopy.text = ev.text;\r\n\t\t\t\tcopy.start_date = date;\r\n\t\t\t\tcopy.id = ev.id + \"#\" + Math.ceil(date.valueOf());\r\n\t\t\t\tcopy.end_date = new Date(date.valueOf() + eventDuration * 1000);\r\n\t\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date);\r\n\t\t\t\tcopy._timed = scheduler.isOneDayEvent(copy);\r\n\r\n\r\n\r\n\t\t\t\tif (!copy._timed && !scheduler._table_view && !scheduler.config.multi_day) continue;\r\n\t\t\t\tstack.push(copy);\r\n\r\n\t\t\t\tif (!non_render) {\r\n\t\t\t\t\tscheduler._events[copy.id] = copy;\r\n\t\t\t\t\tscheduler._rec_temp.push(copy);\r\n\t\t\t\t}\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._fix_daylight_saving_date = function (start_date, end_date, ev, counter, default_date) {\r\n\t\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\t\tif (shift) {\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\t// e.g. 24h -> 23h\r\n\t\t\t\treturn new Date(counter.valueOf() + ev.duration * 1000 - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// e.g. 24h -> 25h\r\n\t\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Date(default_date.valueOf());\r\n\t};\r\n\tscheduler.getRecDates = function (id, max) {\r\n\t\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\t\tvar recurrings = [];\r\n\t\tmax = max || 100;\r\n\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\treturn [\r\n\t\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t\t];\r\n\t\t}\r\n\t\tif (ev.deleted) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\t\tvar result = [];\r\n\t\tfor (var i = 0; i < recurrings.length; i++) {\r\n\t\t\tif (!recurrings[i].deleted) {\r\n\t\t\t\tresult.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tscheduler.getEvents = function (from, to) {\r\n\t\tvar result = [];\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tfor (var a in this._events) {\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tif (from && to && ev.start_date < to && ev.end_date > from) {\r\n\t\t\t\t\tvar sev = [];\r\n\t\t\t\t\tthis.repeat_date(ev, sev, true, from, to, undefined, exceptions);\r\n\t\t\t\t\tsev.forEach(function(occurence){\r\n\t\t\t\t\t\tif (occurence.start_date < to && occurence.end_date > from) {\r\n\t\t\t\t\t\t\tresult.push(occurence);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else if(!from && !to){\r\n\t\t\t\t\tresult.push(ev);\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\r\n\t//drop secondary attributes\r\n\tscheduler._copy_dummy = function (ev) {\r\n\t\tvar start_date = new Date(this.start_date);\r\n\t\tvar end_date = new Date(this.end_date);\r\n\t\tthis.start_date = start_date;\r\n\t\tthis.end_date = end_date;\r\n\t\tthis.duration = this.rrule = null;\r\n\t};\r\n\r\n\tscheduler.config.include_end_by = false;\r\n\tscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\tscheduler.config.recurring_workdays = [RRule.MO.weekday,RRule.TU.weekday,RRule.WE.weekday,RRule.TH.weekday,RRule.FR.weekday];\r\n\tscheduler.config.repeat_date = \"%m.%d.%Y\";\r\n\tscheduler.config.lightbox.sections = [\r\n\t\t{ name: \"description\", map_to: \"text\", type: \"textarea\", focus: true },\r\n\t\t{ name: \"recurring\", type: \"recurring\", map_to: \"rec_type\" },\r\n\t\t{ name: \"time\", height: 72, type: \"time\", map_to: \"auto\" }\r\n\t];\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function () {\r\n\t\tscheduler._rec_markers = {}; //clear recurring events data\r\n\t\tscheduler._rec_markers_pull = {};\r\n\t\tscheduler._rec_temp = [];\r\n\t});\r\n\r\n\r\n\tfunction getTopLevelOption(rruleObj, untilDate) {\r\n\t\tconst options = rruleObj.options;\r\n\t\tconst until = options.until || untilDate;\r\n\r\n\t\tconst hasEndCondition = options.count || (until && until.getFullYear() !== 9999);\r\n\r\n\t\tif (hasEndCondition) {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\r\n\t\tif (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'DAILY';\r\n\t\t} else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'WEEKLY';\r\n\t\t} else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'MONTHLY';\r\n\t\t} else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'YEARLY';\r\n\t\t} else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler.config.recurring_workdays.length &&\r\n\t\t\toptions.byweekday.includes(RRule.MO) &&\r\n\t\t\toptions.byweekday.includes(RRule.TU) &&\r\n\t\t\toptions.byweekday.includes(RRule.WE) &&\r\n\t\t\toptions.byweekday.includes(RRule.TH) &&\r\n\t\t\toptions.byweekday.includes(RRule.FR)) {\r\n\t\t\treturn 'WORKDAYS';\r\n\t\t} else {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction getWeekdayOfMonth(date) {\r\n\t\tconst dayOfWeek = date.getDay();\r\n\t\tconst dayOfMonth = date.getDate();\r\n\t\tconst dayNumber = Math.ceil(dayOfMonth / 7);\r\n\t\treturn { dayOfWeek, dayNumber };\r\n\t}\r\n\r\n\r\n\tconst jsDaysToRRULEDays = {\r\n\t\t0: \"SU\",\r\n\t\t1: \"MO\",\r\n\t\t2: \"TU\",\r\n\t\t3: \"WE\",\r\n\t\t4: \"TH\",\r\n\t\t5: \"FR\",\r\n\t\t6: \"SA\"\r\n\t};\r\n\tconst RruleDayNumsToJs = {\r\n\t\t0: 1,\r\n\t\t1: 2,\r\n\t\t2: 3,\r\n\t\t3: 4,\r\n\t\t4: 5,\r\n\t\t5: 6,\r\n\t\t6: 0\r\n\t};\r\n\r\n\tfunction fillCustomDaily(node, rule) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\t}\r\n\r\n\tfunction fillCustomWeekly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`);\r\n\t\tdayCheckboxes.forEach((ch) => ch.checked = false);\r\n\t\tif (rule && rule.byweekday) {\r\n\t\t\trule.byweekday.forEach((day) => {\r\n\t\t\t\tconst dayNum = RruleDayNumsToJs[day.weekday];\r\n\t\t\t\tconst dayLabel = jsDaysToRRULEDays[dayNum];\r\n\t\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst dayLabel = jsDaysToRRULEDays[event.start_date.getDay()];\r\n\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction fillCustomMonthly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfMonth.innerText = scheduler.templates.repeat_monthly_date(event.start_date, event);\r\n\t\tnthWeekDayOfMonth.innerText = scheduler.templates.repeat_monthly_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction formatDayNumber(date){\r\n\t\tswitch (date) {\r\n\t\t\tcase 1:\r\n\t\t\tcase 31:\r\n\t\t\t\treturn `${date}st`;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn `${date}nd`;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn `${date}rd`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${date}th`;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.templates.repeat_monthly_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\treturn `Every ${formatDayNumber(date)}`;\r\n\t};\r\n\tscheduler.templates.repeat_monthly_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`;\r\n\t};\r\n\t\r\n\tscheduler.templates.repeat_yearly_month_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(date)} day of ${monthLabel}`;\r\n\t};\r\n\tscheduler.templates.repeat_yearly_month_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`;\r\n\t};\r\n\r\n\tfunction fillCustomYearly(node, rule, event) {\r\n\t\tconst dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfYear.innerText = scheduler.templates.repeat_yearly_month_date(event.start_date, event);\r\n\t\tnthWeekDayOfYear.innerText = scheduler.templates.repeat_yearly_month_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fillEndRule(node, rule, event) {\r\n\t\tconst countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_after\"]`);\r\n\t\tconst ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_ondate\"]`);\r\n\t\tconst endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`);\r\n\t\tcountInput.value = 1;\r\n\r\n\t\tlet formatter = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tondateInput.value = scheduler.config.repeat_date_of_end;\r\n\r\n\t\tif (rule && rule.count) {\r\n\t\t\tendOptionSelect.value = \"AFTER\";\r\n\t\t\tcountInput.value = rule.count;\r\n\t\t} else if (event._end_date && event._end_date.getFullYear() !== 9999) {\r\n\t\t\tendOptionSelect.value = \"ON\";\r\n\t\t\tondateInput.value = formatter(event._end_date);\r\n\t\t} else {\r\n\t\t\tendOptionSelect.value = \"NEVER\";\r\n\t\t}\r\n\t\tendOptionSelect.dispatchEvent(new Event(\"change\"));\r\n\t}\r\n\r\n\tconst getRecValue = {\r\n\t\tMONTHLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.MONTHLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWEEKLY: function (dates) {\r\n\t\t\tlet day = dates.start.getDay() - 1;\r\n\t\t\tif (day == -1) day = 6;\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: [day]\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tDAILY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.DAILY,\r\n\t\t\t\tinterval: 1\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tYEARLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.YEARLY,\r\n\t\t\t\tbymonth: dates.start.getMonth() + 1,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWORKDAYS: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: scheduler.config.recurring_workdays\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tCUSTOM: function (dates, node) {\r\n\t\t\tconst rrule = {};\r\n\t\t\tconst freq = node.querySelector(`[name=\"repeat_interval_unit\"]`).value;\r\n\t\t\tconst interval = Math.max(1, node.querySelector(`[name=\"repeat_interval_value\"]`).value);\r\n\t\t\tconst monthRepeat = node.querySelector(`[name=\"dhx_custom_month_option\"]`).value;\r\n\t\t\tconst yearRepeat = node.querySelector(`[name=\"dhx_custom_year_option\"]`).value;\r\n\r\n\t\t\trrule.interval = interval;\r\n\t\t\tlet days;\r\n\t\t\tlet day;\r\n\r\n\t\t\tswitch (freq) {\r\n\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\trrule.freq = RRule.DAILY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WEEKLY\": \r\n\t\t\t\t\trrule.freq = RRule.WEEKLY;\r\n\t\t\t\t\tdays = [];\r\n\t\t\t\t\tnode.querySelectorAll(`.dhx_form_repeat_custom_week [name=\"week_day\"]`).forEach((ch) => {\r\n\t\t\t\t\t\tif(ch.checked){\r\n\t\t\t\t\t\t\tdays.push(ch.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trrule.byweekday = days.map((day) => {\r\n\t\t\t\t\t\tswitch (day) {\r\n\t\t\t\t\t\t\tcase \"MO\":\r\n\t\t\t\t\t\t\t\treturn RRule.MO.weekday;\r\n\t\t\t\t\t\t\tcase \"TU\":\r\n\t\t\t\t\t\t\t\treturn RRule.TU.weekday;\r\n\t\t\t\t\t\t\tcase \"WE\":\r\n\t\t\t\t\t\t\t\treturn RRule.WE.weekday;\r\n\t\t\t\t\t\t\tcase \"TH\":\r\n\t\t\t\t\t\t\t\treturn RRule.TH.weekday;\r\n\t\t\t\t\t\t\tcase \"FR\":\r\n\t\t\t\t\t\t\t\treturn RRule.FR.weekday;\r\n\t\t\t\t\t\t\tcase \"SA\":\r\n\t\t\t\t\t\t\t\treturn RRule.SA.weekday;\r\n\t\t\t\t\t\t\tcase \"SU\":\r\n\t\t\t\t\t\t\t\treturn RRule.SU.weekday;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\trrule.freq = RRule.MONTHLY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (monthRepeat === \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\trrule.freq = RRule.YEARLY;\r\n\t\t\t\t\trrule.bymonth = dates.start.getMonth() + 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (yearRepeat == \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tlet until = new Date(9999, 1, 1);\r\n\t\t\tconst endRule = node.querySelector(`[name=\"dhx_custom_repeat_ends\"]`);\r\n\t\t\tif(endRule === \"ON\"){\r\n\t\t\t\tuntil = node.querySelector(`[name=\"dhx_form_repeat_ends_ondate\"]`).value;\r\n\t\t\t} else if(endRule === \"AFTER\") {\r\n\t\t\t\trrule.count = Math.max(1, node.querySelector(`[name=\"dhx_form_repeat_ends_after\"]`).value);\r\n\t\t\t}\r\n\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tNEVER: function () {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction fillInDefaults(node, rule, event) {\r\n\t\tfillCustomDaily(node, rule, event);\r\n\t\tfillCustomWeekly(node, rule, event);\r\n\t\tfillCustomMonthly(node, rule, event);\r\n\t\tfillCustomYearly(node, rule, event);\r\n\t\tfillEndRule(node, rule, event);\r\n\t}\r\n\tscheduler.form_blocks[\"recurring\"] = {\r\n\t\trender: function (sns) {\r\n\t\t\tif (sns.form) {\r\n\t\t\t\tlet rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\t\tlet form = rec._get_node(sns.form);\r\n\t\t\t\tlet html = rec._outer_html(form);\r\n\t\t\t\tform.style.display = 'none';\r\n\t\t\t\treturn html;\r\n\t\t\t}\r\n\t\t\tlet loc = scheduler.locale.labels;\r\n\r\n\t\t\treturn `
\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
${loc.repeat_ends}
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t
\r\n\t
`;\r\n\t\t},\r\n\r\n\t\r\n\t\t_init_set_value: function (node, value, event) {\r\n\t\t\tscheduler.form_blocks[\"recurring\"]._ds = { start: event.start_date, end: event.end_date };\r\n\t\t\tfunction hide(node) {\r\n\t\t\t\tnode.classList.add(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction show(node) {\r\n\t\t\t\tnode.classList.remove(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction onRepeatOptionChange(value) {\r\n\t\t\t\tconst repeat = node.querySelector(\".dhx_form_repeat_custom\");\r\n\t\t\t\tif (value === \"CUSTOM\") {\r\n\t\t\t\t\tshow(repeat);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thide(repeat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatIntervalChange(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tweekly: node.querySelector(\".dhx_form_repeat_custom_week\"),\r\n\t\t\t\t\tmonthly: node.querySelector(\".dhx_form_repeat_custom_month\"),\r\n\t\t\t\t\tyearly: node.querySelector(\".dhx_form_repeat_custom_year\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"WEEKLY\":\r\n\t\t\t\t\t\tshow(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\tshow(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\tshow(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatEndRule(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tafter: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after\"),\r\n\t\t\t\t\ton: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"NEVER\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AFTER\":\r\n\t\t\t\t\t\tshow(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ON\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\tshow(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// repeat section change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").addEventListener(\"change\", function () {\r\n\t\t\t\tonRepeatOptionChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat interval change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_custom_interval [name='repeat_interval_unit']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatIntervalChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat end rule\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatEndRule(this.value);\r\n\t\t\t});\r\n\r\n\t\t\tscheduler._lightbox._rec_init_done = true;\r\n\t\t},\r\n\t\tbutton_click: function(){},\r\n\t\tset_value: function (node, value, ev) {\r\n\t\t\tlet rf = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\t\trf._init_set_value(node, value, ev);\r\n\t\t\tnode.open = !ev.rrule;\r\n\r\n\t\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\t\tlet ds = rf._ds;\r\n\t\t\tds.start = ev.start_date;\r\n\t\t\tds.end = ev._end_date;\r\n\r\n\t\t\tif (ev.rrule) {\r\n\t\t\t\tconst rruleset = rrulestr(ev.rrule);\r\n\t\t\t\tfillInDefaults(node, rruleset.origOptions, ev);\r\n\t\t\t\tconst topOption = getTopLevelOption(rruleset, ev._end_date);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = topOption;\r\n\t\t\t\tif(topOption === \"CUSTOM\"){\r\n\t\t\t\t\tlet customFreq;\r\n\t\t\t\t\tswitch (rruleset.origOptions.freq) {\r\n\t\t\t\t\t\tcase RRule.DAILY:\r\n\t\t\t\t\t\t\tcustomFreq = \"DAILY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.WEEKLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"WEEKLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.MONTHLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"MONTHLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.YEARLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"YEARLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(customFreq){\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).value = customFreq;\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).dispatchEvent(new Event(\"change\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t//\trepeat_interval_unit\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tfillInDefaults(node, null, ev);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = \"NEVER\";\r\n\t\t\t}\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").dispatchEvent(new Event(\"change\"));\r\n\r\n\t\t},\r\n\t\tget_value: function (node, ev) {\r\n\t\t\t\r\n\t\t\tif(!node.blocked && node.querySelector(\".dhx_form_repeat_pattern select\").value !== \"NEVER\") {\r\n\t\t\t\tlet ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\t\tlet actual_dates = {};\r\n\r\n\t\t\t\tlet timeControl = getTimeSection();\r\n\r\n\t\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\t\tds.start = actual_dates.start_date;\r\n\t\t\t\tconst pattern = node.querySelector(\".dhx_form_repeat_pattern select\").value;\r\n\t\t\t\tconst recurrence = getRecValue[pattern](ds, node);\r\n\t\t\t\tev.rrule = new RRule(recurrence.rrule).toString().replace(\"RRULE:\", \"\");\r\n\t\t\t\tds.end = recurrence.until;\r\n\r\n\t\t\t\tev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1000);\r\n\r\n\t\t\t\tif (ds._start) {\r\n\t\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\t\tds._start = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._start_date = null;\r\n\r\n\t\t\t\tev._end_date = ds.end;\r\n\t\t\t}else{\r\n\t\t\t\tev.rrule = ev.rrule = \"\";\r\n\t\t\t\tev._end_date = ev.end_date;\r\n\t\t\t}\r\n\r\n\t\t\treturn ev.rrule;\r\n\t\t},\r\n\r\n\t\tfocus: function (node) {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction getTimeSection() {\r\n\t\tlet timeControl = scheduler.formSection('time');\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('time');\r\n\t\t}\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t\t}\r\n\r\n\r\n\t\tif (!timeControl) {\r\n\t\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\t\t\t\t\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\t\t\t\t\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\t\t\t\t\"\",\r\n\t\t\t\t\"scheduler.config.lightbox.sections = [\",\r\n\t\t\t\t\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n\t\t\t\t.join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\treturn timeControl;\r\n\t}\r\n\r\n\tfunction getFirstSectionOfType(type) {\r\n\t\tfor (let i = 0; i < scheduler.config.lightbox.sections.length; i++) {\r\n\t\t\tlet section = scheduler.config.lightbox.sections[i];\r\n\t\t\tif (section.type === type) {\r\n\t\t\t\treturn scheduler.formSection(section.name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t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t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'
';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_year_grid= function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport recurring_legacy from \"./recurring_legacy\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\trecurring_legacy,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };"],"names":["dhtmlxHook","dhtmlx","attaches","attachScheduler","day","mode","tabs","scheduler","obj","document","createElement","id","this","_genStr","innerHTML","body","appendChild","firstChild","attachObject","vs","av","sched","schedId","setSizes","updateView","destructor","init","_viewRestore","globalScope","window","global","global$1","dragHighlightPos","dndMarkers","dragStarted","eventNode","event","isEnabled","config","drag_highlight","markTimespan","checkViewName","viewName","viewObj","getView","layout","checkSectionPropertyName","y_property","map_to","setRequiredStylesToMarker","style","top","left","marginLeft","createMarkerConfig","configSettings","sectionId","sections","markerObject","start_date","end_date","css","html","date","add","createViewMarker","settings","markerConfigs","getMonthViewMarkers","getTimelineAndUnitsViewMarkers","getColumnViewMarkers","forEach","cfg","push","columnViewMarkersArray","eventNodes","$container","querySelectorAll","event_attribute","i","length","eventNodeClone","cloneNode","startDate","Date","getAttribute","endDate","dates","monthViewMarkersArray","weekDates","currDate","valueOf","week_start","cells","unitMarkersArray","sectionPropertyName","multisection","String","split","section_delimiter","formatedSections","map","element","elems","attachEvent","e","getEvent","target","closest","getState","cascade_event_display","unselect","getActionData","section","unmarkTimespan","undoDelete","ev","deletedEvent","copy","undo_deleted","new_event","message","text","expire","type","callback","undoBtn","addEvent","render","limitPlugin","mark_now","display_marked_timespans","overwrite_marked_timespans","dhx_time_block","default_timespan_type","fix_options","options","days","zones","get_resulting_options","blockTime","addMarkedTimespan","unblockTime","deleteMarkedTimespan","checkInMarkedTimespan","timespan_type","on_overlap","res","temp_start_date","temp_end_date","timespans","_marked_timespans","date_part","day_value","day_index","getDay","getZones","eventStart","_get_zone_minutes","eventEnd","getDate","markerStart","markerEnd","checkLimitViolation","check_limits","s","c","evs","rec_type","_end_date","seriesEnd","limit_start","limit_end","recEventInLimits","complete_res","p","_timed","isOneDayEvent","allow","_drag_id","_drag_mode","setHours","setMinutes","checkEvent","callEvent","_get_blocked_zones","property","timeline_zones","blocked_timeline_zones","_get_relevant_blocked_zones","_add_timespan_zones","resultZones","concat","containers","_props","matrix","container","view","view_config","linker","_mark_now","hide","dhx_now_time","_els","now","_currentDate","_remove_mark_now","_max_date","_min_date","getHours","first_hour","last_hour","locate_holder_day","_append_mark_now","zone_start","_table_view","_mode","start_index","end_index","units_l","size","position","r_divs","t_day","t_div","_render_marked_timespan","els","div","parent","parentNode","removeChild","getMinutes","_prepare_timespan_options","r_configs","temp_configs","Array","t_days","slice","cloned_config","_lame_clone","apply","undefined","min","max","invert_zones","invertZones","uid","view_key","hasOwnProperty","ids","t_config","_lame_copy","k","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","index","start","end","start_day","delta","t_date","_get_css_classes_by_config","css_classes","join","_get_block_by_config","block","area","blocks","min_date","max_date","date_to_display","min_day","areas","_scales","sday","_cols","_ignores","block_proto","className","height","width","order","inner_index","locate_holder","Math","all_hours_height","hour_size_px","hour_ms","round","_mark_timespans","data","divs","_on_scale_add_marker","len","childNodes","_getClassName","indexOf","configuration","Error","rebuild_els","get_elements","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","offset","splice","_subtract_timespan_zones","is_modified","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","d","dayConfig","day_timespans","d_t","related_zones","arguments","types","t","typedConfig","_get_types_to_render","common","specific","types_to_render","_get_configs_to_render","units","_get_unit_index","unit","_date","dx","day_ind","unitsPerDay","floor","key","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","src","dblclick_create","addEventNow","createMethod","methods","isActive","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","call","restoreMethods","batchUpdatePayload","console","error","$stateProvider","registerProvider","batch_update","batchUpdate","noRedraw","call_dp","_dp","updateMode","dp_mode","setUpdateMode","calls","setModeDate","needRender","needUpdateView","repaintEvents","rememberModeDate","setCurrentView","render_data","render_view_data","updateEvent","sendData","initPlugins","limit","uidSeed","isArray","pop","isStringObject","Function","prototype","toString","constructor","isNumberObject","isBooleanObject","isDate","getFullYear","getMonth","defined","delay","timeout","timer","result","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","utils","mixin","source","force","f","object","Number","Boolean","varType","Object","StateService","stateProviders","name","provider","method","internal","unregisterProvider","assert","check","show_errors","log","extend","commonViews","agenda","grid","timeline","week_agenda","year","anythingElse","requiredExtensions","_commonErrorMessages","unknownView","relatedDoc","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","renderCalendar","exportToPNG","exportToPDF","dhtmlxError","catchError","a","b","responseText","ajax_error","alert","classes","cssClass","classList","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","isCalendarVisible","destroyCalendar","navigation","handler","calendar","html_element","findRenderer","renderer","rows","cols","renderElement","value","align","justifyContent","prepareConfig","renderLayout","fragment","createDocumentFragment","items","next","_init_nav_bar","navBar","querySelector","_update_nav_bar","previousHeight","heightChanged","configChanged","newHeight","xy","nav_height","unset_actions","set_actions","display","isAttachedNode","root","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","equals","listenWindowResize","oldSize","resizeDelay","$destroyed","newSize","triggerSchedulerResize","$root","watchNodeResize","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","addResizeListener","containerStyles","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","salesforce_environment","contentWindow","EventHost","_silent_mode","listeners","createEventStorage","handlers","eventStorage","combinedResult","handlerResult","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","innerId","attachAll","eventArguments","handlerName","detachEvent","list","eventId","detachAllEvents","eventable","nav_bar","_detachDomEvent","el","removeEventListener","_init_once","scheduler_resize_listener","navbar","header","dataArea","hasSchedulerMarkup","createDefaultHeader","views","nav","_grid","names","optionalViews","_obj","getElementById","wai_aria_application_role","JSON","stringify","rtl","_skin_init","_scroll","init_templates","_init_touch_events","set_sizes","$initialized","min_event_height","bar_height","scale_width","scroll_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","keys","edit_save","edit_cancel","functor","_x","scale_x","materialScalePlaceholder","_is_material_skin","insertBefore","set_xy","offsetTop","_lightbox","_setLbPosition","_data_width","right","node","x","y","prepareValue","val","prepared","isNaN","direction","getElementsByTagName","class_name","attr_value","label","locale","labels","_waiAria","labelAttr","domEventsScope","_createDomEventScope","detachAll","_click","attach","preventDefault","_temp_touch_block","_on_mouse_move","_ignore_next_click","_on_mouse_down","_on_mouse_up","_on_dbl_click","returnValue","_locate_event","select","_select_id","_close_not_saved","editStop","previousSelection","editor_id","_edit_id","lightbox_id","_lightbox_id","_new_event","select_id","expanded","drag_id","drag_mode","dhx_cal_data","cancelBubble","readonly","icon","mask","buttons","replace","dhx_cal_prev_button","dhx_cal_next_button","dummy","step","def_step","dhx_cal_today_button","dhx_cal_tab","deprecated_name","substring","search","delete","confirm_deleting","_dhtmlx_confirm","title","title_confirm_deleting","deleteEvent","ok","icon_delete","edit","save","details","showLightbox","form","cancel","opts","confirm","base","_isObject","_isDate","duration","event_duration","time_step","start_hour","setTime","_loading","_drag_event","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","isIE","pageX","pageY","clientX","scrollLeft","clientLeft","clientY","scrollTop","clientTop","_colsS","$domHelpers","getAbsoluteLeft","getAbsoluteTop","dy","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","confirm_closing","title_confirm_closing","positive_closing","_drag_pos","_correct_shift","back","getTimezoneOffset","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","acc","abs","d_pos","has_moved","_correct_drag_start_date","_start_correction","_end_correction","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","time_part","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","lastHour","maxY","precisePos","minDate","maxDate","preciseDate","cursor","shift","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","_allow_dnd","update_render","sx","update_view","for_rendered","r","srcElement","classname","drag_event_body","fullClass","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","_mobile","moved","_dhx_changed","is_new","edit_on_create","details_on_create","_trigger_dyn_loading","_load_mode","_load","_render_wait","_reset_ignores","_reset_scale","isViewExists","templates","_set_aria_buttons_attrs","buttonGroups","group","j","prev","headerButtonsAttributes","icon_form","icon_edit","oldClass","newClass","dhx_multi_day","prev_scroll","preserve_scroll","multidayScroll","_dy_shift","tab","headerToggleState","remove","_render_x_header","offset_top","head","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","from","to","count","count_n","_get_timeunit_start","_get_view_end","dd","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","parseInt","scales","cls","firstHalf","slotDate","format_date","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","day_start","_getNavDateElement","str","drag_resize","drag_move","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","visibility","totalWidth","col_length","hiddenWidth","c2","cc","content","hour_scale","hourScaleAttr","scroll_hour","now_date","n","preserve","ignore","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","month_day","cellBody","bf1","parse_date","getLabel","lightbox","updateCollection","list_name","collection","serverList","resetLightbox","hideCover","cache","create","n_ev","_focus","focus","getDaysDifference","differenceInTime","getTime","differenceInDays","eventLength","startColumnIndex","endColumnIndex","_get_date_index","last_column","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","fd","start_slot","end_slot","_get_section_property","_is_initialized","state","_is_lightbox_open","defaultDomEvents","addEventListener","eventRemove","createEventScope","domEvents","eventScope","capture","detach","staticArray","_eventRemoveAll","_trim","func","trim","htmlTags","RegExp","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","attr","attributes","setAttributes","values","day_date","role","getHeaderCellAttr","dateString","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","attrs","agendaDetailsBtnString","icon_details","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","month","hour","minute","messageButtonAttrString","buttonLabel","messageInfoAttr","messageModalAttr","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","isDisabled","payload","elementPosition","elem","bottom","getBoundingClientRect","box","docElem","pageYOffset","pageXOffset","offsetLeft","offsetParent","getRelativeEventPosition","getNodePosition","getClassName","baseVal","getTargetNode","trg","tagName","shadowRoot","composedPath","locateCss","strict","ind","charAt","isVisible","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","hasHref","canHaveHref","nodeName","loLowerCase","canDisable","input","textarea","hasAttribute","getFocusableNodes","nodes","nodesArray","$position","sort","isValid","isShadowDomSupported","createShadowRoot","attachShadow","getActiveElement","activeElement","getSelection","focusNode","getRootNode","ShadowRoot","host","hasShadowParent","dom_helpers","htmlObject","getOffset","getOffsetSum","getOffsetRect","test","navigator","userAgent","dummyBox","selector","insertAfter","newNode","referenceNode","nextSibling","isChildOf","child","contains","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isOpera","isChrome","isKHTML","isFF","isIPad","isEdge","isNode","clearAll","serialize$1","serialized","encodeURIComponent","Promise","createConfig","url","async","headers","serialize","ajax","serializeRequestParams","parse","DOMParser","parseFromString","ActiveXObject","loadXML","xmltop","tagname","xhr","status","xml","responseXML","xpath","xpathExp","docObj","selectNodes","first","col","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","query","_call","get","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","match","readyState","xmlDoc","filePath","open","setRequestHeader","toUpperCase","send","urlSeparator","$ajax","generateStringToDate","format","utc","splt","code","csp_date_to_str","to_fixed","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","month_short","month_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","csp_str_to_date","set","temp","month_short_hash","month_full_hash","UTC","cspEnabled","checkIfCSPEnabled","useCsp","csp","old","setSeconds","setMilliseconds","start_on_monday","month_start","setDate","year_start","setMonth","_add_days","inc","ndate","datesDiff","rest","hours","setYear","num","date_to_str","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","isYMDDate","datestr","isMDYDate","isDMYDate","isISO8601","parseYMD","parseMDY","parseDMY","parse_exact_format","nday","first_thursday","year_number","ordinal_date","week_number","convert_to_utc","default_date","month_date","load_date","week_date","hour_date","date_format","api_date","displayed_event_color","displayed_event_text_color","wide_form","day_column_padding","use_select_menu_space","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","server_utc","touch","touch_tip","touch_drag","touch_swipe_dates","quick_info_detached","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","delay_render","timeline_swap_resize","$initial","_helpers","parseDate","xml_date","formatDate","xml_format","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","load_format","event_header","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","_events","_loaded","clear_view","extra_data","event_updated","silent","setEvent","hash","_rendered","changeEventId","new_id","create_getter","create_setter","_changed","is_visible_events","clear_event","in_visible_range","evFirstHour","evLastHour","end_dates_visible","hidden_duration","checkEndDate","get_visible_events","only_timed","stack","filter_event","filter","_is_main_area_event","hold","full","_not_render","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","getEvents","_get_event_bar_pos","widt","x2","_pre_render_events","render_event_bar","max_evs","max_month_events","_sorder","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_line","_pre_render_events_table","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","t_end_date","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","cellIndex","weekCellIndex","out","weeks","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","parentPosition","zIndex","color","setProperty","tplClass","cssText","_editor","shiftKey","keyCode","icons","icons_str","ariaAttr","currentIcon","textColor","highlightEventPosition","contentA","contentB","cs","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","restoreOriginalColors","getSectionTop","posFromDate","_smartRenderingEnabled","scrollTo","_append_drag_marker","m","zone","scale","lastChild","previousSibling","_update_marker_position","_parsers","canParse","topElement","loader","csrfToken","security_key","arr","itms","itm","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","err","events","dhx_security","collections","collections_loaded","option","option_key","ical","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","dh","dm","utcMark","dn","getSerializator","_load_url","prevent_cache","ajaxCallback","response","on_load","lf","cache_line","temp_to","xmlLoaded","jsonLoader","iCalLoader","foundParser","parser","_process","_process_loading","_after_call","_tagvalue","_init_date","getSerializableData","createSerializator","dataset","allEvents","exportedEvent","exportValue","rawValue","load","setLoadMode","array","show_loading","_y","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","time","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","dt","last","limit_time_select","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","full_day","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","getLightboxRoot","cspEnvironment","salesforceEnvironment","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","action","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","labelBlock","inputBlock","fallback","inputId","old_id","mobile","MSStream","platform","maxTouchPoints","touchEventsSupported","createEvent","_touch_events","touches","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","accessor","tracker","scroll_mode","action_mode","dblclicktime","attachTouchEvent","passive","check_direction_swipe","s_ev","e_ev","max_dy","scrollable","doMouseMove","dnd","original_render","_update_global_tip","drag_cancel","_pointerDragId","pointerId","fake_event","_block_next_stop","actTask","fakeTask","sourceTask","_show_global_tip","_hide_global_tip","toptip","_global_tip","drag_to_create","drag_to_move","getRootView","tag","hooks","didInsert","cmp","_addThemeClass","skin","_skin_settings","_skin_xy","lightbox_additional_height","checkIfMaterialSkin","themeNameFromFile","links","href","_build_skin_info","monitorThemeChange","styles","themeVar","isCssVarTheme","themeName","cssValues","oldMaterialTheme","_theme_info","theme","cssVarTheme","themeVariables","calculatedMaterial","probe","cachedBorderBoxValue","checkIfBorderBoxStyling","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","newStyling","_configure","setSkin","flatSkinHourScale","monitorIntervalId","clearInterval","setInterval","csstheme","_old_month_day","old_month_day","reorderTabs","specialTabs","tabName","find","firstTab","reverse","jQuery","$","counter","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","self","oldDate","oldMode","updateFlags","lazy_updateView","ars","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","_add_rec_marker","extendScheduler","_is_virtual_event","getUserData","_set_event_text_style","rec_pattern","_dp_change_event_id","_dp_hook_delete","setDp","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","setTransactionMode","total","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","_columns","getSyncState","enableDataNames","enablePartialDataSend","master","rowId","findRow","existing","set_invalid","is_invalid","markRow","_methods","getActionByState","checkBeforeUpdate","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","pref","_applyPayload","dataToSend","_onResolvedCreateUpdate","resultState","sid","tid","afterUpdateCallback","routerMode","actionPromise","update","then","catch","queryParams","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","preprocessedData","_cleanupItemBeforeSend","valid","_forEachUpdatedRow","_getAllData","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","processedData","updatedItem","output","_prepareDataItem","item","processedItem","dataItem","createDataProcessor","tMode","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","which","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","buttonCss","info","timers","pull","getFirstDefined","_boxStructure","contentId","inner","message_ok","message_cancel","btn","_createBox","hidden","alertPopup","confirmPopup","boxPopup","box_params","params","alertBox","confirmBox","focusable","subtype","seed","hideAll","popups","modalbox","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","section_description","section_time","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","repeat_never","repeat_daily","repeat_workdays","repeat_weekly","repeat_monthly","repeat_yearly","repeat_custom","repeat_freq_day","repeat_freq_week","repeat_freq_month","repeat_freq_year","repeat_on_date","repeat_ends","month_for_recurring","day_for_recurring","be","agenda_tab","description","year_tab","week_agenda_tab","ca","cn","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","i18nFactory","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","labelFormat","dayElement","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","dayStart","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","stateProvider","common_errors","schedulerCore","wai_aria","dom","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","event_highlight","dhtmlx_suite_hooks","skins","jquery","dataProcessorExtend","connector","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","addPlugins","ext","activePlugins","plugins","extensionList","getExtensionList","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","ExtensionsManager","_extensions","SchedulerFactory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","calendars","addCalendar","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","_agendaScrollTop","set_full_view","l","rowAttr","dateHeader","descriptionHeader","tableAttr","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","agenda_area","v_border","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","renderEmptyView","renderDay","calendarEvent","renderOneEvent","selectedId","bg","all_timed_month","is_event_short","_safe_copy","proto","event_pid","isPrototypeOf","event_length","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","before","collision_limit","_setTempSection","event_id","checked_mode","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","second","evs_dates","getRecDates","tevs","concurrent","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","rows_length","year_y","week_agenda_scale_height","cur_height","eventsContainer","g","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","setCookie","cookie_param","getCookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","old_load","notImplemented","daytimeline_restricted","drag_between_restricted","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","all_options","single_option","addOption","getIndexByValue","selectOption","selected_id","disable","setComboValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","grid_view","html_templates","all","keyboard_shortcuts","$keyboardNavigation","shortcuts","createCommand","modifiers","alt","ctrl","meta","shortcut","commands","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","ctrlKey","metaKey","printableKey","fromCharCode","getHashFromEvent","getHash","parts","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","eventhandler","EventHandler","_handlers","findHandler","doAction","unbind","bindAll","initKeys","trap_modal_focus","trapFocus","currentFocus","currentIndex","nextIndex","nextItem","renderMultiple","currentStart","currentEnd","TimeSlot","_modes","_getMode","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","round_position","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","_timeline_getX","tempStart","tempEnd","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","lineHeight","scheduler_node","SchedulerNode","_compose","getDefaultNode","getMode","blur","enable","removeAttribute","_compareEvents","_pickEvent","startId","eventElement","Event","getNode","nextEventHandler","activeNode","dispatcher","nextEvent","currEvent","visibleDates","nextEv","setActiveNode","prevEventHandler","HeaderCell","getNodes","_key_nav_copy_paste","nav_node","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","header_cell","defaultCell","_getSection","_getNodes","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","keepScrollPosition","_moveToSlot","slot","nextSlot","time_slot","movingDate","getDefaultDate","key_nav_step","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","clone","timeslot","_getMultisectionView","_getNextSection","isInRange","defaultSlot","DataArea","smart_rendering","_pasteDate","_pasteSection","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","minutes","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","minical_button","MinicalButton","globalNode","MinicalCell","minical_cell","_getGrid","_getNode","enabled","newRow","newCol","modals","modalsStack","isModal","afterPopup","startModal","endModal","isTopModal","currentTarget","traceLightbox","_keyNavMessagePopup","focusElement","backupFocus","core","getActiveNode","setDefaultNode","focusGlobalNode","blurNode","editor","keyDownHandler","defaultPrevented","schedulerNode","_timeout","key_nav_legacy","_temp_key_scope","key_nav","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","clear_event_after","copyEvent","_make_pasted_event","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","getSelectedEvent","_buffer_event","new_ev","scheduler_handlers","attachSchedulerHandlers","focusHandler","waitCall","reFocusActiveNode","mousedownHandler","dataAreaClick","listOfScales","arrOfScales","some","focusEvent","evNode","prevState","lastStart","lastEnd","lastSection","minical_handlers","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","td","renderMinical","cal","added","destroyMinical","_def_count","addShortcut","scope","scopeObject","getScope","getShortcutHandler","removeShortcut","disp","scopes","minicalButton","minicalDate","timeSlot","searchMap","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_view","_temp_limit_scope","om","od","nm","nd","isBlocked","date_end","resetDate","is_new_event","data_copy","native_object","_mark_now_timer","GoogleMapAdapter","_markers","zoom","zoom_after_resolve","initial_zoom","lat","lng","setCenter","setZoom","error_position","google","maps","trigger","mapOptions","center","initial_position","mapId","scrollwheel","mapTypeId","Map","__gm","messageOverlay","outerContainer","setOptions","addListener","geocoder","Geocoder","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","event_location","formatted_address","clearInstanceListeners","addEventMarker","AdvancedMarkerElement","importLibrary","mapView","createMarker","setMap","infoWindow","close","InfoWindow","maxWidth","info_window_max_width","setContent","map_info_content","anchor","markerInfo","setVisible","setPosition","latlng","LatLng","clearEventMarkers","latitude","longitude","string","address","OpenStreetMapAdapter","openPopup","closeTooltip","setView","mapWrapper","L","tileLayer","addTo","on","fetch","country","myIcon","iconUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupConfig","minWidth","markerPopup","popup","tooltip","markerConfig","bindPopup","bindTooltip","removeLayer","setLatLng","lon","MapboxAdapter","getPopup","isOpen","togglePopup","mapboxgl","accessToken","lngLat","features","place_name","Popup","focusAfterOpen","setMaxWidth","setHTML","Marker","setLngLat","setPopup","resolveAddress","map_view","mapAdapter","eventHandlerIds","adapters","googleMap","openStreetMaps","mapbox","createAdapter","map_view_provider","currentAdapter","_latLngUpdate","_eventLocationChanged","map_settings","resolve_user_location","resolve_event_location","view_provider","map_initial_position","map_error_position","map_date_width","map_icon_width","map_description_width","add_map","map_date","map_time","map_text","map_start","setupMapView","attachSchedulerEvents","addEventWithLocation","coordinates","removeEventMarker","setUserLocation","adapter","geolocation","getCurrentPosition","coords","dblclick_dhx_map_area","unmodifiedEvent","updateEventMarker","newIdEvent","onEventClick","detachSchedulerEvents","map_initial_zoom","map_zoom_after_resolve","map_infowindow_max_width","map_resolve_user_location","map_type","map_resolve_event_location","fill_map_tab","map_end","mapContainer","_setMapSize","destroy","initialize","elem_id","marginRight","marginTop","_selected_event_id","ariaButtonAttr","_updateEventLocation","_delay","ret","_event_resolve_delay","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","cont","tpos","_get_def_cont","_render_calendar","$dom","cellRoot","dateAttribute","unmarkCalendar","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","refreshOnLoad","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","arrow","dayHeaders","dayCells","inputs","selects","inp","number","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","noHighlight","monthheight","old_s","multisection_restricted","multiselect","parseXMLOptions","parseJSONOptions","_result","_children","_mark_inputs","_ids","delimiter","script_url","divLoading","multisource","backup","mvc","use_id","sanitize","update_timer","_start_ext_load","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","dragger","dhtmlDragAndDropObject","stopDrag","last_event","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","parseFloat","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_start","xml_end","xml_top","profile","footer","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","getPDFData","send_xml","submit","to_pdf","schedulersToPdf","objects","toPDF","toPDFRange","quick_info","show_quick_info","clickedElementPosition","_$quickInfoHandler","getPositionInsideScheduler","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","ontransitionend","fitQIInsideWindow","quickInfoPopup","popupRect","containerRect","offsetBottom","_quick_info_onscroll_handler","$testmode","_qi_button_click","domEv","titleContent","titleDate","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","txt_replace","txts","txtt","originalForm","readonlyForm","_lightbox_r","ALL_WEEKDAYS","Weekday","weekday","fromStr","nth","other","getJsWeekday","isPresent","isNumber","isWeekdayStr","includes","rang","repeat","times","toArray","padStart","targetLength","padString","sep","splits","pymod","divmod","mod","empty","notEmpty","datetime","MONTH_DAYS","ONE_DAY","MAXYEAR","ORDINAL_BASE","PY_WEEKDAYS","isLeapYear","isValidDate","daysBetween","date1","date2","date1ms","date2ms","differencems","toOrdinal","fromOrdinal","ordinal","getMonthDays","getWeekday","monthRange","combine","getMilliseconds","dolly","cloneDates","clones","timeToUntilString","untilStringToDate","until","bits","dateTZtoISO8601","timeZone","dateStr","dateInTimeZone","localTimeZone","Intl","DateTimeFormat","resolvedOptions","dateInLocalTZ","dateInTargetTZ","tzOffset","IterResult","after","accept","tooEarly","tooLate","extendStatics","setPrototypeOf","__proto__","__extends","TypeError","__","__assign","assign","__spreadArray","pack","SuppressedError","suppressed","CallbackIterResult","_super","iterator","_this","ENGLISH","dayNames","monthNames","tokens","SKIP","numberAsText","every","at","the","third","for","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","may","june","july","august","september","october","november","december","comma","defaultGetText","defaultDateFormatter","ToText","rrule","gettext","language","dateFormatter","origOptions","bymonthday","bynmonthday","byweekday","allWeeks","someWeeks","isWeekdays","isEveryDay","sortWeekDays","isFullyConvertible","canConvert","freq","IMPLEMENTED","RRule","FREQUENCIES","plural","HOURLY","MINUTELY","DAILY","bymonth","_bymonth","_bymonthday","_byweekday","byhour","_byhour","WEEKLY","MONTHLY","YEARLY","byyearday","byweekno","weekdaytext","monthtext","npos","wday","finalDelim","delim","delimJoin","finalDelimiter","o","realCallback","Parser","rules","done","nextSymbol","isDone","symbol","best","bestSymbol","rule","name_1","v","acceptNumber","expect","parseText","ttr","S","AT","F","MO","TU","WE","TH","FR","ON","wkd","decodeWKD","MDAYs","decodeM","decodeNTH","Frequency","freqIsDailyOrGreater","fromText","toText","Time","millisecond","DateTime","fromDate","getYear","addYears","years","addMonths","yearDiv","monthMod","addWeekly","wkst","fixDay","addDaily","addHours","filtered","_a","dayDiv","hourMod","addMinutes","byminute","hourDiv","minuteMod","addSeconds","seconds","bysecond","minuteDiv","secondMod","daysinmonth","SECONDLY","initializeOptions","_i","keys_1","defaultKeys","parseOptions","DEFAULT_OPTIONS","byeaster","dtstart","bysetpos","bynweekday","parsedOptions","buildTimeset","millisecondModulo","timeset","parseString","rfcString","parseLine","parseDtstart","line","dtstartWithZone","tzid","parseRrule","strippedLine","Days","parseNumber","optionKey","parseWeekday","parseIndividualNumber","SyntaxError","wdaypart","DateWithZone","RangeError","defineProperty","enumerable","configurable","isUTC","rezonedDate","optionsToString","outValue","buildDtstart","strValues","ruleString","argsMatch","Cache","between","_cacheAdd","what","_value","_cacheGet","cached","argsKeys","findCacheDiff","cachedObject","iterResult","M365MASK","M366MASK","M28","M29","M30","M31","MDAY366MASK","MDAY365MASK","NM28","NM29","NM30","NM31","NMDAY366MASK","NMDAY365MASK","M366RANGE","M365RANGE","WDAYMASK","wdaymask","rebuildYear","firstyday","yearlen","nextyearlen","yearordinal","yearweekday","baseYearMasks","wnomask","firstwkst","wyearlen","no1wkst","numweeks","lnumweeks","lyearweekday","lno1wkst","lyearlen","weekst","mmask","mdaymask","nmdaymask","mrange","rebuildMonth","lastyear","lastmonth","nwdaymask","ranges","easter","yearStart","Iterinfo","rebuild","yearinfo","monthinfo","eastermask","ydayset","mdayset","_","wdayset","ddayset","htimeset","mtimeset","stimeset","getdayset","gettimeset","buildPoslist","ii","dayset","poslist","daypos","timepos","tmp","iter","emitResult","counterDate","makeTimeset","removeFilteredDays","rezoneIfNeeded","currentDay","isFiltered","dayCounter","SA","SU","noCache","_cache","fromString","_iter","isFullyConvertibleToText","iterSet","_rrule","_exrule","_rdate","_exdate","_exdateHash","_accept","evalExdate","zonedDate","unfold","forceset","compatible","parseInput","rrulevals","rdatevals","exrulevals","exdatevals","parsedDtstart","lines","splitIntoLines","_b","breakDownLine","parms","_c","rdateTzid","parseRDate","buildRule","rset_1","RRuleSet","groomRruleOptions","rdate","exrule","exdate","rrulestr","extractName","validateDateParm","parm","rdateval","createGetterSetter","fieldName","field","field_1","_addRule","_addDate","rrules","exrules","rdates","exdates","_dtstart","rdatesToString","rrs","clearMilliseconds","isDeletedOccurrence","isSeries","recurring_event_id","clearRecurringProperties","original_start","createException","nid","nev","_rec_temp","_rec_markers_pull","_rec_markers","_pid_time","_get_rec_marker","ch","_get_rec_markers","old_add_event","ev_id","_ignore_call","tev","_pid_changed","deleteEventFromSeries","idTimestamp","_is_modified_occurence","sub","isEventFound","_start_date","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","groupExceptions","exceptions","get_visible_events_rec","repeat_date","old_update_event","toIcalString","non_render","maxCount","seriesExceptions","utcStart","parsedRRule","repeatedDates","adjustedDate","visibleCount","eventDuration","exception","_fix_daylight_saving_date","recurrings","sev","occurence","include_end_by","recurring_workdays","getTopLevelOption","rruleObj","untilDate","hasEndCondition","getWeekdayOfMonth","dayOfWeek","dayOfMonth","dayNumber","jsDaysToRRULEDays","RruleDayNumsToJs","fillCustomDaily","fillCustomWeekly","dayCheckboxes","dayNum","dayLabel","fillCustomMonthly","dateOfMonth","nthWeekDayOfMonth","repeat_monthly_date","repeat_monthly_weekday","formatDayNumber","nthDayOfMonth","repeat_yearly_month_date","repeat_yearly_month_weekday","fillCustomYearly","dateOfYear","nthWeekDayOfYear","fillEndRule","countInput","ondateInput","endOptionSelect","formatter","repeat_date_of_end","dispatchEvent","getRecValue","WORKDAYS","CUSTOM","monthRepeat","yearRepeat","endRule","NEVER","fillInDefaults","rec","_get_node","_outer_html","loc","_init_set_value","_ds","show","onRepeatOptionChange","onCustomRepeatIntervalChange","weekly","monthly","yearly","onCustomRepeatEndRule","_rec_init_done","rf","blocked","rruleset","topOption","customFreq","actual_dates","timeControl","getTimeSection","recurrence","_start","getFirstSectionOfType","recurring_legacy","occurrence_timestamp_in_utc","outerHTML","getOuterHTML","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","str_date_format","str_date","date_str","register_els","inps","change_current_view","get_repeat_code","get_rcode","get_end_rule","transpose_type","transp","set_end_rule","has_values","_get_repeat_code","get_numeric_value","repeat_precise","start_exists","transpose_day_week","set_rcode","set_repeat_code","MouseEvent","_set_repeat_code","elements","_toggle_block","_get_button","getRecurringSection","_get_form","backgroundPosition","transponse_size","day_week","originalMonth","cday","newMonth","cor","cor2","transposeRecurring","recurringParts","dayDurationMs","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","startHour","ted","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","timeline_restricted","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","_getViewPort","viewport","_getViewPortSize","tooltipNode","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","delayShow","utils.default","tooltip_timeout","tooltip_hide_timeout","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","hideTooltip","treetimeline_restricted","units_restricted","s2d","d2s","select_event","week_agenda_restricted","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_year_grid","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","datepicker","locateEvent","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","add_export_methods","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","fail","_plain_export_copy","$text","_create_hidden_form","_hidden_export_form","_get_export_size","A5","A4","A3","A2","A1","A0","dataX","dataY","headY","multY","cSize","getTimeline","getInitialSizes","smartRendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","setExportSizes","initialSizes","setInitialSizes","gplExtensions","drag_between","factory","$dhx"],"mappings":"AACe,SAAAA;AAEf,MAAWC,OAAAA,UAAU,eAAeA,OAAOC,UAAU;AACpDD,WAAOC,SAASC,kBAAkB,SAAUC,KAAKC,MAAMC,MAAMC,YAC5D;AAAA,UAAID,OAAOA,QAAQ;AACnB,UAAIE,MAAMC,SAASC,cAAc,KAAA;AACjCF,UAAIG,KAAK,iBAAiBC,KAAKC,QAAQ,EAAA;AACvCL,UAAIM,YAAY,cAAcN,IAAIG,KAAK,qPAAqPL,OAAO;AACnSG,eAASM,KAAKC,YAAYR,IAAIS,UAAAA;AAE9BL,WAAKM,aAAaV,IAAIG,IAAI,OAAO,IAAA;AAEjCC,WAAKO,GAAGP,KAAKQ,EAAIC,EAAAA,QAAQd;AACzBK,WAAKO,GAAGP,KAAKQ,EAAIE,EAAAA,UAAUd,IAAIG;A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AAEA8pH,uBAAmBrtH;EAGlB,GA9RD;AAgSA;AC3PA,MAAe2vH,gBAAA,EACdznD,cACAQ,eACA4B,aACA34C,WACAg7C,WACAiB,sBACAoC,QACAxJ,aAAaoK,wBACbg/C,cAAc/+C,yBACdC,SACAkC,QACA+5C,YACAn5C,WACAC,gBACAyP,SACA8D,OACAhvE,OACAs4E,UACA+D,SACAiE,aACAjzF,cAAcmzF,yBACdC,aACAU,aACAE,KACAhzB,WACAw1B,KACAuD,YACAv1E,UACAg/B,WACAo7D,kBACAl8E,WACA7sB,UAAU8sG,qBACVl5B,SACA3oB,cAAcykD,yBACdj2G,OAAOk2G,kBACPjjF,KACAzsB,aAAa8vG,wBACbC,IACAC,UAAAA;AC5ED,MAAMsE,UAAU,IAAIvoD,iBAAiBqoD,aAAAA;AAEhC,MAAC3vH,YAAY6vH,QAAQ7/D;AACrB,MAACD,cAAY,EACjB4W,QAAQ3mE,UAAUkjB,KAAK2sG,QAAQlpD,QAAQkpD,OAGxCvuH,EAAAA;AAAAA,OAAOtB,YAAYA;AACnBsB,OAAOyuD,YAAYA;AAEnB,KAAIzuD,OAAOwuH,MAAM;AAChBxuH,SAAOwuH,OAAO;AACf;AAEAxuH,OAAOwuH,KAAK9vH,YAAYA;AACxBsB,OAAOwuH,KAAK//D,YAAYA;","x_google_ignoreList":[126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153]} \ No newline at end of file diff --git a/codebase/sources/dhtmlxscheduler.js b/codebase/sources/dhtmlxscheduler.js index 80ae1ed..6e62111 100644 --- a/codebase/sources/dhtmlxscheduler.js +++ b/codebase/sources/dhtmlxscheduler.js @@ -29,1033 +29,2226 @@ globalScope = global; } const global$1 = globalScope; - function assert(scheduler2) { - return function assert2(check, message2) { - if (!check) { - if (scheduler2.config.show_errors && scheduler2.callEvent("onError", [message2]) !== false) { - if (scheduler2.message) { - scheduler2.message({ type: "error", text: message2, expire: -1 }); - } else { - console.log(message2); - } - debugger; - } + function dragHighlightPos(scheduler2) { + let dndMarkers = []; + let dragStarted = false; + let eventNode = null; + let event2 = null; + function isEnabled2() { + return scheduler2.config.drag_highlight && scheduler2.markTimespan; + } + function checkViewName(viewName) { + const viewObj = scheduler2.getView(viewName); + if (viewObj) { + return viewObj.layout; } - }; - } - function extend$n(scheduler2) { - var commonViews = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }; - var requiredExtensions = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" }; - scheduler2._commonErrorMessages = { unknownView: function(view) { - var relatedDoc = "Related docs: " + (commonViews[view] || commonViews.anythingElse); - var relatedExtension = requiredExtensions[view] ? "You're probably missing " + requiredExtensions[view] + "." : ""; - return "`" + view + "` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \n" + relatedDoc + "\n" + (relatedExtension ? relatedExtension + "\n" : ""); - }, collapsedContainer: function(div) { - return "Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \nMake sure that the container has some initial height or use different units. For example:\n
\n"; - } }; - scheduler2.createTimelineView = function() { - throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: " + requiredExtensions.timeline + "\nRelated docs: " + commonViews.timeline); - }; - scheduler2.createUnitsView = function() { - throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: " + requiredExtensions.unit + "\nRelated docs: " + commonViews.unit); - }; - scheduler2.createGridView = function() { - throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: " + requiredExtensions.grid + "\nRelated docs: " + commonViews.grid); - }; - scheduler2.addMarkedTimespan = function() { - throw new Error("scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\nRelated docs: https://docs.dhtmlx.com/scheduler/limits.html"); - }; - scheduler2.renderCalendar = function() { - throw new Error("scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\nhttps://docs.dhtmlx.com/scheduler/minicalendar.html"); - }; - scheduler2.exportToPNG = function() { - throw new Error(["scheduler.exportToPNG is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); - }; - scheduler2.exportToPDF = function() { - throw new Error(["scheduler.exportToPDF is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); - }; - } - function extend$m(scheduler2) { - scheduler2.attachEvent("onSchedulerReady", function() { - if (typeof dhtmlxError !== "undefined") { - window.dhtmlxError.catchError("LoadXML", function(a, b, c) { - var message2 = c[0].responseText; - switch (scheduler2.config.ajax_error) { - case "alert": - global$1.alert(message2); - break; - case "console": - global$1.console.log(message2); - break; - } - }); + return viewName; + } + function checkSectionPropertyName(viewName) { + const viewObj = scheduler2.getView(viewName); + if (viewObj.y_property) { + return viewObj.y_property; } - }); - } - function extend$l(scheduler2) { - function div(className) { - var element = document.createElement("div"); - var classes = (className || "").split(" "); - classes.forEach(function(cssClass) { - element.classList.add(cssClass); + if (viewObj.map_to) { + return viewObj.map_to; + } + } + function setRequiredStylesToMarker(eventNode2, layout) { + switch (layout) { + case "month": + eventNode2.style.top = ""; + eventNode2.style.left = ""; + break; + case "timeline": + eventNode2.style.left = ""; + eventNode2.style.marginLeft = "1px"; + break; + default: + eventNode2.style.top = ""; + break; + } + } + function createMarkerConfig(configSettings) { + const { event: event3, layout, viewName, sectionId, eventNode: eventNode2 } = configSettings; + setRequiredStylesToMarker(eventNode2, layout); + const sections = {}; + let markerObject = { start_date: event3.start_date, end_date: event3.end_date, css: "dhx_scheduler_dnd_marker", html: eventNode2 }; + if (layout == "timeline" || layout == "month") { + markerObject = { ...markerObject, end_date: scheduler2.date.add(event3.start_date, 1, "minute") }; + } + if (sectionId) { + sections[viewName] = sectionId; + markerObject.sections = sections; + } + return markerObject; + } + function createViewMarker(settings) { + const { layout } = settings; + let markerConfigs; + switch (layout) { + case "month": + markerConfigs = getMonthViewMarkers(settings); + break; + case "timeline": + case "units": + markerConfigs = getTimelineAndUnitsViewMarkers(settings); + break; + default: + markerConfigs = getColumnViewMarkers(settings); + break; + } + markerConfigs.forEach((cfg) => { + dndMarkers.push(scheduler2.markTimespan(cfg)); }); - return element; } - var itemTypes = { rows_container: function() { - return div("dhx_cal_navbar_rows_container"); - }, row: function() { - return div("dhx_cal_navbar_row"); - }, view: function(config) { - var element = div("dhx_cal_tab"); - element.setAttribute("name", config.view + "_tab"); - element.setAttribute("data-tab", config.view); - if (scheduler2.config.fix_tab_position) { - if (config.$firstTab) { - element.classList.add("dhx_cal_tab_first"); - } else if (config.$lastTab) { - element.classList.add("dhx_cal_tab_last"); - } else if (config.view !== "week") { - element.classList.add("dhx_cal_tab_standalone"); + function getColumnViewMarkers(settings) { + const { event: event3, layout, viewName, sectionId } = settings; + let columnViewMarkersArray = []; + let eventNodes = scheduler2.$container.querySelectorAll(`[${scheduler2.config.event_attribute}='${event3.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`); + if (eventNodes) { + for (let i = 0; i < eventNodes.length; i++) { + let eventNodeClone = eventNodes[i].cloneNode(true); + let startDate = /* @__PURE__ */ new Date(+eventNodeClone.getAttribute("data-bar-start")); + let endDate = /* @__PURE__ */ new Date(+eventNodeClone.getAttribute("data-bar-end")); + let dates = { start_date: startDate, end_date: endDate }; + const configSettings = { event: dates, layout, viewName, sectionId, eventNode: eventNodeClone }; + columnViewMarkersArray.push(createMarkerConfig(configSettings)); + } + } + return columnViewMarkersArray; + } + function getMonthViewMarkers(settings) { + let monthViewMarkersArray = []; + const { event: event3, layout, viewName, sectionId } = settings; + const weekDates = []; + let currDate = new Date(event3.start_date); + while (currDate.valueOf() < event3.end_date.valueOf()) { + let obj = { start_date: currDate }; + weekDates.push(obj); + currDate = scheduler2.date.week_start(scheduler2.date.add(currDate, 1, "week")); + } + let cells = scheduler2.$container.querySelectorAll(`[${scheduler2.config.event_attribute}='${event3.id}']`); + for (let i = 0; i < cells.length; i++) { + const configSettings = { event: weekDates[i], layout, viewName, sectionId, eventNode: cells[i].cloneNode(true) }; + monthViewMarkersArray.push(createMarkerConfig(configSettings)); + } + return monthViewMarkersArray; + } + function getTimelineAndUnitsViewMarkers(settings) { + let unitMarkersArray = []; + const { event: event3, layout, viewName, eventNode: eventNode2 } = settings; + let sectionPropertyName = checkSectionPropertyName(viewName); + if (scheduler2.config.multisection && sectionPropertyName) { + const sections = String(event3[sectionPropertyName]).split(scheduler2.config.section_delimiter); + const formatedSections = sections.map((element) => String(element)); + const elems = []; + for (let i = 0; i < formatedSections.length; i++) { + elems[i] = eventNode2.cloneNode(true); + const configSettings = { event: event3, layout, viewName, sectionId: formatedSections[i], eventNode: elems[i] }; + unitMarkersArray.push(createMarkerConfig(configSettings)); + } + } + return unitMarkersArray; + } + scheduler2.attachEvent("onBeforeDrag", function(id2, mode, e) { + if (isEnabled2()) { + dragStarted = true; + event2 = scheduler2.getEvent(id2); + eventNode = e.target.closest(`[${scheduler2.config.event_attribute}]`); + const viewName = scheduler2.getState().mode; + const layout = checkViewName(viewName); + if (layout == "units" && scheduler2.config.cascade_event_display) { + scheduler2.unselect(id2); + eventNode = e.target.closest(`[${scheduler2.config.event_attribute}]`); } - if (config.$segmentedTab) { - element.classList.add("dhx_cal_tab_segmented"); + } + return true; + }); + scheduler2.attachEvent("onEventDrag", function(id2, mode, e) { + if (dragStarted && isEnabled2()) { + dragStarted = false; + const viewName = scheduler2.getState().mode; + const layout = checkViewName(viewName); + const sectionId = scheduler2.getActionData(e).section; + if (event2) { + const settings = { event: event2, layout, viewName, sectionId, eventNode }; + createViewMarker(settings); } } - return element; - }, date: function() { - return div("dhx_cal_date"); - }, button: function(config) { - return div("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab"); - }, builtInButton: function(config) { - return div("dhx_cal_" + config.view + "_button dhx_cal_nav_button"); - }, spacer: function() { - return div("dhx_cal_line_spacer"); - }, minicalendarButton: function(config) { - var minicalendarDiv = div("dhx_minical_icon"); - if (!config.click && !minicalendarDiv.$_eventAttached) { - scheduler2.event(minicalendarDiv, "click", function() { - if (scheduler2.isCalendarVisible()) { - scheduler2.destroyCalendar(); - } else { - scheduler2.renderCalendar({ position: this, date: scheduler2.getState().date, navigation: true, handler: function(date, calendar) { - scheduler2.setCurrentView(date); - scheduler2.destroyCalendar(); - } }); + }); + scheduler2.attachEvent("onDragEnd", function(id2, mode, e) { + for (let i = 0; i < dndMarkers.length; i++) { + scheduler2.unmarkTimespan(dndMarkers[i]); + } + dndMarkers = []; + eventNode = null; + event2 = null; + }); + } + function undoDelete(scheduler2) { + scheduler2.attachEvent("onEventDeleted", function(id2, ev) { + let deletedEvent = scheduler2.copy(ev); + if (scheduler2.config.undo_deleted && !scheduler2.getState().new_event) { + scheduler2.message({ text: `
+ Event deleted + +
`, expire: 1e4, type: "popup_after_delete", callback: function(e) { + let undoBtn = e.target.closest(`[data-deleted-event-id="${ev.id}"]`); + if (undoBtn) { + scheduler2.addEvent(deletedEvent); + scheduler2.render(); } - }); + } }); } - return minicalendarDiv; - }, html_element: function(config) { - return div("dhx_cal_nav_content"); - } }; - function findRenderer(config) { - var renderer; - if (config.view) { - switch (config.view) { - case "today": - case "next": - case "prev": - renderer = itemTypes.builtInButton; - break; - case "date": - renderer = itemTypes.date; - break; - case "spacer": - renderer = itemTypes.spacer; - break; - case "button": - renderer = itemTypes.button; - break; - case "minicalendar": - renderer = itemTypes.minicalendarButton; - break; - default: - renderer = itemTypes.view; - break; + }); + } + function limitPlugin(scheduler2) { + scheduler2.config.mark_now = true; + scheduler2.config.display_marked_timespans = true; + scheduler2.config.overwrite_marked_timespans = true; + var dhx_time_block = "dhx_time_block"; + var default_timespan_type = "default"; + var fix_options = function(options, days, zones) { + if (days instanceof Date && zones instanceof Date) { + options.start_date = days; + options.end_date = zones; + } else { + options.days = days; + options.zones = zones; + } + return options; + }; + var get_resulting_options = function(days, zones, sections) { + var options = typeof days == "object" ? days : { days }; + options.type = dhx_time_block; + options.css = ""; + if (zones) { + if (sections) + options.sections = sections; + options = fix_options(options, days, zones); + } + return options; + }; + scheduler2.blockTime = function(days, zones, sections) { + var options = get_resulting_options(days, zones, sections); + return scheduler2.addMarkedTimespan(options); + }; + scheduler2.unblockTime = function(days, zones, sections) { + zones = zones || "fullday"; + var options = get_resulting_options(days, zones, sections); + return scheduler2.deleteMarkedTimespan(options); + }; + scheduler2.checkInMarkedTimespan = function(ev, timespan_type, on_overlap) { + timespan_type = timespan_type || default_timespan_type; + var res = true; + var temp_start_date = new Date(ev.start_date.valueOf()); + var temp_end_date = scheduler2.date.add(temp_start_date, 1, "day"); + var timespans = scheduler2._marked_timespans; + for (; temp_start_date < ev.end_date; temp_start_date = scheduler2.date.date_part(temp_end_date), temp_end_date = scheduler2.date.add(temp_start_date, 1, "day")) { + var day_value = +scheduler2.date.date_part(new Date(temp_start_date)); + var day_index = temp_start_date.getDay(); + var zones = getZones(ev, timespans, day_index, day_value, timespan_type); + if (zones) { + for (var i = 0; i < zones.length; i += 2) { + var eventStart = scheduler2._get_zone_minutes(temp_start_date); + var eventEnd = ev.end_date > temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ? 1440 : scheduler2._get_zone_minutes(ev.end_date); + var markerStart = zones[i]; + var markerEnd = zones[i + 1]; + if (markerStart < eventEnd && markerEnd > eventStart) { + if (typeof on_overlap == "function") { + res = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd); + } else { + res = false; + } + if (!res) + break; + } + } } - } else if (config.rows) { - renderer = itemTypes.rows_container; - } else if (config.cols) { - renderer = itemTypes.row; - } - return renderer; - } - function renderElement(config) { - var renderer = findRenderer(config); - if (!renderer) { - return; } - var element = renderer(config); - if (config.css) { - element.classList.add(config.css); + return !res; + }; + scheduler2.checkLimitViolation = function(event2) { + if (!event2) + return true; + if (!scheduler2.config.check_limits) + return true; + var s = scheduler2; + var c = s.config; + var evs = []; + if (event2.rec_type && event2._end_date || event2.rrule) { + const seriesEnd = event2._end_date || event2.end_date; + if (c.limit_start && c.limit_end) { + var recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event2.start_date.valueOf() <= c.limit_end.valueOf(); + return recEventInLimits; + } else + return true; + } else { + evs = [event2]; } - if (config.width) { - var value = config.width; - if (value === value * 1) { - value += "px"; + var complete_res = true; + for (var p = 0; p < evs.length; p++) { + var res = true; + var ev = evs[p]; + ev._timed = scheduler2.isOneDayEvent(ev); + res = c.limit_start && c.limit_end ? ev.start_date.valueOf() >= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf() : true; + if (res) { + res = !scheduler2.checkInMarkedTimespan(ev, dhx_time_block, function(event3, eventStart, eventEnd, markerStart, markerEnd) { + var allow = true; + if (eventStart <= markerEnd && eventStart >= markerStart) { + if (markerEnd == 24 * 60 || eventEnd <= markerEnd) { + allow = false; + } + if (event3._timed && s._drag_id && s._drag_mode == "new-size") { + event3.start_date.setHours(0); + event3.start_date.setMinutes(markerEnd); + } else { + allow = false; + } + } + if (eventEnd >= markerStart && eventEnd <= markerEnd || eventStart < markerStart && eventEnd > markerEnd) { + if (event3._timed && s._drag_id && s._drag_mode == "new-size") { + event3.end_date.setHours(0); + event3.end_date.setMinutes(markerStart); + } else { + allow = false; + } + } + return allow; + }); } - element.style.width = value; - } - if (config.height) { - var value = config.height; - if (value === value * 1) { - value += "px"; + if (!res) { + res = s.checkEvent("onLimitViolation") ? s.callEvent("onLimitViolation", [ev.id, ev]) : res; } - element.style.height = value; + complete_res = complete_res && res; } - if (config.click) { - scheduler2.event(element, "click", config.click); + if (!complete_res) { + s._drag_id = null; + s._drag_mode = null; } - if (config.html) { - element.innerHTML = config.html; + return complete_res; + }; + scheduler2._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type) { + var zones = []; + if (timespans && timespans[property]) { + var timeline_zones = timespans[property]; + var blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type); + for (var i = 0; i < blocked_timeline_zones.length; i++) { + zones = this._add_timespan_zones(zones, blocked_timeline_zones[i].zones); + } } - if (config.align) { - var value = ""; - if (config.align == "right") { - value = "flex-end"; - } else if (config.align == "left") { - value = "flex-start"; + return zones; + }; + scheduler2._get_relevant_blocked_zones = function(day_index, day_value, zones, timespan_type) { + var resultZones; + if (scheduler2.config.overwrite_marked_timespans) { + resultZones = zones[day_value] && zones[day_value][timespan_type] ? zones[day_value][timespan_type] : zones[day_index] && zones[day_index][timespan_type] ? zones[day_index][timespan_type] : []; + } else { + resultZones = []; + if (zones[day_value] && zones[day_value][timespan_type]) { + resultZones = resultZones.concat(zones[day_value][timespan_type]); + } + if (zones[day_index] && zones[day_index][timespan_type]) { + resultZones = resultZones.concat(zones[day_index][timespan_type]); + } + } + return resultZones; + }; + function getZones(ev, timespans, day_index, day_value, timespan_type) { + var s = scheduler2; + var zones = []; + var containers = { _props: "map_to", matrix: "y_property" }; + for (var container in containers) { + var property = containers[container]; + if (s[container]) { + for (var view in s[container]) { + var view_config = s[container][view]; + var linker = view_config[property]; + if (!ev[linker]) + continue; + zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans[view], ev[linker], day_index, day_value, timespan_type)); + } } - element.style.justifyContent = value; } - return element; + zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans, "global", day_index, day_value, timespan_type)); + return zones; } - function prepareConfig(config) { - if (typeof config === "string") { - config = { view: config }; - } - if (!config.view && !config.rows && !config.cols) { - config.view = "button"; + scheduler2._mark_now = function(hide) { + var dhx_now_time = "dhx_now_time"; + if (!this._els[dhx_now_time]) { + this._els[dhx_now_time] = []; } - return config; - } - function renderLayout(config) { - var fragment = document.createDocumentFragment(); - var items; - if (Array.isArray(config)) { - items = config; - } else { - items = [config]; + var now = scheduler2._currentDate(); + var cfg = this.config; + scheduler2._remove_mark_now(); + if (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() < cfg.last_hour) { + var day_index = this.locate_holder_day(now); + this._els[dhx_now_time] = scheduler2._append_mark_now(day_index, now); } - for (var i = 0; i < items.length; i++) { - var view = prepareConfig(items[i]); - if (view.view === "day" && items[i + 1]) { - var next = prepareConfig(items[i + 1]); - if (next.view === "week" || next.view === "month") { - view.$firstTab = true; - view.$segmentedTab = true; + }; + scheduler2._append_mark_now = function(day_index, now) { + var dhx_now_time = "dhx_now_time"; + var zone_start = scheduler2._get_zone_minutes(now); + var options = { zones: [zone_start, zone_start + 1], css: dhx_now_time, type: dhx_now_time }; + if (!this._table_view) { + if (this._props && this._props[this._mode]) { + var start_index, end_index; + var view = this._props[this._mode]; + var units_l = view.size || view.options.length; + if (view.days > 1) { + if (view.size && view.options.length) { + day_index = (view.position + day_index) / view.options.length * view.size; + } + start_index = day_index; + end_index = day_index + units_l; + } else { + start_index = 0; + end_index = start_index + units_l; } + var r_divs = []; + for (var i = start_index; i < end_index; i++) { + var t_day = i; + options.days = t_day; + var t_div = scheduler2._render_marked_timespan(options, null, t_day)[0]; + r_divs.push(t_div); + } + return r_divs; + } else { + options.days = day_index; + return scheduler2._render_marked_timespan(options, null, day_index); } - if (view.view === "week" && items[i - 1]) { - var next = prepareConfig(items[i + 1]); - if (next.view === "week" || next.view === "month") { - view.$segmentedTab = true; + } else { + if (this._mode == "month") { + options.days = +scheduler2.date.date_part(now); + return scheduler2._render_marked_timespan(options, null, null); + } + } + }; + scheduler2._remove_mark_now = function() { + var dhx_now_time = "dhx_now_time"; + var els = this._els[dhx_now_time]; + for (var i = 0; i < els.length; i++) { + var div = els[i]; + var parent = div.parentNode; + if (parent) { + parent.removeChild(div); + } + } + this._els[dhx_now_time] = []; + }; + scheduler2._marked_timespans = { global: {} }; + scheduler2._get_zone_minutes = function(date) { + return date.getHours() * 60 + date.getMinutes(); + }; + scheduler2._prepare_timespan_options = function(config) { + var r_configs = []; + var temp_configs = []; + if (config.days == "fullweek") + config.days = [0, 1, 2, 3, 4, 5, 6]; + if (config.days instanceof Array) { + var t_days = config.days.slice(); + for (var i = 0; i < t_days.length; i++) { + var cloned_config = scheduler2._lame_clone(config); + cloned_config.days = t_days[i]; + r_configs.push.apply(r_configs, scheduler2._prepare_timespan_options(cloned_config)); + } + return r_configs; + } + if (!config || !(config.start_date && config.end_date && config.end_date > config.start_date || config.days !== void 0 && config.zones) && !config.type) + return r_configs; + var min = 0; + var max = 24 * 60; + if (config.zones == "fullday") + config.zones = [min, max]; + if (config.zones && config.invert_zones) { + config.zones = scheduler2.invertZones(config.zones); + } + config.id = scheduler2.uid(); + config.css = config.css || ""; + config.type = config.type || default_timespan_type; + var sections = config.sections; + if (sections) { + for (var view_key in sections) { + if (sections.hasOwnProperty(view_key)) { + var ids = sections[view_key]; + if (!(ids instanceof Array)) + ids = [ids]; + for (var i = 0; i < ids.length; i++) { + var t_config = scheduler2._lame_copy({}, config); + t_config.sections = {}; + t_config.sections[view_key] = ids[i]; + temp_configs.push(t_config); + } } } - if (view.view === "month" && items[i - 1]) { - var next = prepareConfig(items[i - 1]); - if (next.view === "week" || next.view === "day") { - view.$lastTab = true; - view.$segmentedTab = true; + } else { + temp_configs.push(config); + } + for (var k = 0; k < temp_configs.length; k++) { + var c_config = temp_configs[k]; + var start_date = c_config.start_date; + var end_date = c_config.end_date; + if (start_date && end_date) { + var t_sd = scheduler2.date.date_part(new Date(start_date)); + var t_ed = scheduler2.date.add(t_sd, 1, "day"); + while (t_sd < end_date) { + var t_config = scheduler2._lame_copy({}, c_config); + delete t_config.start_date; + delete t_config.end_date; + t_config.days = t_sd.valueOf(); + var zone_start = start_date > t_sd ? scheduler2._get_zone_minutes(start_date) : min; + var zone_end = end_date > t_ed || end_date.getDate() != t_sd.getDate() ? max : scheduler2._get_zone_minutes(end_date); + t_config.zones = [zone_start, zone_end]; + r_configs.push(t_config); + t_sd = t_ed; + t_ed = scheduler2.date.add(t_ed, 1, "day"); } + } else { + if (c_config.days instanceof Date) + c_config.days = scheduler2.date.date_part(c_config.days).valueOf(); + c_config.zones = config.zones.slice(); + r_configs.push(c_config); + } + } + return r_configs; + }; + scheduler2._get_dates_by_index = function(index, start, end) { + var dates = []; + start = scheduler2.date.date_part(new Date(start || scheduler2._min_date)); + end = new Date(end || scheduler2._max_date); + var start_day = start.getDay(); + var delta = index - start_day >= 0 ? index - start_day : 7 - start.getDay() + index; + var t_date = scheduler2.date.add(start, delta, "day"); + for (; t_date < end; t_date = scheduler2.date.add(t_date, 1, "week")) { + dates.push(t_date); + } + return dates; + }; + scheduler2._get_css_classes_by_config = function(config) { + var css_classes = []; + if (config.type == dhx_time_block) { + css_classes.push(dhx_time_block); + if (config.css) + css_classes.push(dhx_time_block + "_reset"); + } + css_classes.push("dhx_marked_timespan", config.css); + return css_classes.join(" "); + }; + scheduler2._get_block_by_config = function(config) { + var block = document.createElement("div"); + if (config.html) { + if (typeof config.html == "string") + block.innerHTML = config.html; + else + block.appendChild(config.html); + } + return block; + }; + scheduler2._render_marked_timespan = function(options, area, day) { + var blocks = []; + var c = scheduler2.config; + var min_date = this._min_date; + var max_date = this._max_date; + var day_value = false; + if (!c.display_marked_timespans) + return blocks; + if (!day && day !== 0) { + if (options.days < 7) + day = options.days; + else { + var date_to_display = new Date(options.days); + day_value = +date_to_display; + if (!(+max_date > +date_to_display && +min_date <= +date_to_display)) + return blocks; + day = date_to_display.getDay(); } - var element = renderElement(view); - fragment.appendChild(element); - if (view.cols || view.rows) { - element.appendChild(renderLayout(view.cols || view.rows)); + var min_day = min_date.getDay(); + if (min_day > day) { + day = 7 - (min_day - day); + } else { + day = day - min_day; } } - return fragment; - } - scheduler2._init_nav_bar = function(items) { - var navBar = this.$container.querySelector(".dhx_cal_navline"); - if (!navBar) { - navBar = document.createElement("div"); - navBar.className = "dhx_cal_navline dhx_cal_navline_flex"; - scheduler2._update_nav_bar(items, navBar); - return navBar; + var zones = options.zones; + var css_classes = scheduler2._get_css_classes_by_config(options); + if (scheduler2._table_view && scheduler2._mode == "month") { + var areas = []; + var days = []; + if (!area) { + days = day_value ? [day_value] : scheduler2._get_dates_by_index(day); + for (var i = 0; i < days.length; i++) { + areas.push(this._scales[days[i]]); + } + } else { + areas.push(area); + days.push(day); + } + for (var i = 0; i < areas.length; i++) { + area = areas[i]; + day = days[i]; + var sday = this.locate_holder_day(day, false) % this._cols.length; + if (this._ignores[sday]) + continue; + var block_proto = scheduler2._get_block_by_config(options); + block_proto.className = css_classes; + block_proto.style.top = "0px"; + block_proto.style.height = "100%"; + for (var k = 0; k < zones.length; k += 2) { + var start = zones[i]; + var end = zones[i + 1]; + if (end <= start) + return []; + var block = block_proto.cloneNode(true); + block.style.left = "0px"; + block.style.width = "100%"; + area.appendChild(block); + blocks.push(block); + } + } + } else { + var index = day; + if (this._ignores[this.locate_holder_day(day, false)]) + return blocks; + if (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) { + var view = this._props[this._mode]; + index = view.order[options.sections[this._mode]]; + var inner_index = view.order[options.sections[this._mode]]; + if (!(view.days > 1)) { + index = inner_index; + if (view.size && index > view.position + view.size) { + index = 0; + } + } else { + var units_l = view.size || view.options.length; + index = index * units_l + inner_index; + } + } + area = area ? area : scheduler2.locate_holder(index); + for (var i = 0; i < zones.length; i += 2) { + var start = Math.max(zones[i], c.first_hour * 60); + var end = Math.min(zones[i + 1], c.last_hour * 60); + if (end <= start) { + if (i + 2 < zones.length) + continue; + else + return []; + } + var block = scheduler2._get_block_by_config(options); + block.className = css_classes; + var all_hours_height = this.config.hour_size_px * 24 + 1; + var hour_ms = 60 * 60 * 1e3; + block.style.top = Math.round((start * 60 * 1e3 - this.config.first_hour * hour_ms) * this.config.hour_size_px / hour_ms) % all_hours_height + "px"; + block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * this.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; + area.appendChild(block); + blocks.push(block); + } } - return navBar; + return blocks; }; - var previousHeight = null; - scheduler2._update_nav_bar = function(config, container) { - if (!config) { - return; + scheduler2._mark_timespans = function() { + var data = this._els["dhx_cal_data"][0]; + var divs = []; + if (scheduler2._table_view && scheduler2._mode == "month") { + for (var day in this._scales) { + var date = /* @__PURE__ */ new Date(+day); + divs.push.apply(divs, scheduler2._on_scale_add_marker(this._scales[day], date)); + } + } else { + var date = new Date(scheduler2._min_date); + for (var i = 0, len = data.childNodes.length; i < len; i++) { + var area = data.childNodes[i]; + if (area.firstChild && scheduler2._getClassName(area.firstChild).indexOf("dhx_scale_hour") > -1) { + continue; + } + divs.push.apply(divs, scheduler2._on_scale_add_marker(area, date)); + date = scheduler2.date.add(date, 1, "day"); + } } - var heightChanged = false; - var configChanged = false; - var newHeight = config.height || scheduler2.xy.nav_height; - if (previousHeight === null || previousHeight !== newHeight) { - heightChanged = true; + return divs; + }; + scheduler2.markTimespan = function(configuration) { + if (!this._els) { + throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`."); } - { - configChanged = true; + var rebuild_els = false; + if (!this._els["dhx_cal_data"]) { + scheduler2.get_elements(); + rebuild_els = true; } - if (heightChanged) { - scheduler2.xy.nav_height = newHeight; + var timespans_ids = scheduler2._marked_timespans_ids, timespan_types = scheduler2._marked_timespans_types, timespans = scheduler2._marked_timespans; + scheduler2.deleteMarkedTimespan(); + scheduler2.addMarkedTimespan(configuration); + var divs = scheduler2._mark_timespans(); + if (rebuild_els) + scheduler2._els = []; + scheduler2._marked_timespans_ids = timespans_ids; + scheduler2._marked_timespans_types = timespan_types; + scheduler2._marked_timespans = timespans; + return divs; + }; + scheduler2.unmarkTimespan = function(divs) { + if (!divs) + return; + for (var i = 0; i < divs.length; i++) { + var div = divs[i]; + if (div.parentNode) { + div.parentNode.removeChild(div); + } + } + }; + scheduler2._addMarkerTimespanConfig = function(config) { + var global2 = "global"; + var timespans = scheduler2._marked_timespans; + var id2 = config.id; + var ids = scheduler2._marked_timespans_ids; + if (!ids[id2]) + ids[id2] = []; + var day = config.days; + var sections = config.sections; + var type = config.type; + config.id = id2; + if (sections) { + for (var view_key in sections) { + if (sections.hasOwnProperty(view_key)) { + if (!timespans[view_key]) + timespans[view_key] = {}; + var unit_id = sections[view_key]; + var timespans_view = timespans[view_key]; + if (!timespans_view[unit_id]) + timespans_view[unit_id] = {}; + if (!timespans_view[unit_id][day]) + timespans_view[unit_id][day] = {}; + if (!timespans_view[unit_id][day][type]) { + timespans_view[unit_id][day][type] = []; + if (!scheduler2._marked_timespans_types) + scheduler2._marked_timespans_types = {}; + if (!scheduler2._marked_timespans_types[type]) + scheduler2._marked_timespans_types[type] = true; + } + var day_configs = timespans_view[unit_id][day][type]; + config._array = day_configs; + day_configs.push(config); + ids[id2].push(config); + } + } + } else { + if (!timespans[global2][day]) + timespans[global2][day] = {}; + if (!timespans[global2][day][type]) + timespans[global2][day][type] = []; + if (!scheduler2._marked_timespans_types) + scheduler2._marked_timespans_types = {}; + if (!scheduler2._marked_timespans_types[type]) + scheduler2._marked_timespans_types[type] = true; + var day_configs = timespans[global2][day][type]; + config._array = day_configs; + day_configs.push(config); + ids[id2].push(config); + } + }; + scheduler2._marked_timespans_ids = {}; + scheduler2.addMarkedTimespan = function(configuration) { + var configs = scheduler2._prepare_timespan_options(configuration); + if (!configs.length) + return; + var id2 = configs[0].id; + for (var i = 0; i < configs.length; i++) { + scheduler2._addMarkerTimespanConfig(configs[i]); } - if (configChanged) { - container.innerHTML = ""; - container.appendChild(renderLayout(config)); + return id2; + }; + scheduler2._add_timespan_zones = function(current_zones, zones) { + var resulting_zones = current_zones.slice(); + zones = zones.slice(); + if (!resulting_zones.length) + return zones; + for (var i = 0; i < resulting_zones.length; i += 2) { + var c_zone_start = resulting_zones[i]; + var c_zone_end = resulting_zones[i + 1]; + var isLast = i + 2 == resulting_zones.length; + for (var k = 0; k < zones.length; k += 2) { + var zone_start = zones[k]; + var zone_end = zones[k + 1]; + if (zone_end > c_zone_end && zone_start <= c_zone_end || zone_start < c_zone_start && zone_end >= c_zone_start) { + resulting_zones[i] = Math.min(c_zone_start, zone_start); + resulting_zones[i + 1] = Math.max(c_zone_end, zone_end); + i -= 2; + } else { + if (!isLast) + continue; + var offset = c_zone_start > zone_start ? 0 : 2; + resulting_zones.splice(i + offset, 0, zone_start, zone_end); + } + zones.splice(k--, 2); + break; + } } - if (heightChanged || configChanged) { - scheduler2.unset_actions(); - scheduler2._els = []; - scheduler2.get_elements(); - scheduler2.set_actions(); + return resulting_zones; + }; + scheduler2._subtract_timespan_zones = function(current_zones, zones) { + var resulting_zones = current_zones.slice(); + for (var i = 0; i < resulting_zones.length; i += 2) { + var c_zone_start = resulting_zones[i]; + var c_zone_end = resulting_zones[i + 1]; + for (var k = 0; k < zones.length; k += 2) { + var zone_start = zones[k]; + var zone_end = zones[k + 1]; + if (zone_end > c_zone_start && zone_start < c_zone_end) { + var is_modified = false; + if (c_zone_start >= zone_start && c_zone_end <= zone_end) { + resulting_zones.splice(i, 2); + } + if (c_zone_start < zone_start) { + resulting_zones.splice(i, 2, c_zone_start, zone_start); + is_modified = true; + } + if (c_zone_end > zone_end) { + resulting_zones.splice(is_modified ? i + 2 : i, is_modified ? 0 : 2, zone_end, c_zone_end); + } + i -= 2; + break; + } else { + continue; + } + } } - if (newHeight === 0) { - container.style.display = "none"; - } else { - container.style.display = ""; + return resulting_zones; + }; + scheduler2.invertZones = function(zones) { + return scheduler2._subtract_timespan_zones([0, 1440], zones.slice()); + }; + scheduler2._delete_marked_timespan_by_id = function(id2) { + var configs = scheduler2._marked_timespans_ids[id2]; + if (configs) { + for (var i = 0; i < configs.length; i++) { + var config = configs[i]; + var parent_array = config._array; + for (var k = 0; k < parent_array.length; k++) { + if (parent_array[k] == config) { + parent_array.splice(k, 1); + break; + } + } + } } - previousHeight = newHeight; }; - } - function extend$k(scheduler2) { - function isAttachedNode(container) { - var root = document.body; - while (container && container != root) { - container = container.parentNode; + scheduler2._delete_marked_timespan_by_config = function(config) { + var timespans = scheduler2._marked_timespans; + var sections = config.sections; + var day = config.days; + var type = config.type || default_timespan_type; + var viewspans; + if (sections) { + for (var view_key in sections) { + if (sections.hasOwnProperty(view_key) && timespans[view_key]) { + var unit_id = sections[view_key]; + if (timespans[view_key][unit_id]) { + viewspans = timespans[view_key][unit_id]; + } + } + } + } else { + viewspans = timespans.global; } - return !!(root == container); - } - function getWindowSize(window2) { - return { w: window2.innerWidth || document.documentElement.clientWidth, h: window2.innerHeight || document.documentElement.clientHeight }; - } - function equals(a, b) { - return a.w == b.w && a.h == b.h; - } - function listenWindowResize(scheduler3, window2) { - var oldSize = getWindowSize(window2); - var resizeDelay; - scheduler3.event(window2, "resize", function() { - clearTimeout(resizeDelay); - resizeDelay = setTimeout(function() { - if (!isAttachedNode(scheduler3.$container) || scheduler3.$destroyed) { - return; + if (viewspans) { + if (day !== void 0) { + if (viewspans[day] && viewspans[day][type]) { + scheduler2._addMarkerTimespanConfig(config); + scheduler2._delete_marked_timespans_list(viewspans[day][type], config); } - var newSize = getWindowSize(window2); - if (!equals(oldSize, newSize)) { - oldSize = newSize; - triggerSchedulerResize(scheduler3); + } else { + for (var d in viewspans) { + if (viewspans[d][type]) { + var dayConfig = scheduler2._lame_clone(config); + config.days = d; + scheduler2._addMarkerTimespanConfig(dayConfig); + scheduler2._delete_marked_timespans_list(viewspans[d][type], config); + } } - }, 150); - }); - } - function triggerSchedulerResize(scheduler3) { - if (scheduler3.$destroyed || !scheduler3.$root || !isAttachedNode(scheduler3.$root)) { - return; + } } - if (scheduler3.callEvent("onSchedulerResize", [])) { - scheduler3.updateView(); - scheduler3.callEvent("onAfterSchedulerResize", []); + }; + scheduler2._delete_marked_timespans_list = function(day_timespans, config) { + for (var i = 0; i < day_timespans.length; i++) { + var d_t = day_timespans[i]; + var zones = scheduler2._subtract_timespan_zones(d_t.zones, config.zones); + if (zones.length) + d_t.zones = zones; + else { + day_timespans.splice(i, 1); + i--; + var related_zones = scheduler2._marked_timespans_ids[d_t.id]; + for (var k = 0; k < related_zones.length; k++) { + if (related_zones[k] == d_t) { + related_zones.splice(k, 1); + break; + } + } + } } - } - function watchNodeResize(scheduler3) { - var previousHeight = scheduler3.$root.offsetHeight; - var previousWidth = scheduler3.$root.offsetWidth; - function lowlevelResizeWatcher() { - if (scheduler3.$destroyed) { - return; + }; + scheduler2.deleteMarkedTimespan = function(configuration) { + if (!arguments.length) { + scheduler2._marked_timespans = { global: {} }; + scheduler2._marked_timespans_ids = {}; + scheduler2._marked_timespans_types = {}; + } + if (typeof configuration != "object") { + scheduler2._delete_marked_timespan_by_id(configuration); + } else { + if (!(configuration.start_date && configuration.end_date)) { + if (configuration.days === void 0 && !configuration.type) + configuration.days = "fullweek"; + if (!configuration.zones) + configuration.zones = "fullday"; } - if (scheduler3.$root) { - if (scheduler3.$root.offsetHeight != previousHeight || scheduler3.$root.offsetWidth != previousWidth) { - triggerSchedulerResize(scheduler3); + var types = []; + if (!configuration.type) { + for (var type in scheduler2._marked_timespans_types) { + types.push(type); + } + } else { + types.push(configuration.type); + } + var configs = scheduler2._prepare_timespan_options(configuration); + for (var i = 0; i < configs.length; i++) { + var config = configs[i]; + for (var t = 0; t < types.length; t++) { + var typedConfig = scheduler2._lame_clone(config); + typedConfig.type = types[t]; + scheduler2._delete_marked_timespan_by_config(typedConfig); } - previousHeight = scheduler3.$root.offsetHeight; - previousWidth = scheduler3.$root.offsetWidth; } - setTimeout(lowlevelResizeWatcher, 200); } - lowlevelResizeWatcher(); - } - function addResizeListener(scheduler3) { - var root = scheduler3.$container; - var containerStyles = window.getComputedStyle(root); - if (containerStyles.getPropertyValue("position") == "static") { - root.style.position = "relative"; + }; + scheduler2._get_types_to_render = function(common2, specific) { + var types_to_render = common2 ? scheduler2._lame_copy({}, common2) : {}; + for (var type in specific || {}) { + if (specific.hasOwnProperty(type)) { + types_to_render[type] = specific[type]; + } } - var resizeWatcher = document.createElement("iframe"); - resizeWatcher.className = "scheduler_container_resize_watcher"; - resizeWatcher.tabIndex = -1; - if (scheduler3.config.wai_aria_attributes) { - resizeWatcher.setAttribute("role", "none"); - resizeWatcher.setAttribute("aria-hidden", true); + return types_to_render; + }; + scheduler2._get_configs_to_render = function(types) { + var configs = []; + for (var type in types) { + if (types.hasOwnProperty(type)) { + configs.push.apply(configs, types[type]); + } } - var salesforce_environment = !!window["Sfdc"] || !!window["$A"] || window["Aura"]; - if (salesforce_environment) { - watchNodeResize(scheduler3); - } else { - root.appendChild(resizeWatcher); - if (resizeWatcher.contentWindow) { - listenWindowResize(scheduler3, resizeWatcher.contentWindow); + return configs; + }; + scheduler2._on_scale_add_marker = function(area, day) { + if (scheduler2._table_view && scheduler2._mode != "month") + return; + var day_index = day.getDay(); + var day_value = day.valueOf(); + var mode = this._mode; + var timespans = scheduler2._marked_timespans; + var r_configs = []; + var divs = []; + if (this._props && this._props[mode]) { + var view = this._props[mode]; + var units = view.options; + var index = scheduler2._get_unit_index(view, day); + var unit = units[index]; + if (!(view.days > 1)) { + day = scheduler2.date.date_part(new Date(this._date)); } else { - root.removeChild(resizeWatcher); - listenWindowResize(scheduler3, window); + var dx = 24 * 60 * 60 * 1e3; + var day_ind = Math.round((day - scheduler2._min_date) / dx); + var unitsPerDay = view.size || units.length; + day = scheduler2.date.add(scheduler2._min_date, Math.floor(day_ind / unitsPerDay), "day"); + day = scheduler2.date.date_part(day); + } + day_index = day.getDay(); + day_value = day.valueOf(); + if (timespans[mode] && timespans[mode][unit.key]) { + var unit_zones = timespans[mode][unit.key]; + var unit_types = scheduler2._get_types_to_render(unit_zones[day_index], unit_zones[day_value]); + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(unit_types)); + } + } + var global_data = timespans["global"]; + if (scheduler2.config.overwrite_marked_timespans) { + var day_types = global_data[day_value] || global_data[day_index]; + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(day_types)); + } else { + if (global_data[day_value]) { + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_value])); + } + if (global_data[day_index]) { + r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_index])); } } + for (var i = 0; i < r_configs.length; i++) { + divs.push.apply(divs, scheduler2._render_marked_timespan(r_configs[i], area, day)); + } + return divs; + }; + scheduler2.attachEvent("onScaleAdd", function() { + scheduler2._on_scale_add_marker.apply(scheduler2, arguments); + }); + scheduler2.dblclick_dhx_marked_timespan = function(e, src) { + scheduler2.callEvent("onScaleDblClick", [scheduler2.getActionData(e).date, src, e]); + if (scheduler2.config.dblclick_create) { + scheduler2.addEventNow(scheduler2.getActionData(e).date, null, e); + } + }; + } + function createMethod(scheduler2) { + var methods = {}; + var isActive = false; + function disableMethod(methodName, dummyMethod) { + dummyMethod = typeof dummyMethod == "function" ? dummyMethod : function() { + }; + if (!methods[methodName]) { + methods[methodName] = this[methodName]; + this[methodName] = dummyMethod; + } } - addResizeListener(scheduler2); - } - class EventHost { - constructor() { - this._silent_mode = false; - this.listeners = {}; - } - _silentStart() { - this._silent_mode = true; + function restoreMethod(methodName) { + if (methods[methodName]) { + this[methodName] = methods[methodName]; + methods[methodName] = null; + } } - _silentEnd() { - this._silent_mode = false; + function disableMethods(methodsHash) { + for (var i in methodsHash) { + disableMethod.call(this, i, methodsHash[i]); + } } - } - const createEventStorage = function(obj) { - let handlers = {}; - let index = 0; - const eventStorage = function() { - let combinedResult = true; - for (const i in handlers) { - const handlerResult = handlers[i].apply(obj, arguments); - combinedResult = combinedResult && handlerResult; + function restoreMethods() { + for (var i in methods) { + restoreMethod.call(this, i); } - return combinedResult; - }; - eventStorage.addEvent = function(handler, settings) { - if (typeof handler == "function") { - let handlerId; - if (settings && settings.id) { - handlerId = settings.id; + } + function batchUpdatePayload(callback) { + try { + callback(); + } catch (e) { + window.console.error(e); + } + } + scheduler2.$stateProvider.registerProvider("batchUpdate", function() { + return { batch_update: isActive }; + }, false); + return function batchUpdate2(callback, noRedraw) { + if (isActive) { + batchUpdatePayload(callback); + return; + } + var call_dp = this._dp && this._dp.updateMode != "off"; + var dp_mode; + if (call_dp) { + dp_mode = this._dp.updateMode; + this._dp.setUpdateMode("off"); + } + const calls = { setModeDate: { date: null, mode: null }, needRender: false, needUpdateView: false, repaintEvents: {} }; + const rememberModeDate = (date, mode) => { + if (date) { + calls.setModeDate.date = date; + } + if (mode) { + calls.setModeDate.mode = mode; + } + }; + var methods2 = { render: (date, mode) => { + calls.needRender = true; + rememberModeDate(date, mode); + }, setCurrentView: (date, mode) => { + calls.needRender = true; + rememberModeDate(date, mode); + }, updateView: (date, mode) => { + calls.needUpdateView = true; + rememberModeDate(date, mode); + }, render_data: () => calls.needRender = true, render_view_data: (evs) => { + if (evs && evs.length) { + evs.forEach((e) => calls.repaintEvents[e.id] = true); } else { - handlerId = index; - index++; + calls.needRender = true; } - if (settings && settings.once) { - const originalHandler = handler; - handler = function() { - originalHandler(); - eventStorage.removeEvent(handlerId); - }; + } }; + disableMethods.call(this, methods2); + isActive = true; + this.callEvent("onBeforeBatchUpdate", []); + batchUpdatePayload(callback); + this.callEvent("onAfterBatchUpdate", []); + restoreMethods.call(this); + isActive = false; + if (!noRedraw) { + if (calls.needRender) { + scheduler2.render(calls.setModeDate.date, calls.setModeDate.mode); + } else if (calls.needUpdateView) { + scheduler2.updateView(calls.setModeDate.date, calls.setModeDate.mode); + } else { + for (const i in calls.repaintEvents) { + scheduler2.updateEvent(i); + } } - handlers[handlerId] = handler; - return handlerId; } + if (call_dp) { + this._dp.setUpdateMode(dp_mode); + this._dp.sendData(); + } + }; + } + function batchUpdate(scheduler2) { + scheduler2.batchUpdate = createMethod(scheduler2); + } + function initPlugins(scheduler2) { + undoDelete(scheduler2); + dragHighlightPos(scheduler2); + limitPlugin(scheduler2); + batchUpdate(scheduler2); + } + var uidSeed = Date.now(); + function uid() { + return uidSeed++; + } + function isArray$1(obj) { + if (Array.isArray) { + return Array.isArray(obj); + } else { + return obj && obj.length !== void 0 && obj.pop && obj.push; + } + } + function isStringObject(obj) { + return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function String() { [native code] }"; + } + function isNumberObject(obj) { + return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Number() { [native code] }"; + } + function isBooleanObject(obj) { + return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Boolean() { [native code] }"; + } + function isDate$1(obj) { + if (obj && typeof obj === "object") { + return !!(obj.getFullYear && obj.getMonth && obj.getDate); + } else { return false; + } + } + function defined(obj) { + return typeof obj != "undefined"; + } + function delay(callback, timeout) { + var timer; + var result = function() { + result.$cancelTimeout(); + result.$pending = true; + var args = Array.prototype.slice.call(arguments); + timer = setTimeout(function() { + callback.apply(this, args); + result.$pending = false; + }, timeout); }; - eventStorage.removeEvent = function(id2) { - delete handlers[id2]; + result.$pending = false; + result.$cancelTimeout = function() { + clearTimeout(timer); + result.$pending = false; }; - eventStorage.clear = function() { - handlers = {}; + result.$execute = function() { + var args = Array.prototype.slice.call(arguments); + callback.apply(this, args); + result.$cancelTimeout(); }; - return eventStorage; - }; - function makeEventable(obj) { - const eventHost = new EventHost(); - obj.attachEvent = function(eventName, handler, settings) { - eventName = "ev_" + eventName.toLowerCase(); - if (!eventHost.listeners[eventName]) { - eventHost.listeners[eventName] = createEventStorage(this); + return result; + } + const utils = { uid, mixin: function mixin(target, source, force) { + for (var f in source) + if (target[f] === void 0 || force) + target[f] = source[f]; + return target; + }, copy: function copy(object) { + var i, result; + if (object && typeof object == "object") { + switch (true) { + case isDate$1(object): + result = new Date(object); + break; + case isArray$1(object): + result = new Array(object.length); + for (i = 0; i < object.length; i++) { + result[i] = copy(object[i]); + } + break; + case isStringObject(object): + result = new String(object); + break; + case isNumberObject(object): + result = new Number(object); + break; + case isBooleanObject(object): + result = new Boolean(object); + break; + default: + result = {}; + for (i in object) { + const varType = typeof object[i]; + if (varType === "string" || varType === "number" || varType === "boolean") { + result[i] = object[i]; + } else if (isDate$1(object[i])) { + result[i] = new Date(object[i]); + } else if (Object.prototype.hasOwnProperty.apply(object, [i])) + result[i] = copy(object[i]); + } + break; } - if (settings && settings.thisObject) { - handler = handler.bind(settings.thisObject); + } + return result || object; + }, defined, isDate: isDate$1, delay }; + const StateService = function() { + const stateProviders = {}; + function getState(name) { + const provider = stateProviders[name]; + if (provider) { + return stateProviders[name].method(); + } else { + const res = {}; + for (const i in stateProviders) { + if (!stateProviders[i].internal) + utils.mixin(res, stateProviders[i].method(), true); + } + return res; } - const innerId = eventHost.listeners[eventName].addEvent(handler, settings); - let handlerId = eventName + ":" + innerId; - if (settings && settings.id) { - handlerId = settings.id; + } + function registerProvider(name, provider, internal) { + stateProviders[name] = { method: provider, internal }; + } + function unregisterProvider(name) { + delete stateProviders[name]; + } + return { getState, registerProvider, unregisterProvider }; + }; + function assert(scheduler2) { + return function assert2(check, message2) { + if (!check) { + if (scheduler2.config.show_errors && scheduler2.callEvent("onError", [message2]) !== false) { + if (scheduler2.message) { + scheduler2.message({ type: "error", text: message2, expire: -1 }); + } else { + console.log(message2); + } + debugger; + } } - return handlerId; }; - obj.attachAll = function(callback) { - this.attachEvent("listen_all", callback); + } + function extend$n(scheduler2) { + var commonViews = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }; + var requiredExtensions = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" }; + scheduler2._commonErrorMessages = { unknownView: function(view) { + var relatedDoc = "Related docs: " + (commonViews[view] || commonViews.anythingElse); + var relatedExtension = requiredExtensions[view] ? "You're probably missing " + requiredExtensions[view] + "." : ""; + return "`" + view + "` view is not defined. \nPlease check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \n" + relatedDoc + "\n" + (relatedExtension ? relatedExtension + "\n" : ""); + }, collapsedContainer: function(div) { + return "Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \nMake sure that the container has some initial height or use different units. For example:\n
\n"; + } }; + scheduler2.createTimelineView = function() { + throw new Error("scheduler.createTimelineView is not implemented. Be sure to add the required extension: " + requiredExtensions.timeline + "\nRelated docs: " + commonViews.timeline); }; - obj.callEvent = function(name, eventArguments) { - if (eventHost._silent_mode) - return true; - const handlerName = "ev_" + name.toLowerCase(); - const listeners = eventHost.listeners; - if (listeners["ev_listen_all"]) { - listeners["ev_listen_all"].apply(this, [name].concat(eventArguments)); - } - if (listeners[handlerName]) - return listeners[handlerName].apply(this, eventArguments); - return true; + scheduler2.createUnitsView = function() { + throw new Error("scheduler.createUnitsView is not implemented. Be sure to add the required extension: " + requiredExtensions.unit + "\nRelated docs: " + commonViews.unit); }; - obj.checkEvent = function(name) { - const listeners = eventHost.listeners; - return !!listeners["ev_" + name.toLowerCase()]; + scheduler2.createGridView = function() { + throw new Error("scheduler.createGridView is not implemented. Be sure to add the required extension: " + requiredExtensions.grid + "\nRelated docs: " + commonViews.grid); }; - obj.detachEvent = function(id2) { - if (id2) { - let listeners = eventHost.listeners; - for (const i in listeners) { - listeners[i].removeEvent(id2); - } - const list = id2.split(":"); - listeners = eventHost.listeners; - if (list.length === 2) { - const eventName = list[0]; - const eventId = list[1]; - if (listeners[eventName]) { - listeners[eventName].removeEvent(eventId); - } - } - } + scheduler2.addMarkedTimespan = function() { + throw new Error("scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\nRelated docs: https://docs.dhtmlx.com/scheduler/limits.html"); }; - obj.detachAllEvents = function() { - for (const name in eventHost.listeners) { - eventHost.listeners[name].clear(); - } + scheduler2.renderCalendar = function() { + throw new Error("scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\nhttps://docs.dhtmlx.com/scheduler/minicalendar.html"); + }; + scheduler2.exportToPNG = function() { + throw new Error(["scheduler.exportToPNG is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); + }; + scheduler2.exportToPDF = function() { + throw new Error(["scheduler.exportToPDF is not implemented.", "This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html", "Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml"].join("\n")); }; } - function extend$j(scheduler2) { - makeEventable(scheduler2); - extend$l(scheduler2); - scheduler2._detachDomEvent = function(el2, event2, handler) { - if (el2.removeEventListener) { - el2.removeEventListener(event2, handler, false); - } else if (el2.detachEvent) { - el2.detachEvent("on" + event2, handler); + function extend$m(scheduler2) { + scheduler2.attachEvent("onSchedulerReady", function() { + if (typeof dhtmlxError !== "undefined") { + window.dhtmlxError.catchError("LoadXML", function(a, b, c) { + var message2 = c[0].responseText; + switch (scheduler2.config.ajax_error) { + case "alert": + global$1.alert(message2); + break; + case "console": + global$1.console.log(message2); + break; + } + }); } - }; - scheduler2._init_once = function() { - extend$k(scheduler2); - scheduler2._init_once = function() { - }; - }; - const layout = { navbar: { render: function(config) { - return scheduler2._init_nav_bar(config); - } }, header: { render: function(config) { - const element = document.createElement("div"); - element.className = "dhx_cal_header"; - return element; - } }, dataArea: { render: function(config) { - const element = document.createElement("div"); - element.className = "dhx_cal_data"; + }); + } + function extend$l(scheduler2) { + function div(className) { + var element = document.createElement("div"); + var classes = (className || "").split(" "); + classes.forEach(function(cssClass) { + element.classList.add(cssClass); + }); return element; - } }, html_element: { render: function(config) { - return config.html; - } } }; - function hasSchedulerMarkup(element) { - return !!(element.querySelector(".dhx_cal_header") && element.querySelector(".dhx_cal_data") && element.querySelector(".dhx_cal_navline")); } - function createDefaultHeader(scheduler3) { - const views = ["day", "week", "month"]; - const date = ["date"]; - const nav = ["prev", "today", "next"]; - if (scheduler3.matrix) { - for (const i in scheduler3.matrix) { - views.push(i); + var itemTypes = { rows_container: function() { + return div("dhx_cal_navbar_rows_container"); + }, row: function() { + return div("dhx_cal_navbar_row"); + }, view: function(config) { + var element = div("dhx_cal_tab"); + element.setAttribute("name", config.view + "_tab"); + element.setAttribute("data-tab", config.view); + if (scheduler2.config.fix_tab_position) { + if (config.$firstTab) { + element.classList.add("dhx_cal_tab_first"); + } else if (config.$lastTab) { + element.classList.add("dhx_cal_tab_last"); + } else if (config.view !== "week") { + element.classList.add("dhx_cal_tab_standalone"); } - } - if (scheduler3._props) { - for (const i in scheduler3._props) { - views.push(i); + if (config.$segmentedTab) { + element.classList.add("dhx_cal_tab_segmented"); } } - if (scheduler3._grid && scheduler3._grid.names) { - for (const i in scheduler3._grid.names) { - views.push(i); - } + return element; + }, date: function() { + return div("dhx_cal_date"); + }, button: function(config) { + return div("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab"); + }, builtInButton: function(config) { + return div("dhx_cal_" + config.view + "_button dhx_cal_nav_button"); + }, spacer: function() { + return div("dhx_cal_line_spacer"); + }, minicalendarButton: function(config) { + var minicalendarDiv = div("dhx_minical_icon"); + if (!config.click && !minicalendarDiv.$_eventAttached) { + scheduler2.event(minicalendarDiv, "click", function() { + if (scheduler2.isCalendarVisible()) { + scheduler2.destroyCalendar(); + } else { + scheduler2.renderCalendar({ position: this, date: scheduler2.getState().date, navigation: true, handler: function(date, calendar) { + scheduler2.setCurrentView(date); + scheduler2.destroyCalendar(); + } }); + } + }); } - const optionalViews = ["map", "agenda", "week_agenda", "year"]; - optionalViews.forEach(function(viewName) { - if (scheduler3[viewName + "_view"]) { - views.push(viewName); + return minicalendarDiv; + }, html_element: function(config) { + return div("dhx_cal_nav_content"); + } }; + function findRenderer(config) { + var renderer; + if (config.view) { + switch (config.view) { + case "today": + case "next": + case "prev": + renderer = itemTypes.builtInButton; + break; + case "date": + renderer = itemTypes.date; + break; + case "spacer": + renderer = itemTypes.spacer; + break; + case "button": + renderer = itemTypes.button; + break; + case "minicalendar": + renderer = itemTypes.minicalendarButton; + break; + default: + renderer = itemTypes.view; + break; } - }); - return views.concat(date).concat(nav); + } else if (config.rows) { + renderer = itemTypes.rows_container; + } else if (config.cols) { + renderer = itemTypes.row; + } + return renderer; } - scheduler2.init = function(id2, date, mode) { - if (this.$destroyed) { + function renderElement(config) { + var renderer = findRenderer(config); + if (!renderer) { return; } - date = date || scheduler2._currentDate(); - mode = mode || "week"; - if (this._obj) { - this.unset_actions(); + var element = renderer(config); + if (config.css) { + element.classList.add(config.css); } - this._obj = typeof id2 == "string" ? document.getElementById(id2) : id2; - this.$container = this._obj; - this.$root = this._obj; - if (!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === "100%") { - window.console.error(scheduler2._commonErrorMessages.collapsedContainer(), this.$container); + if (config.width) { + var value = config.width; + if (value === value * 1) { + value += "px"; + } + element.style.width = value; } - if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { - this.$container.setAttribute("role", "application"); + if (config.height) { + var value = config.height; + if (value === value * 1) { + value += "px"; + } + element.style.height = value; } - if (!this.config.header && !hasSchedulerMarkup(this.$container)) { - this.config.header = createDefaultHeader(this); - window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.", "Using a default header configuration: ", "scheduler.config.header = " + JSON.stringify(this.config.header, null, 2), "Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join("\n")); + if (config.click) { + scheduler2.event(element, "click", config.click); } - if (this.config.header) { - this.$container.innerHTML = ""; - this.$container.classList.add("dhx_cal_container"); - if (this.config.header.height) { - this.xy.nav_height = this.config.header.height; - } - this.$container.appendChild(layout.navbar.render(this.config.header)); - this.$container.appendChild(layout.header.render()); - this.$container.appendChild(layout.dataArea.render()); - } else { - if (!hasSchedulerMarkup(this.$container)) { - throw new Error(["Required DOM elements are missing from the scheduler container.", "Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup", "Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join("\n")); - } + if (config.html) { + element.innerHTML = config.html; } - if (this.config.rtl) - this.$container.className += " dhx_cal_container_rtl"; - if (this._skin_init) - scheduler2._skin_init(); - scheduler2.date.init(); - this._scroll = true; - this._els = []; - this.get_elements(); - this.init_templates(); - this.set_actions(); - this._init_once(); - this._init_touch_events(); - this.set_sizes(); - scheduler2.callEvent("onSchedulerReady", []); - scheduler2.$initialized = true; - this.setCurrentView(date, mode); - }; - scheduler2.xy = { min_event_height: 20, bar_height: 24, scale_width: 50, scroll_width: 18, scale_height: 20, month_scale_height: 20, menu_width: 25, margin_top: 0, margin_left: 0, editor_width: 140, month_head_height: 22, event_header_height: 14 }; - scheduler2.keys = { edit_save: 13, edit_cancel: 27 }; - scheduler2.bind = function bind(functor, object) { - if (functor.bind) - return functor.bind(object); - else - return function() { - return functor.apply(object, arguments); - }; - }; - scheduler2.set_sizes = function() { - var w = this._x = this._obj.clientWidth - this.xy.margin_left; - var scale_x = this._table_view ? 0 : this.xy.scale_width + this.xy.scroll_width; - var materialScalePlaceholder = this.$container.querySelector(".dhx_cal_scale_placeholder"); - if (scheduler2._is_material_skin()) { - if (!materialScalePlaceholder) { - materialScalePlaceholder = document.createElement("div"); - materialScalePlaceholder.className = "dhx_cal_scale_placeholder"; - this.$container.insertBefore(materialScalePlaceholder, this._els["dhx_cal_header"][0]); - } - materialScalePlaceholder.style.display = "block"; - this.set_xy(materialScalePlaceholder, w, this.xy.scale_height + 1, 0, this._els["dhx_cal_header"][0].offsetTop); - } else { - if (materialScalePlaceholder) { - materialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder); + if (config.align) { + var value = ""; + if (config.align == "right") { + value = "flex-end"; + } else if (config.align == "left") { + value = "flex-start"; } + element.style.justifyContent = value; } - if (this._lightbox) { - if (scheduler2.$container.offsetWidth < 1200) - ; - else { - this._setLbPosition(document.querySelector(".dhx_cal_light")); - } + return element; + } + function prepareConfig(config) { + if (typeof config === "string") { + config = { view: config }; } - this._data_width = w - scale_x; - this._els["dhx_cal_navline"][0].style.width = w + "px"; - const header = this._els["dhx_cal_header"][0]; - this.set_xy(header, this._data_width, this.xy.scale_height); - header.style.left = ``; - header.style.right = ``; - if (!this._table_view) { - if (this.config.rtl) { - header.style.right = `${this.xy.scale_width}px`; - } else { - header.style.left = `${this.xy.scale_width}px`; - } + if (!config.view && !config.rows && !config.cols) { + config.view = "button"; + } + return config; + } + function renderLayout(config) { + var fragment = document.createDocumentFragment(); + var items; + if (Array.isArray(config)) { + items = config; } else { - if (!this.config.rtl) { - header.style.left = `-1px`; - } else { - header.style.right = `-1px`; - } + items = [config]; } - }; - scheduler2.set_xy = function(node, w, h, x, y) { - function prepareValue(val) { - let prepared = val; - if (!isNaN(Number(prepared))) { - prepared = Math.max(0, prepared) + "px"; + for (var i = 0; i < items.length; i++) { + var view = prepareConfig(items[i]); + if (view.view === "day" && items[i + 1]) { + var next = prepareConfig(items[i + 1]); + if (next.view === "week" || next.view === "month") { + view.$firstTab = true; + view.$segmentedTab = true; + } } - return prepared; - } - var direction = "left"; - if (w !== void 0) { - node.style.width = prepareValue(w); - } - if (h !== void 0) { - node.style.height = prepareValue(h); - } - if (arguments.length > 3) { - if (x !== void 0) { - if (this.config.rtl) - direction = "right"; - node.style[direction] = x + "px"; + if (view.view === "week" && items[i - 1]) { + var next = prepareConfig(items[i + 1]); + if (next.view === "week" || next.view === "month") { + view.$segmentedTab = true; + } } - if (y !== void 0) { - node.style.top = y + "px"; + if (view.view === "month" && items[i - 1]) { + var next = prepareConfig(items[i - 1]); + if (next.view === "week" || next.view === "day") { + view.$lastTab = true; + view.$segmentedTab = true; + } } - } - }; - scheduler2.get_elements = function() { - const els = this._obj.getElementsByTagName("DIV"); - for (let i = 0; i < els.length; i++) { - let class_name = scheduler2._getClassName(els[i]); - const attr_value = els[i].getAttribute("data-tab") || els[i].getAttribute("name") || ""; - if (class_name) - class_name = class_name.split(" ")[0]; - if (!this._els[class_name]) - this._els[class_name] = []; - this._els[class_name].push(els[i]); - let label = scheduler2.locale.labels[attr_value + "_tab"] || scheduler2.locale.labels[attr_value || class_name]; - if (typeof label !== "string" && attr_value && !els[i].innerHTML) - label = attr_value.split("_")[0]; - if (label) { - this._waiAria.labelAttr(els[i], label); - els[i].innerHTML = label; + var element = renderElement(view); + fragment.appendChild(element); + if (view.cols || view.rows) { + element.appendChild(renderLayout(view.cols || view.rows)); } } - }; - const domEventsScope = scheduler2._createDomEventScope(); - scheduler2.unset_actions = function() { - domEventsScope.detachAll(); - }; - scheduler2.set_actions = function() { - for (const a in this._els) { - if (this._click[a]) { - for (let i = 0; i < this._els[a].length; i++) { - const element = this._els[a][i]; - const handler = this._click[a].bind(element); - domEventsScope.attach(element, "click", handler); - } - } + return fragment; + } + scheduler2._init_nav_bar = function(items) { + var navBar = this.$container.querySelector(".dhx_cal_navline"); + if (!navBar) { + navBar = document.createElement("div"); + navBar.className = "dhx_cal_navline dhx_cal_navline_flex"; + scheduler2._update_nav_bar(items, navBar); + return navBar; } - domEventsScope.attach(this._obj, "selectstart", function(e) { - e.preventDefault(); - return false; - }); - domEventsScope.attach(this._obj, "mousemove", function(e) { - if (!scheduler2._temp_touch_block) - scheduler2._on_mouse_move(e); - }); - domEventsScope.attach(this._obj, "mousedown", function(e) { - if (!scheduler2._ignore_next_click) - scheduler2._on_mouse_down(e); - }); - domEventsScope.attach(this._obj, "mouseup", function(e) { - if (!scheduler2._ignore_next_click) - scheduler2._on_mouse_up(e); - }); - domEventsScope.attach(this._obj, "dblclick", function(e) { - scheduler2._on_dbl_click(e); - }); - domEventsScope.attach(this._obj, "contextmenu", function(event2) { - if (scheduler2.checkEvent("onContextMenu")) { - event2.preventDefault(); - } - const returnValue = scheduler2.callEvent("onContextMenu", [scheduler2._locate_event(event2.target), event2]); - return returnValue; - }); + return navBar; }; - scheduler2.select = function(id2) { - if (this._select_id == id2) + var previousHeight = null; + scheduler2._update_nav_bar = function(config, container) { + if (!config) { return; - scheduler2._close_not_saved(); - this.editStop(false); - if (this._select_id) { - this.unselect(); } - this._select_id = id2; - this.updateEvent(id2); - this.callEvent("onEventSelected", [id2]); - }; - scheduler2.unselect = function(id2) { - if (id2 && id2 != this._select_id) { - return; + var heightChanged = false; + var configChanged = false; + var newHeight = config.height || scheduler2.xy.nav_height; + if (previousHeight === null || previousHeight !== newHeight) { + heightChanged = true; } - const previousSelection = this._select_id; - this._select_id = null; - if (previousSelection && this.getEvent(previousSelection)) { - this.updateEvent(previousSelection); + { + configChanged = true; } - this.callEvent("onEventUnselected", [previousSelection]); - }; - scheduler2.getState = function() { - return { mode: this._mode, date: new Date(this._date), min_date: new Date(this._min_date), max_date: new Date(this._max_date), editor_id: this._edit_id, lightbox_id: this._lightbox_id, new_event: this._new_event, select_id: this._select_id, expanded: this.expanded, drag_id: this._drag_id, drag_mode: this._drag_mode }; - }; - scheduler2._click = { dhx_cal_data: function(e) { - if (scheduler2._ignore_next_click) { - if (e.preventDefault) - e.preventDefault(); - e.cancelBubble = true; - scheduler2._ignore_next_click = false; - return false; + if (heightChanged) { + scheduler2.xy.nav_height = newHeight; } - const id2 = scheduler2._locate_event(e.target); - if (!id2) { - scheduler2.callEvent("onEmptyClick", [scheduler2.getActionData(e).date, e]); - } else { - if (!scheduler2.callEvent("onClick", [id2, e]) || scheduler2.config.readonly) - return; + if (configChanged) { + container.innerHTML = ""; + container.appendChild(renderLayout(config)); } - if (id2 && scheduler2.config.select) { - scheduler2.select(id2); - const icon = e.target.closest(".dhx_menu_icon"); - const mask = scheduler2._getClassName(icon); - if (mask.indexOf("_icon") != -1) - scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); + if (heightChanged || configChanged) { + scheduler2.unset_actions(); + scheduler2._els = []; + scheduler2.get_elements(); + scheduler2.set_actions(); + } + if (newHeight === 0) { + container.style.display = "none"; } else { - scheduler2._close_not_saved(); - if (scheduler2.getState().select_id && (/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500) { - scheduler2.unselect(); - } + container.style.display = ""; } - }, dhx_cal_prev_button: function() { - scheduler2._click.dhx_cal_next_button(0, -1); - }, dhx_cal_next_button: function(dummy, step) { - let def_step = 1; - if (scheduler2.config.rtl) { - step = -step; - def_step = -def_step; + previousHeight = newHeight; + }; + } + function extend$k(scheduler2) { + function isAttachedNode(container) { + var root = document.body; + while (container && container != root) { + container = container.parentNode; } - scheduler2.setCurrentView(scheduler2.date.add(scheduler2.date[scheduler2._mode + "_start"](new Date(scheduler2._date)), step || def_step, scheduler2._mode)); - }, dhx_cal_today_button: function() { - if (scheduler2.callEvent("onBeforeTodayDisplayed", [])) { - scheduler2.setCurrentView(scheduler2._currentDate()); + return !!(root == container); + } + function getWindowSize(window2) { + return { w: window2.innerWidth || document.documentElement.clientWidth, h: window2.innerHeight || document.documentElement.clientHeight }; + } + function equals(a, b) { + return a.w == b.w && a.h == b.h; + } + function listenWindowResize(scheduler3, window2) { + var oldSize = getWindowSize(window2); + var resizeDelay; + scheduler3.event(window2, "resize", function() { + clearTimeout(resizeDelay); + resizeDelay = setTimeout(function() { + if (!isAttachedNode(scheduler3.$container) || scheduler3.$destroyed) { + return; + } + var newSize = getWindowSize(window2); + if (!equals(oldSize, newSize)) { + oldSize = newSize; + triggerSchedulerResize(scheduler3); + } + }, 150); + }); + } + function triggerSchedulerResize(scheduler3) { + if (scheduler3.$destroyed || !scheduler3.$root || !isAttachedNode(scheduler3.$root)) { + return; } - }, dhx_cal_tab: function() { - const name = this.getAttribute("data-tab"); - const deprecated_name = this.getAttribute("name"); - const mode = name || deprecated_name.substring(0, deprecated_name.search("_tab")); - scheduler2.setCurrentView(scheduler2._date, mode); - }, buttons: { delete: function(id2) { - const c = scheduler2.locale.labels.confirm_deleting; - scheduler2._dhtmlx_confirm({ message: c, title: scheduler2.locale.labels.title_confirm_deleting, callback: function() { - scheduler2.deleteEvent(id2); - }, config: { ok: scheduler2.locale.labels.icon_delete } }); - }, edit: function(id2) { - scheduler2.edit(id2); - }, save: function(id2) { - scheduler2.editStop(true); - }, details: function(id2) { - scheduler2.showLightbox(id2); - }, form: function(id2) { - scheduler2.showLightbox(id2); - }, cancel: function(id2) { - scheduler2.editStop(false); - } } }; - scheduler2._dhtmlx_confirm = function({ message: message2, title, callback, config }) { - if (!message2) - return callback(); - config = config || {}; - const opts = { ...config, text: message2 }; - if (title) { - opts.title = title; + if (scheduler3.callEvent("onSchedulerResize", [])) { + scheduler3.updateView(); + scheduler3.callEvent("onAfterSchedulerResize", []); } - if (callback) { - opts.callback = function(result) { - if (result) { - callback(); + } + function watchNodeResize(scheduler3) { + var previousHeight = scheduler3.$root.offsetHeight; + var previousWidth = scheduler3.$root.offsetWidth; + function lowlevelResizeWatcher() { + if (scheduler3.$destroyed) { + return; + } + if (scheduler3.$root) { + if (scheduler3.$root.offsetHeight != previousHeight || scheduler3.$root.offsetWidth != previousWidth) { + triggerSchedulerResize(scheduler3); } - }; + previousHeight = scheduler3.$root.offsetHeight; + previousWidth = scheduler3.$root.offsetWidth; + } + setTimeout(lowlevelResizeWatcher, 200); } - scheduler2.confirm(opts); - }; - scheduler2.addEventNow = function(start, end, e) { - let base = {}; - if (scheduler2._isObject(start) && !scheduler2._isDate(start)) { - base = start; - start = null; + lowlevelResizeWatcher(); + } + function addResizeListener(scheduler3) { + var root = scheduler3.$container; + var containerStyles = window.getComputedStyle(root); + if (containerStyles.getPropertyValue("position") == "static") { + root.style.position = "relative"; } - const duration = (this.config.event_duration || this.config.time_step) * 6e4; - if (!start) - start = base.start_date || Math.round(scheduler2._currentDate().valueOf() / duration) * duration; - let start_date = new Date(start); - if (!end) { - let start_hour = this.config.first_hour; - if (start_hour > start_date.getHours()) { - start_date.setHours(start_hour); - start = start_date.valueOf(); + var resizeWatcher = document.createElement("iframe"); + resizeWatcher.className = "scheduler_container_resize_watcher"; + resizeWatcher.tabIndex = -1; + if (scheduler3.config.wai_aria_attributes) { + resizeWatcher.setAttribute("role", "none"); + resizeWatcher.setAttribute("aria-hidden", true); + } + var salesforce_environment = !!window["Sfdc"] || !!window["$A"] || window["Aura"]; + if (salesforce_environment) { + watchNodeResize(scheduler3); + } else { + root.appendChild(resizeWatcher); + if (resizeWatcher.contentWindow) { + listenWindowResize(scheduler3, resizeWatcher.contentWindow); + } else { + root.removeChild(resizeWatcher); + listenWindowResize(scheduler3, window); } - end = start.valueOf() + duration; } - let end_date = new Date(end); - if (start_date.valueOf() == end_date.valueOf()) - end_date.setTime(end_date.valueOf() + duration); - base.start_date = base.start_date || start_date; - base.end_date = base.end_date || end_date; - base.text = base.text || this.locale.labels.new_event; - base.id = this._drag_id = base.id || this.uid(); - this._drag_mode = "new-size"; - this._loading = true; - const eventId = this.addEvent(base); - this.callEvent("onEventCreated", [this._drag_id, e]); - this._loading = false; - this._drag_event = {}; - this._on_mouse_up(e); - return eventId; + } + addResizeListener(scheduler2); + } + class EventHost { + constructor() { + this._silent_mode = false; + this.listeners = {}; + } + _silentStart() { + this._silent_mode = true; + } + _silentEnd() { + this._silent_mode = false; + } + } + const createEventStorage = function(obj) { + let handlers = {}; + let index = 0; + const eventStorage = function() { + let combinedResult = true; + for (const i in handlers) { + const handlerResult = handlers[i].apply(obj, arguments); + combinedResult = combinedResult && handlerResult; + } + return combinedResult; }; - scheduler2._on_dbl_click = function(e, src) { - src = src || e.target; - if (this.config.readonly) - return; - const name = scheduler2._getClassName(src).split(" ")[0]; - switch (name) { - case "dhx_scale_holder": - case "dhx_scale_holder_now": - case "dhx_month_body": - case "dhx_wa_day_data": - if (!scheduler2.config.dblclick_create) - break; - this.addEventNow(this.getActionData(e).date, null, e); - break; - case "dhx_cal_event": - case "dhx_wa_ev_body": - case "dhx_agenda_line": - case "dhx_cal_agenda_event_line": - case "dhx_grid_event": - case "dhx_cal_event_line": - case "dhx_cal_event_clear": { - const id2 = this._locate_event(src); - if (!this.callEvent("onDblClick", [id2, e])) - return; - if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id2)._timed || !this.config.select) - this.showLightbox(id2); - else - this.edit(id2); - break; + eventStorage.addEvent = function(handler, settings) { + if (typeof handler == "function") { + let handlerId; + if (settings && settings.id) { + handlerId = settings.id; + } else { + handlerId = index; + index++; } - case "dhx_time_block": - case "dhx_cal_container": - return; - default: { - const viewHandler = this["dblclick_" + name]; - if (viewHandler) { - viewHandler.call(this, e); - } else { - if (src.parentNode && src != this) - return scheduler2._on_dbl_click(e, src.parentNode); - } - break; + if (settings && settings.once) { + const originalHandler = handler; + handler = function() { + originalHandler(); + eventStorage.removeEvent(handlerId); + }; } + handlers[handlerId] = handler; + return handlerId; } + return false; }; - scheduler2._get_column_index = function(x_pos) { - let column = 0; - if (this._cols) { - let width = 0; - let i = 0; - while (width + this._cols[i] < x_pos && i < this._cols.length) { - width += this._cols[i]; - i++; + eventStorage.removeEvent = function(id2) { + delete handlers[id2]; + }; + eventStorage.clear = function() { + handlers = {}; + }; + return eventStorage; + }; + function makeEventable(obj) { + const eventHost = new EventHost(); + obj.attachEvent = function(eventName, handler, settings) { + eventName = "ev_" + eventName.toLowerCase(); + if (!eventHost.listeners[eventName]) { + eventHost.listeners[eventName] = createEventStorage(this); + } + if (settings && settings.thisObject) { + handler = handler.bind(settings.thisObject); + } + const innerId = eventHost.listeners[eventName].addEvent(handler, settings); + let handlerId = eventName + ":" + innerId; + if (settings && settings.id) { + handlerId = settings.id; + } + return handlerId; + }; + obj.attachAll = function(callback) { + this.attachEvent("listen_all", callback); + }; + obj.callEvent = function(name, eventArguments) { + if (eventHost._silent_mode) + return true; + const handlerName = "ev_" + name.toLowerCase(); + const listeners = eventHost.listeners; + if (listeners["ev_listen_all"]) { + listeners["ev_listen_all"].apply(this, [name].concat(eventArguments)); + } + if (listeners[handlerName]) + return listeners[handlerName].apply(this, eventArguments); + return true; + }; + obj.checkEvent = function(name) { + const listeners = eventHost.listeners; + return !!listeners["ev_" + name.toLowerCase()]; + }; + obj.detachEvent = function(id2) { + if (id2) { + let listeners = eventHost.listeners; + for (const i in listeners) { + listeners[i].removeEvent(id2); } - column = i + (this._cols[i] ? (x_pos - width) / this._cols[i] : 0); - if (this._ignores) { - if (column >= this._cols.length) { - while (column >= 1 && this._ignores[Math.floor(column)]) { - column--; - } + const list = id2.split(":"); + listeners = eventHost.listeners; + if (list.length === 2) { + const eventName = list[0]; + const eventId = list[1]; + if (listeners[eventName]) { + listeners[eventName].removeEvent(eventId); } } } - return column; }; - scheduler2._week_indexes_from_pos = function(pos) { - if (!this._cols) { - return pos; + obj.detachAllEvents = function() { + for (const name in eventHost.listeners) { + eventHost.listeners[name].clear(); + } + }; + } + function extend$j(scheduler2) { + makeEventable(scheduler2); + extend$l(scheduler2); + scheduler2._detachDomEvent = function(el2, event2, handler) { + if (el2.removeEventListener) { + el2.removeEventListener(event2, handler, false); + } else if (el2.detachEvent) { + el2.detachEvent("on" + event2, handler); + } + }; + scheduler2._init_once = function() { + extend$k(scheduler2); + scheduler2._init_once = function() { + }; + }; + const layout = { navbar: { render: function(config) { + return scheduler2._init_nav_bar(config); + } }, header: { render: function(config) { + const element = document.createElement("div"); + element.className = "dhx_cal_header"; + return element; + } }, dataArea: { render: function(config) { + const element = document.createElement("div"); + element.className = "dhx_cal_data"; + return element; + } }, html_element: { render: function(config) { + return config.html; + } } }; + function hasSchedulerMarkup(element) { + return !!(element.querySelector(".dhx_cal_header") && element.querySelector(".dhx_cal_data") && element.querySelector(".dhx_cal_navline")); + } + function createDefaultHeader(scheduler3) { + const views = ["day", "week", "month"]; + const date = ["date"]; + const nav = ["prev", "today", "next"]; + if (scheduler3.matrix) { + for (const i in scheduler3.matrix) { + views.push(i); + } + } + if (scheduler3._props) { + for (const i in scheduler3._props) { + views.push(i); + } + } + if (scheduler3._grid && scheduler3._grid.names) { + for (const i in scheduler3._grid.names) { + views.push(i); + } + } + const optionalViews = ["map", "agenda", "week_agenda", "year"]; + optionalViews.forEach(function(viewName) { + if (scheduler3[viewName + "_view"]) { + views.push(viewName); + } + }); + return views.concat(date).concat(nav); + } + scheduler2.init = function(id2, date, mode) { + if (this.$destroyed) { + return; + } + date = date || scheduler2._currentDate(); + mode = mode || "week"; + if (this._obj) { + this.unset_actions(); + } + this._obj = typeof id2 == "string" ? document.getElementById(id2) : id2; + this.$container = this._obj; + this.$root = this._obj; + if (!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === "100%") { + window.console.error(scheduler2._commonErrorMessages.collapsedContainer(), this.$container); + } + if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { + this.$container.setAttribute("role", "application"); + } + if (!this.config.header && !hasSchedulerMarkup(this.$container)) { + this.config.header = createDefaultHeader(this); + window.console.log(["Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.", "Using a default header configuration: ", "scheduler.config.header = " + JSON.stringify(this.config.header, null, 2), "Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html"].join("\n")); + } + if (this.config.header) { + this.$container.innerHTML = ""; + this.$container.classList.add("dhx_cal_container"); + if (this.config.header.height) { + this.xy.nav_height = this.config.header.height; + } + this.$container.appendChild(layout.navbar.render(this.config.header)); + this.$container.appendChild(layout.header.render()); + this.$container.appendChild(layout.dataArea.render()); } else { - const column = this._get_column_index(pos.x); - pos.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(column) - 1)); - pos.y = Math.max(0, Math.ceil(pos.y * 60 / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step); - return pos; + if (!hasSchedulerMarkup(this.$container)) { + throw new Error(["Required DOM elements are missing from the scheduler container.", "Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup", "Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig"].join("\n")); + } } + if (this.config.rtl) + this.$container.className += " dhx_cal_container_rtl"; + if (this._skin_init) + scheduler2._skin_init(); + scheduler2.date.init(); + this._scroll = true; + this._els = []; + this.get_elements(); + this.init_templates(); + this.set_actions(); + this._init_once(); + this._init_touch_events(); + this.set_sizes(); + scheduler2.callEvent("onSchedulerReady", []); + scheduler2.$initialized = true; + this.setCurrentView(date, mode); }; - scheduler2._mouse_coords = function(ev) { - let pos; - const body = document.body; - const documentElement = document.documentElement; - if (!this.$env.isIE && (ev.pageX || ev.pageY)) - pos = { x: ev.pageX, y: ev.pageY }; + scheduler2.xy = { min_event_height: 20, bar_height: 24, scale_width: 50, scroll_width: 18, scale_height: 20, month_scale_height: 20, menu_width: 25, margin_top: 0, margin_left: 0, editor_width: 140, month_head_height: 22, event_header_height: 14 }; + scheduler2.keys = { edit_save: 13, edit_cancel: 27 }; + scheduler2.bind = function bind(functor, object) { + if (functor.bind) + return functor.bind(object); else - pos = { x: ev.clientX + (body.scrollLeft || documentElement.scrollLeft || 0) - body.clientLeft, y: ev.clientY + (body.scrollTop || documentElement.scrollTop || 0) - body.clientTop }; - if (this.config.rtl && this._colsS) { - pos.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - pos.x; - pos.x += this.$domHelpers.getAbsoluteLeft(this._obj); - if (this._mode !== "month") { - pos.x -= this.xy.scale_width; + return function() { + return functor.apply(object, arguments); + }; + }; + scheduler2.set_sizes = function() { + var w = this._x = this._obj.clientWidth - this.xy.margin_left; + var scale_x = this._table_view ? 0 : this.xy.scale_width + this.xy.scroll_width; + var materialScalePlaceholder = this.$container.querySelector(".dhx_cal_scale_placeholder"); + if (scheduler2._is_material_skin()) { + if (!materialScalePlaceholder) { + materialScalePlaceholder = document.createElement("div"); + materialScalePlaceholder.className = "dhx_cal_scale_placeholder"; + this.$container.insertBefore(materialScalePlaceholder, this._els["dhx_cal_header"][0]); } + materialScalePlaceholder.style.display = "block"; + this.set_xy(materialScalePlaceholder, w, this.xy.scale_height + 1, 0, this._els["dhx_cal_header"][0].offsetTop); } else { - pos.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width); + if (materialScalePlaceholder) { + materialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder); + } } - const dataArea = this.$container.querySelector(".dhx_cal_data"); - pos.y -= this.$domHelpers.getAbsoluteTop(dataArea) - this._els["dhx_cal_data"][0].scrollTop; - pos.ev = ev; - const handler = this["mouse_" + this._mode]; - if (handler) { - pos = handler.call(this, pos); + if (this._lightbox) { + if (scheduler2.$container.offsetWidth < 1200) + ; + else { + this._setLbPosition(document.querySelector(".dhx_cal_light")); + } + } + this._data_width = w - scale_x; + this._els["dhx_cal_navline"][0].style.width = w + "px"; + const header = this._els["dhx_cal_header"][0]; + this.set_xy(header, this._data_width, this.xy.scale_height); + header.style.left = ``; + header.style.right = ``; + if (!this._table_view) { + if (this.config.rtl) { + header.style.right = `${this.xy.scale_width}px`; + } else { + header.style.left = `${this.xy.scale_width}px`; + } } else { - if (!this._table_view) { - pos = this._week_indexes_from_pos(pos); + if (!this.config.rtl) { + header.style.left = `-1px`; } else { - const column = this._get_column_index(pos.x); - if (!this._cols || !this._colsS) - return pos; - let dy = 0; - for (dy = 1; dy < this._colsS.heights.length; dy++) - if (this._colsS.heights[dy] > pos.y) - break; - pos.y = Math.ceil((Math.max(0, column) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step); - if (scheduler2._drag_mode || this._mode == "month") - pos.y = (Math.max(0, Math.ceil(column) - 1) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step; - if (this._drag_mode == "move") { - if (scheduler2._ignores_detected && scheduler2.config.preserve_length) { - pos._ignores = true; - if (!this._drag_event._event_length) - this._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step: 1, x_unit: "day" }); - } - } - pos.x = 0; + header.style.right = `-1px`; } } - pos.timestamp = +/* @__PURE__ */ new Date(); - return pos; }; - scheduler2._close_not_saved = function() { - if ((/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500 && scheduler2._edit_id) { - const confirmationText = scheduler2.locale.labels.confirm_closing; - scheduler2._dhtmlx_confirm({ message: confirmationText, title: scheduler2.locale.labels.title_confirm_closing, callback: function() { - scheduler2.editStop(scheduler2.config.positive_closing); - } }); - if (confirmationText) { - this._drag_id = this._drag_pos = this._drag_mode = null; + scheduler2.set_xy = function(node, w, h, x, y) { + function prepareValue(val) { + let prepared = val; + if (!isNaN(Number(prepared))) { + prepared = Math.max(0, prepared) + "px"; } + return prepared; } - }; - scheduler2._correct_shift = function(start, back) { - return start -= (new Date(scheduler2._min_date).getTimezoneOffset() - new Date(start).getTimezoneOffset()) * 6e4 * (back ? -1 : 1); - }; - scheduler2._is_pos_changed = function(old_pos, new_pos) { - function diff(old_val, new_val, acc) { - return !!(Math.abs(old_val - new_val) > acc); + var direction = "left"; + if (w !== void 0) { + node.style.width = prepareValue(w); } - if (!(old_pos && this._drag_pos)) { - return true; + if (h !== void 0) { + node.style.height = prepareValue(h); + } + if (arguments.length > 3) { + if (x !== void 0) { + if (this.config.rtl) + direction = "right"; + node.style[direction] = x + "px"; + } + if (y !== void 0) { + node.style.top = y + "px"; + } } - const delay2 = 100; - const d_pos = 5; - return !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || new_pos.timestamp - this._drag_pos.timestamp > delay2 || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos)); }; - scheduler2._correct_drag_start_date = function(start) { - let obj; - if (scheduler2.matrix) - obj = scheduler2.matrix[scheduler2._mode]; - obj = obj || { x_step: 1, x_unit: "day" }; - start = new Date(start); - let len = 1; - if (obj._start_correction || obj._end_correction) + scheduler2.get_elements = function() { + const els = this._obj.getElementsByTagName("DIV"); + for (let i = 0; i < els.length; i++) { + let class_name = scheduler2._getClassName(els[i]); + const attr_value = els[i].getAttribute("data-tab") || els[i].getAttribute("name") || ""; + if (class_name) + class_name = class_name.split(" ")[0]; + if (!this._els[class_name]) + this._els[class_name] = []; + this._els[class_name].push(els[i]); + let label = scheduler2.locale.labels[attr_value + "_tab"] || scheduler2.locale.labels[attr_value || class_name]; + if (typeof label !== "string" && attr_value && !els[i].innerHTML) + label = attr_value.split("_")[0]; + if (label) { + this._waiAria.labelAttr(els[i], label); + els[i].innerHTML = label; + } + } + }; + const domEventsScope = scheduler2._createDomEventScope(); + scheduler2.unset_actions = function() { + domEventsScope.detachAll(); + }; + scheduler2.set_actions = function() { + for (const a in this._els) { + if (this._click[a]) { + for (let i = 0; i < this._els[a].length; i++) { + const element = this._els[a][i]; + const handler = this._click[a].bind(element); + domEventsScope.attach(element, "click", handler); + } + } + } + domEventsScope.attach(this._obj, "selectstart", function(e) { + e.preventDefault(); + return false; + }); + domEventsScope.attach(this._obj, "mousemove", function(e) { + if (!scheduler2._temp_touch_block) + scheduler2._on_mouse_move(e); + }); + domEventsScope.attach(this._obj, "mousedown", function(e) { + if (!scheduler2._ignore_next_click) + scheduler2._on_mouse_down(e); + }); + domEventsScope.attach(this._obj, "mouseup", function(e) { + if (!scheduler2._ignore_next_click) + scheduler2._on_mouse_up(e); + }); + domEventsScope.attach(this._obj, "dblclick", function(e) { + scheduler2._on_dbl_click(e); + }); + domEventsScope.attach(this._obj, "contextmenu", function(event2) { + if (scheduler2.checkEvent("onContextMenu")) { + event2.preventDefault(); + } + const returnValue = scheduler2.callEvent("onContextMenu", [scheduler2._locate_event(event2.target), event2]); + return returnValue; + }); + }; + scheduler2.select = function(id2) { + if (this._select_id == id2) + return; + scheduler2._close_not_saved(); + this.editStop(false); + if (this._select_id) { + this.unselect(); + } + this._select_id = id2; + this.updateEvent(id2); + this.callEvent("onEventSelected", [id2]); + }; + scheduler2.unselect = function(id2) { + if (id2 && id2 != this._select_id) { + return; + } + const previousSelection = this._select_id; + this._select_id = null; + if (previousSelection && this.getEvent(previousSelection)) { + this.updateEvent(previousSelection); + } + this.callEvent("onEventUnselected", [previousSelection]); + }; + scheduler2.$stateProvider.registerProvider("global", (function() { + return { mode: this._mode, date: new Date(this._date), min_date: new Date(this._min_date), max_date: new Date(this._max_date), editor_id: this._edit_id, lightbox_id: this._lightbox_id, new_event: this._new_event, select_id: this._select_id, expanded: this.expanded, drag_id: this._drag_id, drag_mode: this._drag_mode }; + }).bind(scheduler2)); + scheduler2._click = { dhx_cal_data: function(e) { + if (scheduler2._ignore_next_click) { + if (e.preventDefault) + e.preventDefault(); + e.cancelBubble = true; + scheduler2._ignore_next_click = false; + return false; + } + const id2 = scheduler2._locate_event(e.target); + if (!id2) { + scheduler2.callEvent("onEmptyClick", [scheduler2.getActionData(e).date, e]); + } else { + if (!scheduler2.callEvent("onClick", [id2, e]) || scheduler2.config.readonly) + return; + } + if (id2 && scheduler2.config.select) { + scheduler2.select(id2); + const icon = e.target.closest(".dhx_menu_icon"); + const mask = scheduler2._getClassName(icon); + if (mask.indexOf("_icon") != -1) + scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); + } else { + scheduler2._close_not_saved(); + if (scheduler2.getState().select_id && (/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500) { + scheduler2.unselect(); + } + } + }, dhx_cal_prev_button: function() { + scheduler2._click.dhx_cal_next_button(0, -1); + }, dhx_cal_next_button: function(dummy, step) { + let def_step = 1; + if (scheduler2.config.rtl) { + step = -step; + def_step = -def_step; + } + scheduler2.setCurrentView(scheduler2.date.add(scheduler2.date[scheduler2._mode + "_start"](new Date(scheduler2._date)), step || def_step, scheduler2._mode)); + }, dhx_cal_today_button: function() { + if (scheduler2.callEvent("onBeforeTodayDisplayed", [])) { + scheduler2.setCurrentView(scheduler2._currentDate()); + } + }, dhx_cal_tab: function() { + const name = this.getAttribute("data-tab"); + const deprecated_name = this.getAttribute("name"); + const mode = name || deprecated_name.substring(0, deprecated_name.search("_tab")); + scheduler2.setCurrentView(scheduler2._date, mode); + }, buttons: { delete: function(id2) { + const c = scheduler2.locale.labels.confirm_deleting; + scheduler2._dhtmlx_confirm({ message: c, title: scheduler2.locale.labels.title_confirm_deleting, callback: function() { + scheduler2.deleteEvent(id2); + }, config: { ok: scheduler2.locale.labels.icon_delete } }); + }, edit: function(id2) { + scheduler2.edit(id2); + }, save: function(id2) { + scheduler2.editStop(true); + }, details: function(id2) { + scheduler2.showLightbox(id2); + }, form: function(id2) { + scheduler2.showLightbox(id2); + }, cancel: function(id2) { + scheduler2.editStop(false); + } } }; + scheduler2._dhtmlx_confirm = function({ message: message2, title, callback, config }) { + if (!message2) + return callback(); + config = config || {}; + const opts = { ...config, text: message2 }; + if (title) { + opts.title = title; + } + if (callback) { + opts.callback = function(result) { + if (result) { + callback(); + } + }; + } + scheduler2.confirm(opts); + }; + scheduler2.addEventNow = function(start, end, e) { + let base = {}; + if (scheduler2._isObject(start) && !scheduler2._isDate(start)) { + base = start; + start = null; + } + const duration = (this.config.event_duration || this.config.time_step) * 6e4; + if (!start) + start = base.start_date || Math.round(scheduler2._currentDate().valueOf() / duration) * duration; + let start_date = new Date(start); + if (!end) { + let start_hour = this.config.first_hour; + if (start_hour > start_date.getHours()) { + start_date.setHours(start_hour); + start = start_date.valueOf(); + } + end = start.valueOf() + duration; + } + let end_date = new Date(end); + if (start_date.valueOf() == end_date.valueOf()) + end_date.setTime(end_date.valueOf() + duration); + base.start_date = base.start_date || start_date; + base.end_date = base.end_date || end_date; + base.text = base.text || this.locale.labels.new_event; + base.id = this._drag_id = base.id || this.uid(); + this._drag_mode = "new-size"; + this._loading = true; + const eventId = this.addEvent(base); + this.callEvent("onEventCreated", [this._drag_id, e]); + this._loading = false; + this._drag_event = {}; + this._on_mouse_up(e); + return eventId; + }; + scheduler2._on_dbl_click = function(e, src) { + src = src || e.target; + if (this.config.readonly) + return; + const name = scheduler2._getClassName(src).split(" ")[0]; + switch (name) { + case "dhx_scale_holder": + case "dhx_scale_holder_now": + case "dhx_month_body": + case "dhx_wa_day_data": + if (!scheduler2.config.dblclick_create) + break; + this.addEventNow(this.getActionData(e).date, null, e); + break; + case "dhx_cal_event": + case "dhx_wa_ev_body": + case "dhx_agenda_line": + case "dhx_cal_agenda_event_line": + case "dhx_grid_event": + case "dhx_cal_event_line": + case "dhx_cal_event_clear": { + const id2 = this._locate_event(src); + if (!this.callEvent("onDblClick", [id2, e])) + return; + if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id2)._timed || !this.config.select) + this.showLightbox(id2); + else + this.edit(id2); + break; + } + case "dhx_time_block": + case "dhx_cal_container": + return; + default: { + const viewHandler = this["dblclick_" + name]; + if (viewHandler) { + viewHandler.call(this, e); + } else { + if (src.parentNode && src != this) + return scheduler2._on_dbl_click(e, src.parentNode); + } + break; + } + } + }; + scheduler2._get_column_index = function(x_pos) { + let column = 0; + if (this._cols) { + let width = 0; + let i = 0; + while (width + this._cols[i] < x_pos && i < this._cols.length) { + width += this._cols[i]; + i++; + } + column = i + (this._cols[i] ? (x_pos - width) / this._cols[i] : 0); + if (this._ignores) { + if (column >= this._cols.length) { + while (column >= 1 && this._ignores[Math.floor(column)]) { + column--; + } + } + } + } + return column; + }; + scheduler2._week_indexes_from_pos = function(pos) { + if (!this._cols) { + return pos; + } else { + const column = this._get_column_index(pos.x); + pos.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(column) - 1)); + pos.y = Math.max(0, Math.ceil(pos.y * 60 / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step); + return pos; + } + }; + scheduler2._mouse_coords = function(ev) { + let pos; + const body = document.body; + const documentElement = document.documentElement; + if (!this.$env.isIE && (ev.pageX || ev.pageY)) + pos = { x: ev.pageX, y: ev.pageY }; + else + pos = { x: ev.clientX + (body.scrollLeft || documentElement.scrollLeft || 0) - body.clientLeft, y: ev.clientY + (body.scrollTop || documentElement.scrollTop || 0) - body.clientTop }; + if (this.config.rtl && this._colsS) { + pos.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - pos.x; + pos.x += this.$domHelpers.getAbsoluteLeft(this._obj); + if (this._mode !== "month") { + pos.x -= this.xy.scale_width; + } + } else { + pos.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width); + } + const dataArea = this.$container.querySelector(".dhx_cal_data"); + pos.y -= this.$domHelpers.getAbsoluteTop(dataArea) - this._els["dhx_cal_data"][0].scrollTop; + pos.ev = ev; + const handler = this["mouse_" + this._mode]; + if (handler) { + pos = handler.call(this, pos); + } else { + if (!this._table_view) { + pos = this._week_indexes_from_pos(pos); + } else { + const column = this._get_column_index(pos.x); + if (!this._cols || !this._colsS) + return pos; + let dy = 0; + for (dy = 1; dy < this._colsS.heights.length; dy++) + if (this._colsS.heights[dy] > pos.y) + break; + pos.y = Math.ceil((Math.max(0, column) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step); + if (scheduler2._drag_mode || this._mode == "month") + pos.y = (Math.max(0, Math.ceil(column) - 1) + Math.max(0, dy - 1) * 7) * 24 * 60 / this.config.time_step; + if (this._drag_mode == "move") { + if (scheduler2._ignores_detected && scheduler2.config.preserve_length) { + pos._ignores = true; + if (!this._drag_event._event_length) + this._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step: 1, x_unit: "day" }); + } + } + pos.x = 0; + } + } + pos.timestamp = +/* @__PURE__ */ new Date(); + return pos; + }; + scheduler2._close_not_saved = function() { + if ((/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500 && scheduler2._edit_id) { + const confirmationText = scheduler2.locale.labels.confirm_closing; + scheduler2._dhtmlx_confirm({ message: confirmationText, title: scheduler2.locale.labels.title_confirm_closing, callback: function() { + scheduler2.editStop(scheduler2.config.positive_closing); + } }); + if (confirmationText) { + this._drag_id = this._drag_pos = this._drag_mode = null; + } + } + }; + scheduler2._correct_shift = function(start, back) { + return start -= (new Date(scheduler2._min_date).getTimezoneOffset() - new Date(start).getTimezoneOffset()) * 6e4 * (back ? -1 : 1); + }; + scheduler2._is_pos_changed = function(old_pos, new_pos) { + function diff(old_val, new_val, acc) { + return !!(Math.abs(old_val - new_val) > acc); + } + if (!(old_pos && this._drag_pos)) { + return true; + } + const delay2 = 100; + const d_pos = 5; + return !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || new_pos.timestamp - this._drag_pos.timestamp > delay2 || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos)); + }; + scheduler2._correct_drag_start_date = function(start) { + let obj; + if (scheduler2.matrix) + obj = scheduler2.matrix[scheduler2._mode]; + obj = obj || { x_step: 1, x_unit: "day" }; + start = new Date(start); + let len = 1; + if (obj._start_correction || obj._end_correction) len = (obj.last_hour || 0) * 60 - (start.getHours() * 60 + start.getMinutes()) || 1; return start * 1 + (scheduler2._get_fictional_event_length(start, len, obj) - len); }; @@ -2327,106 +3520,10 @@ } return payload.apply(this, arguments); }; - }(scheduler2._waiAria[i]); - } - })(); - } - var uidSeed = Date.now(); - function uid() { - return uidSeed++; - } - function isArray(obj) { - if (Array.isArray) { - return Array.isArray(obj); - } else { - return obj && obj.length !== void 0 && obj.pop && obj.push; - } - } - function isStringObject(obj) { - return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function String() { [native code] }"; - } - function isNumberObject(obj) { - return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Number() { [native code] }"; - } - function isBooleanObject(obj) { - return obj && typeof obj === "object" && Function.prototype.toString.call(obj.constructor) === "function Boolean() { [native code] }"; - } - function isDate(obj) { - if (obj && typeof obj === "object") { - return !!(obj.getFullYear && obj.getMonth && obj.getDate); - } else { - return false; - } - } - function defined(obj) { - return typeof obj != "undefined"; - } - function delay(callback, timeout) { - var timer; - var result = function() { - result.$cancelTimeout(); - result.$pending = true; - var args = Array.prototype.slice.call(arguments); - timer = setTimeout(function() { - callback.apply(this, args); - result.$pending = false; - }, timeout); - }; - result.$pending = false; - result.$cancelTimeout = function() { - clearTimeout(timer); - result.$pending = false; - }; - result.$execute = function() { - var args = Array.prototype.slice.call(arguments); - callback.apply(this, args); - result.$cancelTimeout(); - }; - return result; - } - const utils = { uid, mixin: function mixin(target, source, force) { - for (var f in source) - if (target[f] === void 0 || force) - target[f] = source[f]; - return target; - }, copy: function copy(object) { - var i, result; - if (object && typeof object == "object") { - switch (true) { - case isDate(object): - result = new Date(object); - break; - case isArray(object): - result = new Array(object.length); - for (i = 0; i < object.length; i++) { - result[i] = copy(object[i]); - } - break; - case isStringObject(object): - result = new String(object); - break; - case isNumberObject(object): - result = new Number(object); - break; - case isBooleanObject(object): - result = new Boolean(object); - break; - default: - result = {}; - for (i in object) { - const varType = typeof object[i]; - if (varType === "string" || varType === "number" || varType === "boolean") { - result[i] = object[i]; - } else if (isDate(object[i])) { - result[i] = new Date(object[i]); - } else if (Object.prototype.hasOwnProperty.apply(object, [i])) - result[i] = copy(object[i]); - } - break; + }(scheduler2._waiAria[i]); } - } - return result || object; - }, defined, isDate, delay }; + })(); + } function elementPosition(elem) { var top = 0, left = 0, right = 0, bottom = 0; if (elem.getBoundingClientRect) { @@ -2455,7 +3552,7 @@ function getRelativeEventPosition(ev, node) { var d = document.documentElement; var box = elementPosition(node); - return { x: ev.clientX + d.scrollLeft - d.clientLeft - box.x + node.scrollLeft, y: ev.clientY + d.scrollTop - d.clientTop - box.y + node.scrollTop }; + return { x: ev.clientX - d.clientLeft - box.x + node.scrollLeft, y: ev.clientY - d.clientTop - box.y + node.scrollTop }; } function getNodePosition(elem) { var top = 0, left = 0, right = 0, bottom = 0; @@ -3292,7 +4389,7 @@ } }; } function extend$d(scheduler2) { - scheduler2.config = { default_date: "%j %M %Y", month_date: "%F %Y", load_date: "%Y-%m-%d", week_date: "%l", day_date: "%D %j", hour_date: "%H:%i", month_day: "%d", date_format: "%Y-%m-%d %H:%i", api_date: "%d-%m-%Y %H:%i", parse_exact_format: false, preserve_length: true, time_step: 5, displayed_event_color: "#ff4a4a", displayed_event_text_color: "#ffef80", wide_form: 0, day_column_padding: 8, use_select_menu_space: true, fix_tab_position: true, start_on_monday: true, first_hour: 0, last_hour: 24, readonly: false, drag_resize: true, drag_move: true, drag_create: true, drag_event_body: true, dblclick_create: true, details_on_dblclick: true, edit_on_create: true, details_on_create: true, header: null, hour_size_px: 44, resize_month_events: false, resize_month_timed: false, responsive_lightbox: false, separate_short_events: true, rtl: false, cascade_event_display: false, cascade_event_count: 4, cascade_event_margin: 30, multi_day: true, multi_day_height_limit: 200, drag_lightbox: true, preserve_scroll: true, select: true, server_utc: false, touch: true, touch_tip: true, touch_drag: 500, touch_swipe_dates: false, quick_info_detached: true, positive_closing: false, drag_highlight: true, limit_drag_out: false, icons_edit: ["icon_save", "icon_cancel"], icons_select: ["icon_details", "icon_edit", "icon_delete"], buttons_left: ["dhx_save_btn", "dhx_cancel_btn"], buttons_right: ["dhx_delete_btn"], lightbox: { sections: [{ name: "description", map_to: "text", type: "textarea", focus: true }, { name: "time", height: 72, type: "time", map_to: "auto" }] }, highlight_displayed_event: true, left_border: false, ajax_error: "alert", delay_render: 0, timeline_swap_resize: true, wai_aria_attributes: true, wai_aria_application_role: true, csp: "auto", event_attribute: "data-event-id", show_errors: true }; + scheduler2.config = { default_date: "%j %M %Y", month_date: "%F %Y", load_date: "%Y-%m-%d", week_date: "%l", day_date: "%D %j", hour_date: "%H:%i", month_day: "%d", date_format: "%Y-%m-%d %H:%i", api_date: "%d-%m-%Y %H:%i", parse_exact_format: false, preserve_length: true, time_step: 5, displayed_event_color: "#ff4a4a", displayed_event_text_color: "#ffef80", wide_form: 0, day_column_padding: 8, use_select_menu_space: true, fix_tab_position: true, start_on_monday: true, first_hour: 0, last_hour: 24, readonly: false, drag_resize: true, drag_move: true, drag_create: true, drag_event_body: true, dblclick_create: true, details_on_dblclick: true, edit_on_create: true, details_on_create: true, header: null, hour_size_px: 44, resize_month_events: false, resize_month_timed: false, responsive_lightbox: false, separate_short_events: true, rtl: false, cascade_event_display: false, cascade_event_count: 4, cascade_event_margin: 30, multi_day: true, multi_day_height_limit: 200, drag_lightbox: true, preserve_scroll: true, select: true, undo_deleted: true, server_utc: false, touch: true, touch_tip: true, touch_drag: 500, touch_swipe_dates: false, quick_info_detached: true, positive_closing: false, drag_highlight: true, limit_drag_out: false, icons_edit: ["icon_save", "icon_cancel"], icons_select: ["icon_details", "icon_edit", "icon_delete"], buttons_left: ["dhx_save_btn", "dhx_cancel_btn"], buttons_right: ["dhx_delete_btn"], lightbox: { sections: [{ name: "description", map_to: "text", type: "textarea", focus: true }, { name: "time", height: 72, type: "time", map_to: "auto" }] }, highlight_displayed_event: true, left_border: false, ajax_error: "alert", delay_render: 0, timeline_swap_resize: true, wai_aria_attributes: true, wai_aria_application_role: true, csp: "auto", event_attribute: "data-event-id", show_errors: true }; scheduler2.config.buttons_left.$initial = scheduler2.config.buttons_left.join(); scheduler2.config.buttons_right.$initial = scheduler2.config.buttons_right.join(); scheduler2._helpers = { parseDate: function parseDate(date) { @@ -4154,7 +5251,10 @@ cs2 += " dhx_cal_event_cascade"; } var boxWidth = w - 1; - var html = '
'; + var html = `
+
`; d.innerHTML = html; var container = d.cloneNode(true).firstChild; if (!bottom && scheduler2.renderEvent(container, ev, w, h, contentA, contentB)) { @@ -4984,21 +6084,21 @@ case "%Y": selectBoxClass = "dhx_lightbox_year_select"; sns._time_format_order[3] = p; - var range; + var range2; var start_year; var end_year; if (sns.year_range) { if (!isNaN(sns.year_range)) { - range = sns.year_range; + range2 = sns.year_range; } else if (sns.year_range.push) { start_year = sns.year_range[0]; end_year = sns.year_range[1]; } } - range = range || 10; - var offset = offset || Math.floor(range / 2); + range2 = range2 || 10; + var offset = offset || Math.floor(range2 / 2); start_year = start_year || dt.getFullYear() - offset; - end_year = end_year || start_year + range; + end_year = end_year || start_year + range2; for (var i = start_year; i < end_year; i++) options += ""; break; @@ -5480,7 +6580,7 @@ if (typeof label_name !== "string") { label_name = sns[i].name; } - html += "
" + button + "
" + block.render.call(this, sns[i]); + html += "
" + button + "
" + block.render.call(this, sns[i]); html += "
"; } var ds = d.getElementsByTagName("div"); @@ -6250,8180 +7350,11198 @@ if (this._is_virtual_event) { return !this._is_virtual_event(id2); } - return true; - }; - scheduler2.setUserData = function(id2, name, value) { - if (id2) { - var ev = this.getEvent(id2); - if (ev) - ev[name] = value; + return true; + }; + scheduler2.setUserData = function(id2, name, value) { + if (id2) { + var ev = this.getEvent(id2); + if (ev) + ev[name] = value; + } else { + this._userdata[name] = value; + } + }; + scheduler2.getUserData = function(id2, name) { + if (id2) { + var ev = this.getEvent(id2); + if (ev) + return ev[name]; + else + return null; + } else { + return this._userdata[name]; + } + }; + scheduler2._set_event_text_style = function(id2, style) { + if (!scheduler2.getEvent(id2)) + return; + this.for_rendered(id2, function(r) { + r.style.cssText += ";" + style; + }); + var ev = this.getEvent(id2); + ev["_text_style"] = style; + this.event_updated(ev); + }; + scheduler2._update_callback = function(upd, id2) { + var data = scheduler2._xmlNodeToJSON(upd.firstChild); + if (data.rec_type == "none") + data.rec_pattern = "none"; + data.text = data.text || data._tagvalue; + data.start_date = scheduler2._helpers.parseDate(data.start_date); + data.end_date = scheduler2._helpers.parseDate(data.end_date); + scheduler2.addEvent(data); + if (scheduler2._add_rec_marker) + scheduler2.setCurrentView(); + }; + scheduler2._dp_change_event_id = function(id2, new_id) { + if (!scheduler2.getEvent(id2)) + return; + scheduler2.changeEventId(id2, new_id); + }; + scheduler2._dp_hook_delete = function(id2, new_id) { + if (!scheduler2.getEvent(id2)) + return; + if (new_id && id2 != new_id) { + if (this.getUserData(id2, dp.action_param) == "true_deleted") + this.setUserData(id2, dp.action_param, "updated"); + this.changeEventId(id2, new_id); + } + return this.deleteEvent(new_id, true); + }; + scheduler2.setDp = function() { + this._dp = dp; + }; + scheduler2.setDp(); + } + function DataProcessor(serverProcessorURL) { + this.serverProcessor = serverProcessorURL; + this.action_param = "!nativeeditor_status"; + this.object = null; + this.updatedRows = []; + this.autoUpdate = true; + this.updateMode = "cell"; + this._tMode = "GET"; + this._headers = null; + this._payload = null; + this.post_delim = "_"; + this._waitMode = 0; + this._in_progress = {}; + this._invalid = {}; + this.messages = []; + this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }; + this.enableUTFencoding(true); + makeEventable(this); + return this; + } + DataProcessor.prototype = { setTransactionMode: function(mode, total) { + if (typeof mode == "object") { + this._tMode = mode.mode || this._tMode; + if (mode.headers !== void 0) { + this._headers = mode.headers; + } + if (mode.payload !== void 0) { + this._payload = mode.payload; + } + this._tSend = !!total; + } else { + this._tMode = mode; + this._tSend = total; + } + if (this._tMode == "REST") { + this._tSend = false; + this._endnm = true; + } + if (this._tMode === "JSON" || this._tMode === "REST-JSON") { + this._tSend = false; + this._endnm = true; + this._serializeAsJson = true; + this._headers = this._headers || {}; + this._headers["Content-Type"] = "application/json"; + } else { + if (this._headers && !this._headers["Content-Type"]) { + this._headers["Content-Type"] = "application/x-www-form-urlencoded"; + } + } + if (this._tMode === "CUSTOM") { + this._tSend = false; + this._endnm = true; + this._router = mode.router; + } + }, escape: function(data) { + if (this._utf) + return encodeURIComponent(data); + else + return escape(data); + }, enableUTFencoding: function(mode) { + this._utf = !!mode; + }, setDataColumns: function(val) { + this._columns = typeof val == "string" ? val.split(",") : val; + }, getSyncState: function() { + return !this.updatedRows.length; + }, enableDataNames: function(mode) { + this._endnm = !!mode; + }, enablePartialDataSend: function(mode) { + this._changed = !!mode; + }, setUpdateMode: function(mode, dnd) { + this.autoUpdate = mode == "cell"; + this.updateMode = mode; + this.dnd = dnd; + }, ignore: function(code, master) { + this._silent_mode = true; + code.call(master || window); + this._silent_mode = false; + }, setUpdated: function(rowId, state, mode) { + if (this._silent_mode) + return; + var ind = this.findRow(rowId); + mode = mode || "updated"; + var existing = this.$scheduler.getUserData(rowId, this.action_param); + if (existing && mode == "updated") + mode = existing; + if (state) { + this.set_invalid(rowId, false); + this.updatedRows[ind] = rowId; + this.$scheduler.setUserData(rowId, this.action_param, mode); + if (this._in_progress[rowId]) + this._in_progress[rowId] = "wait"; + } else { + if (!this.is_invalid(rowId)) { + this.updatedRows.splice(ind, 1); + this.$scheduler.setUserData(rowId, this.action_param, ""); + } + } + this.markRow(rowId, state, mode); + if (state && this.autoUpdate) + this.sendData(rowId); + }, markRow: function(id2, state, mode) { + var str = ""; + var invalid = this.is_invalid(id2); + if (invalid) { + str = this.styles[invalid]; + state = true; + } + if (this.callEvent("onRowMark", [id2, state, mode, invalid])) { + str = this.styles[state ? mode : "clear"] + str; + this.$scheduler[this._methods[0]](id2, str); + if (invalid && invalid.details) { + str += this.styles[invalid + "_cell"]; + for (var i = 0; i < invalid.details.length; i++) + if (invalid.details[i]) + this.$scheduler[this._methods[1]](id2, i, str); + } + } + }, getActionByState: function(state) { + if (state === "inserted") { + return "create"; + } + if (state === "updated") { + return "update"; + } + if (state === "deleted") { + return "delete"; + } + return "update"; + }, getState: function(id2) { + return this.$scheduler.getUserData(id2, this.action_param); + }, is_invalid: function(id2) { + return this._invalid[id2]; + }, set_invalid: function(id2, mode, details) { + if (details) + mode = { value: mode, details, toString: function() { + return this.value.toString(); + } }; + this._invalid[id2] = mode; + }, checkBeforeUpdate: function(rowId) { + return true; + }, sendData: function(rowId) { + if (this.$scheduler.editStop) + this.$scheduler.editStop(); + if (typeof rowId == "undefined" || this._tSend) + return this.sendAllData(); + if (this._in_progress[rowId]) + return false; + this.messages = []; + if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidationError", [rowId, this.messages])) + return false; + this._beforeSendData(this._getRowData(rowId), rowId); + }, _beforeSendData: function(data, rowId) { + if (!this.callEvent("onBeforeUpdate", [rowId, this.getState(rowId), data])) + return false; + this._sendData(data, rowId); + }, serialize: function(data, id2) { + if (this._serializeAsJson) { + return this._serializeAsJSON(data); + } + if (typeof data == "string") + return data; + if (typeof id2 != "undefined") + return this.serialize_one(data, ""); + else { + var stack = []; + var keys = []; + for (var key in data) + if (data.hasOwnProperty(key)) { + stack.push(this.serialize_one(data[key], key + this.post_delim)); + keys.push(key); + } + stack.push("ids=" + this.escape(keys.join(","))); + if (this.$scheduler.security_key) + stack.push("dhx_security=" + this.$scheduler.security_key); + return stack.join("&"); + } + }, serialize_one: function(data, pref) { + if (typeof data == "string") + return data; + var stack = []; + var serialized = ""; + for (var key in data) + if (data.hasOwnProperty(key)) { + if ((key == "id" || key == this.action_param) && this._tMode == "REST") + continue; + if (typeof data[key] === "string" || typeof data[key] === "number") { + serialized = data[key]; + } else { + serialized = JSON.stringify(data[key]); + } + stack.push(this.escape((pref || "") + key) + "=" + this.escape(serialized)); + } + return stack.join("&"); + }, _applyPayload: function(url2) { + var ajax = this.$scheduler.ajax; + if (this._payload) + for (var key in this._payload) + url2 = url2 + ajax.urlSeparator(url2) + this.escape(key) + "=" + this.escape(this._payload[key]); + return url2; + }, _sendData: function(dataToSend, rowId) { + if (!dataToSend) { + return; + } + if (!this.callEvent("onBeforeDataSending", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) { + return false; + } + if (rowId) { + this._in_progress[rowId] = (/* @__PURE__ */ new Date()).valueOf(); + } + var self2 = this; + var ajax = this.$scheduler.ajax; + if (this._tMode === "CUSTOM") { + var state = this.getState(rowId); + var action = this.getActionByState(state); + var _onResolvedCreateUpdate = function(tag) { + var resultState = state; + if (tag && tag.responseText && tag.setRequestHeader) { + if (tag.status !== 200) { + resultState = "error"; + } + try { + tag = JSON.parse(tag.responseText); + } catch (e) { + } + } + resultState = resultState || "updated"; + var sid = rowId; + var tid = rowId; + if (tag) { + resultState = tag.action || resultState; + sid = tag.sid || sid; + tid = tag.id || tag.tid || tid; + } + self2.afterUpdateCallback(sid, tid, resultState, tag); + }; + const routerMode = "event"; + var actionPromise; + if (this._router instanceof Function) { + actionPromise = this._router(routerMode, action, dataToSend, rowId); } else { - this._userdata[name] = value; + switch (state) { + case "inserted": + actionPromise = this._router[routerMode].create(dataToSend); + break; + case "deleted": + actionPromise = this._router[routerMode].delete(rowId); + break; + default: + actionPromise = this._router[routerMode].update(dataToSend, rowId); + break; + } } - }; - scheduler2.getUserData = function(id2, name) { - if (id2) { - var ev = this.getEvent(id2); - if (ev) - return ev[name]; - else - return null; + if (actionPromise) { + if (!actionPromise.then && (actionPromise.id === void 0 && actionPromise.tid === void 0 && actionPromise.action === void 0)) { + throw new Error("Incorrect router return value. A Promise or a response object is expected"); + } + if (actionPromise.then) { + actionPromise.then(_onResolvedCreateUpdate).catch(function(error) { + if (error && error.action) { + _onResolvedCreateUpdate(error); + } else { + _onResolvedCreateUpdate({ action: "error", value: error }); + } + }); + } else { + _onResolvedCreateUpdate(actionPromise); + } } else { - return this._userdata[name]; + _onResolvedCreateUpdate(null); } - }; - scheduler2._set_event_text_style = function(id2, style) { - if (!scheduler2.getEvent(id2)) - return; - this.for_rendered(id2, function(r) { - r.style.cssText += ";" + style; - }); - var ev = this.getEvent(id2); - ev["_text_style"] = style; - this.event_updated(ev); - }; - scheduler2._update_callback = function(upd, id2) { - var data = scheduler2._xmlNodeToJSON(upd.firstChild); - if (data.rec_type == "none") - data.rec_pattern = "none"; - data.text = data.text || data._tagvalue; - data.start_date = scheduler2._helpers.parseDate(data.start_date); - data.end_date = scheduler2._helpers.parseDate(data.end_date); - scheduler2.addEvent(data); - if (scheduler2._add_rec_marker) - scheduler2.setCurrentView(); - }; - scheduler2._dp_change_event_id = function(id2, new_id) { - if (!scheduler2.getEvent(id2)) - return; - scheduler2.changeEventId(id2, new_id); - }; - scheduler2._dp_hook_delete = function(id2, new_id) { - if (!scheduler2.getEvent(id2)) - return; - if (new_id && id2 != new_id) { - if (this.getUserData(id2, dp.action_param) == "true_deleted") - this.setUserData(id2, dp.action_param, "updated"); - this.changeEventId(id2, new_id); + return; + } + var queryParams = { callback: function(xml) { + var ids = []; + if (rowId) { + ids.push(rowId); + } else if (dataToSend) { + for (var key2 in dataToSend) { + ids.push(key2); + } } - return this.deleteEvent(new_id, true); - }; - scheduler2.setDp = function() { - this._dp = dp; - }; - scheduler2.setDp(); - } - function DataProcessor(serverProcessorURL) { - this.serverProcessor = serverProcessorURL; - this.action_param = "!nativeeditor_status"; - this.object = null; - this.updatedRows = []; - this.autoUpdate = true; - this.updateMode = "cell"; - this._tMode = "GET"; - this._headers = null; - this._payload = null; - this.post_delim = "_"; - this._waitMode = 0; - this._in_progress = {}; - this._invalid = {}; + return self2.afterUpdate(self2, xml, ids); + }, headers: self2._headers }; + var urlParams = this.serverProcessor + (this._user ? ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.$scheduler.getUserData(0, "version")].join("&") : ""); + var url2 = this._applyPayload(urlParams); + var data; + switch (this._tMode) { + case "GET": + data = this._cleanupArgumentsBeforeSend(dataToSend); + queryParams.url = url2 + ajax.urlSeparator(url2) + this.serialize(data, rowId); + queryParams.method = "GET"; + break; + case "POST": + data = this._cleanupArgumentsBeforeSend(dataToSend); + queryParams.url = url2; + queryParams.method = "POST"; + queryParams.data = this.serialize(data, rowId); + break; + case "JSON": + data = {}; + var preprocessedData = this._cleanupItemBeforeSend(dataToSend); + for (var key in preprocessedData) { + if (key === this.action_param || key === "id" || key === "gr_id") { + continue; + } + data[key] = preprocessedData[key]; + } + queryParams.url = url2; + queryParams.method = "POST"; + queryParams.data = JSON.stringify({ id: rowId, action: dataToSend[this.action_param], data }); + break; + case "REST": + case "REST-JSON": + url2 = urlParams.replace(/(&|\?)editing=true/, ""); + data = ""; + switch (this.getState(rowId)) { + case "inserted": + queryParams.method = "POST"; + queryParams.data = this.serialize(dataToSend, rowId); + break; + case "deleted": + queryParams.method = "DELETE"; + url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; + break; + default: + queryParams.method = "PUT"; + queryParams.data = this.serialize(dataToSend, rowId); + url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; + break; + } + queryParams.url = this._applyPayload(url2); + break; + } + this._waitMode++; + return ajax.query(queryParams); + }, sendAllData: function() { + if (!this.updatedRows.length || this.updateMode === "off") { + return; + } this.messages = []; - this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }; - this.enableUTFencoding(true); - makeEventable(this); - return this; - } - DataProcessor.prototype = { setTransactionMode: function(mode, total) { - if (typeof mode == "object") { - this._tMode = mode.mode || this._tMode; - if (mode.headers !== void 0) { - this._headers = mode.headers; - } - if (mode.payload !== void 0) { - this._payload = mode.payload; + var valid = true; + this._forEachUpdatedRow(function(rowId) { + valid = valid && this.checkBeforeUpdate(rowId); + }); + if (!valid && !this.callEvent("onValidationError", ["", this.messages])) { + return false; + } + if (this._tSend) { + this._sendData(this._getAllData()); + } else { + this._forEachUpdatedRow(function(rowId) { + if (!this._in_progress[rowId]) { + if (this.is_invalid(rowId)) { + return; + } + this._beforeSendData(this._getRowData(rowId), rowId); + } + }); + } + }, _getAllData: function(rowId) { + var out = {}; + var has_one = false; + this._forEachUpdatedRow(function(id2) { + if (this._in_progress[id2] || this.is_invalid(id2)) { + return; } - this._tSend = !!total; - } else { - this._tMode = mode; - this._tSend = total; + var row = this._getRowData(id2); + if (!this.callEvent("onBeforeUpdate", [id2, this.getState(id2), row])) { + return; + } + out[id2] = row; + has_one = true; + this._in_progress[id2] = (/* @__PURE__ */ new Date()).valueOf(); + }); + return has_one ? out : null; + }, findRow: function(pattern) { + var i = 0; + for (i = 0; i < this.updatedRows.length; i++) + if (pattern == this.updatedRows[i]) + break; + return i; + }, defineAction: function(name, handler) { + if (!this._uActions) + this._uActions = {}; + this._uActions[name] = handler; + }, afterUpdateCallback: function(sid, tid, action, btag) { + if (!this.$scheduler) { + return; } - if (this._tMode == "REST") { - this._tSend = false; - this._endnm = true; + var marker2 = sid; + var correct = action !== "error" && action !== "invalid"; + if (!correct) { + this.set_invalid(sid, action); } - if (this._tMode === "JSON" || this._tMode === "REST-JSON") { - this._tSend = false; - this._endnm = true; - this._serializeAsJson = true; - this._headers = this._headers || {}; - this._headers["Content-Type"] = "application/json"; - } else { - if (this._headers && !this._headers["Content-Type"]) { - this._headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (this._uActions && this._uActions[action] && !this._uActions[action](btag)) { + return delete this._in_progress[marker2]; + } + if (this._in_progress[marker2] !== "wait") { + this.setUpdated(sid, false); + } + var originalSid = sid; + switch (action) { + case "inserted": + case "insert": + if (tid != sid) { + this.setUpdated(sid, false); + this.$scheduler[this._methods[2]](sid, tid); + sid = tid; + } + break; + case "delete": + case "deleted": + this.$scheduler.setUserData(sid, this.action_param, "true_deleted"); + this.$scheduler[this._methods[3]](sid, tid); + delete this._in_progress[marker2]; + return this.callEvent("onAfterUpdate", [sid, action, tid, btag]); + } + if (this._in_progress[marker2] !== "wait") { + if (correct) { + this.$scheduler.setUserData(sid, this.action_param, ""); } + delete this._in_progress[marker2]; + } else { + delete this._in_progress[marker2]; + this.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param)); } - if (this._tMode === "CUSTOM") { - this._tSend = false; - this._endnm = true; - this._router = mode.router; + this.callEvent("onAfterUpdate", [originalSid, action, tid, btag]); + }, _errorResponse: function(xml, id2) { + if (this.$scheduler && this.$scheduler.callEvent) { + this.$scheduler.callEvent("onSaveError", [id2, xml.xmlDoc]); } - }, escape: function(data) { - if (this._utf) - return encodeURIComponent(data); - else - return escape(data); - }, enableUTFencoding: function(mode) { - this._utf = !!mode; - }, setDataColumns: function(val) { - this._columns = typeof val == "string" ? val.split(",") : val; - }, getSyncState: function() { - return !this.updatedRows.length; - }, enableDataNames: function(mode) { - this._endnm = !!mode; - }, enablePartialDataSend: function(mode) { - this._changed = !!mode; - }, setUpdateMode: function(mode, dnd) { - this.autoUpdate = mode == "cell"; - this.updateMode = mode; - this.dnd = dnd; - }, ignore: function(code, master) { - this._silent_mode = true; - code.call(master || window); - this._silent_mode = false; - }, setUpdated: function(rowId, state, mode) { - if (this._silent_mode) + return this.cleanUpdate(id2); + }, _setDefaultTransactionMode: function() { + if (this.serverProcessor) { + this.setTransactionMode("POST", true); + this.serverProcessor += (this.serverProcessor.indexOf("?") !== -1 ? "&" : "?") + "editing=true"; + this._serverProcessor = this.serverProcessor; + } + }, afterUpdate: function(that, xml, id2) { + var ajax = this.$scheduler.ajax; + if (xml.xmlDoc.status !== 200) { + this._errorResponse(xml, id2); return; - var ind = this.findRow(rowId); - mode = mode || "updated"; - var existing = this.$scheduler.getUserData(rowId, this.action_param); - if (existing && mode == "updated") - mode = existing; - if (state) { - this.set_invalid(rowId, false); - this.updatedRows[ind] = rowId; - this.$scheduler.setUserData(rowId, this.action_param, mode); - if (this._in_progress[rowId]) - this._in_progress[rowId] = "wait"; - } else { - if (!this.is_invalid(rowId)) { - this.updatedRows.splice(ind, 1); - this.$scheduler.setUserData(rowId, this.action_param, ""); + } + var tag; + try { + tag = JSON.parse(xml.xmlDoc.responseText); + } catch (e) { + if (!xml.xmlDoc.responseText.length) { + tag = {}; } } - this.markRow(rowId, state, mode); - if (state && this.autoUpdate) - this.sendData(rowId); - }, markRow: function(id2, state, mode) { - var str = ""; - var invalid = this.is_invalid(id2); - if (invalid) { - str = this.styles[invalid]; - state = true; + if (tag) { + var action = tag.action || this.getState(id2) || "updated"; + var sid = tag.sid || id2[0]; + var tid = tag.tid || id2[0]; + that.afterUpdateCallback(sid, tid, action, tag); + that.finalizeUpdate(); + return; } - if (this.callEvent("onRowMark", [id2, state, mode, invalid])) { - str = this.styles[state ? mode : "clear"] + str; - this.$scheduler[this._methods[0]](id2, str); - if (invalid && invalid.details) { - str += this.styles[invalid + "_cell"]; - for (var i = 0; i < invalid.details.length; i++) - if (invalid.details[i]) - this.$scheduler[this._methods[1]](id2, i, str); - } + var top = ajax.xmltop("data", xml.xmlDoc); + if (!top) { + return this._errorResponse(xml, id2); } - }, getActionByState: function(state) { - if (state === "inserted") { - return "create"; + var atag = ajax.xpath("//data/action", top); + if (!atag.length) { + return this._errorResponse(xml, id2); } - if (state === "updated") { - return "update"; + for (var i = 0; i < atag.length; i++) { + var btag = atag[i]; + var action = btag.getAttribute("type"); + var sid = btag.getAttribute("sid"); + var tid = btag.getAttribute("tid"); + that.afterUpdateCallback(sid, tid, action, btag); } - if (state === "deleted") { - return "delete"; + that.finalizeUpdate(); + }, cleanUpdate: function(id2) { + if (id2) + for (var i = 0; i < id2.length; i++) + delete this._in_progress[id2[i]]; + }, finalizeUpdate: function() { + if (this._waitMode) + this._waitMode--; + this.callEvent("onAfterUpdateFinish", []); + if (!this.updatedRows.length) + this.callEvent("onFullSync", []); + }, init: function(scheduler2) { + if (this._initialized) { + return; } - return "update"; - }, getState: function(id2) { - return this.$scheduler.getUserData(id2, this.action_param); - }, is_invalid: function(id2) { - return this._invalid[id2]; - }, set_invalid: function(id2, mode, details) { - if (details) - mode = { value: mode, details, toString: function() { - return this.value.toString(); - } }; - this._invalid[id2] = mode; - }, checkBeforeUpdate: function(rowId) { - return true; - }, sendData: function(rowId) { - if (this.$scheduler.editStop) - this.$scheduler.editStop(); - if (typeof rowId == "undefined" || this._tSend) - return this.sendAllData(); - if (this._in_progress[rowId]) - return false; - this.messages = []; - if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidationError", [rowId, this.messages])) - return false; - this._beforeSendData(this._getRowData(rowId), rowId); - }, _beforeSendData: function(data, rowId) { - if (!this.callEvent("onBeforeUpdate", [rowId, this.getState(rowId), data])) + this.$scheduler = scheduler2; + if (this.$scheduler._dp_init) { + this.$scheduler._dp_init(this); + } + this._setDefaultTransactionMode(); + this._methods = this._methods || ["_set_event_text_style", "", "_dp_change_event_id", "_dp_hook_delete"]; + extendScheduler(this.$scheduler, this); + var dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this); + dataProcessorEvents.attach(); + this.attachEvent("onDestroy", function() { + delete this._getRowData; + delete this.$scheduler._dp; + delete this.$scheduler._dataprocessor; + delete this.$scheduler._set_event_text_style; + delete this.$scheduler._dp_change_event_id; + delete this.$scheduler._dp_hook_delete; + delete this.$scheduler; + dataProcessorEvents.detach(); + }); + this.$scheduler.callEvent("onDataProcessorReady", [this]); + this._initialized = true; + scheduler2._dataprocessor = this; + }, setOnAfterUpdate: function(ev) { + this.attachEvent("onAfterUpdate", ev); + }, setOnBeforeUpdateHandler: function(func) { + this.attachEvent("onBeforeDataSending", func); + }, setAutoUpdate: function(interval, user) { + interval = interval || 2e3; + this._user = user || (/* @__PURE__ */ new Date()).valueOf(); + this._need_update = false; + this._update_busy = false; + this.attachEvent("onAfterUpdate", function(sid, action, tid, xml_node) { + this.afterAutoUpdate(sid, action, tid, xml_node); + }); + this.attachEvent("onFullSync", function() { + this.fullSync(); + }); + var self2 = this; + let intervalId = global$1.setInterval(function() { + self2.loadUpdate(); + }, interval); + this.attachEvent("onDestroy", function() { + clearInterval(intervalId); + }); + }, afterAutoUpdate: function(sid, action, tid, xml_node) { + if (action == "collision") { + this._need_update = true; return false; - this._sendData(data, rowId); - }, serialize: function(data, id2) { - if (this._serializeAsJson) { - return this._serializeAsJSON(data); + } else { + return true; } - if (typeof data == "string") - return data; - if (typeof id2 != "undefined") - return this.serialize_one(data, ""); - else { - var stack = []; - var keys = []; - for (var key in data) - if (data.hasOwnProperty(key)) { - stack.push(this.serialize_one(data[key], key + this.post_delim)); - keys.push(key); - } - stack.push("ids=" + this.escape(keys.join(","))); - if (this.$scheduler.security_key) - stack.push("dhx_security=" + this.$scheduler.security_key); - return stack.join("&"); + }, fullSync: function() { + if (this._need_update) { + this._need_update = false; + this.loadUpdate(); } - }, serialize_one: function(data, pref) { - if (typeof data == "string") - return data; - var stack = []; - var serialized = ""; - for (var key in data) - if (data.hasOwnProperty(key)) { - if ((key == "id" || key == this.action_param) && this._tMode == "REST") - continue; - if (typeof data[key] === "string" || typeof data[key] === "number") { - serialized = data[key]; - } else { - serialized = JSON.stringify(data[key]); - } - stack.push(this.escape((pref || "") + key) + "=" + this.escape(serialized)); - } - return stack.join("&"); - }, _applyPayload: function(url2) { + return true; + }, getUpdates: function(url2, callback) { var ajax = this.$scheduler.ajax; - if (this._payload) - for (var key in this._payload) - url2 = url2 + ajax.urlSeparator(url2) + this.escape(key) + "=" + this.escape(this._payload[key]); - return url2; - }, _sendData: function(dataToSend, rowId) { - if (!dataToSend) { - return; - } - if (!this.callEvent("onBeforeDataSending", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) { + if (this._update_busy) return false; + else + this._update_busy = true; + ajax.get(url2, callback); + }, _getXmlNodeValue: function(node) { + if (node.firstChild) { + return node.firstChild.nodeValue; } - if (rowId) { - this._in_progress[rowId] = (/* @__PURE__ */ new Date()).valueOf(); - } + return ""; + }, loadUpdate: function() { var self2 = this; var ajax = this.$scheduler.ajax; - if (this._tMode === "CUSTOM") { - var state = this.getState(rowId); - var action = this.getActionByState(state); - var _onResolvedCreateUpdate = function(tag) { - var resultState = state; - if (tag && tag.responseText && tag.setRequestHeader) { - if (tag.status !== 200) { - resultState = "error"; - } - try { - tag = JSON.parse(tag.responseText); - } catch (e) { + var version = this.$scheduler.getUserData(0, "version"); + var url2 = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + version].join("&"); + url2 = url2.replace("editing=true&", ""); + this.getUpdates(url2, function(xml) { + var vers = ajax.xpath("//userdata", xml); + self2.$scheduler.setUserData(0, "version", self2._getXmlNodeValue(vers[0])); + var updates = ajax.xpath("//update", xml); + if (updates.length) { + self2._silent_mode = true; + for (var i = 0; i < updates.length; i++) { + var status = updates[i].getAttribute("status"); + var id2 = updates[i].getAttribute("id"); + var parent = updates[i].getAttribute("parent"); + switch (status) { + case "inserted": + this.callEvent("insertCallback", [updates[i], id2, parent]); + break; + case "updated": + this.callEvent("updateCallback", [updates[i], id2, parent]); + break; + case "deleted": + this.callEvent("deleteCallback", [updates[i], id2, parent]); + break; } } - resultState = resultState || "updated"; - var sid = rowId; - var tid = rowId; - if (tag) { - resultState = tag.action || resultState; - sid = tag.sid || sid; - tid = tag.id || tag.tid || tid; - } - self2.afterUpdateCallback(sid, tid, resultState, tag); - }; - const routerMode = "event"; - var actionPromise; - if (this._router instanceof Function) { - actionPromise = this._router(routerMode, action, dataToSend, rowId); - } else { - switch (state) { - case "inserted": - actionPromise = this._router[routerMode].create(dataToSend); - break; - case "deleted": - actionPromise = this._router[routerMode].delete(rowId); - break; - default: - actionPromise = this._router[routerMode].update(dataToSend, rowId); - break; - } - } - if (actionPromise) { - if (!actionPromise.then && (actionPromise.id === void 0 && actionPromise.tid === void 0 && actionPromise.action === void 0)) { - throw new Error("Incorrect router return value. A Promise or a response object is expected"); - } - if (actionPromise.then) { - actionPromise.then(_onResolvedCreateUpdate).catch(function(error) { - if (error && error.action) { - _onResolvedCreateUpdate(error); - } else { - _onResolvedCreateUpdate({ action: "error", value: error }); - } - }); - } else { - _onResolvedCreateUpdate(actionPromise); - } - } else { - _onResolvedCreateUpdate(null); + self2._silent_mode = false; } - return; + self2._update_busy = false; + self2 = null; + }); + }, destructor: function() { + this.callEvent("onDestroy", []); + this.detachAllEvents(); + this.updatedRows = []; + this._in_progress = {}; + this._invalid = {}; + this._headers = null; + this._payload = null; + delete this._initialized; + }, url: function(url2) { + this.serverProcessor = this._serverProcessor = url2; + }, _serializeAsJSON: function(data) { + if (typeof data === "string") { + return data; } - var queryParams = { callback: function(xml) { - var ids = []; - if (rowId) { - ids.push(rowId); - } else if (dataToSend) { - for (var key2 in dataToSend) { - ids.push(key2); - } + var copy = this.$scheduler.utils.copy(data); + if (this._tMode === "REST-JSON") { + delete copy.id; + delete copy[this.action_param]; + } + return JSON.stringify(copy); + }, _cleanupArgumentsBeforeSend: function(dataToSend) { + var processedData; + if (dataToSend[this.action_param] === void 0) { + processedData = {}; + for (var i in dataToSend) { + processedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]); } - return self2.afterUpdate(self2, xml, ids); - }, headers: self2._headers }; - var urlParams = this.serverProcessor + (this._user ? ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.$scheduler.getUserData(0, "version")].join("&") : ""); - var url2 = this._applyPayload(urlParams); - var data; - switch (this._tMode) { - case "GET": - data = this._cleanupArgumentsBeforeSend(dataToSend); - queryParams.url = url2 + ajax.urlSeparator(url2) + this.serialize(data, rowId); - queryParams.method = "GET"; - break; - case "POST": - data = this._cleanupArgumentsBeforeSend(dataToSend); - queryParams.url = url2; - queryParams.method = "POST"; - queryParams.data = this.serialize(data, rowId); - break; - case "JSON": - data = {}; - var preprocessedData = this._cleanupItemBeforeSend(dataToSend); - for (var key in preprocessedData) { - if (key === this.action_param || key === "id" || key === "gr_id") { - continue; - } - data[key] = preprocessedData[key]; - } - queryParams.url = url2; - queryParams.method = "POST"; - queryParams.data = JSON.stringify({ id: rowId, action: dataToSend[this.action_param], data }); - break; - case "REST": - case "REST-JSON": - url2 = urlParams.replace(/(&|\?)editing=true/, ""); - data = ""; - switch (this.getState(rowId)) { - case "inserted": - queryParams.method = "POST"; - queryParams.data = this.serialize(dataToSend, rowId); - break; - case "deleted": - queryParams.method = "DELETE"; - url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; - break; - default: - queryParams.method = "PUT"; - queryParams.data = this.serialize(dataToSend, rowId); - url2 = url2 + (url2.slice(-1) === "/" ? "" : "/") + rowId; - break; + } else { + processedData = this._cleanupItemBeforeSend(dataToSend); + } + return processedData; + }, _cleanupItemBeforeSend: function(updatedItem) { + var output = null; + if (updatedItem) { + if (updatedItem[this.action_param] === "deleted") { + output = {}; + output.id = updatedItem.id; + output[this.action_param] = updatedItem[this.action_param]; + } else { + output = updatedItem; + } + } + return output; + }, _forEachUpdatedRow: function(code) { + var updatedRows = this.updatedRows.slice(); + for (var i = 0; i < updatedRows.length; i++) { + var rowId = updatedRows[i]; + if (this.$scheduler.getUserData(rowId, this.action_param)) { + code.call(this, rowId); + } + } + }, _prepareDataItem: function(item) { + var processedItem = {}; + var scheduler2 = this.$scheduler; + var copy = scheduler2.utils.copy(item); + for (var i in copy) { + if (i.indexOf("_") === 0) { + continue; + } else if (copy[i]) { + if (copy[i].getUTCFullYear) { + processedItem[i] = scheduler2._helpers.formatDate(copy[i]); + } else if (typeof copy[i] == "object") { + processedItem[i] = this._prepareDataItem(copy[i]); + } else if (copy[i] === null) { + processedItem[i] = ""; + } else { + processedItem[i] = copy[i]; } - queryParams.url = this._applyPayload(url2); - break; + } } - this._waitMode++; - return ajax.query(queryParams); - }, sendAllData: function() { - if (!this.updatedRows.length || this.updateMode === "off") { - return; + processedItem[this.action_param] = scheduler2.getUserData(item.id, this.action_param); + return processedItem; + }, _getRowData: function(id2) { + var dataItem = this.$scheduler.getEvent(id2); + if (!dataItem) { + dataItem = { id: id2 }; } - this.messages = []; - var valid = true; - this._forEachUpdatedRow(function(rowId) { - valid = valid && this.checkBeforeUpdate(rowId); - }); - if (!valid && !this.callEvent("onValidationError", ["", this.messages])) { - return false; + return this._prepareDataItem(dataItem); + } }; + function extend(scheduler2) { + scheduler2.createDataProcessor = function(config) { + var router; + var tMode; + if (config instanceof Function) { + router = config; + } else if (config.hasOwnProperty("router")) { + router = config.router; + } else if (config.hasOwnProperty("event")) { + router = config; + } + if (router) { + tMode = "CUSTOM"; + } else { + tMode = config.mode || "REST-JSON"; + } + var dp = new DataProcessor(config.url); + dp.init(scheduler2); + dp.setTransactionMode({ mode: tMode, router }, config.batchUpdate); + return dp; + }; + scheduler2.DataProcessor = DataProcessor; + } + function message(scheduler2) { + var boxAttribute = "data-dhxbox"; + var _dhx_msg_cfg = null; + function callback(config, result) { + var usercall = config.callback; + modalBox.hide(config.box); + _dhx_msg_cfg = config.box = null; + if (usercall) + usercall(result); } - if (this._tSend) { - this._sendData(this._getAllData()); - } else { - this._forEachUpdatedRow(function(rowId) { - if (!this._in_progress[rowId]) { - if (this.is_invalid(rowId)) { - return; + function modal_key(event2) { + if (_dhx_msg_cfg) { + var code = event2.which || event2.keyCode; + var preventDefault = false; + if (messageBox.keyboard) { + if (code == 13 || code == 32) { + var target = event2.target || event2.srcElement; + if (dom_helpers.getClassName(target).indexOf("scheduler_popup_button") > -1 && target.click) { + target.click(); + } else { + callback(_dhx_msg_cfg, true); + preventDefault = true; + } + } + if (code == 27) { + callback(_dhx_msg_cfg, false); + preventDefault = true; } - this._beforeSendData(this._getRowData(rowId), rowId); } - }); - } - }, _getAllData: function(rowId) { - var out = {}; - var has_one = false; - this._forEachUpdatedRow(function(id2) { - if (this._in_progress[id2] || this.is_invalid(id2)) { + if (preventDefault) { + if (event2.preventDefault) { + event2.preventDefault(); + } + return !(event2.cancelBubble = true); + } return; } - var row = this._getRowData(id2); - if (!this.callEvent("onBeforeUpdate", [id2, this.getState(id2), row])) { - return; + } + scheduler2.event(document, "keydown", modal_key, true); + function modality(mode) { + if (!modality.cover) { + modality.cover = document.createElement("div"); + scheduler2.event(modality.cover, "keydown", modal_key); + modality.cover.className = "dhx_modal_cover"; + document.body.appendChild(modality.cover); } - out[id2] = row; - has_one = true; - this._in_progress[id2] = (/* @__PURE__ */ new Date()).valueOf(); - }); - return has_one ? out : null; - }, findRow: function(pattern) { - var i = 0; - for (i = 0; i < this.updatedRows.length; i++) - if (pattern == this.updatedRows[i]) - break; - return i; - }, defineAction: function(name, handler) { - if (!this._uActions) - this._uActions = {}; - this._uActions[name] = handler; - }, afterUpdateCallback: function(sid, tid, action, btag) { - if (!this.$scheduler) { - return; + modality.cover.style.display = mode ? "inline-block" : "none"; } - var marker2 = sid; - var correct = action !== "error" && action !== "invalid"; - if (!correct) { - this.set_invalid(sid, action); + function button(text, classValue, result) { + var buttonAriaAttrs = scheduler2._waiAria.messageButtonAttrString(text); + var name = (classValue || "").toLowerCase().replace(/ /g, "_"); + var buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; + return `
${text}
`; } - if (this._uActions && this._uActions[action] && !this._uActions[action](btag)) { - return delete this._in_progress[marker2]; + function info(text) { + if (!messageBox.area) { + messageBox.area = document.createElement("div"); + messageBox.area.className = "scheduler_message_area dhtmlx_message_area"; + messageBox.area.style[messageBox.position] = "5px"; + document.body.appendChild(messageBox.area); + } + messageBox.hide(text.id); + var message2 = document.createElement("div"); + message2.innerHTML = "
" + text.text + "
"; + message2.className = "scheduler-info dhtmlx-info scheduler-" + text.type + " dhtmlx-" + text.type; + scheduler2.event(message2, "click", function(e) { + if (text.callback) { + text.callback.call(this, e); + } + messageBox.hide(text.id); + text = null; + }); + scheduler2._waiAria.messageInfoAttr(message2); + if (messageBox.position == "bottom" && messageBox.area.firstChild) + messageBox.area.insertBefore(message2, messageBox.area.firstChild); + else + messageBox.area.appendChild(message2); + if (text.expire > 0) + messageBox.timers[text.id] = window.setTimeout(function() { + if (messageBox) + messageBox.hide(text.id); + }, text.expire); + messageBox.pull[text.id] = message2; + message2 = null; + return text.id; } - if (this._in_progress[marker2] !== "wait") { - this.setUpdated(sid, false); + function getFirstDefined() { + var values = [].slice.apply(arguments, [0]); + for (var i = 0; i < values.length; i++) { + if (values[i]) { + return values[i]; + } + } } - var originalSid = sid; - switch (action) { - case "inserted": - case "insert": - if (tid != sid) { - this.setUpdated(sid, false); - this.$scheduler[this._methods[2]](sid, tid); - sid = tid; + function _boxStructure(config, ok, cancel) { + var box = document.createElement("div"); + var contentId = utils.uid(); + scheduler2._waiAria.messageModalAttr(box, contentId); + box.className = " scheduler_modal_box dhtmlx_modal_box scheduler-" + config.type + " dhtmlx-" + config.type; + box.setAttribute(boxAttribute, 1); + var inner = ""; + if (config.width) + box.style.width = config.width; + if (config.height) + box.style.height = config.height; + if (config.title) + inner += '
' + config.title + "
"; + inner += '
' + (config.content ? "" : config.text) + '
'; + if (ok) + inner += button(getFirstDefined(config.ok, scheduler2.locale.labels.message_ok, "OK"), "ok", true); + if (cancel) + inner += button(getFirstDefined(config.cancel, scheduler2.locale.labels.message_cancel, "Cancel"), "cancel", false); + if (config.buttons) { + for (var i = 0; i < config.buttons.length; i++) { + var btn = config.buttons[i]; + if (typeof btn == "object") { + var label = btn.label; + var css = btn.css || "scheduler_" + btn.label.toLowerCase() + "_button dhtmlx_" + btn.label.toLowerCase() + "_button"; + var value = btn.value || i; + inner += button(label, css, value); + } else { + inner += button(btn, btn, i); + } + } + } + inner += "
"; + box.innerHTML = inner; + if (config.content) { + var node = config.content; + if (typeof node == "string") + node = document.getElementById(node); + if (node.style.display == "none") + node.style.display = ""; + box.childNodes[config.title ? 1 : 0].appendChild(node); + } + scheduler2.event(box, "click", function(event2) { + var source = event2.target || event2.srcElement; + if (!source.className) + source = source.parentNode; + if (dom_helpers.closest(source, ".scheduler_popup_button")) { + var result = source.getAttribute("data-result"); + result = result == "true" || (result == "false" ? false : result); + callback(config, result); } - break; - case "delete": - case "deleted": - this.$scheduler.setUserData(sid, this.action_param, "true_deleted"); - this.$scheduler[this._methods[3]](sid, tid); - delete this._in_progress[marker2]; - return this.callEvent("onAfterUpdate", [sid, action, tid, btag]); + }); + config.box = box; + if (ok || cancel) + _dhx_msg_cfg = config; + return box; } - if (this._in_progress[marker2] !== "wait") { - if (correct) { - this.$scheduler.setUserData(sid, this.action_param, ""); - } - delete this._in_progress[marker2]; - } else { - delete this._in_progress[marker2]; - this.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param)); + function _createBox(config, ok, cancel) { + var box = config.tagName ? config : _boxStructure(config, ok, cancel); + if (!config.hidden) + modality(true); + document.body.appendChild(box); + var x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2)); + var y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2)); + if (config.position == "top") + box.style.top = "-3px"; + else + box.style.top = y + "px"; + box.style.left = x + "px"; + scheduler2.event(box, "keydown", modal_key); + modalBox.focus(box); + if (config.hidden) + modalBox.hide(box); + scheduler2.callEvent("onMessagePopup", [box]); + return box; } - this.callEvent("onAfterUpdate", [originalSid, action, tid, btag]); - }, _errorResponse: function(xml, id2) { - if (this.$scheduler && this.$scheduler.callEvent) { - this.$scheduler.callEvent("onSaveError", [id2, xml.xmlDoc]); + function alertPopup(config) { + return _createBox(config, true, false); } - return this.cleanUpdate(id2); - }, _setDefaultTransactionMode: function() { - if (this.serverProcessor) { - this.setTransactionMode("POST", true); - this.serverProcessor += (this.serverProcessor.indexOf("?") !== -1 ? "&" : "?") + "editing=true"; - this._serverProcessor = this.serverProcessor; + function confirmPopup(config) { + return _createBox(config, true, true); } - }, afterUpdate: function(that, xml, id2) { - var ajax = this.$scheduler.ajax; - if (xml.xmlDoc.status !== 200) { - this._errorResponse(xml, id2); - return; + function boxPopup(config) { + return _createBox(config); } - var tag; - try { - tag = JSON.parse(xml.xmlDoc.responseText); - } catch (e) { - if (!xml.xmlDoc.responseText.length) { - tag = {}; + function box_params(text, type, callback2) { + if (typeof text != "object") { + if (typeof type == "function") { + callback2 = type; + type = ""; + } + text = { text, type, callback: callback2 }; } + return text; } - if (tag) { - var action = tag.action || this.getState(id2) || "updated"; - var sid = tag.sid || id2[0]; - var tid = tag.tid || id2[0]; - that.afterUpdateCallback(sid, tid, action, tag); - that.finalizeUpdate(); - return; - } - var top = ajax.xmltop("data", xml.xmlDoc); - if (!top) { - return this._errorResponse(xml, id2); - } - var atag = ajax.xpath("//data/action", top); - if (!atag.length) { - return this._errorResponse(xml, id2); - } - for (var i = 0; i < atag.length; i++) { - var btag = atag[i]; - var action = btag.getAttribute("type"); - var sid = btag.getAttribute("sid"); - var tid = btag.getAttribute("tid"); - that.afterUpdateCallback(sid, tid, action, btag); - } - that.finalizeUpdate(); - }, cleanUpdate: function(id2) { - if (id2) - for (var i = 0; i < id2.length; i++) - delete this._in_progress[id2[i]]; - }, finalizeUpdate: function() { - if (this._waitMode) - this._waitMode--; - this.callEvent("onAfterUpdateFinish", []); - if (!this.updatedRows.length) - this.callEvent("onFullSync", []); - }, init: function(scheduler2) { - if (this._initialized) { - return; - } - this.$scheduler = scheduler2; - if (this.$scheduler._dp_init) { - this.$scheduler._dp_init(this); - } - this._setDefaultTransactionMode(); - this._methods = this._methods || ["_set_event_text_style", "", "_dp_change_event_id", "_dp_hook_delete"]; - extendScheduler(this.$scheduler, this); - var dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this); - dataProcessorEvents.attach(); - this.attachEvent("onDestroy", function() { - delete this._getRowData; - delete this.$scheduler._dp; - delete this.$scheduler._dataprocessor; - delete this.$scheduler._set_event_text_style; - delete this.$scheduler._dp_change_event_id; - delete this.$scheduler._dp_hook_delete; - delete this.$scheduler; - dataProcessorEvents.detach(); - }); - this.$scheduler.callEvent("onDataProcessorReady", [this]); - this._initialized = true; - scheduler2._dataprocessor = this; - }, setOnAfterUpdate: function(ev) { - this.attachEvent("onAfterUpdate", ev); - }, setOnBeforeUpdateHandler: function(func) { - this.attachEvent("onBeforeDataSending", func); - }, setAutoUpdate: function(interval, user) { - interval = interval || 2e3; - this._user = user || (/* @__PURE__ */ new Date()).valueOf(); - this._need_update = false; - this._update_busy = false; - this.attachEvent("onAfterUpdate", function(sid, action, tid, xml_node) { - this.afterAutoUpdate(sid, action, tid, xml_node); - }); - this.attachEvent("onFullSync", function() { - this.fullSync(); - }); - var self2 = this; - let intervalId = global$1.setInterval(function() { - self2.loadUpdate(); - }, interval); - this.attachEvent("onDestroy", function() { - clearInterval(intervalId); - }); - }, afterAutoUpdate: function(sid, action, tid, xml_node) { - if (action == "collision") { - this._need_update = true; - return false; - } else { - return true; - } - }, fullSync: function() { - if (this._need_update) { - this._need_update = false; - this.loadUpdate(); - } - return true; - }, getUpdates: function(url2, callback) { - var ajax = this.$scheduler.ajax; - if (this._update_busy) - return false; - else - this._update_busy = true; - ajax.get(url2, callback); - }, _getXmlNodeValue: function(node) { - if (node.firstChild) { - return node.firstChild.nodeValue; + function params(text, type, expire, id2, callback2) { + if (typeof text != "object") + text = { text, type, expire, id: id2, callback: callback2 }; + text.id = text.id || utils.uid(); + text.expire = text.expire || messageBox.expire; + return text; } - return ""; - }, loadUpdate: function() { - var self2 = this; - var ajax = this.$scheduler.ajax; - var version = this.$scheduler.getUserData(0, "version"); - var url2 = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + version].join("&"); - url2 = url2.replace("editing=true&", ""); - this.getUpdates(url2, function(xml) { - var vers = ajax.xpath("//userdata", xml); - self2.$scheduler.setUserData(0, "version", self2._getXmlNodeValue(vers[0])); - var updates = ajax.xpath("//update", xml); - if (updates.length) { - self2._silent_mode = true; - for (var i = 0; i < updates.length; i++) { - var status = updates[i].getAttribute("status"); - var id2 = updates[i].getAttribute("id"); - var parent = updates[i].getAttribute("parent"); - switch (status) { - case "inserted": - this.callEvent("insertCallback", [updates[i], id2, parent]); - break; - case "updated": - this.callEvent("updateCallback", [updates[i], id2, parent]); - break; - case "deleted": - this.callEvent("deleteCallback", [updates[i], id2, parent]); - break; - } + var alertBox = function() { + var text = box_params.apply(this, arguments); + text.type = text.type || "confirm"; + return alertPopup(text); + }; + var confirmBox = function() { + var text = box_params.apply(this, arguments); + text.type = text.type || "alert"; + return confirmPopup(text); + }; + var modalBox = function() { + var text = box_params.apply(this, arguments); + text.type = text.type || "alert"; + return boxPopup(text); + }; + modalBox.hide = function(node) { + while (node && node.getAttribute && !node.getAttribute(boxAttribute)) + node = node.parentNode; + if (node) { + node.parentNode.removeChild(node); + modality(false); + scheduler2.callEvent("onAfterMessagePopup", [node]); + } + }; + modalBox.focus = function(node) { + setTimeout(function() { + var focusable = dom_helpers.getFocusableNodes(node); + if (focusable.length) { + if (focusable[0].focus) + focusable[0].focus(); + } + }, 1); + }; + var messageBox = function(text, type, expire, id2) { + text = params.apply(this, arguments); + text.type = text.type || "info"; + var subtype = text.type.split("-")[0]; + switch (subtype) { + case "alert": + return alertPopup(text); + case "confirm": + return confirmPopup(text); + case "modalbox": + return boxPopup(text); + default: + return info(text); + } + }; + messageBox.seed = (/* @__PURE__ */ new Date()).valueOf(); + messageBox.uid = utils.uid; + messageBox.expire = 4e3; + messageBox.keyboard = true; + messageBox.position = "top"; + messageBox.pull = {}; + messageBox.timers = {}; + messageBox.hideAll = function() { + for (var key in messageBox.pull) + messageBox.hide(key); + }; + messageBox.hide = function(id2) { + var obj = messageBox.pull[id2]; + if (obj && obj.parentNode) { + window.setTimeout(function() { + obj.parentNode.removeChild(obj); + obj = null; + }, 2e3); + obj.className += " hidden"; + if (messageBox.timers[id2]) + window.clearTimeout(messageBox.timers[id2]); + delete messageBox.pull[id2]; + } + }; + var popups = []; + scheduler2.attachEvent("onMessagePopup", function(box) { + popups.push(box); + }); + scheduler2.attachEvent("onAfterMessagePopup", function(box) { + for (var i = 0; i < popups.length; i++) { + if (popups[i] === box) { + popups.splice(i, 1); + i--; } - self2._silent_mode = false; } - self2._update_busy = false; - self2 = null; }); - }, destructor: function() { - this.callEvent("onDestroy", []); - this.detachAllEvents(); - this.updatedRows = []; - this._in_progress = {}; - this._invalid = {}; - this._headers = null; - this._payload = null; - delete this._initialized; - }, url: function(url2) { - this.serverProcessor = this._serverProcessor = url2; - }, _serializeAsJSON: function(data) { - if (typeof data === "string") { - return data; + scheduler2.attachEvent("onDestroy", function() { + if (modality.cover && modality.cover.parentNode) { + modality.cover.parentNode.removeChild(modality.cover); + } + for (var i = 0; i < popups.length; i++) { + if (popups[i].parentNode) { + popups[i].parentNode.removeChild(popups[i]); + } + } + popups = null; + if (messageBox.area && messageBox.area.parentNode) { + messageBox.area.parentNode.removeChild(messageBox.area); + } + messageBox = null; + }); + return { alert: alertBox, confirm: confirmBox, message: messageBox, modalbox: modalBox }; + } + const ar = { date: { month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"], day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"] }, labels: { dhx_cal_today_button: "اليوم", day_tab: "يوم", week_tab: "أسبوع", month_tab: "شهر", new_event: "حدث جديد", icon_save: "اخزن", icon_cancel: "الغاء", icon_details: "تفاصيل", icon_edit: "تحرير", icon_delete: "حذف", confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟", confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟", section_description: "الوصف", section_time: "الفترة الزمنية", full_day: "طوال اليوم", confirm_recurring: "هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟", section_recurring: "تكرار الحدث", button_recurring: "تعطيل", button_recurring_open: "تمكين", button_edit_series: "تحرير سلسلة", button_edit_occurrence: "تعديل نسخة", grid_tab: "جدول", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "يومي", repeat_radio_week: "أسبوعي", repeat_radio_month: "شهري", repeat_radio_year: "سنوي", repeat_radio_day_type: "كل", repeat_text_day_count: "يوم", repeat_radio_day_type2: "كل يوم عمل", repeat_week: " تكرار كل", repeat_text_week_count: "أسبوع في الأيام التالية:", repeat_radio_month_type: "تكرار", repeat_radio_month_start: "في", repeat_text_month_day: "يوم كل", repeat_text_month_count: "شهر", repeat_text_month_count2_before: "كل", repeat_text_month_count2_after: "شهر", repeat_year_label: "في", select_year_day2: "من", repeat_text_year_day: "يوم", select_year_month: "شهر", repeat_radio_end: "بدون تاريخ انتهاء", repeat_text_occurences_count: "تكرارات", repeat_radio_end2: "بعد", repeat_radio_end3: "ينتهي في", repeat_never: "أبداً", repeat_daily: "كل يوم", repeat_workdays: "كل يوم عمل", repeat_weekly: "كل أسبوع", repeat_monthly: "كل شهر", repeat_yearly: "كل سنة", repeat_custom: "تخصيص", repeat_freq_day: "يوم", repeat_freq_week: "أسبوع", repeat_freq_month: "شهر", repeat_freq_year: "سنة", repeat_on_date: "في التاريخ", repeat_ends: "ينتهي", month_for_recurring: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_for_recurring: ["الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"] } }; + const be = { date: { month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"], month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"], day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"], day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сёння", day_tab: "Дзень", week_tab: "Тыдзень", month_tab: "Месяц", new_event: "Новая падзея", icon_save: "Захаваць", icon_cancel: "Адмяніць", icon_details: "Дэталі", icon_edit: "Змяніць", icon_delete: "Выдаліць", confirm_closing: "", confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?", section_description: "Апісанне", section_time: "Перыяд часу", full_day: "Увесь дзень", confirm_recurring: "Вы хочаце змяніць усю серыю паўтаральных падзей?", section_recurring: "Паўтарэнне", button_recurring: "Адключана", button_recurring_open: "Уключана", button_edit_series: "Рэдагаваць серыю", button_edit_occurrence: "Рэдагаваць асобнік", agenda_tab: "Спіс", date: "Дата", description: "Апісанне", year_tab: "Год", week_agenda_tab: "Спіс", grid_tab: "Спic", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Дзень", repeat_radio_week: "Тыдзень", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Кожны", repeat_text_day_count: "дзень", repeat_radio_day_type2: "Кожны працоўны дзень", repeat_week: " Паўтараць кожны", repeat_text_week_count: "тыдзень", repeat_radio_month_type: "Паўтараць", repeat_radio_month_start: "", repeat_text_month_day: " чысла кожнага", repeat_text_month_count: "месяцу", repeat_text_month_count2_before: "кожны ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "дзень", select_year_month: "", repeat_radio_end: "Без даты заканчэння", repeat_text_occurences_count: "паўтораў", repeat_radio_end2: "", repeat_radio_end3: "Да ", repeat_never: "Ніколі", repeat_daily: "Кожны дзень", repeat_workdays: "Кожны працоўны дзень", repeat_weekly: "Кожны тыдзень", repeat_monthly: "Кожны месяц", repeat_yearly: "Кожны год", repeat_custom: "Наладжвальны", repeat_freq_day: "Дзень", repeat_freq_week: "Тыдзень", repeat_freq_month: "Месяц", repeat_freq_year: "Год", repeat_on_date: "На дату", repeat_ends: "Заканчваецца", month_for_recurring: ["Студзеня", "Лютага", "Сакавіка", "Красавіка", "Мая", "Чэрвеня", "Ліпeня", "Жніўня", "Верасня", "Кастрычніка", "Лістапада", "Снежня"], day_for_recurring: ["Нядзелю", "Панядзелак", "Аўторак", "Сераду", "Чацвер", "Пятніцу", "Суботу"] } }; + const ca = { date: { month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"] }, labels: { dhx_cal_today_button: "Hui", day_tab: "Dia", week_tab: "Setmana", month_tab: "Mes", new_event: "Nou esdeveniment", icon_save: "Guardar", icon_cancel: "Cancel·lar", icon_details: "Detalls", icon_edit: "Editar", icon_delete: "Esborrar", confirm_closing: "", confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?", section_description: "Descripció", section_time: "Periode de temps", full_day: "Tot el dia", confirm_recurring: "¿Desitja modificar el conjunt d'esdeveniments repetits?", section_recurring: "Repeteixca l'esdeveniment", button_recurring: "Impedit", button_recurring_open: "Permés", button_edit_series: "Edit sèrie", button_edit_occurrence: "Edita Instància", agenda_tab: "Agenda", date: "Data", description: "Descripció", year_tab: "Any", week_agenda_tab: "Agenda", grid_tab: "Taula", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diari", repeat_radio_week: "Setmanal", repeat_radio_month: "Mensual", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada dia laborable", repeat_week: " Repetir cada", repeat_text_week_count: "setmana els dies següents:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "de", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sense data de finalització", repeat_text_occurences_count: "ocurrències", repeat_radio_end2: "Després", repeat_radio_end3: "Finalitzar el", repeat_never: "Mai", repeat_daily: "Cada dia", repeat_workdays: "Cada dia laborable", repeat_weekly: "Cada setmana", repeat_monthly: "Cada mes", repeat_yearly: "Cada any", repeat_custom: "Personalitzat", repeat_freq_day: "Dia", repeat_freq_week: "Setmana", repeat_freq_month: "Mes", repeat_freq_year: "Any", repeat_on_date: "En la data", repeat_ends: "Finalitza", month_for_recurring: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], day_for_recurring: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] } }; + const cn = { date: { month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], day_short: ["日", "一", "二", "三", "四", "五", "六"] }, labels: { dhx_cal_today_button: "今天", day_tab: "日", week_tab: "周", month_tab: "月", new_event: "新建日程", icon_save: "保存", icon_cancel: "关闭", icon_details: "详细", icon_edit: "编辑", icon_delete: "删除", confirm_closing: "请确认是否撤销修改!", confirm_deleting: "是否删除日程?", section_description: "描述", section_time: "时间范围", full_day: "整天", confirm_recurring: "请确认是否将日程设为重复模式?", section_recurring: "重复周期", button_recurring: "禁用", button_recurring_open: "启用", button_edit_series: "编辑系列", button_edit_occurrence: "编辑实例", agenda_tab: "议程", date: "日期", description: "说明", year_tab: "今年", week_agenda_tab: "议程", grid_tab: "电网", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "按天", repeat_radio_week: "按周", repeat_radio_month: "按月", repeat_radio_year: "按年", repeat_radio_day_type: "每", repeat_text_day_count: "天", repeat_radio_day_type2: "每个工作日", repeat_week: " 重复 每", repeat_text_week_count: "星期的:", repeat_radio_month_type: "重复", repeat_radio_month_start: "在", repeat_text_month_day: "日 每", repeat_text_month_count: "月", repeat_text_month_count2_before: "每", repeat_text_month_count2_after: "月", repeat_year_label: "在", select_year_day2: "的", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "无结束日期", repeat_text_occurences_count: "次结束", repeat_radio_end2: "重复", repeat_radio_end3: "结束于", repeat_never: "从不", repeat_daily: "每天", repeat_workdays: "每个工作日", repeat_weekly: "每周", repeat_monthly: "每月", repeat_yearly: "每年", repeat_custom: "自定义", repeat_freq_day: "天", repeat_freq_week: "周", repeat_freq_month: "月", repeat_freq_year: "年", repeat_on_date: "在日期", repeat_ends: "结束", month_for_recurring: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], day_for_recurring: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] } }; + const cs = { date: { month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"], day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"], day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Den", week_tab: "Týden", month_tab: "Měsíc", new_event: "Nová událost", icon_save: "Uložit", icon_cancel: "Zpět", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Smazat", confirm_closing: "", confirm_deleting: "Událost bude trvale smazána, opravdu?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Přejete si upravit celou řadu opakovaných událostí?", section_recurring: "Opakování události", button_recurring: "Vypnuto", button_recurring_open: "Zapnuto", button_edit_series: "Edit series", button_edit_occurrence: "Upravit instance", agenda_tab: "Program", date: "Datum", description: "Poznámka", year_tab: "Rok", full_day: "Full day", week_agenda_tab: "Program", grid_tab: "Mřížka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denně", repeat_radio_week: "Týdně", repeat_radio_month: "Měsíčně", repeat_radio_year: "Ročně", repeat_radio_day_type: "každý", repeat_text_day_count: "Den", repeat_radio_day_type2: "pracovní dny", repeat_week: "Opakuje každých", repeat_text_week_count: "Týdnů na:", repeat_radio_month_type: "u každého", repeat_radio_month_start: "na", repeat_text_month_day: "Den každého", repeat_text_month_count: "Měsíc", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "Měsíc", repeat_year_label: "na", select_year_day2: "v", repeat_text_year_day: "Den v", select_year_month: "", repeat_radio_end: "bez data ukončení", repeat_text_occurences_count: "Události", repeat_radio_end2: "po", repeat_radio_end3: "Konec", repeat_never: "Nikdy", repeat_daily: "Každý den", repeat_workdays: "Každý pracovní den", repeat_weekly: "Každý týden", repeat_monthly: "Každý měsíc", repeat_yearly: "Každý rok", repeat_custom: "Vlastní", repeat_freq_day: "Den", repeat_freq_week: "Týden", repeat_freq_month: "Měsíc", repeat_freq_year: "Rok", repeat_on_date: "Na datum", repeat_ends: "Končí", month_for_recurring: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], day_for_recurring: ["Neděle ", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"] } }; + const da = { date: { month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uge", month_tab: "Måned", new_event: "Ny begivenhed", icon_save: "Gem", icon_cancel: "Fortryd", icon_details: "Detaljer", icon_edit: "Tilret", icon_delete: "Slet", confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?", confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du tilrette hele serien af gentagne begivenheder?", section_recurring: "Gentag begivenhed", button_recurring: "Frakoblet", button_recurring_open: "Tilkoblet", button_edit_series: "Rediger serien", button_edit_occurrence: "Rediger en kopi", agenda_tab: "Dagsorden", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Dagsorden", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ugenlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "På hver arbejdsdag", repeat_week: " Gentager sig hver", repeat_text_week_count: "uge på følgende dage:", repeat_radio_month_type: "Hver den", repeat_radio_month_start: "Den", repeat_text_month_day: " i hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen slutdato", repeat_text_occurences_count: "gentagelse", repeat_radio_end2: "Efter", repeat_radio_end3: "Slut", repeat_never: "Aldrig", repeat_daily: "Hver dag", repeat_workdays: "Hver hverdag", repeat_weekly: "Hver uge", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Brugerdefineret", repeat_freq_day: "Dag", repeat_freq_week: "Uge", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; + const de = { date: { month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"], month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"], day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }, labels: { dhx_cal_today_button: "Heute", day_tab: "Tag", week_tab: "Woche", month_tab: "Monat", new_event: "neuer Eintrag", icon_save: "Speichern", icon_cancel: "Abbrechen", icon_details: "Details", icon_edit: "Ändern", icon_delete: "Löschen", confirm_closing: "", confirm_deleting: "Der Eintrag wird gelöscht", section_description: "Beschreibung", section_time: "Zeitspanne", full_day: "Ganzer Tag", confirm_recurring: "Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?", section_recurring: "Wiederholung", button_recurring: "Aus", button_recurring_open: "An", button_edit_series: "Bearbeiten Sie die Serie", button_edit_occurrence: "Bearbeiten Sie eine Kopie", agenda_tab: "Agenda", date: "Datum", description: "Beschreibung", year_tab: "Jahre", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Täglich", repeat_radio_week: "Wöchentlich", repeat_radio_month: "Monatlich", repeat_radio_year: "Jährlich", repeat_radio_day_type: "jeden", repeat_text_day_count: "Tag", repeat_radio_day_type2: "an jedem Arbeitstag", repeat_week: " Wiederholt sich jede", repeat_text_week_count: "Woche am:", repeat_radio_month_type: "an jedem", repeat_radio_month_start: "am", repeat_text_month_day: "Tag eines jeden", repeat_text_month_count: "Monats", repeat_text_month_count2_before: "jeden", repeat_text_month_count2_after: "Monats", repeat_year_label: "am", select_year_day2: "im", repeat_text_year_day: "Tag im", select_year_month: "", repeat_radio_end: "kein Enddatum", repeat_text_occurences_count: "Ereignissen", repeat_radio_end3: "Schluß", repeat_radio_end2: "nach", repeat_never: "Nie", repeat_daily: "Jeden Tag", repeat_workdays: "Jeden Werktag", repeat_weekly: "Jede Woche", repeat_monthly: "Jeden Monat", repeat_yearly: "Jedes Jahr", repeat_custom: "Benutzerdefiniert", repeat_freq_day: "Tag", repeat_freq_week: "Woche", repeat_freq_month: "Monat", repeat_freq_year: "Jahr", repeat_on_date: "Am Datum", repeat_ends: "Endet", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] } }; + const el = { date: { month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"], day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"] }, labels: { dhx_cal_today_button: "Σήμερα", day_tab: "Ημέρα", week_tab: "Εβδομάδα", month_tab: "Μήνας", new_event: "Νέο έργο", icon_save: "Αποθήκευση", icon_cancel: "Άκυρο", icon_details: "Λεπτομέρειες", icon_edit: "Επεξεργασία", icon_delete: "Διαγραφή", confirm_closing: "", confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;", section_description: "Περιγραφή", section_time: "Χρονική περίοδος", full_day: "Πλήρης Ημέρα", confirm_recurring: "Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;", section_recurring: "Επαναλαμβανόμενο έργο", button_recurring: "Ανενεργό", button_recurring_open: "Ενεργό", button_edit_series: "Επεξεργαστείτε τη σειρά", button_edit_occurrence: "Επεξεργασία ένα αντίγραφο", agenda_tab: "Ημερήσια Διάταξη", date: "Ημερομηνία", description: "Περιγραφή", year_tab: "Έτος", week_agenda_tab: "Ημερήσια Διάταξη", grid_tab: "Πλέγμα", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Ημερησίως", repeat_radio_week: "Εβδομαδιαίως", repeat_radio_month: "Μηνιαίως", repeat_radio_year: "Ετησίως", repeat_radio_day_type: "Κάθε", repeat_text_day_count: "ημέρα", repeat_radio_day_type2: "Κάθε εργάσιμη", repeat_week: " Επανάληψη κάθε", repeat_text_week_count: "εβδομάδα τις επόμενες ημέρες:", repeat_radio_month_type: "Επανάληψη", repeat_radio_month_start: "Την", repeat_text_month_day: "ημέρα κάθε", repeat_text_month_count: "μήνα", repeat_text_month_count2_before: "κάθε", repeat_text_month_count2_after: "μήνα", repeat_year_label: "Την", select_year_day2: "του", repeat_text_year_day: "ημέρα", select_year_month: "μήνα", repeat_radio_end: "Χωρίς ημερομηνία λήξεως", repeat_text_occurences_count: "επαναλήψεις", repeat_radio_end3: "Λήγει την", repeat_radio_end2: "Μετά από", repeat_never: "Ποτέ", repeat_daily: "Κάθε μέρα", repeat_workdays: "Κάθε εργάσιμη μέρα", repeat_weekly: "Κάθε εβδομάδα", repeat_monthly: "Κάθε μήνα", repeat_yearly: "Κάθε χρόνο", repeat_custom: "Προσαρμοσμένο", repeat_freq_day: "Ημέρα", repeat_freq_week: "Εβδομάδα", repeat_freq_month: "Μήνας", repeat_freq_year: "Χρόνος", repeat_on_date: "Σε ημερομηνία", repeat_ends: "Λήγει", month_for_recurring: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], day_for_recurring: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"] } }; + const en = { date: { month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, labels: { dhx_cal_today_button: "Today", day_tab: "Day", week_tab: "Week", month_tab: "Month", new_event: "New event", icon_save: "Save", icon_cancel: "Cancel", icon_details: "Details", icon_edit: "Edit", icon_delete: "Delete", confirm_closing: "", confirm_deleting: "Event will be deleted permanently, are you sure?", section_description: "Description", section_time: "Time period", full_day: "Full day", confirm_recurring: "Do you want to edit the whole set of repeated events?", section_recurring: "Repeat event", button_recurring: "Disabled", button_recurring_open: "Enabled", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Agenda", date: "Date", description: "Description", year_tab: "Year", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daily", repeat_radio_week: "Weekly", repeat_radio_month: "Monthly", repeat_radio_year: "Yearly", repeat_radio_day_type: "Every", repeat_text_day_count: "day", repeat_radio_day_type2: "Every workday", repeat_week: " Repeat every", repeat_text_week_count: "week next days:", repeat_radio_month_type: "Repeat", repeat_radio_month_start: "On", repeat_text_month_day: "day every", repeat_text_month_count: "month", repeat_text_month_count2_before: "every", repeat_text_month_count2_after: "month", repeat_year_label: "On", select_year_day2: "of", repeat_text_year_day: "day", select_year_month: "month", repeat_radio_end: "No end date", repeat_text_occurences_count: "occurrences", repeat_radio_end2: "After", repeat_radio_end3: "End by", repeat_never: "Never", repeat_daily: "Every day", repeat_workdays: "Every weekday", repeat_weekly: "Every week", repeat_monthly: "Every month", repeat_yearly: "Every year", repeat_custom: "Custom", repeat_freq_day: "Day", repeat_freq_week: "Week", repeat_freq_month: "Month", repeat_freq_year: "Year", repeat_on_date: "On date", repeat_ends: "Ends", month_for_recurring: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], day_for_recurring: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] } }; + const es = { date: { month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"] }, labels: { dhx_cal_today_button: "Hoy", day_tab: "Día", week_tab: "Semana", month_tab: "Mes", new_event: "Nuevo evento", icon_save: "Guardar", icon_cancel: "Cancelar", icon_details: "Detalles", icon_edit: "Editar", icon_delete: "Eliminar", confirm_closing: "", confirm_deleting: "El evento se borrará definitivamente, ¿continuar?", section_description: "Descripción", section_time: "Período", full_day: "Todo el día", confirm_recurring: "¿Desea modificar el conjunto de eventos repetidos?", section_recurring: "Repita el evento", button_recurring: "Impedido", button_recurring_open: "Permitido", button_edit_series: "Editar la serie", button_edit_occurrence: "Editar este evento", agenda_tab: "Día", date: "Fecha", description: "Descripción", year_tab: "Año", week_agenda_tab: "Día", grid_tab: "Reja", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diariamente", repeat_radio_week: "Semanalmente", repeat_radio_month: "Mensualmente", repeat_radio_year: "Anualmente", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada jornada de trabajo", repeat_week: " Repetir cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repita", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada ", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "del", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sin fecha de finalización", repeat_text_occurences_count: "ocurrencias", repeat_radio_end3: "Fin", repeat_radio_end2: "Después de", repeat_never: "Nunca", repeat_daily: "Cada día", repeat_workdays: "Cada día laborable", repeat_weekly: "Cada semana", repeat_monthly: "Cada mes", repeat_yearly: "Cada año", repeat_custom: "Personalizado", repeat_freq_day: "Día", repeat_freq_week: "Semana", repeat_freq_month: "Mes", repeat_freq_year: "Año", repeat_on_date: "En la fecha", repeat_ends: "Termina", month_for_recurring: ["Enero", "Febrero", "Маrzo", "Аbril", "Mayo", "Junio", "Julio", "Аgosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"], day_for_recurring: ["Domingo", "Lunes", "Martes", "Miércoles", "Jeuves", "Viernes", "Sabado"] } }; + const fi = { date: { month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"], day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"] }, labels: { dhx_cal_today_button: "Tänään", day_tab: "Päivä", week_tab: "Viikko", month_tab: "Kuukausi", new_event: "Uusi tapahtuma", icon_save: "Tallenna", icon_cancel: "Peru", icon_details: "Tiedot", icon_edit: "Muokkaa", icon_delete: "Poista", confirm_closing: "", confirm_deleting: "Haluatko varmasti poistaa tapahtuman?", section_description: "Kuvaus", section_time: "Aikajakso", full_day: "Koko päivä", confirm_recurring: "Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?", section_recurring: "Toista tapahtuma", button_recurring: "Ei käytössä", button_recurring_open: "Käytössä", button_edit_series: "Muokkaa sarja", button_edit_occurrence: "Muokkaa kopio", agenda_tab: "Esityslista", date: "Päivämäärä", description: "Kuvaus", year_tab: "Vuoden", week_agenda_tab: "Esityslista", grid_tab: "Ritilä", drag_to_create: "Luo uusi vetämällä", drag_to_move: "Siirrä vetämällä", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Päivittäin", repeat_radio_week: "Viikoittain", repeat_radio_month: "Kuukausittain", repeat_radio_year: "Vuosittain", repeat_radio_day_type: "Joka", repeat_text_day_count: "päivä", repeat_radio_day_type2: "Joka arkipäivä", repeat_week: "Toista joka", repeat_text_week_count: "viikko näinä päivinä:", repeat_radio_month_type: "Toista", repeat_radio_month_start: "", repeat_text_month_day: "päivänä joka", repeat_text_month_count: "kuukausi", repeat_text_month_count2_before: "joka", repeat_text_month_count2_after: "kuukausi", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "päivä", select_year_month: "kuukausi", repeat_radio_end: "Ei loppumisaikaa", repeat_text_occurences_count: "Toiston jälkeen", repeat_radio_end3: "Loppuu", repeat_radio_end2: "", repeat_never: "Ei koskaan", repeat_daily: "Joka päivä", repeat_workdays: "Joka arkipäivä", repeat_weekly: "Joka viikko", repeat_monthly: "Joka kuukausi", repeat_yearly: "Joka vuosi", repeat_custom: "Mukautettu", repeat_freq_day: "Päivä", repeat_freq_week: "Viikko", repeat_freq_month: "Kuukausi", repeat_freq_year: "Vuosi", repeat_on_date: "Tiettynä päivänä", repeat_ends: "Päättyy", month_for_recurring: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], day_for_recurring: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"] } }; + const fr = { date: { month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"], day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels: { dhx_cal_today_button: "Aujourd'hui", day_tab: "Jour", week_tab: "Semaine", month_tab: "Mois", new_event: "Nouvel événement", icon_save: "Enregistrer", icon_cancel: "Annuler", icon_details: "Détails", icon_edit: "Modifier", icon_delete: "Effacer", confirm_closing: "", confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?", section_description: "Description", section_time: "Période", full_day: "Journée complète", confirm_recurring: "Voulez-vous éditer toute une série d'évènements répétés?", section_recurring: "Périodicité", button_recurring: "Désactivé", button_recurring_open: "Activé", button_edit_series: "Modifier la série", button_edit_occurrence: "Modifier une copie", agenda_tab: "Jour", date: "Date", description: "Description", year_tab: "Année", week_agenda_tab: "Jour", grid_tab: "Grille", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidienne", repeat_radio_week: "Hebdomadaire", repeat_radio_month: "Mensuelle", repeat_radio_year: "Annuelle", repeat_radio_day_type: "Chaque", repeat_text_day_count: "jour", repeat_radio_day_type2: "Chaque journée de travail", repeat_week: " Répéter toutes les", repeat_text_week_count: "semaine:", repeat_radio_month_type: "Répéter", repeat_radio_month_start: "Le", repeat_text_month_day: "jour chaque", repeat_text_month_count: "mois", repeat_text_month_count2_before: "chaque", repeat_text_month_count2_after: "mois", repeat_year_label: "Le", select_year_day2: "du", repeat_text_year_day: "jour", select_year_month: "mois", repeat_radio_end: "Pas de date d"achèvement", repeat_text_occurences_count: "occurrences", repeat_radio_end3: "Fin", repeat_radio_end2: "Après", repeat_never: "Jamais", repeat_daily: "Chaque jour", repeat_workdays: "Chaque jour ouvrable", repeat_weekly: "Chaque semaine", repeat_monthly: "Chaque mois", repeat_yearly: "Chaque année", repeat_custom: "Personnalisé", repeat_freq_day: "Jour", repeat_freq_week: "Semaine", repeat_freq_month: "Mois", repeat_freq_year: "Année", repeat_on_date: "À la date", repeat_ends: "Se termine", month_for_recurring: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], day_for_recurring: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] } }; + const he = { date: { month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"] }, labels: { dhx_cal_today_button: "היום", day_tab: "יום", week_tab: "שבוע", month_tab: "חודש", new_event: "ארוע חדש", icon_save: "שמור", icon_cancel: "בטל", icon_details: "פרטים", icon_edit: "ערוך", icon_delete: "מחק", confirm_closing: "", confirm_deleting: "ארוע ימחק סופית.להמשיך?", section_description: "תיאור", section_time: "תקופה", confirm_recurring: "האם ברצונך לשנות כל סדרת ארועים מתמשכים?", section_recurring: "להעתיק ארוע", button_recurring: "לא פעיל", button_recurring_open: "פעיל", full_day: "יום שלם", button_edit_series: "ערוך את הסדרה", button_edit_occurrence: "עריכת עותק", agenda_tab: "סדר יום", date: "תאריך", description: "תיאור", year_tab: "לשנה", week_agenda_tab: "סדר יום", grid_tab: "סורג", drag_to_create: "Drag to create", drag_to_move: "גרור כדי להזיז", message_ok: "OK", message_cancel: "בטל", next: "הבא", prev: "הקודם", year: "שנה", month: "חודש", day: "יום", hour: "שעה", minute: "דקה", repeat_radio_day: "יומי", repeat_radio_week: "שבועי", repeat_radio_month: "חודשי", repeat_radio_year: "שנתי", repeat_radio_day_type: "חזור כל", repeat_text_day_count: "ימים", repeat_radio_day_type2: "חזור כל יום עבודה", repeat_week: " חזור כל", repeat_text_week_count: "שבוע לפי ימים:", repeat_radio_month_type: "חזור כל", repeat_radio_month_start: "כל", repeat_text_month_day: "ימים כל", repeat_text_month_count: "חודשים", repeat_text_month_count2_before: "חזור כל", repeat_text_month_count2_after: "חודש", repeat_year_label: "כל", select_year_day2: "בחודש", repeat_text_year_day: "ימים", select_year_month: "חודש", repeat_radio_end: "לעולם לא מסתיים", repeat_text_occurences_count: "אירועים", repeat_radio_end3: "מסתיים ב", repeat_radio_end2: "אחרי", repeat_never: "אף פעם", repeat_daily: "כל יום", repeat_workdays: "כל יום עבודה", repeat_weekly: "כל שבוע", repeat_monthly: "כל חודש", repeat_yearly: "כל שנה", repeat_custom: "מותאם אישית", repeat_freq_day: "יום", repeat_freq_week: "שבוע", repeat_freq_month: "חודש", repeat_freq_year: "שנה", repeat_on_date: "בתאריך", repeat_ends: "מסתיים", month_for_recurring: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], day_for_recurring: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"] } }; + const hu = { date: { month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"], day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"] }, labels: { dhx_cal_today_button: "Ma", day_tab: "Nap", week_tab: "Hét", month_tab: "Hónap", new_event: "Új esemény", icon_save: "Mentés", icon_cancel: "Mégse", icon_details: "Részletek", icon_edit: "Szerkesztés", icon_delete: "Törlés", confirm_closing: "", confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?", section_description: "Leírás", section_time: "Idõszak", full_day: "Egesz napos", confirm_recurring: "Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?", section_recurring: "Esemény ismétlése", button_recurring: "Tiltás", button_recurring_open: "Engedélyezés", button_edit_series: "Edit series", button_edit_occurrence: "Szerkesztés bíróság", agenda_tab: "Napirend", date: "Dátum", description: "Leírás", year_tab: "Év", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Napi", repeat_radio_week: "Heti", repeat_radio_month: "Havi", repeat_radio_year: "Éves", repeat_radio_day_type: "Minden", repeat_text_day_count: "nap", repeat_radio_day_type2: "Minden munkanap", repeat_week: " Ismételje meg minden", repeat_text_week_count: "héten a következő napokon:", repeat_radio_month_type: "Ismétlés", repeat_radio_month_start: "Ekkor", repeat_text_month_day: "nap minden", repeat_text_month_count: "hónapban", repeat_text_month_count2_before: "minden", repeat_text_month_count2_after: "hónapban", repeat_year_label: "Ekkor", select_year_day2: "-án/-én", repeat_text_year_day: "nap", select_year_month: "hónap", repeat_radio_end: "Nincs befejezési dátum", repeat_text_occurences_count: "esemény", repeat_radio_end2: "Után", repeat_radio_end3: "Befejező dátum", repeat_never: "Soha", repeat_daily: "Minden nap", repeat_workdays: "Minden munkanap", repeat_weekly: "Minden héten", repeat_monthly: "Minden hónapban", repeat_yearly: "Minden évben", repeat_custom: "Egyedi", repeat_freq_day: "Nap", repeat_freq_week: "Hét", repeat_freq_month: "Hónap", repeat_freq_year: "Év", repeat_on_date: "Dátum szerint", repeat_ends: "Befejeződik", month_for_recurring: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], day_for_recurring: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"] } }; + const id = { date: { month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"], day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, labels: { dhx_cal_today_button: "Hari Ini", day_tab: "Hari", week_tab: "Minggu", month_tab: "Bulan", new_event: "Acara Baru", icon_save: "Simpan", icon_cancel: "Batal", icon_details: "Detail", icon_edit: "Edit", icon_delete: "Hapus", confirm_closing: "", confirm_deleting: "Acara akan dihapus", section_description: "Keterangan", section_time: "Periode", full_day: "Hari penuh", confirm_recurring: "Apakah acara ini akan berulang?", section_recurring: "Acara Rutin", button_recurring: "Tidak Difungsikan", button_recurring_open: "Difungsikan", button_edit_series: "Mengedit seri", button_edit_occurrence: "Mengedit salinan", agenda_tab: "Agenda", date: "Tanggal", description: "Keterangan", year_tab: "Tahun", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Harian", repeat_radio_week: "Mingguan", repeat_radio_month: "Bulanan", repeat_radio_year: "Tahunan", repeat_radio_day_type: "Setiap", repeat_text_day_count: "hari", repeat_radio_day_type2: "Setiap hari kerja", repeat_week: " Ulangi setiap", repeat_text_week_count: "minggu pada hari berikut:", repeat_radio_month_type: "Ulangi", repeat_radio_month_start: "Pada", repeat_text_month_day: "hari setiap", repeat_text_month_count: "bulan", repeat_text_month_count2_before: "setiap", repeat_text_month_count2_after: "bulan", repeat_year_label: "Pada", select_year_day2: "dari", repeat_text_year_day: "hari", select_year_month: "bulan", repeat_radio_end: "Tanpa tanggal akhir", repeat_text_occurences_count: "kejadian", repeat_radio_end2: "Setelah", repeat_radio_end3: "Berakhir pada", repeat_never: "Tidak pernah", repeat_daily: "Setiap hari", repeat_workdays: "Setiap hari kerja", repeat_weekly: "Setiap minggu", repeat_monthly: "Setiap bulan", repeat_yearly: "Setiap tahun", repeat_custom: "Kustom", repeat_freq_day: "Hari", repeat_freq_week: "Minggu", repeat_freq_month: "Bulan", repeat_freq_year: "Tahun", repeat_on_date: "Pada tanggal", repeat_ends: "Berakhir", month_for_recurring: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] } }; + const it = { date: { month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"] }, labels: { dhx_cal_today_button: "Oggi", day_tab: "Giorno", week_tab: "Settimana", month_tab: "Mese", new_event: "Nuovo evento", icon_save: "Salva", icon_cancel: "Chiudi", icon_details: "Dettagli", icon_edit: "Modifica", icon_delete: "Elimina", confirm_closing: "", confirm_deleting: "L'evento sarà eliminato, siete sicuri?", section_description: "Descrizione", section_time: "Periodo di tempo", full_day: "Intera giornata", confirm_recurring: "Vuoi modificare l'intera serie di eventi?", section_recurring: "Ripetere l'evento", button_recurring: "Disattivato", button_recurring_open: "Attivato", button_edit_series: "Modificare la serie", button_edit_occurrence: "Modificare una copia", agenda_tab: "Agenda", date: "Data", description: "Descrizione", year_tab: "Anno", week_agenda_tab: "Agenda", grid_tab: "Griglia", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidiano", repeat_radio_week: "Settimanale", repeat_radio_month: "Mensile", repeat_radio_year: "Annuale", repeat_radio_day_type: "Ogni", repeat_text_day_count: "giorno", repeat_radio_day_type2: "Ogni giornata lavorativa", repeat_week: " Ripetere ogni", repeat_text_week_count: "settimana:", repeat_radio_month_type: "Ripetere", repeat_radio_month_start: "Il", repeat_text_month_day: "giorno ogni", repeat_text_month_count: "mese", repeat_text_month_count2_before: "ogni", repeat_text_month_count2_after: "mese", repeat_year_label: "Il", select_year_day2: "del", repeat_text_year_day: "giorno", select_year_month: "mese", repeat_radio_end: "Senza data finale", repeat_text_occurences_count: "occorenze", repeat_radio_end3: "Fine", repeat_radio_end2: "Dopo", repeat_never: "Mai", repeat_daily: "Ogni giorno", repeat_workdays: "Ogni giorno feriale", repeat_weekly: "Ogni settimana", repeat_monthly: "Ogni mese", repeat_yearly: "Ogni anno", repeat_custom: "Personalizzato", repeat_freq_day: "Giorno", repeat_freq_week: "Settimana", repeat_freq_month: "Mese", repeat_freq_year: "Anno", repeat_on_date: "Alla data", repeat_ends: "Finisce", month_for_recurring: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Jiugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], day_for_recurring: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Jovedì", "Venerdì", "Sabato"] } }; + const jp = { date: { month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], day_short: ["日", "月", "火", "水", "木", "金", "土"] }, labels: { dhx_cal_today_button: "今日", day_tab: "日", week_tab: "週", month_tab: "月", new_event: "新イベント", icon_save: "保存", icon_cancel: "キャンセル", icon_details: "詳細", icon_edit: "編集", icon_delete: "削除", confirm_closing: "", confirm_deleting: "イベント完全に削除されます、宜しいですか?", section_description: "デスクリプション", section_time: "期間", confirm_recurring: "繰り返されているイベントを全て編集しますか?", section_recurring: "イベントを繰り返す", button_recurring: "無効", button_recurring_open: "有効", full_day: "終日", button_edit_series: "シリーズを編集します", button_edit_occurrence: "コピーを編集", agenda_tab: "議題は", date: "日付", description: "説明", year_tab: "今年", week_agenda_tab: "議題は", grid_tab: "グリッド", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "毎日", repeat_radio_week: "毎週", repeat_radio_month: "毎月", repeat_radio_year: "毎年", repeat_radio_day_type: "毎", repeat_text_day_count: "日", repeat_radio_day_type2: "毎営業日", repeat_week: " 繰り返し毎", repeat_text_week_count: "週 次の日:", repeat_radio_month_type: "繰り返し", repeat_radio_month_start: "オン", repeat_text_month_day: "日毎", repeat_text_month_count: "月", repeat_text_month_count2_before: "毎", repeat_text_month_count2_after: "月", repeat_year_label: "オン", select_year_day2: "の", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "終了日なし", repeat_text_occurences_count: "回数", repeat_radio_end2: "後", repeat_radio_end3: "終了日まで", repeat_never: "決して", repeat_daily: "毎日", repeat_workdays: "毎営業日", repeat_weekly: "毎週", repeat_monthly: "毎月", repeat_yearly: "毎年", repeat_custom: "カスタム", repeat_freq_day: "日", repeat_freq_week: "週", repeat_freq_month: "月", repeat_freq_year: "年", repeat_on_date: "日にち", repeat_ends: "終了", month_for_recurring: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_for_recurring: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"] } }; + class LocaleManager { + constructor(config) { + this._locales = {}; + for (const i in config) { + this._locales[i] = config[i]; + } } - var copy = this.$scheduler.utils.copy(data); - if (this._tMode === "REST-JSON") { - delete copy.id; - delete copy[this.action_param]; + addLocale(name, locale) { + this._locales[name] = locale; } - return JSON.stringify(copy); - }, _cleanupArgumentsBeforeSend: function(dataToSend) { - var processedData; - if (dataToSend[this.action_param] === void 0) { - processedData = {}; - for (var i in dataToSend) { - processedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]); - } - } else { - processedData = this._cleanupItemBeforeSend(dataToSend); + getLocale(name) { + return this._locales[name]; } - return processedData; - }, _cleanupItemBeforeSend: function(updatedItem) { - var output = null; - if (updatedItem) { - if (updatedItem[this.action_param] === "deleted") { - output = {}; - output.id = updatedItem.id; - output[this.action_param] = updatedItem[this.action_param]; - } else { - output = updatedItem; + } + const nb = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "I dag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny hendelse", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du forandre hele dette settet av repeterende hendelser?", section_recurring: "Repeter hendelsen", button_recurring: "Av", button_recurring_open: "På", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Alle hverdager", repeat_week: " Gjentas hver", repeat_text_week_count: "uke på:", repeat_radio_month_type: "På hver", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "på", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomst", repeat_radio_end3: "Stop den", repeat_radio_end2: "Etter", repeat_never: "Aldri", repeat_daily: "Hver dag", repeat_workdays: "Hver ukedag", repeat_weekly: "Hver uke", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Tilpasset", repeat_freq_day: "Dag", repeat_freq_week: "Uke", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Sondag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; + const nl = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { dhx_cal_today_button: "Vandaag", day_tab: "Dag", week_tab: "Week", month_tab: "Maand", new_event: "Nieuw item", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", full_day: "Hele dag", confirm_recurring: "Wilt u alle terugkerende items bijwerken?", section_recurring: "Item herhalen", button_recurring: "Uit", button_recurring_open: "Aan", button_edit_series: "Bewerk de serie", button_edit_occurrence: "Bewerk een kopie", agenda_tab: "Agenda", date: "Datum", description: "Omschrijving", year_tab: "Jaar", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagelijks", repeat_radio_week: "Wekelijks", repeat_radio_month: "Maandelijks", repeat_radio_year: "Jaarlijks", repeat_radio_day_type: "Elke", repeat_text_day_count: "dag(en)", repeat_radio_day_type2: "Elke werkdag", repeat_week: " Herhaal elke", repeat_text_week_count: "week op de volgende dagen:", repeat_radio_month_type: "Herhaal", repeat_radio_month_start: "Op", repeat_text_month_day: "dag iedere", repeat_text_month_count: "maanden", repeat_text_month_count2_before: "iedere", repeat_text_month_count2_after: "maanden", repeat_year_label: "Op", select_year_day2: "van", repeat_text_year_day: "dag", select_year_month: "maand", repeat_radio_end: "Geen eind datum", repeat_text_occurences_count: "keren", repeat_radio_end3: "Eindigd per", repeat_radio_end2: "Na", repeat_never: "Nooit", repeat_daily: "Elke dag", repeat_workdays: "Elke werkdag", repeat_weekly: "Elke week", repeat_monthly: "Elke maand", repeat_yearly: "Elk jaar", repeat_custom: "Aangepast", repeat_freq_day: "Dag", repeat_freq_week: "Week", repeat_freq_month: "Maand", repeat_freq_year: "Jaar", repeat_on_date: "Op datum", repeat_ends: "Eindigt", month_for_recurring: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], day_for_recurring: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"] } }; + const no = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", full_day: "Full dag", confirm_recurring: "Vil du endre hele settet med repeterende oppføringer?", section_recurring: "Repeterende oppføring", button_recurring: "Ikke aktiv", button_recurring_open: "Aktiv", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Hver arbeidsdag", repeat_week: " Gjenta hver", repeat_text_week_count: "uke neste dager:", repeat_radio_month_type: "Gjenta", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "På", select_year_day2: "av", repeat_text_year_day: "dag", select_year_month: "måned", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomster", repeat_radio_end2: "Etter", repeat_radio_end3: "Slutt innen", repeat_never: "Aldri", repeat_daily: "Hver dag", repeat_workdays: "Hver ukedag", repeat_weekly: "Hver uke", repeat_monthly: "Hver måned", repeat_yearly: "Hvert år", repeat_custom: "Tilpasset", repeat_freq_day: "Dag", repeat_freq_week: "Uke", repeat_freq_month: "Måned", repeat_freq_year: "År", repeat_on_date: "På dato", repeat_ends: "Slutter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; + const pl = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { dhx_cal_today_button: "Dziś", day_tab: "Dzień", week_tab: "Tydzień", month_tab: "Miesiąc", new_event: "Nowe zdarzenie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", full_day: "Cały dzień", confirm_recurring: "Czy chcesz edytować cały zbiór powtarzających się zdarzeń?", section_recurring: "Powtórz zdarzenie", button_recurring: "Nieaktywne", button_recurring_open: "Aktywne", button_edit_series: "Edytuj serię", button_edit_occurrence: "Edytuj kopię", agenda_tab: "Agenda", date: "Data", description: "Opis", year_tab: "Rok", week_agenda_tab: "Agenda", grid_tab: "Tabela", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Codziennie", repeat_radio_week: "Co tydzie", repeat_radio_month: "Co miesic", repeat_radio_year: "Co rok", repeat_radio_day_type: "Kadego", repeat_text_day_count: "dnia", repeat_radio_day_type2: "Kadego dnia roboczego", repeat_week: " Powtarzaj kadego", repeat_text_week_count: "tygodnia w dni:", repeat_radio_month_type: "Powtrz", repeat_radio_month_start: "W", repeat_text_month_day: "dnia kadego", repeat_text_month_count: "miesica", repeat_text_month_count2_before: "kadego", repeat_text_month_count2_after: "miesica", repeat_year_label: "W", select_year_day2: "miesica", repeat_text_year_day: "dnia miesica", select_year_month: "", repeat_radio_end: "Bez daty kocowej", repeat_text_occurences_count: "wystpieniu/ach", repeat_radio_end3: "Zakocz w", repeat_radio_end2: "Po", repeat_never: "Nigdy", repeat_daily: "Codziennie", repeat_workdays: "Każdy dzień roboczy", repeat_weekly: "Co tydzień", repeat_monthly: "Co miesiąc", repeat_yearly: "Co rok", repeat_custom: "Niestandardowy", repeat_freq_day: "Dzień", repeat_freq_week: "Tydzień", repeat_freq_month: "Miesiąc", repeat_freq_year: "Rok", repeat_on_date: "W dniu", repeat_ends: "Kończy się", month_for_recurring: ["Stycznia", "Lutego", "Marca", "Kwietnia", "Maja", "Czerwca", "Lipca", "Sierpnia", "Wrzenia", "Padziernka", "Listopada", "Grudnia"], day_for_recurring: ["Niedziela", "Poniedziaek", "Wtorek", "roda", "Czwartek", "Pitek", "Sobota"] } }; + const pt = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { dhx_cal_today_button: "Hoje", day_tab: "Dia", week_tab: "Semana", month_tab: "Mês", new_event: "Novo evento", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Deletar", confirm_closing: "", confirm_deleting: "Tem certeza que deseja excluir?", section_description: "Descrição", section_time: "Período de tempo", full_day: "Dia inteiro", confirm_recurring: "Deseja editar todos esses eventos repetidos?", section_recurring: "Repetir evento", button_recurring: "Desabilitar", button_recurring_open: "Habilitar", button_edit_series: "Editar a série", button_edit_occurrence: "Editar uma cópia", agenda_tab: "Dia", date: "Data", description: "Descrição", year_tab: "Ano", week_agenda_tab: "Dia", grid_tab: "Grade", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diário", repeat_radio_week: "Semanal", repeat_radio_month: "Mensal", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia(s)", repeat_radio_day_type2: "Cada trabalho diário", repeat_week: " Repita cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "Em", repeat_text_month_day: "todo dia", repeat_text_month_count: "mês", repeat_text_month_count2_before: "todo", repeat_text_month_count2_after: "mês", repeat_year_label: "Em", select_year_day2: "of", repeat_text_year_day: "dia", select_year_month: "mês", repeat_radio_end: "Sem data final", repeat_text_occurences_count: "ocorrências", repeat_radio_end3: "Fim", repeat_radio_end2: "Depois", repeat_never: "Nunca", repeat_daily: "Todos os dias", repeat_workdays: "Todos os dias úteis", repeat_weekly: "Toda semana", repeat_monthly: "Todo mês", repeat_yearly: "Todo ano", repeat_custom: "Personalizado", repeat_freq_day: "Dia", repeat_freq_week: "Semana", repeat_freq_month: "Mês", repeat_freq_year: "Ano", repeat_on_date: "Na data", repeat_ends: "Termina", month_for_recurring: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], day_for_recurring: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] } }; + const ro = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { dhx_cal_today_button: "Astazi", day_tab: "Zi", week_tab: "Saptamana", month_tab: "Luna", new_event: "Eveniment nou", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", full_day: "Toata ziua", confirm_recurring: "Vrei sa editezi toata seria de evenimente repetate?", section_recurring: "Repetare", button_recurring: "Dezactivata", button_recurring_open: "Activata", button_edit_series: "Editeaza serie", button_edit_occurrence: "Editeaza doar intrare", agenda_tab: "Agenda", date: "Data", description: "Descriere", year_tab: "An", week_agenda_tab: "Agenda", grid_tab: "Lista", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Zilnic", repeat_radio_week: "Saptamanal", repeat_radio_month: "Lunar", repeat_radio_year: "Anual", repeat_radio_day_type: "La fiecare", repeat_text_day_count: "zi(le)", repeat_radio_day_type2: "Fiecare zi lucratoare", repeat_week: " Repeta la fiecare", repeat_text_week_count: "saptamana in urmatoarele zile:", repeat_radio_month_type: "Repeta in", repeat_radio_month_start: "In a", repeat_text_month_day: "zi la fiecare", repeat_text_month_count: "luni", repeat_text_month_count2_before: "la fiecare", repeat_text_month_count2_after: "luni", repeat_year_label: "In", select_year_day2: "a lunii", repeat_text_year_day: "zi a lunii", select_year_month: "", repeat_radio_end: "Fara data de sfarsit", repeat_text_occurences_count: "evenimente", repeat_radio_end3: "La data", repeat_radio_end2: "Dupa", repeat_never: "Niciodată", repeat_daily: "În fiecare zi", repeat_workdays: "În fiecare zi lucrătoare", repeat_weekly: "În fiecare săptămână", repeat_monthly: "În fiecare lună", repeat_yearly: "În fiecare an", repeat_custom: "Personalizat", repeat_freq_day: "Zi", repeat_freq_week: "Săptămână", repeat_freq_month: "Lună", repeat_freq_year: "An", repeat_on_date: "La data", repeat_ends: "Se termină", month_for_recurring: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], day_for_recurring: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"] } }; + const ru = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сегодня", day_tab: "День", week_tab: "Неделя", month_tab: "Месяц", new_event: "Новое событие", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", full_day: "Весь день", confirm_recurring: "Вы хотите изменить всю серию повторяющихся событий?", section_recurring: "Повторение", button_recurring: "Отключено", button_recurring_open: "Включено", button_edit_series: "Редактировать серию", button_edit_occurrence: "Редактировать экземпляр", agenda_tab: "Список", date: "Дата", description: "Описание", year_tab: "Год", week_agenda_tab: "Список", grid_tab: "Таблица", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Неделя", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Каждый", repeat_text_day_count: "день", repeat_radio_day_type2: "Каждый рабочий день", repeat_week: " Повторять каждую", repeat_text_week_count: "неделю , в:", repeat_radio_month_type: "Повторять", repeat_radio_month_start: "", repeat_text_month_day: " числа каждый ", repeat_text_month_count: "месяц", repeat_text_month_count2_before: "каждый ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без даты окончания", repeat_text_occurences_count: "повторений", repeat_radio_end3: "До ", repeat_radio_end2: "", repeat_never: "Никогда", repeat_daily: "Каждый день", repeat_workdays: "Каждый будний день", repeat_weekly: "Каждую неделю", repeat_monthly: "Каждый месяц", repeat_yearly: "Каждый год", repeat_custom: "Настроить", repeat_freq_day: "День", repeat_freq_week: "Неделя", repeat_freq_month: "Месяц", repeat_freq_year: "Год", repeat_on_date: "В дату", repeat_ends: "Заканчивается", month_for_recurring: ["Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря"], day_for_recurring: ["Воскресенье", "Понедельник", "Вторник", "Среду", "Четверг", "Пятницу", "Субботу"] } }; + const si = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", full_day: "Ves dan", confirm_recurring: "Želite urediti celoten set ponavljajočih dogodkov?", section_recurring: "Ponovi dogodek", button_recurring: "Onemogočeno", button_recurring_open: "Omogočeno", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Zadeva", date: "Datum", description: "Opis", year_tab: "Leto", week_agenda_tab: "Zadeva", grid_tab: "Miza", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dnevno", repeat_radio_week: "Tedensko", repeat_radio_month: "Mesečno", repeat_radio_year: "Letno", repeat_radio_day_type: "Vsak", repeat_text_day_count: "dan", repeat_radio_day_type2: "Vsak delovni dan", repeat_week: " Ponavljaj vsak", repeat_text_week_count: "teden na naslednje dni:", repeat_radio_month_type: "Ponavljaj", repeat_radio_month_start: "Na", repeat_text_month_day: "dan vsak", repeat_text_month_count: "mesec", repeat_text_month_count2_before: "vsak", repeat_text_month_count2_after: "mesec", repeat_year_label: "Na", select_year_day2: "od", repeat_text_year_day: "dan", select_year_month: "mesec", repeat_radio_end: "Brez končnega datuma", repeat_text_occurences_count: "pojavitve", repeat_radio_end2: "Po", repeat_radio_end3: "Končaj do", repeat_never: "Nikoli", repeat_daily: "Vsak dan", repeat_workdays: "Vsak delovni dan", repeat_weekly: "Vsak teden", repeat_monthly: "Vsak mesec", repeat_yearly: "Vsako leto", repeat_custom: "Po meri", repeat_freq_day: "Dan", repeat_freq_week: "Teden", repeat_freq_month: "Mesec", repeat_freq_year: "Leto", repeat_on_date: "Na datum", repeat_ends: "Konča se", month_for_recurring: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], day_for_recurring: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"] } }; + const sk = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Deň", week_tab: "Týždeň", month_tab: "Mesiac", new_event: "Nová udalosť", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Prajete si upraviť celú radu opakovaných udalostí?", section_recurring: "Opakovanie udalosti", button_recurring: "Vypnuté", button_recurring_open: "Zapnuté", button_edit_series: "Upraviť opakovania", button_edit_occurrence: "Upraviť inštancie", agenda_tab: "Program", date: "Dátum", description: "Poznámka", year_tab: "Rok", full_day: "Celý deň", week_agenda_tab: "Program", grid_tab: "Mriežka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denne", repeat_radio_week: "Týždenne", repeat_radio_month: "Mesaène", repeat_radio_year: "Roène", repeat_radio_day_type: "Každý", repeat_text_day_count: "deò", repeat_radio_day_type2: "Každý prac. deò", repeat_week: "Opakova každý", repeat_text_week_count: "týždeò v dòoch:", repeat_radio_month_type: "Opakova", repeat_radio_month_start: "On", repeat_text_month_day: "deò každý", repeat_text_month_count: "mesiac", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "mesiac", repeat_year_label: "On", select_year_day2: "poèas", repeat_text_year_day: "deò", select_year_month: "mesiac", repeat_radio_end: "Bez dátumu ukonèenia", repeat_text_occurences_count: "udalostiach", repeat_radio_end3: "Ukonèi", repeat_radio_end2: "Po", repeat_never: "Nikdy", repeat_daily: "Každý deň", repeat_workdays: "Každý pracovný deň", repeat_weekly: "Každý týždeň", repeat_monthly: "Každý mesiac", repeat_yearly: "Každý rok", repeat_custom: "Vlastné", repeat_freq_day: "Deň", repeat_freq_week: "Týždeň", repeat_freq_month: "Mesiac", repeat_freq_year: "Rok", repeat_on_date: "Na dátum", repeat_ends: "Koniec", month_for_recurring: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], day_for_recurring: ["Nede¾a", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] } }; + const sv = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Vecka", month_tab: "Månad", new_event: "Ny händelse", icon_save: "Spara", icon_cancel: "Ångra", icon_details: "Detaljer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", full_day: "Hela dagen", confirm_recurring: "Vill du redigera hela serien med repeterande händelser?", section_recurring: "Upprepa händelse", button_recurring: "Inaktiverat", button_recurring_open: "Aktiverat", button_edit_series: "Redigera serien", button_edit_occurrence: "Redigera en kopia", agenda_tab: "Dagordning", date: "Datum", description: "Beskrivning", year_tab: "År", week_agenda_tab: "Dagordning", grid_tab: "Galler", drag_to_create: "Dra för att skapa ny", drag_to_move: "Dra för att flytta", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagligen", repeat_radio_week: "Veckovis", repeat_radio_month: "Månadsvis", repeat_radio_year: "Årligen", repeat_radio_day_type: "Var", repeat_text_day_count: "dag", repeat_radio_day_type2: "Varje arbetsdag", repeat_week: " Upprepa var", repeat_text_week_count: "vecka dessa dagar:", repeat_radio_month_type: "Upprepa", repeat_radio_month_start: "Den", repeat_text_month_day: "dagen var", repeat_text_month_count: "månad", repeat_text_month_count2_before: "var", repeat_text_month_count2_after: "månad", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "månad", repeat_radio_end: "Inget slutdatum", repeat_text_occurences_count: "upprepningar", repeat_radio_end3: "Sluta efter", repeat_radio_end2: "Efter", repeat_never: "Aldrig", repeat_daily: "Varje dag", repeat_workdays: "Varje vardag", repeat_weekly: "Varje vecka", repeat_monthly: "Varje månad", repeat_yearly: "Varje år", repeat_custom: "Anpassad", repeat_freq_day: "Dag", repeat_freq_week: "Vecka", repeat_freq_month: "Månad", repeat_freq_year: "År", repeat_on_date: "På datum", repeat_ends: "Slutar", month_for_recurring: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], day_for_recurring: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] } }; + const tr = { date: { month_full: ["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"], month_short: ["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"] }, labels: { dhx_cal_today_button: "Bugün", day_tab: "Gün", week_tab: "Hafta", month_tab: "Ay", new_event: "Uygun", icon_save: "Kaydet", icon_cancel: "Ýptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Etkinlik silinecek, devam?", section_description: "Açýklama", section_time: "Zaman aralýðý", full_day: "Tam gün", confirm_recurring: "Tüm tekrar eden etkinlikler silinecek, devam?", section_recurring: "Etkinliði tekrarla", button_recurring: "Pasif", button_recurring_open: "Aktif", button_edit_series: "Dizi düzenleme", button_edit_occurrence: "Bir kopyasını düzenleyin", agenda_tab: "Ajanda", date: "Tarih", description: "Açýklama", year_tab: "Yýl", week_agenda_tab: "Ajanda", grid_tab: "Izgara", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Günlük", repeat_radio_week: "Haftalık", repeat_radio_month: "Aylık", repeat_radio_year: "Yıllık", repeat_radio_day_type: "Her", repeat_text_day_count: "gün", repeat_radio_day_type2: "Her iş günü", repeat_week: " Tekrar her", repeat_text_week_count: "hafta şu günlerde:", repeat_radio_month_type: "Tekrar et", repeat_radio_month_start: "Tarihinde", repeat_text_month_day: "gün her", repeat_text_month_count: "ay", repeat_text_month_count2_before: "her", repeat_text_month_count2_after: "ay", repeat_year_label: "Tarihinde", select_year_day2: "ayın", repeat_text_year_day: "günü", select_year_month: "ay", repeat_radio_end: "Bitiş tarihi yok", repeat_text_occurences_count: "olay", repeat_radio_end2: "Sonra", repeat_radio_end3: "Tarihinde bitir", repeat_never: "Asla", repeat_daily: "Her gün", repeat_workdays: "Her iş günü", repeat_weekly: "Her hafta", repeat_monthly: "Her ay", repeat_yearly: "Her yıl", repeat_custom: "Özel", repeat_freq_day: "Gün", repeat_freq_week: "Hafta", repeat_freq_month: "Ay", repeat_freq_year: "Yıl", repeat_on_date: "Tarihinde", repeat_ends: "Biter", month_for_recurring: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], day_for_recurring: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"] } }; + const ua = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { dhx_cal_today_button: "Сьогодні", day_tab: "День", week_tab: "Тиждень", month_tab: "Місяць", new_event: "Нова подія", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", full_day: "Весь день", confirm_recurring: "Хочете редагувати весь перелік повторюваних подій?", section_recurring: "Повторювана подія", button_recurring: "Відключено", button_recurring_open: "Включено", button_edit_series: "Редагувати серію", button_edit_occurrence: "Редагувати примірник", agenda_tab: "Перелік", date: "Дата", description: "Опис", year_tab: "Рік", week_agenda_tab: "Перелік", grid_tab: "Таблиця", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Тиждень", repeat_radio_month: "Місяць", repeat_radio_year: "Рік", repeat_radio_day_type: "Кожний", repeat_text_day_count: "день", repeat_radio_day_type2: "Кожний робочий день", repeat_week: " Повторювати кожен", repeat_text_week_count: "тиждень , по:", repeat_radio_month_type: "Повторювати", repeat_radio_month_start: "", repeat_text_month_day: " числа кожний ", repeat_text_month_count: "місяць", repeat_text_month_count2_before: "кожен ", repeat_text_month_count2_after: "місяць", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без дати закінчення", repeat_text_occurences_count: "повторень", repeat_radio_end3: "До ", repeat_radio_end2: "", repeat_never: "Ніколи", repeat_daily: "Щодня", repeat_workdays: "Щодня в робочі дні", repeat_weekly: "Щотижня", repeat_monthly: "Щомісяця", repeat_yearly: "Щороку", repeat_custom: "Налаштоване", repeat_freq_day: "День", repeat_freq_week: "Тиждень", repeat_freq_month: "Місяць", repeat_freq_year: "Рік", repeat_on_date: "На дату", repeat_ends: "Закінчується", month_for_recurring: ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], day_for_recurring: ["Неділям", "Понеділкам", "Вівторкам", "Середам", "Четвергам", "П'ятницям", "Суботам"] } }; + function i18nFactory() { + return new LocaleManager({ en, ar, be, ca, cn, cs, da, de, el, es, fi, fr, he, hu, id, it, jp, nb, nl, no, pl, pt, ro, ru, si, sk, sv, tr, ua }); + } + class DatePicker { + constructor(scheduler2, container, state = {}) { + this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...state }; + this.container = null; + this.element = null; + this.onStateChangeHandlers = []; + this.scheduler = scheduler2; + this._domEvents = scheduler2._createDomEventScope(); + this.state = this.getState(); + makeEventable(this); + if (container) { + this.container = container; + this.render(this.container); } + this.onStateChange((oldState, newState) => { + this.callEvent("onStateChange", [newState, oldState]); + }); } - return output; - }, _forEachUpdatedRow: function(code) { - var updatedRows = this.updatedRows.slice(); - for (var i = 0; i < updatedRows.length; i++) { - var rowId = updatedRows[i]; - if (this.$scheduler.getUserData(rowId, this.action_param)) { - code.call(this, rowId); + getState() { + return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] }; + } + setState(newState) { + const oldState = { ...this.state }; + if (newState.mode) { + newState.currentModeIndex = this.state.modes.indexOf(newState.mode); + } + this.state = { ...this.state, ...newState }; + this._notifyStateChange(oldState, this.state); + if (this.container) { + this.render(this.container); } } - }, _prepareDataItem: function(item) { - var processedItem = {}; - var scheduler2 = this.$scheduler; - var copy = scheduler2.utils.copy(item); - for (var i in copy) { - if (i.indexOf("_") === 0) { - continue; - } else if (copy[i]) { - if (copy[i].getUTCFullYear) { - processedItem[i] = scheduler2._helpers.formatDate(copy[i]); - } else if (typeof copy[i] == "object") { - processedItem[i] = this._prepareDataItem(copy[i]); - } else if (copy[i] === null) { - processedItem[i] = ""; - } else { - processedItem[i] = copy[i]; + onStateChange(handler) { + this.onStateChangeHandlers.push(handler); + return () => { + const index = this.onStateChangeHandlers.indexOf(handler); + if (index !== -1) { + this.onStateChangeHandlers.splice(index, 1); } - } + }; } - processedItem[this.action_param] = scheduler2.getUserData(item.id, this.action_param); - return processedItem; - }, _getRowData: function(id2) { - var dataItem = this.$scheduler.getEvent(id2); - if (!dataItem) { - dataItem = { id: id2 }; + _notifyStateChange(oldState, newState) { + this.onStateChangeHandlers.forEach((handler) => handler(oldState, newState)); } - return this._prepareDataItem(dataItem); - } }; - function extend(scheduler2) { - scheduler2.createDataProcessor = function(config) { - var router; - var tMode; - if (config instanceof Function) { - router = config; - } else if (config.hasOwnProperty("router")) { - router = config.router; - } else if (config.hasOwnProperty("event")) { - router = config; - } - if (router) { - tMode = "CUSTOM"; + _adjustDate(direction) { + const { mode, date } = this.getState(); + const newDate = new Date(date); + if (mode === "days") { + newDate.setMonth(date.getMonth() + direction); + } else if (mode === "months") { + newDate.setFullYear(date.getFullYear() + direction); } else { - tMode = config.mode || "REST-JSON"; + newDate.setFullYear(date.getFullYear() + direction * 10); } - var dp = new DataProcessor(config.url); - dp.init(scheduler2); - dp.setTransactionMode({ mode: tMode, router }, config.batchUpdate); - return dp; - }; - scheduler2.DataProcessor = DataProcessor; - } - function message(scheduler2) { - var boxAttribute = "data-dhxbox"; - var _dhx_msg_cfg = null; - function callback(config, result) { - var usercall = config.callback; - modalBox.hide(config.box); - _dhx_msg_cfg = config.box = null; - if (usercall) - usercall(result); + this.setState({ date: newDate }); } - function modal_key(event2) { - if (_dhx_msg_cfg) { - var code = event2.which || event2.keyCode; - var preventDefault = false; - if (messageBox.keyboard) { - if (code == 13 || code == 32) { - var target = event2.target || event2.srcElement; - if (dom_helpers.getClassName(target).indexOf("scheduler_popup_button") > -1 && target.click) { - target.click(); - } else { - callback(_dhx_msg_cfg, true); - preventDefault = true; - } - } - if (code == 27) { - callback(_dhx_msg_cfg, false); - preventDefault = true; - } - } - if (preventDefault) { - if (event2.preventDefault) { - event2.preventDefault(); - } - return !(event2.cancelBubble = true); - } - return; + _toggleMode() { + const newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length; + this.setState({ currentModeIndex: newIndex }); + } + _renderCalendarHeader(container) { + const { mode, date } = this.getState(); + const header = document.createElement("div"); + header.classList.add("dhx_cal_datepicker_header"); + const backwardArrow = document.createElement("button"); + backwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"); + header.appendChild(backwardArrow); + const monthLabel = document.createElement("div"); + monthLabel.classList.add("dhx_cal_datepicker_title"); + if (mode === "days") { + monthLabel.innerText = date.toLocaleString("default", { month: "long" }) + " " + date.getFullYear(); + } else if (mode === "months") { + monthLabel.innerText = date.getFullYear(); + } else { + const startYear = Math.floor(date.getFullYear() / 10) * 10; + monthLabel.innerText = `${startYear} - ${startYear + 9}`; } + this._domEvents.attach(monthLabel, "click", this._toggleMode.bind(this)); + header.appendChild(monthLabel); + const forwardArrow = document.createElement("button"); + forwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"); + header.appendChild(forwardArrow); + container.appendChild(header); + this._domEvents.attach(backwardArrow, "click", this._adjustDate.bind(this, -1)); + this._domEvents.attach(forwardArrow, "click", this._adjustDate.bind(this, 1)); } - scheduler2.event(document, "keydown", modal_key, true); - function modality(mode) { - if (!modality.cover) { - modality.cover = document.createElement("div"); - scheduler2.event(modality.cover, "keydown", modal_key); - modality.cover.className = "dhx_modal_cover"; - document.body.appendChild(modality.cover); + render(container) { + this._domEvents.detachAll(); + this.container = container || this.container; + this.container.innerHTML = ""; + if (!this.element) { + this.element = document.createElement("div"); + this.element.classList.add("dhx_cal_datepicker"); + } + this.element.innerHTML = ""; + this.container.appendChild(this.element); + this._renderCalendarHeader(this.element); + const dataContainer = document.createElement("div"); + dataContainer.classList.add("dhx_cal_datepicker_data"); + this.element.appendChild(dataContainer); + const { mode } = this.getState(); + if (mode === "days") { + this._renderDayGrid(dataContainer); + } else if (mode === "months") { + this._renderMonthGrid(dataContainer); + } else { + this._renderYearGrid(dataContainer); } - modality.cover.style.display = mode ? "inline-block" : "none"; - } - function button(text, classValue, result) { - var buttonAriaAttrs = scheduler2._waiAria.messageButtonAttrString(text); - var name = (classValue || "").toLowerCase().replace(/ /g, "_"); - var buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; - return `
${text}
`; } - function info(text) { - if (!messageBox.area) { - messageBox.area = document.createElement("div"); - messageBox.area.className = "scheduler_message_area dhtmlx_message_area"; - messageBox.area.style[messageBox.position] = "5px"; - document.body.appendChild(messageBox.area); + _renderDayGridHeader(daysOfWeekContainer) { + const { date } = this.getState(); + const scheduler2 = this.scheduler; + let currentDate = scheduler2.date.week_start(new Date(date)); + const maxDate = scheduler2.date.add(scheduler2.date.week_start(new Date(date)), 1, "week"); + daysOfWeekContainer.classList.add("dhx_cal_datepicker_days"); + const labelFormat = scheduler2.date.date_to_str("%D"); + while (currentDate.valueOf() < maxDate.valueOf()) { + const label = labelFormat(currentDate); + const dayElement = document.createElement("div"); + dayElement.setAttribute("data-day", currentDate.getDay()); + dayElement.classList.add("dhx_cal_datepicker_dayname"); + dayElement.innerText = label; + daysOfWeekContainer.appendChild(dayElement); + currentDate = scheduler2.date.add(currentDate, 1, "day"); } - messageBox.hide(text.id); - var message2 = document.createElement("div"); - message2.innerHTML = "
" + text.text + "
"; - message2.className = "scheduler-info dhtmlx-info scheduler-" + text.type + " dhtmlx-" + text.type; - scheduler2.event(message2, "click", function() { - messageBox.hide(text.id); - text = null; - }); - scheduler2._waiAria.messageInfoAttr(message2); - if (messageBox.position == "bottom" && messageBox.area.firstChild) - messageBox.area.insertBefore(message2, messageBox.area.firstChild); - else - messageBox.area.appendChild(message2); - if (text.expire > 0) - messageBox.timers[text.id] = window.setTimeout(function() { - if (messageBox) - messageBox.hide(text.id); - }, text.expire); - messageBox.pull[text.id] = message2; - message2 = null; - return text.id; } - function getFirstDefined() { - var values = [].slice.apply(arguments, [0]); - for (var i = 0; i < values.length; i++) { - if (values[i]) { - return values[i]; - } + _weeksBetween(min, max) { + const scheduler2 = this.scheduler; + let weeks = 0; + let currWeek = new Date(min); + while (currWeek.valueOf() < max.valueOf()) { + weeks += 1; + currWeek = scheduler2.date.week_start(scheduler2.date.add(currWeek, 1, "week")); } + return weeks; } - function _boxStructure(config, ok, cancel) { - var box = document.createElement("div"); - var contentId = utils.uid(); - scheduler2._waiAria.messageModalAttr(box, contentId); - box.className = " scheduler_modal_box dhtmlx_modal_box scheduler-" + config.type + " dhtmlx-" + config.type; - box.setAttribute(boxAttribute, 1); - var inner = ""; - if (config.width) - box.style.width = config.width; - if (config.height) - box.style.height = config.height; - if (config.title) - inner += '
' + config.title + "
"; - inner += '
' + (config.content ? "" : config.text) + '
'; - if (ok) - inner += button(getFirstDefined(config.ok, scheduler2.locale.labels.message_ok, "OK"), "ok", true); - if (cancel) - inner += button(getFirstDefined(config.cancel, scheduler2.locale.labels.message_cancel, "Cancel"), "cancel", false); - if (config.buttons) { - for (var i = 0; i < config.buttons.length; i++) { - var btn = config.buttons[i]; - if (typeof btn == "object") { - var label = btn.label; - var css = btn.css || "scheduler_" + btn.label.toLowerCase() + "_button dhtmlx_" + btn.label.toLowerCase() + "_button"; - var value = btn.value || i; - inner += button(label, css, value); - } else { - inner += button(btn, btn, i); + _renderDayGrid(container) { + const { date, currentRange, eventDates, minWeeks } = this.getState(); + let minSchedulerDate = currentRange[0]; + let maxSchedulerDate = currentRange[1]; + const eventDaysTable = eventDates.reduce((acc, date2) => { + const dayStart = this.scheduler.date.day_start(new Date(date2)); + acc[dayStart.valueOf()] = true; + return acc; + }, {}); + const daysOfWeekContainer = document.createElement("div"); + this._renderDayGridHeader(daysOfWeekContainer); + container.appendChild(daysOfWeekContainer); + const scheduler2 = this.scheduler; + const firstDate = scheduler2.date.week_start(scheduler2.date.month_start(new Date(date))); + const monthStart = scheduler2.date.month_start(new Date(date)); + const monthEnd = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); + let lastDate = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); + const currentCalDate = scheduler2.date.date_part(scheduler2._currentDate()); + if (lastDate.getDay() !== 0) { + lastDate = scheduler2.date.add(scheduler2.date.week_start(lastDate), 1, "week"); + } + let weeks = this._weeksBetween(firstDate, lastDate); + if (minWeeks && weeks < minWeeks) { + lastDate = scheduler2.date.add(lastDate, minWeeks - weeks, "week"); + } + let currDate = firstDate; + const dayGridContainer = document.createElement("div"); + dayGridContainer.classList.add("dhx_cal_datepicker_days"); + this._domEvents.attach(dayGridContainer, "click", (event2) => { + const dateCell = event2.target.closest("[data-cell-date]"); + const date2 = new Date(dateCell.getAttribute("data-cell-date")); + this.callEvent("onDateClick", [date2, event2]); + }); + while (currDate.valueOf() < lastDate.valueOf()) { + const dayElement = document.createElement("div"); + dayElement.setAttribute("data-cell-date", scheduler2.templates.format_date(currDate)); + dayElement.setAttribute("data-day", currDate.getDay()); + dayElement.innerHTML = currDate.getDate(); + if (currDate.valueOf() < monthStart.valueOf()) { + dayElement.classList.add("dhx_before"); + } else if (currDate.valueOf() >= monthEnd.valueOf()) { + dayElement.classList.add("dhx_after"); + } + if (currDate.getDay() === 0 || currDate.getDay() === 6) { + dayElement.classList.add("dhx_cal_datepicker_weekend"); + } + if (currDate.valueOf() == currentCalDate.valueOf()) { + dayElement.classList.add("dhx_now"); + } + if (minSchedulerDate && maxSchedulerDate) { + if (currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()) { + dayElement.classList.add("dhx_cal_datepicker_current"); } } + if (eventDaysTable[currDate.valueOf()]) { + dayElement.classList.add("dhx_cal_datepicker_event"); + } + dayElement.classList.add("dhx_cal_datepicker_date"); + dayGridContainer.appendChild(dayElement); + currDate = scheduler2.date.add(currDate, 1, "day"); } - inner += "
"; - box.innerHTML = inner; - if (config.content) { - var node = config.content; - if (typeof node == "string") - node = document.getElementById(node); - if (node.style.display == "none") - node.style.display = ""; - box.childNodes[config.title ? 1 : 0].appendChild(node); + container.appendChild(dayGridContainer); + } + _renderMonthGrid(container) { + const { date } = this.getState(); + const wrapper = document.createElement("div"); + wrapper.classList.add("dhx_cal_datepicker_months"); + const months = []; + for (let i = 0; i < 12; i++) { + months.push(new Date(date.getFullYear(), i, 1)); } - scheduler2.event(box, "click", function(event2) { - var source = event2.target || event2.srcElement; - if (!source.className) - source = source.parentNode; - if (dom_helpers.closest(source, ".scheduler_popup_button")) { - var result = source.getAttribute("data-result"); - result = result == "true" || (result == "false" ? false : result); - callback(config, result); + const formatLabel = this.scheduler.date.date_to_str("%M"); + months.forEach((month) => { + const monthElement = document.createElement("div"); + monthElement.classList.add("dhx_cal_datepicker_month"); + if (date.getMonth() === month.getMonth()) { + monthElement.classList.add("dhx_cal_datepicker_current"); } - }); - config.box = box; - if (ok || cancel) - _dhx_msg_cfg = config; - return box; - } - function _createBox(config, ok, cancel) { - var box = config.tagName ? config : _boxStructure(config, ok, cancel); - if (!config.hidden) - modality(true); - document.body.appendChild(box); - var x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2)); - var y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2)); - if (config.position == "top") - box.style.top = "-3px"; - else - box.style.top = y + "px"; - box.style.left = x + "px"; - scheduler2.event(box, "keydown", modal_key); - modalBox.focus(box); - if (config.hidden) - modalBox.hide(box); - scheduler2.callEvent("onMessagePopup", [box]); - return box; - } - function alertPopup(config) { - return _createBox(config, true, false); - } - function confirmPopup(config) { - return _createBox(config, true, true); - } - function boxPopup(config) { - return _createBox(config); + monthElement.setAttribute("data-month", month.getMonth()); + monthElement.innerHTML = formatLabel(month); + this._domEvents.attach(monthElement, "click", () => { + const newDate = new Date(month); + this.setState({ date: newDate, mode: "days" }); + }); + wrapper.appendChild(monthElement); + }); + container.appendChild(wrapper); + const doneArea = document.createElement("div"); + doneArea.classList.add("dhx_cal_datepicker_done"); + const doneBtn = document.createElement("button"); + doneBtn.innerText = "Done"; + doneBtn.classList.add("dhx_cal_datepicker_done_btn"); + this._domEvents.attach(doneBtn, "click", () => { + this.setState({ mode: "days" }); + }); + doneArea.appendChild(doneBtn); + container.appendChild(doneArea); } - function box_params(text, type, callback2) { - if (typeof text != "object") { - if (typeof type == "function") { - callback2 = type; - type = ""; + _renderYearGrid(container) { + const { date } = this.getState(); + const startYear = Math.floor(date.getFullYear() / 10) * 10; + const wrapper = document.createElement("div"); + wrapper.classList.add("dhx_cal_datepicker_years"); + for (let i = startYear - 1; i <= startYear + 10; i++) { + const yearElement = document.createElement("div"); + yearElement.innerText = i; + yearElement.classList.add("dhx_cal_datepicker_year"); + yearElement.setAttribute("data-year", i); + if (date.getFullYear() === i) { + yearElement.classList.add("dhx_cal_datepicker_current"); } - text = { text, type, callback: callback2 }; + this._domEvents.attach(yearElement, "click", () => { + this.setState({ date: new Date(i, date.getMonth(), 1), mode: "months" }); + }); + wrapper.appendChild(yearElement); } - return text; - } - function params(text, type, expire, id2) { - if (typeof text != "object") - text = { text, type, expire, id: id2 }; - text.id = text.id || utils.uid(); - text.expire = text.expire || messageBox.expire; - return text; + container.appendChild(wrapper); + const doneArea = document.createElement("div"); + doneArea.classList.add("dhx_cal_datepicker_done"); + const doneBtn = document.createElement("button"); + doneBtn.innerText = "Done"; + doneBtn.classList.add("dhx_cal_datepicker_done_btn"); + this._domEvents.attach(doneBtn, "click", () => { + this.setState({ mode: "months" }); + }); + doneArea.appendChild(doneBtn); + container.appendChild(doneArea); } - var alertBox = function() { - var text = box_params.apply(this, arguments); - text.type = text.type || "confirm"; - return alertPopup(text); - }; - var confirmBox = function() { - var text = box_params.apply(this, arguments); - text.type = text.type || "alert"; - return confirmPopup(text); - }; - var modalBox = function() { - var text = box_params.apply(this, arguments); - text.type = text.type || "alert"; - return boxPopup(text); - }; - modalBox.hide = function(node) { - while (node && node.getAttribute && !node.getAttribute(boxAttribute)) - node = node.parentNode; - if (node) { - node.parentNode.removeChild(node); - modality(false); - scheduler2.callEvent("onAfterMessagePopup", [node]); + destructor() { + this.onStateChangeHandlers = []; + if (this.element) { + this.element.innerHTML = ""; + this.element.remove(); } + this._domEvents.detachAll(); + this.callEvent("onDestroy", []); + this.detachAllEvents(); + this.scheduler = null; + } + } + function factoryMethod(extensionManager) { + const scheduler2 = { version: "7.1.0" }; + scheduler2.$stateProvider = StateService(); + scheduler2.getState = scheduler2.$stateProvider.getState; + extend$n(scheduler2); + extend$i(scheduler2); + extend$j(scheduler2); + extend$h(scheduler2); + scheduler2.utils = utils; + scheduler2.$domHelpers = dom_helpers; + scheduler2.utils.dom = dom_helpers; + scheduler2.uid = utils.uid; + scheduler2.mixin = utils.mixin; + scheduler2.defined = utils.defined; + scheduler2.assert = assert(scheduler2); + scheduler2.copy = utils.copy; + scheduler2._createDatePicker = function(container, config) { + return new DatePicker(scheduler2, container, config); }; - modalBox.focus = function(node) { - setTimeout(function() { - var focusable = dom_helpers.getFocusableNodes(node); - if (focusable.length) { - if (focusable[0].focus) - focusable[0].focus(); + scheduler2._getFocusableNodes = dom_helpers.getFocusableNodes; + scheduler2._getClassName = dom_helpers.getClassName; + scheduler2._locate_css = dom_helpers.locateCss; + const messageApi = message(scheduler2); + scheduler2.utils.mixin(scheduler2, messageApi); + scheduler2.env = scheduler2.$env = env; + scheduler2.Promise = window.Promise; + extend$g(scheduler2); + extend$f(scheduler2); + extend$e(scheduler2); + extend$d(scheduler2); + extend$c(scheduler2); + extend$b(scheduler2); + extend$7(scheduler2); + extend$6(scheduler2); + extend$5(scheduler2); + extend$4(scheduler2); + extend$3(scheduler2); + extend$2(); + extend$1(scheduler2); + extend(scheduler2); + extend$m(scheduler2); + const i18n = i18nFactory(); + scheduler2.i18n = { addLocale: i18n.addLocale, setLocale: function(locale) { + if (typeof locale === "string") { + var localeObject = i18n.getLocale(locale); + if (!localeObject) { + localeObject = i18n.getLocale("en"); + } + scheduler2.locale = localeObject; + } else if (locale) { + if (!scheduler2.locale) { + scheduler2.locale = locale; + } else { + for (var i in locale) { + if (locale[i] && typeof locale[i] === "object") { + if (!scheduler2.locale[i]) { + scheduler2.locale[i] = {}; + } + scheduler2.mixin(scheduler2.locale[i], locale[i], true); + } else { + scheduler2.locale[i] = locale[i]; + } + } } - }, 1); - }; - var messageBox = function(text, type, expire, id2) { - text = params.apply(this, arguments); - text.type = text.type || "info"; - var subtype = text.type.split("-")[0]; - switch (subtype) { - case "alert": - return alertPopup(text); - case "confirm": - return confirmPopup(text); - case "modalbox": - return boxPopup(text); - default: - return info(text); } - }; - messageBox.seed = (/* @__PURE__ */ new Date()).valueOf(); - messageBox.uid = utils.uid; - messageBox.expire = 4e3; - messageBox.keyboard = true; - messageBox.position = "top"; - messageBox.pull = {}; - messageBox.timers = {}; - messageBox.hideAll = function() { - for (var key in messageBox.pull) - messageBox.hide(key); - }; - messageBox.hide = function(id2) { - var obj = messageBox.pull[id2]; - if (obj && obj.parentNode) { - window.setTimeout(function() { - obj.parentNode.removeChild(obj); - obj = null; - }, 2e3); - obj.className += " hidden"; - if (messageBox.timers[id2]) - window.clearTimeout(messageBox.timers[id2]); - delete messageBox.pull[id2]; + var labels = scheduler2.locale.labels; + labels.dhx_save_btn = labels.icon_save; + labels.dhx_cancel_btn = labels.icon_cancel; + labels.dhx_delete_btn = labels.icon_delete; + if (scheduler2.$container) { + scheduler2.get_elements(); } + }, getLocale: i18n.getLocale }; + scheduler2.i18n.setLocale("en"); + initPlugins(scheduler2); + scheduler2.ext = {}; + const activePlugins = {}; + scheduler2.plugins = function(config) { + const extensionList = getExtensionList(config, { treetimeline: ["timeline"], daytimeline: ["timeline"], outerdrag: ["legacy"] }, { legacy: 1, limit: 1, timeline: 2, daytimeline: 3, treetimeline: 3, outerdrag: 6 }); + extensionList.forEach(function(name) { + if (!activePlugins[name]) { + const plugin = extensionManager.getExtension(name); + if (plugin) { + plugin(scheduler2); + activePlugins[name] = true; + } else { + throw new Error("unknown plugin " + name); + } + } + }); }; - var popups = []; - scheduler2.attachEvent("onMessagePopup", function(box) { - popups.push(box); - }); - scheduler2.attachEvent("onAfterMessagePopup", function(box) { - for (var i = 0; i < popups.length; i++) { - if (popups[i] === box) { - popups.splice(i, 1); - i--; + function getExtensionList(config, dependencies, priorities) { + const result = []; + for (const i in config) { + if (config[i]) { + const extension = i.toLowerCase(); + if (dependencies[extension]) { + dependencies[extension].forEach(function(dep) { + const dependencyName = dep.toLowerCase(); + if (!config[dependencyName]) { + result.push(dependencyName); + } + }); + } + result.push(extension); } } - }); - scheduler2.attachEvent("onDestroy", function() { - if (modality.cover && modality.cover.parentNode) { - modality.cover.parentNode.removeChild(modality.cover); - } - for (var i = 0; i < popups.length; i++) { - if (popups[i].parentNode) { - popups[i].parentNode.removeChild(popups[i]); + result.sort(function(a, b) { + const orderA = priorities[a] || 0; + const orderB = priorities[b] || 0; + if (orderA > orderB) { + return 1; + } else if (orderA < orderB) { + return -1; + } else { + return 0; } - } - popups = null; - if (messageBox.area && messageBox.area.parentNode) { - messageBox.area.parentNode.removeChild(messageBox.area); - } - messageBox = null; - }); - return { alert: alertBox, confirm: confirmBox, message: messageBox, modalbox: modalBox }; + }); + return result; + } + return scheduler2; } - const ar = { date: { month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"], month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"], day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"] }, labels: { dhx_cal_today_button: "اليوم", day_tab: "يوم", week_tab: "أسبوع", month_tab: "شهر", new_event: "حدث جديد", icon_save: "اخزن", icon_cancel: "الغاء", icon_details: "تفاصيل", icon_edit: "تحرير", icon_delete: "حذف", confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟", confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟", section_description: "الوصف", section_time: "الفترة الزمنية", full_day: "طوال اليوم", confirm_recurring: "هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟", section_recurring: "تكرار الحدث", button_recurring: "تعطيل", button_recurring_open: "تمكين", button_edit_series: "تحرير سلسلة", button_edit_occurrence: "تعديل نسخة", grid_tab: "جدول", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const be = { date: { month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"], month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"], day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"], day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сёння", day_tab: "Дзень", week_tab: "Тыдзень", month_tab: "Месяц", new_event: "Новая падзея", icon_save: "Захаваць", icon_cancel: "Адмяніць", icon_details: "Дэталі", icon_edit: "Змяніць", icon_delete: "Выдаліць", confirm_closing: "", confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?", section_description: "Апісанне", section_time: "Перыяд часу", full_day: "Увесь дзень", confirm_recurring: "Вы хочаце змяніць усю серыю паўтаральных падзей?", section_recurring: "Паўтарэнне", button_recurring: "Адключана", button_recurring_open: "Уключана", button_edit_series: "Рэдагаваць серыю", button_edit_occurrence: "Рэдагаваць асобнік", agenda_tab: "Спіс", date: "Дата", description: "Апісанне", year_tab: "Год", week_agenda_tab: "Спіс", grid_tab: "Спic", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Дзень", repeat_radio_week: "Тыдзень", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Кожны", repeat_text_day_count: "дзень", repeat_radio_day_type2: "Кожны працоўны дзень", repeat_week: " Паўтараць кожны", repeat_text_week_count: "тыдзень", repeat_radio_month_type: "Паўтараць", repeat_radio_month_start: "", repeat_text_month_day: " чысла кожнага", repeat_text_month_count: "месяцу", repeat_text_month_count2_before: "кожны ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "дзень", select_year_month: "", repeat_radio_end: "Без даты заканчэння", repeat_text_occurences_count: "паўтораў", repeat_radio_end2: "", repeat_radio_end3: "Да ", month_for_recurring: ["Студзеня", "Лютага", "Сакавіка", "Красавіка", "Мая", "Чэрвеня", "Ліпeня", "Жніўня", "Верасня", "Кастрычніка", "Лістапада", "Снежня"], day_for_recurring: ["Нядзелю", "Панядзелак", "Аўторак", "Сераду", "Чацвер", "Пятніцу", "Суботу"] } }; - const ca = { date: { month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"] }, labels: { dhx_cal_today_button: "Hui", day_tab: "Dia", week_tab: "Setmana", month_tab: "Mes", new_event: "Nou esdeveniment", icon_save: "Guardar", icon_cancel: "Cancel·lar", icon_details: "Detalls", icon_edit: "Editar", icon_delete: "Esborrar", confirm_closing: "", confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?", section_description: "Descripció", section_time: "Periode de temps", full_day: "Tot el dia", confirm_recurring: "¿Desitja modificar el conjunt d'esdeveniments repetits?", section_recurring: "Repeteixca l'esdeveniment", button_recurring: "Impedit", button_recurring_open: "Permés", button_edit_series: "Edit sèrie", button_edit_occurrence: "Edita Instància", agenda_tab: "Agenda", date: "Data", description: "Descripció", year_tab: "Any", week_agenda_tab: "Agenda", grid_tab: "Taula", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const cn = { date: { month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], day_short: ["日", "一", "二", "三", "四", "五", "六"] }, labels: { dhx_cal_today_button: "今天", day_tab: "日", week_tab: "周", month_tab: "月", new_event: "新建日程", icon_save: "保存", icon_cancel: "关闭", icon_details: "详细", icon_edit: "编辑", icon_delete: "删除", confirm_closing: "请确认是否撤销修改!", confirm_deleting: "是否删除日程?", section_description: "描述", section_time: "时间范围", full_day: "整天", confirm_recurring: "请确认是否将日程设为重复模式?", section_recurring: "重复周期", button_recurring: "禁用", button_recurring_open: "启用", button_edit_series: "编辑系列", button_edit_occurrence: "编辑实例", agenda_tab: "议程", date: "日期", description: "说明", year_tab: "今年", week_agenda_tab: "议程", grid_tab: "电网", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "按天", repeat_radio_week: "按周", repeat_radio_month: "按月", repeat_radio_year: "按年", repeat_radio_day_type: "每", repeat_text_day_count: "天", repeat_radio_day_type2: "每个工作日", repeat_week: " 重复 每", repeat_text_week_count: "星期的:", repeat_radio_month_type: "重复", repeat_radio_month_start: "在", repeat_text_month_day: "日 每", repeat_text_month_count: "月", repeat_text_month_count2_before: "每", repeat_text_month_count2_after: "月", repeat_year_label: "在", select_year_day2: "的", repeat_text_year_day: "日", select_year_month: "月", repeat_radio_end: "无结束日期", repeat_text_occurences_count: "次结束", repeat_radio_end2: "重复", repeat_radio_end3: "结束于", month_for_recurring: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], day_for_recurring: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] } }; - const cs = { date: { month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"], day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"], day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Den", week_tab: "Týden", month_tab: "Měsíc", new_event: "Nová událost", icon_save: "Uložit", icon_cancel: "Zpět", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Smazat", confirm_closing: "", confirm_deleting: "Událost bude trvale smazána, opravdu?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Přejete si upravit celou řadu opakovaných událostí?", section_recurring: "Opakování události", button_recurring: "Vypnuto", button_recurring_open: "Zapnuto", button_edit_series: "Edit series", button_edit_occurrence: "Upravit instance", agenda_tab: "Program", date: "Datum", description: "Poznámka", year_tab: "Rok", full_day: "Full day", week_agenda_tab: "Program", grid_tab: "Mřížka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denně", repeat_radio_week: "Týdně", repeat_radio_month: "Měsíčně", repeat_radio_year: "Ročně", repeat_radio_day_type: "každý", repeat_text_day_count: "Den", repeat_radio_day_type2: "pracovní dny", repeat_week: "Opakuje každých", repeat_text_week_count: "Týdnů na:", repeat_radio_month_type: "u každého", repeat_radio_month_start: "na", repeat_text_month_day: "Den každého", repeat_text_month_count: "Měsíc", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "Měsíc", repeat_year_label: "na", select_year_day2: "v", repeat_text_year_day: "Den v", select_year_month: "", repeat_radio_end: "bez data ukončení", repeat_text_occurences_count: "Události", repeat_radio_end2: "po", repeat_radio_end3: "Konec", month_for_recurring: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], day_for_recurring: ["Neděle ", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"] } }; - const da = { date: { month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uge", month_tab: "Måned", new_event: "Ny begivenhed", icon_save: "Gem", icon_cancel: "Fortryd", icon_details: "Detaljer", icon_edit: "Tilret", icon_delete: "Slet", confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?", confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du tilrette hele serien af gentagne begivenheder?", section_recurring: "Gentag begivenhed", button_recurring: "Frakoblet", button_recurring_open: "Tilkoblet", button_edit_series: "Rediger serien", button_edit_occurrence: "Rediger en kopi", agenda_tab: "Dagsorden", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Dagsorden", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ugenlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "På hver arbejdsdag", repeat_week: " Gentager sig hver", repeat_text_week_count: "uge på følgende dage:", repeat_radio_month_type: "Hver den", repeat_radio_month_start: "Den", repeat_text_month_day: " i hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen slutdato", repeat_text_occurences_count: "gentagelse", repeat_radio_end2: "Efter", repeat_radio_end3: "Slut", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; - const de = { date: { month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"], month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"], day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] }, labels: { dhx_cal_today_button: "Heute", day_tab: "Tag", week_tab: "Woche", month_tab: "Monat", new_event: "neuer Eintrag", icon_save: "Speichern", icon_cancel: "Abbrechen", icon_details: "Details", icon_edit: "Ändern", icon_delete: "Löschen", confirm_closing: "", confirm_deleting: "Der Eintrag wird gelöscht", section_description: "Beschreibung", section_time: "Zeitspanne", full_day: "Ganzer Tag", confirm_recurring: "Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?", section_recurring: "Wiederholung", button_recurring: "Aus", button_recurring_open: "An", button_edit_series: "Bearbeiten Sie die Serie", button_edit_occurrence: "Bearbeiten Sie eine Kopie", agenda_tab: "Agenda", date: "Datum", description: "Beschreibung", year_tab: "Jahre", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Täglich", repeat_radio_week: "Wöchentlich", repeat_radio_month: "Monatlich", repeat_radio_year: "Jährlich", repeat_radio_day_type: "jeden", repeat_text_day_count: "Tag", repeat_radio_day_type2: "an jedem Arbeitstag", repeat_week: " Wiederholt sich jede", repeat_text_week_count: "Woche am:", repeat_radio_month_type: "an jedem", repeat_radio_month_start: "am", repeat_text_month_day: "Tag eines jeden", repeat_text_month_count: "Monats", repeat_text_month_count2_before: "jeden", repeat_text_month_count2_after: "Monats", repeat_year_label: "am", select_year_day2: "im", repeat_text_year_day: "Tag im", select_year_month: "", repeat_radio_end: "kein Enddatum", repeat_text_occurences_count: "Ereignissen", repeat_radio_end3: "Schluß", repeat_radio_end2: "nach", month_for_recurring: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], day_for_recurring: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] } }; - const el = { date: { month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"], day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"] }, labels: { dhx_cal_today_button: "Σήμερα", day_tab: "Ημέρα", week_tab: "Εβδομάδα", month_tab: "Μήνας", new_event: "Νέο έργο", icon_save: "Αποθήκευση", icon_cancel: "Άκυρο", icon_details: "Λεπτομέρειες", icon_edit: "Επεξεργασία", icon_delete: "Διαγραφή", confirm_closing: "", confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;", section_description: "Περιγραφή", section_time: "Χρονική περίοδος", full_day: "Πλήρης Ημέρα", confirm_recurring: "Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;", section_recurring: "Επαναλαμβανόμενο έργο", button_recurring: "Ανενεργό", button_recurring_open: "Ενεργό", button_edit_series: "Επεξεργαστείτε τη σειρά", button_edit_occurrence: "Επεξεργασία ένα αντίγραφο", agenda_tab: "Ημερήσια Διάταξη", date: "Ημερομηνία", description: "Περιγραφή", year_tab: "Έτος", week_agenda_tab: "Ημερήσια Διάταξη", grid_tab: "Πλέγμα", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Ημερησίως", repeat_radio_week: "Εβδομαδιαίως", repeat_radio_month: "Μηνιαίως", repeat_radio_year: "Ετησίως", repeat_radio_day_type: "Κάθε", repeat_text_day_count: "ημέρα", repeat_radio_day_type2: "Κάθε εργάσιμη", repeat_week: " Επανάληψη κάθε", repeat_text_week_count: "εβδομάδα τις επόμενες ημέρες:", repeat_radio_month_type: "Επανάληψη", repeat_radio_month_start: "Την", repeat_text_month_day: "ημέρα κάθε", repeat_text_month_count: "μήνα", repeat_text_month_count2_before: "κάθε", repeat_text_month_count2_after: "μήνα", repeat_year_label: "Την", select_year_day2: "του", repeat_text_year_day: "ημέρα", select_year_month: "μήνα", repeat_radio_end: "Χωρίς ημερομηνία λήξεως", repeat_text_occurences_count: "επαναλήψεις", repeat_radio_end3: "Λήγει την", repeat_radio_end2: "Μετά από", month_for_recurring: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], day_for_recurring: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"] } }; - const en = { date: { month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, labels: { dhx_cal_today_button: "Today", day_tab: "Day", week_tab: "Week", month_tab: "Month", new_event: "New event", icon_save: "Save", icon_cancel: "Cancel", icon_details: "Details", icon_edit: "Edit", icon_delete: "Delete", confirm_closing: "", confirm_deleting: "Event will be deleted permanently, are you sure?", section_description: "Description", section_time: "Time period", full_day: "Full day", confirm_recurring: "Do you want to edit the whole set of repeated events?", section_recurring: "Repeat event", button_recurring: "Disabled", button_recurring_open: "Enabled", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Agenda", date: "Date", description: "Description", year_tab: "Year", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daily", repeat_radio_week: "Weekly", repeat_radio_month: "Monthly", repeat_radio_year: "Yearly", repeat_radio_day_type: "Every", repeat_text_day_count: "day", repeat_radio_day_type2: "Every workday", repeat_week: " Repeat every", repeat_text_week_count: "week next days:", repeat_radio_month_type: "Repeat", repeat_radio_month_start: "On", repeat_text_month_day: "day every", repeat_text_month_count: "month", repeat_text_month_count2_before: "every", repeat_text_month_count2_after: "month", repeat_year_label: "On", select_year_day2: "of", repeat_text_year_day: "day", select_year_month: "month", repeat_radio_end: "No end date", repeat_text_occurences_count: "occurrences", repeat_radio_end2: "After", repeat_radio_end3: "End by", month_for_recurring: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], day_for_recurring: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] } }; - const es = { date: { month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"] }, labels: { dhx_cal_today_button: "Hoy", day_tab: "Día", week_tab: "Semana", month_tab: "Mes", new_event: "Nuevo evento", icon_save: "Guardar", icon_cancel: "Cancelar", icon_details: "Detalles", icon_edit: "Editar", icon_delete: "Eliminar", confirm_closing: "", confirm_deleting: "El evento se borrará definitivamente, ¿continuar?", section_description: "Descripción", section_time: "Período", full_day: "Todo el día", confirm_recurring: "¿Desea modificar el conjunto de eventos repetidos?", section_recurring: "Repita el evento", button_recurring: "Impedido", button_recurring_open: "Permitido", button_edit_series: "Editar la serie", button_edit_occurrence: "Editar este evento", agenda_tab: "Día", date: "Fecha", description: "Descripción", year_tab: "Año", week_agenda_tab: "Día", grid_tab: "Reja", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diariamente", repeat_radio_week: "Semanalmente", repeat_radio_month: "Mensualmente", repeat_radio_year: "Anualmente", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia", repeat_radio_day_type2: "Cada jornada de trabajo", repeat_week: " Repetir cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repita", repeat_radio_month_start: "El", repeat_text_month_day: "dia cada ", repeat_text_month_count: "mes", repeat_text_month_count2_before: "cada", repeat_text_month_count2_after: "mes", repeat_year_label: "El", select_year_day2: "del", repeat_text_year_day: "dia", select_year_month: "mes", repeat_radio_end: "Sin fecha de finalización", repeat_text_occurences_count: "ocurrencias", repeat_radio_end3: "Fin", repeat_radio_end2: "Después de", month_for_recurring: ["Enero", "Febrero", "Маrzo", "Аbril", "Mayo", "Junio", "Julio", "Аgosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"], day_for_recurring: ["Domingo", "Lunes", "Martes", "Miércoles", "Jeuves", "Viernes", "Sabado"] } }; - const fi = { date: { month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"], day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"], day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"] }, labels: { dhx_cal_today_button: "Tänään", day_tab: "Päivä", week_tab: "Viikko", month_tab: "Kuukausi", new_event: "Uusi tapahtuma", icon_save: "Tallenna", icon_cancel: "Peru", icon_details: "Tiedot", icon_edit: "Muokkaa", icon_delete: "Poista", confirm_closing: "", confirm_deleting: "Haluatko varmasti poistaa tapahtuman?", section_description: "Kuvaus", section_time: "Aikajakso", full_day: "Koko päivä", confirm_recurring: "Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?", section_recurring: "Toista tapahtuma", button_recurring: "Ei käytössä", button_recurring_open: "Käytössä", button_edit_series: "Muokkaa sarja", button_edit_occurrence: "Muokkaa kopio", agenda_tab: "Esityslista", date: "Päivämäärä", description: "Kuvaus", year_tab: "Vuoden", week_agenda_tab: "Esityslista", grid_tab: "Ritilä", drag_to_create: "Luo uusi vetämällä", drag_to_move: "Siirrä vetämällä", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Päivittäin", repeat_radio_week: "Viikoittain", repeat_radio_month: "Kuukausittain", repeat_radio_year: "Vuosittain", repeat_radio_day_type: "Joka", repeat_text_day_count: "päivä", repeat_radio_day_type2: "Joka arkipäivä", repeat_week: "Toista joka", repeat_text_week_count: "viikko näinä päivinä:", repeat_radio_month_type: "Toista", repeat_radio_month_start: "", repeat_text_month_day: "päivänä joka", repeat_text_month_count: "kuukausi", repeat_text_month_count2_before: "joka", repeat_text_month_count2_after: "kuukausi", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "päivä", select_year_month: "kuukausi", repeat_radio_end: "Ei loppumisaikaa", repeat_text_occurences_count: "Toiston jälkeen", repeat_radio_end3: "Loppuu", repeat_radio_end2: "", month_for_recurring: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], day_for_recurring: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"] } }; - const fr = { date: { month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"], day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels: { dhx_cal_today_button: "Aujourd'hui", day_tab: "Jour", week_tab: "Semaine", month_tab: "Mois", new_event: "Nouvel événement", icon_save: "Enregistrer", icon_cancel: "Annuler", icon_details: "Détails", icon_edit: "Modifier", icon_delete: "Effacer", confirm_closing: "", confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?", section_description: "Description", section_time: "Période", full_day: "Journée complète", confirm_recurring: "Voulez-vous éditer toute une série d'évènements répétés?", section_recurring: "Périodicité", button_recurring: "Désactivé", button_recurring_open: "Activé", button_edit_series: "Modifier la série", button_edit_occurrence: "Modifier une copie", agenda_tab: "Jour", date: "Date", description: "Description", year_tab: "Année", week_agenda_tab: "Jour", grid_tab: "Grille", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidienne", repeat_radio_week: "Hebdomadaire", repeat_radio_month: "Mensuelle", repeat_radio_year: "Annuelle", repeat_radio_day_type: "Chaque", repeat_text_day_count: "jour", repeat_radio_day_type2: "Chaque journée de travail", repeat_week: " Répéter toutes les", repeat_text_week_count: "semaine:", repeat_radio_month_type: "Répéter", repeat_radio_month_start: "Le", repeat_text_month_day: "jour chaque", repeat_text_month_count: "mois", repeat_text_month_count2_before: "chaque", repeat_text_month_count2_after: "mois", repeat_year_label: "Le", select_year_day2: "du", repeat_text_year_day: "jour", select_year_month: "mois", repeat_radio_end: "Pas de date d"achèvement", repeat_text_occurences_count: "occurrences", repeat_radio_end3: "Fin", repeat_radio_end2: "Après", month_for_recurring: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], day_for_recurring: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] } }; - const he = { date: { month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"], day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"] }, labels: { dhx_cal_today_button: "היום", day_tab: "יום", week_tab: "שבוע", month_tab: "חודש", new_event: "ארוע חדש", icon_save: "שמור", icon_cancel: "בטל", icon_details: "פרטים", icon_edit: "ערוך", icon_delete: "מחק", confirm_closing: "", confirm_deleting: "ארוע ימחק סופית.להמשיך?", section_description: "תיאור", section_time: "תקופה", confirm_recurring: "האם ברצונך לשנות כל סדרת ארועים מתמשכים?", section_recurring: "להעתיק ארוע", button_recurring: "לא פעיל", button_recurring_open: "פעיל", full_day: "יום שלם", button_edit_series: "ערוך את הסדרה", button_edit_occurrence: "עריכת עותק", agenda_tab: "סדר יום", date: "תאריך", description: "תיאור", year_tab: "לשנה", week_agenda_tab: "סדר יום", grid_tab: "סורג", drag_to_create: "Drag to create", drag_to_move: "גרור כדי להזיז", message_ok: "OK", message_cancel: "בטל", next: "הבא", prev: "הקודם", year: "שנה", month: "חודש", day: "יום", hour: "שעה", minute: "דקה", repeat_radio_day: "יומי", repeat_radio_week: "שבועי", repeat_radio_month: "חודשי", repeat_radio_year: "שנתי", repeat_radio_day_type: "חזור כל", repeat_text_day_count: "ימים", repeat_radio_day_type2: "חזור כל יום עבודה", repeat_week: " חזור כל", repeat_text_week_count: "שבוע לפי ימים:", repeat_radio_month_type: "חזור כל", repeat_radio_month_start: "כל", repeat_text_month_day: "ימים כל", repeat_text_month_count: "חודשים", repeat_text_month_count2_before: "חזור כל", repeat_text_month_count2_after: "חודש", repeat_year_label: "כל", select_year_day2: "בחודש", repeat_text_year_day: "ימים", select_year_month: "חודש", repeat_radio_end: "לעולם לא מסתיים", repeat_text_occurences_count: "אירועים", repeat_radio_end3: "מסתיים ב", repeat_radio_end2: "אחרי", month_for_recurring: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], day_for_recurring: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"] } }; - const hu = { date: { month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"], month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"], day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"] }, labels: { dhx_cal_today_button: "Ma", day_tab: "Nap", week_tab: "Hét", month_tab: "Hónap", new_event: "Új esemény", icon_save: "Mentés", icon_cancel: "Mégse", icon_details: "Részletek", icon_edit: "Szerkesztés", icon_delete: "Törlés", confirm_closing: "", confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?", section_description: "Leírás", section_time: "Idõszak", full_day: "Egesz napos", confirm_recurring: "Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?", section_recurring: "Esemény ismétlése", button_recurring: "Tiltás", button_recurring_open: "Engedélyezés", button_edit_series: "Edit series", button_edit_occurrence: "Szerkesztés bíróság", agenda_tab: "Napirend", date: "Dátum", description: "Leírás", year_tab: "Év", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const id = { date: { month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"], day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, labels: { dhx_cal_today_button: "Hari Ini", day_tab: "Hari", week_tab: "Minggu", month_tab: "Bulan", new_event: "Acara Baru", icon_save: "Simpan", icon_cancel: "Batal", icon_details: "Detail", icon_edit: "Edit", icon_delete: "Hapus", confirm_closing: "", confirm_deleting: "Acara akan dihapus", section_description: "Keterangan", section_time: "Periode", full_day: "Hari penuh", confirm_recurring: "Apakah acara ini akan berulang?", section_recurring: "Acara Rutin", button_recurring: "Tidak Difungsikan", button_recurring_open: "Difungsikan", button_edit_series: "Mengedit seri", button_edit_occurrence: "Mengedit salinan", agenda_tab: "Agenda", date: "Tanggal", description: "Keterangan", year_tab: "Tahun", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const it = { date: { month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"] }, labels: { dhx_cal_today_button: "Oggi", day_tab: "Giorno", week_tab: "Settimana", month_tab: "Mese", new_event: "Nuovo evento", icon_save: "Salva", icon_cancel: "Chiudi", icon_details: "Dettagli", icon_edit: "Modifica", icon_delete: "Elimina", confirm_closing: "", confirm_deleting: "L'evento sarà eliminato, siete sicuri?", section_description: "Descrizione", section_time: "Periodo di tempo", full_day: "Intera giornata", confirm_recurring: "Vuoi modificare l'intera serie di eventi?", section_recurring: "Ripetere l'evento", button_recurring: "Disattivato", button_recurring_open: "Attivato", button_edit_series: "Modificare la serie", button_edit_occurrence: "Modificare una copia", agenda_tab: "Agenda", date: "Data", description: "Descrizione", year_tab: "Anno", week_agenda_tab: "Agenda", grid_tab: "Griglia", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Quotidiano", repeat_radio_week: "Settimanale", repeat_radio_month: "Mensile", repeat_radio_year: "Annuale", repeat_radio_day_type: "Ogni", repeat_text_day_count: "giorno", repeat_radio_day_type2: "Ogni giornata lavorativa", repeat_week: " Ripetere ogni", repeat_text_week_count: "settimana:", repeat_radio_month_type: "Ripetere", repeat_radio_month_start: "Il", repeat_text_month_day: "giorno ogni", repeat_text_month_count: "mese", repeat_text_month_count2_before: "ogni", repeat_text_month_count2_after: "mese", repeat_year_label: "Il", select_year_day2: "del", repeat_text_year_day: "giorno", select_year_month: "mese", repeat_radio_end: "Senza data finale", repeat_text_occurences_count: "occorenze", repeat_radio_end3: "Fine", repeat_radio_end2: "Dopo", month_for_recurring: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Jiugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], day_for_recurring: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Jovedì", "Venerdì", "Sabato"] } }; - const jp = { date: { month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], day_short: ["日", "月", "火", "水", "木", "金", "土"] }, labels: { dhx_cal_today_button: "今日", day_tab: "日", week_tab: "週", month_tab: "月", new_event: "新イベント", icon_save: "保存", icon_cancel: "キャンセル", icon_details: "詳細", icon_edit: "編集", icon_delete: "削除", confirm_closing: "", confirm_deleting: "イベント完全に削除されます、宜しいですか?", section_description: "デスクリプション", section_time: "期間", confirm_recurring: "繰り返されているイベントを全て編集しますか?", section_recurring: "イベントを繰り返す", button_recurring: "無効", button_recurring_open: "有効", full_day: "終日", button_edit_series: "シリーズを編集します", button_edit_occurrence: "コピーを編集", agenda_tab: "議題は", date: "日付", description: "説明", year_tab: "今年", week_agenda_tab: "議題は", grid_tab: "グリッド", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - class LocaleManager { + class ExtensionsManager { constructor(config) { - this._locales = {}; + this._extensions = {}; for (const i in config) { - this._locales[i] = config[i]; + this._extensions[i] = config[i]; } } - addLocale(name, locale) { - this._locales[name] = locale; + addExtension(name, ext) { + this._extensions[name] = ext; } - getLocale(name) { - return this._locales[name]; + getExtension(name) { + return this._extensions[name]; } } - const nb = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "I dag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny hendelse", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", confirm_recurring: "Vil du forandre hele dette settet av repeterende hendelser?", section_recurring: "Repeter hendelsen", button_recurring: "Av", button_recurring_open: "På", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Daglig", repeat_radio_week: "Ukentlig", repeat_radio_month: "Månedlig", repeat_radio_year: "Årlig", repeat_radio_day_type: "Hver", repeat_text_day_count: "dag", repeat_radio_day_type2: "Alle hverdager", repeat_week: " Gjentas hver", repeat_text_week_count: "uke på:", repeat_radio_month_type: "På hver", repeat_radio_month_start: "På", repeat_text_month_day: "dag hver", repeat_text_month_count: "måned", repeat_text_month_count2_before: "hver", repeat_text_month_count2_after: "måned", repeat_year_label: "på", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "", repeat_radio_end: "Ingen sluttdato", repeat_text_occurences_count: "forekomst", repeat_radio_end3: "Stop den", repeat_radio_end2: "Etter", month_for_recurring: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], day_for_recurring: ["Sondag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"] } }; - const nl = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { dhx_cal_today_button: "Vandaag", day_tab: "Dag", week_tab: "Week", month_tab: "Maand", new_event: "Nieuw item", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", full_day: "Hele dag", confirm_recurring: "Wilt u alle terugkerende items bijwerken?", section_recurring: "Item herhalen", button_recurring: "Uit", button_recurring_open: "Aan", button_edit_series: "Bewerk de serie", button_edit_occurrence: "Bewerk een kopie", agenda_tab: "Agenda", date: "Datum", description: "Omschrijving", year_tab: "Jaar", week_agenda_tab: "Agenda", grid_tab: "Tabel", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagelijks", repeat_radio_week: "Wekelijks", repeat_radio_month: "Maandelijks", repeat_radio_year: "Jaarlijks", repeat_radio_day_type: "Elke", repeat_text_day_count: "dag(en)", repeat_radio_day_type2: "Elke werkdag", repeat_week: " Herhaal elke", repeat_text_week_count: "week op de volgende dagen:", repeat_radio_month_type: "Herhaal", repeat_radio_month_start: "Op", repeat_text_month_day: "dag iedere", repeat_text_month_count: "maanden", repeat_text_month_count2_before: "iedere", repeat_text_month_count2_after: "maanden", repeat_year_label: "Op", select_year_day2: "van", repeat_text_year_day: "dag", select_year_month: "maand", repeat_radio_end: "Geen eind datum", repeat_text_occurences_count: "keren", repeat_radio_end3: "Eindigd per", repeat_radio_end2: "Na", month_for_recurring: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], day_for_recurring: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"] } }; - const no = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Uke", month_tab: "Måned", new_event: "Ny", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", full_day: "Full dag", confirm_recurring: "Vil du endre hele settet med repeterende oppføringer?", section_recurring: "Repeterende oppføring", button_recurring: "Ikke aktiv", button_recurring_open: "Aktiv", button_edit_series: "Rediger serien", button_edit_occurrence: "Redigere en kopi", agenda_tab: "Agenda", date: "Dato", description: "Beskrivelse", year_tab: "År", week_agenda_tab: "Agenda", grid_tab: "Grid", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const pl = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { dhx_cal_today_button: "Dziś", day_tab: "Dzień", week_tab: "Tydzień", month_tab: "Miesiąc", new_event: "Nowe zdarzenie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", full_day: "Cały dzień", confirm_recurring: "Czy chcesz edytować cały zbiór powtarzających się zdarzeń?", section_recurring: "Powtórz zdarzenie", button_recurring: "Nieaktywne", button_recurring_open: "Aktywne", button_edit_series: "Edytuj serię", button_edit_occurrence: "Edytuj kopię", agenda_tab: "Agenda", date: "Data", description: "Opis", year_tab: "Rok", week_agenda_tab: "Agenda", grid_tab: "Tabela", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Codziennie", repeat_radio_week: "Co tydzie", repeat_radio_month: "Co miesic", repeat_radio_year: "Co rok", repeat_radio_day_type: "Kadego", repeat_text_day_count: "dnia", repeat_radio_day_type2: "Kadego dnia roboczego", repeat_week: " Powtarzaj kadego", repeat_text_week_count: "tygodnia w dni:", repeat_radio_month_type: "Powtrz", repeat_radio_month_start: "W", repeat_text_month_day: "dnia kadego", repeat_text_month_count: "miesica", repeat_text_month_count2_before: "kadego", repeat_text_month_count2_after: "miesica", repeat_year_label: "W", select_year_day2: "miesica", repeat_text_year_day: "dnia miesica", select_year_month: "", repeat_radio_end: "Bez daty kocowej", repeat_text_occurences_count: "wystpieniu/ach", repeat_radio_end3: "Zakocz w", repeat_radio_end2: "Po", month_for_recurring: ["Stycznia", "Lutego", "Marca", "Kwietnia", "Maja", "Czerwca", "Lipca", "Sierpnia", "Wrzenia", "Padziernka", "Listopada", "Grudnia"], day_for_recurring: ["Niedziela", "Poniedziaek", "Wtorek", "roda", "Czwartek", "Pitek", "Sobota"] } }; - const pt = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { dhx_cal_today_button: "Hoje", day_tab: "Dia", week_tab: "Semana", month_tab: "Mês", new_event: "Novo evento", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Deletar", confirm_closing: "", confirm_deleting: "Tem certeza que deseja excluir?", section_description: "Descrição", section_time: "Período de tempo", full_day: "Dia inteiro", confirm_recurring: "Deseja editar todos esses eventos repetidos?", section_recurring: "Repetir evento", button_recurring: "Desabilitar", button_recurring_open: "Habilitar", button_edit_series: "Editar a série", button_edit_occurrence: "Editar uma cópia", agenda_tab: "Dia", date: "Data", description: "Descrição", year_tab: "Ano", week_agenda_tab: "Dia", grid_tab: "Grade", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Diário", repeat_radio_week: "Semanal", repeat_radio_month: "Mensal", repeat_radio_year: "Anual", repeat_radio_day_type: "Cada", repeat_text_day_count: "dia(s)", repeat_radio_day_type2: "Cada trabalho diário", repeat_week: " Repita cada", repeat_text_week_count: "semana:", repeat_radio_month_type: "Repetir", repeat_radio_month_start: "Em", repeat_text_month_day: "todo dia", repeat_text_month_count: "mês", repeat_text_month_count2_before: "todo", repeat_text_month_count2_after: "mês", repeat_year_label: "Em", select_year_day2: "of", repeat_text_year_day: "dia", select_year_month: "mês", repeat_radio_end: "Sem data final", repeat_text_occurences_count: "ocorrências", repeat_radio_end3: "Fim", repeat_radio_end2: "Depois", month_for_recurring: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], day_for_recurring: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] } }; - const ro = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { dhx_cal_today_button: "Astazi", day_tab: "Zi", week_tab: "Saptamana", month_tab: "Luna", new_event: "Eveniment nou", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", full_day: "Toata ziua", confirm_recurring: "Vrei sa editezi toata seria de evenimente repetate?", section_recurring: "Repetare", button_recurring: "Dezactivata", button_recurring_open: "Activata", button_edit_series: "Editeaza serie", button_edit_occurrence: "Editeaza doar intrare", agenda_tab: "Agenda", date: "Data", description: "Descriere", year_tab: "An", week_agenda_tab: "Agenda", grid_tab: "Lista", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Zilnic", repeat_radio_week: "Saptamanal", repeat_radio_month: "Lunar", repeat_radio_year: "Anual", repeat_radio_day_type: "La fiecare", repeat_text_day_count: "zi(le)", repeat_radio_day_type2: "Fiecare zi lucratoare", repeat_week: " Repeta la fiecare", repeat_text_week_count: "saptamana in urmatoarele zile:", repeat_radio_month_type: "Repeta in", repeat_radio_month_start: "In a", repeat_text_month_day: "zi la fiecare", repeat_text_month_count: "luni", repeat_text_month_count2_before: "la fiecare", repeat_text_month_count2_after: "luni", repeat_year_label: "In", select_year_day2: "a lunii", repeat_text_year_day: "zi a lunii", select_year_month: "", repeat_radio_end: "Fara data de sfarsit", repeat_text_occurences_count: "evenimente", repeat_radio_end3: "La data", repeat_radio_end2: "Dupa", month_for_recurring: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], day_for_recurring: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"] } }; - const ru = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { dhx_cal_today_button: "Сегодня", day_tab: "День", week_tab: "Неделя", month_tab: "Месяц", new_event: "Новое событие", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", full_day: "Весь день", confirm_recurring: "Вы хотите изменить всю серию повторяющихся событий?", section_recurring: "Повторение", button_recurring: "Отключено", button_recurring_open: "Включено", button_edit_series: "Редактировать серию", button_edit_occurrence: "Редактировать экземпляр", agenda_tab: "Список", date: "Дата", description: "Описание", year_tab: "Год", week_agenda_tab: "Список", grid_tab: "Таблица", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Неделя", repeat_radio_month: "Месяц", repeat_radio_year: "Год", repeat_radio_day_type: "Каждый", repeat_text_day_count: "день", repeat_radio_day_type2: "Каждый рабочий день", repeat_week: " Повторять каждую", repeat_text_week_count: "неделю , в:", repeat_radio_month_type: "Повторять", repeat_radio_month_start: "", repeat_text_month_day: " числа каждый ", repeat_text_month_count: "месяц", repeat_text_month_count2_before: "каждый ", repeat_text_month_count2_after: "месяц", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без даты окончания", repeat_text_occurences_count: "повторений", repeat_radio_end3: "До ", repeat_radio_end2: "", month_for_recurring: ["Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря"], day_for_recurring: ["Воскресенье", "Понедельник", "Вторник", "Среду", "Четверг", "Пятницу", "Субботу"] } }; - const si = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", full_day: "Ves dan", confirm_recurring: "Želite urediti celoten set ponavljajočih dogodkov?", section_recurring: "Ponovi dogodek", button_recurring: "Onemogočeno", button_recurring_open: "Omogočeno", button_edit_series: "Edit series", button_edit_occurrence: "Edit occurrence", agenda_tab: "Zadeva", date: "Datum", description: "Opis", year_tab: "Leto", week_agenda_tab: "Zadeva", grid_tab: "Miza", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const sk = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { dhx_cal_today_button: "Dnes", day_tab: "Deň", week_tab: "Týždeň", month_tab: "Mesiac", new_event: "Nová udalosť", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", confirm_recurring: "Prajete si upraviť celú radu opakovaných udalostí?", section_recurring: "Opakovanie udalosti", button_recurring: "Vypnuté", button_recurring_open: "Zapnuté", button_edit_series: "Upraviť opakovania", button_edit_occurrence: "Upraviť inštancie", agenda_tab: "Program", date: "Dátum", description: "Poznámka", year_tab: "Rok", full_day: "Celý deň", week_agenda_tab: "Program", grid_tab: "Mriežka", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Denne", repeat_radio_week: "Týždenne", repeat_radio_month: "Mesaène", repeat_radio_year: "Roène", repeat_radio_day_type: "Každý", repeat_text_day_count: "deò", repeat_radio_day_type2: "Každý prac. deò", repeat_week: "Opakova každý", repeat_text_week_count: "týždeò v dòoch:", repeat_radio_month_type: "Opakova", repeat_radio_month_start: "On", repeat_text_month_day: "deò každý", repeat_text_month_count: "mesiac", repeat_text_month_count2_before: "každý", repeat_text_month_count2_after: "mesiac", repeat_year_label: "On", select_year_day2: "poèas", repeat_text_year_day: "deò", select_year_month: "mesiac", repeat_radio_end: "Bez dátumu ukonèenia", repeat_text_occurences_count: "udalostiach", repeat_radio_end3: "Ukonèi", repeat_radio_end2: "Po", month_for_recurring: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], day_for_recurring: ["Nede¾a", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] } }; - const sv = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { dhx_cal_today_button: "Idag", day_tab: "Dag", week_tab: "Vecka", month_tab: "Månad", new_event: "Ny händelse", icon_save: "Spara", icon_cancel: "Ångra", icon_details: "Detaljer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", full_day: "Hela dagen", confirm_recurring: "Vill du redigera hela serien med repeterande händelser?", section_recurring: "Upprepa händelse", button_recurring: "Inaktiverat", button_recurring_open: "Aktiverat", button_edit_series: "Redigera serien", button_edit_occurrence: "Redigera en kopia", agenda_tab: "Dagordning", date: "Datum", description: "Beskrivning", year_tab: "År", week_agenda_tab: "Dagordning", grid_tab: "Galler", drag_to_create: "Dra för att skapa ny", drag_to_move: "Dra för att flytta", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "Dagligen", repeat_radio_week: "Veckovis", repeat_radio_month: "Månadsvis", repeat_radio_year: "Årligen", repeat_radio_day_type: "Var", repeat_text_day_count: "dag", repeat_radio_day_type2: "Varje arbetsdag", repeat_week: " Upprepa var", repeat_text_week_count: "vecka dessa dagar:", repeat_radio_month_type: "Upprepa", repeat_radio_month_start: "Den", repeat_text_month_day: "dagen var", repeat_text_month_count: "månad", repeat_text_month_count2_before: "var", repeat_text_month_count2_after: "månad", repeat_year_label: "Den", select_year_day2: "i", repeat_text_year_day: "dag i", select_year_month: "månad", repeat_radio_end: "Inget slutdatum", repeat_text_occurences_count: "upprepningar", repeat_radio_end3: "Sluta efter", repeat_radio_end2: "Efter", month_for_recurring: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], day_for_recurring: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] } }; - const tr = { date: { month_full: ["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"], month_short: ["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"] }, labels: { dhx_cal_today_button: "Bugün", day_tab: "Gün", week_tab: "Hafta", month_tab: "Ay", new_event: "Uygun", icon_save: "Kaydet", icon_cancel: "Ýptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Etkinlik silinecek, devam?", section_description: "Açýklama", section_time: "Zaman aralýðý", full_day: "Tam gün", confirm_recurring: "Tüm tekrar eden etkinlikler silinecek, devam?", section_recurring: "Etkinliði tekrarla", button_recurring: "Pasif", button_recurring_open: "Aktif", button_edit_series: "Dizi düzenleme", button_edit_occurrence: "Bir kopyasını düzenleyin", agenda_tab: "Ajanda", date: "Tarih", description: "Açýklama", year_tab: "Yýl", week_agenda_tab: "Ajanda", grid_tab: "Izgara", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute" } }; - const ua = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { dhx_cal_today_button: "Сьогодні", day_tab: "День", week_tab: "Тиждень", month_tab: "Місяць", new_event: "Нова подія", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", full_day: "Весь день", confirm_recurring: "Хочете редагувати весь перелік повторюваних подій?", section_recurring: "Повторювана подія", button_recurring: "Відключено", button_recurring_open: "Включено", button_edit_series: "Редагувати серію", button_edit_occurrence: "Редагувати примірник", agenda_tab: "Перелік", date: "Дата", description: "Опис", year_tab: "Рік", week_agenda_tab: "Перелік", grid_tab: "Таблиця", drag_to_create: "Drag to create", drag_to_move: "Drag to move", message_ok: "OK", message_cancel: "Cancel", next: "Next", prev: "Previous", year: "Year", month: "Month", day: "Day", hour: "Hour", minute: "Minute", repeat_radio_day: "День", repeat_radio_week: "Тиждень", repeat_radio_month: "Місяць", repeat_radio_year: "Рік", repeat_radio_day_type: "Кожний", repeat_text_day_count: "день", repeat_radio_day_type2: "Кожний робочий день", repeat_week: " Повторювати кожен", repeat_text_week_count: "тиждень , по:", repeat_radio_month_type: "Повторювати", repeat_radio_month_start: "", repeat_text_month_day: " числа кожний ", repeat_text_month_count: "місяць", repeat_text_month_count2_before: "кожен ", repeat_text_month_count2_after: "місяць", repeat_year_label: "", select_year_day2: "", repeat_text_year_day: "день", select_year_month: "", repeat_radio_end: "Без дати закінчення", repeat_text_occurences_count: "повторень", repeat_radio_end3: "До ", repeat_radio_end2: "", month_for_recurring: ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], day_for_recurring: ["Неділям", "Понеділкам", "Вівторкам", "Середам", "Четвергам", "П'ятницям", "Суботам"] } }; - function i18nFactory() { - return new LocaleManager({ en, ar, be, ca, cn, cs, da, de, el, es, fi, fr, he, hu, id, it, jp, nb, nl, no, pl, pt, ro, ru, si, sk, sv, tr, ua }); - } - class DatePicker { - constructor(scheduler2, container, state = {}) { - this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...state }; - this.container = null; - this.element = null; - this.onStateChangeHandlers = []; - this.scheduler = scheduler2; - this._domEvents = scheduler2._createDomEventScope(); - this.state = this.getState(); - makeEventable(this); - if (container) { - this.container = container; - this.render(this.container); - } - this.onStateChange((oldState, newState) => { - this.callEvent("onStateChange", [newState, oldState]); - }); + dhtmlxHook(); + class SchedulerFactory { + constructor(extensions) { + this._seed = 0; + this._schedulerPlugins = []; + this._bundledExtensions = extensions; + this._extensionsManager = new ExtensionsManager(extensions); } - getState() { - return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] }; + plugin(code) { + this._schedulerPlugins.push(code); + if (global$1.scheduler) { + code(global$1.scheduler); + } } - setState(newState) { - const oldState = { ...this.state }; - if (newState.mode) { - newState.currentModeIndex = this.state.modes.indexOf(newState.mode); + getSchedulerInstance(initConfig) { + var scheduler2 = factoryMethod(this._extensionsManager); + for (var i = 0; i < this._schedulerPlugins.length; i++) { + this._schedulerPlugins[i](scheduler2); } - this.state = { ...this.state, ...newState }; - this._notifyStateChange(oldState, this.state); - if (this.container) { - this.render(this.container); + scheduler2._internal_id = this._seed++; + if (this.$syncFactory) { + this.$syncFactory(scheduler2); } + if (initConfig) { + this._initFromConfig(scheduler2, initConfig); + } + return scheduler2; } - onStateChange(handler) { - this.onStateChangeHandlers.push(handler); - return () => { - const index = this.onStateChangeHandlers.indexOf(handler); - if (index !== -1) { - this.onStateChangeHandlers.splice(index, 1); + _initFromConfig(scheduler2, initConfig) { + if (initConfig.plugins) { + scheduler2.plugins(initConfig.plugins); + } + if (initConfig.config) { + scheduler2.mixin(scheduler2.config, initConfig.config, true); + } + if (initConfig.templates) { + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.mixin(scheduler2.templates, initConfig.templates, true); + }, { once: true }); + } + if (initConfig.events) { + for (const event2 in initConfig.events) { + scheduler2.attachEvent(event2, initConfig.events[event2]); } - }; - } - _notifyStateChange(oldState, newState) { - this.onStateChangeHandlers.forEach((handler) => handler(oldState, newState)); - } - _adjustDate(direction) { - const { mode, date } = this.getState(); - const newDate = new Date(date); - if (mode === "days") { - newDate.setMonth(date.getMonth() + direction); - } else if (mode === "months") { - newDate.setFullYear(date.getFullYear() + direction); - } else { - newDate.setFullYear(date.getFullYear() + direction * 10); } - this.setState({ date: newDate }); - } - _toggleMode() { - const newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length; - this.setState({ currentModeIndex: newIndex }); - } - _renderCalendarHeader(container) { - const { mode, date } = this.getState(); - const header = document.createElement("div"); - header.classList.add("dhx_cal_datepicker_header"); - const backwardArrow = document.createElement("button"); - backwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"); - header.appendChild(backwardArrow); - const monthLabel = document.createElement("div"); - monthLabel.classList.add("dhx_cal_datepicker_title"); - if (mode === "days") { - monthLabel.innerText = date.toLocaleString("default", { month: "long" }) + " " + date.getFullYear(); - } else if (mode === "months") { - monthLabel.innerText = date.getFullYear(); - } else { - const startYear = Math.floor(date.getFullYear() / 10) * 10; - monthLabel.innerText = `${startYear} - ${startYear + 9}`; + if (initConfig.locale) { + scheduler2.i18n.setLocale(initConfig.locale); } - this._domEvents.attach(monthLabel, "click", this._toggleMode.bind(this)); - header.appendChild(monthLabel); - const forwardArrow = document.createElement("button"); - forwardArrow.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"); - header.appendChild(forwardArrow); - container.appendChild(header); - this._domEvents.attach(backwardArrow, "click", this._adjustDate.bind(this, -1)); - this._domEvents.attach(forwardArrow, "click", this._adjustDate.bind(this, 1)); - } - render(container) { - this._domEvents.detachAll(); - this.container = container || this.container; - this.container.innerHTML = ""; - if (!this.element) { - this.element = document.createElement("div"); - this.element.classList.add("dhx_cal_datepicker"); + if (Array.isArray(initConfig.calendars)) { + initConfig.calendars.forEach(function(calendar) { + scheduler2.addCalendar(calendar); + }); } - this.element.innerHTML = ""; - this.container.appendChild(this.element); - this._renderCalendarHeader(this.element); - const dataContainer = document.createElement("div"); - dataContainer.classList.add("dhx_cal_datepicker_data"); - this.element.appendChild(dataContainer); - const { mode } = this.getState(); - if (mode === "days") { - this._renderDayGrid(dataContainer); - } else if (mode === "months") { - this._renderMonthGrid(dataContainer); + if (initConfig.container) { + scheduler2.init(initConfig.container); } else { - this._renderYearGrid(dataContainer); - } - } - _renderDayGridHeader(daysOfWeekContainer) { - const { date } = this.getState(); - const scheduler2 = this.scheduler; - let currentDate = scheduler2.date.week_start(new Date(date)); - const maxDate = scheduler2.date.add(scheduler2.date.week_start(new Date(date)), 1, "week"); - daysOfWeekContainer.classList.add("dhx_cal_datepicker_days"); - const labelFormat = scheduler2.date.date_to_str("%D"); - while (currentDate.valueOf() < maxDate.valueOf()) { - const label = labelFormat(currentDate); - const dayElement = document.createElement("div"); - dayElement.setAttribute("data-day", currentDate.getDay()); - dayElement.classList.add("dhx_cal_datepicker_dayname"); - dayElement.innerText = label; - daysOfWeekContainer.appendChild(dayElement); - currentDate = scheduler2.date.add(currentDate, 1, "day"); + scheduler2.init(); } - } - _weeksBetween(min, max) { - const scheduler2 = this.scheduler; - let weeks = 0; - let currWeek = new Date(min); - while (currWeek.valueOf() < max.valueOf()) { - weeks += 1; - currWeek = scheduler2.date.week_start(scheduler2.date.add(currWeek, 1, "week")); + if (initConfig.data) { + if (typeof initConfig.data === "string") { + scheduler2.load(initConfig.data); + } else { + scheduler2.parse(initConfig.data); + } } - return weeks; } - _renderDayGrid(container) { - const { date, currentRange, eventDates, minWeeks } = this.getState(); - let minSchedulerDate = currentRange[0]; - let maxSchedulerDate = currentRange[1]; - const eventDaysTable = eventDates.reduce((acc, date2) => { - const dayStart = this.scheduler.date.day_start(new Date(date2)); - acc[dayStart.valueOf()] = true; - return acc; - }, {}); - const daysOfWeekContainer = document.createElement("div"); - this._renderDayGridHeader(daysOfWeekContainer); - container.appendChild(daysOfWeekContainer); - const scheduler2 = this.scheduler; - const firstDate = scheduler2.date.week_start(scheduler2.date.month_start(new Date(date))); - const monthStart = scheduler2.date.month_start(new Date(date)); - const monthEnd = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); - let lastDate = scheduler2.date.add(scheduler2.date.month_start(new Date(date)), 1, "month"); - const currentCalDate = scheduler2.date.date_part(scheduler2._currentDate()); - if (lastDate.getDay() !== 0) { - lastDate = scheduler2.date.add(scheduler2.date.week_start(lastDate), 1, "week"); + } + function active_links(scheduler2) { + scheduler2.config.active_link_view = "day"; + scheduler2._active_link_click = function(e) { + var start = e.target; + var to = start.getAttribute("data-link-date"); + var s_d = scheduler2.date.str_to_date(scheduler2.config.api_date, false, true); + if (to) { + scheduler2.setCurrentView(s_d(to), scheduler2.config.active_link_view); + if (e && e.preventDefault) + e.preventDefault(); + return false; } - let weeks = this._weeksBetween(firstDate, lastDate); - if (minWeeks && weeks < minWeeks) { - lastDate = scheduler2.date.add(lastDate, minWeeks - weeks, "week"); + }; + scheduler2.attachEvent("onTemplatesReady", function() { + var do_wrapper = function(key2, fullname) { + fullname = fullname || key2 + "_scale_date"; + if (!scheduler2.templates["_active_links_old_" + fullname]) { + scheduler2.templates["_active_links_old_" + fullname] = scheduler2.templates[fullname]; + } + var week_x = scheduler2.templates["_active_links_old_" + fullname]; + var d_s = scheduler2.date.date_to_str(scheduler2.config.api_date); + scheduler2.templates[fullname] = function(date) { + return "" + week_x(date) + ""; + }; + }; + do_wrapper("week"); + do_wrapper("", "month_day"); + if (this.matrix) { + for (var key in this.matrix) + do_wrapper(key); } - let currDate = firstDate; - const dayGridContainer = document.createElement("div"); - dayGridContainer.classList.add("dhx_cal_datepicker_days"); - this._domEvents.attach(dayGridContainer, "click", (event2) => { - const dateCell = event2.target.closest("[data-cell-date]"); - const date2 = new Date(dateCell.getAttribute("data-cell-date")); - this.callEvent("onDateClick", [date2, event2]); - }); - while (currDate.valueOf() < lastDate.valueOf()) { - const dayElement = document.createElement("div"); - dayElement.setAttribute("data-cell-date", scheduler2.templates.format_date(currDate)); - dayElement.setAttribute("data-day", currDate.getDay()); - dayElement.innerHTML = currDate.getDate(); - if (currDate.valueOf() < monthStart.valueOf()) { - dayElement.classList.add("dhx_before"); - } else if (currDate.valueOf() >= monthEnd.valueOf()) { - dayElement.classList.add("dhx_after"); + this._detachDomEvent(this._obj, "click", scheduler2._active_link_click); + scheduler2.event(this._obj, "click", scheduler2._active_link_click); + }); + } + function agenda_legacy(scheduler2) { + scheduler2.date.add_agenda_legacy = function(date) { + return scheduler2.date.add(date, 1, "year"); + }; + scheduler2.templates.agenda_legacy_time = function(start, end, ev) { + if (ev._timed) + return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); + else + return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); + }; + scheduler2.templates.agenda_legacy_text = function(start, end, event2) { + return event2.text; + }; + scheduler2.templates.agenda_legacy_date = function() { + return ""; + }; + scheduler2.date.agenda_legacy_start = function() { + return scheduler2.date.date_part(scheduler2._currentDate()); + }; + scheduler2.attachEvent("onTemplatesReady", function() { + var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; + scheduler2.dblclick_dhx_cal_data = function() { + if (this._mode == "agenda_legacy") { + if (!this.config.readonly && this.config.dblclick_create) + this.addEventNow(); + } else { + if (old_dblclick_dhx_cal_data) + return old_dblclick_dhx_cal_data.apply(this, arguments); } - if (currDate.getDay() === 0 || currDate.getDay() === 6) { - dayElement.classList.add("dhx_cal_datepicker_weekend"); + }; + var old = scheduler2.render_data; + scheduler2.render_data = function(evs) { + if (this._mode == "agenda_legacy") + fill_agenda_tab(); + else + return old.apply(this, arguments); + }; + var old_render_view_data = scheduler2.render_view_data; + scheduler2.render_view_data = function() { + if (this._mode == "agenda_legacy") { + scheduler2._agendaScrollTop = scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop; + scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0; } - if (currDate.valueOf() == currentCalDate.valueOf()) { - dayElement.classList.add("dhx_now"); + return old_render_view_data.apply(this, arguments); + }; + function set_full_view(mode) { + if (mode) { + var l = scheduler2.locale.labels; + var rowAttr = scheduler2._waiAria.agendaHeadAttrString(); + var dateHeader = scheduler2._waiAria.agendaHeadDateString(l.date); + var descriptionHeader = scheduler2._waiAria.agendaHeadDescriptionString(l.description); + scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; + scheduler2._table_view = true; + scheduler2.set_sizes(); } - if (minSchedulerDate && maxSchedulerDate) { - if (currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()) { - dayElement.classList.add("dhx_cal_datepicker_current"); - } + } + function fill_agenda_tab() { + var events = scheduler2.get_visible_events(); + events.sort(function(a, b) { + return a.start_date > b.start_date ? 1 : -1; + }); + var tableAttr = scheduler2._waiAria.agendaDataAttrString(); + var agendaEventAttrString; + var html = "
"; + for (var i = 0; i < events.length; i++) { + var ev = events[i]; + var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; + var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; + var ev_class = scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); + agendaEventAttrString = scheduler2._waiAria.agendaEventAttrString(ev); + var agendaDetailsButtonAttr = scheduler2._waiAria.agendaDetailsBtnString(); + html += "
" + (scheduler2.config.rtl ? scheduler2.templates.agenda_time(ev.end_date, ev.start_date, ev) : scheduler2.templates.agenda_time(ev.start_date, ev.end_date, ev)) + "
"; + html += `
+ +
`; + html += "" + scheduler2.templates.agenda_text(ev.start_date, ev.end_date, ev) + "
"; } - if (eventDaysTable[currDate.valueOf()]) { - dayElement.classList.add("dhx_cal_datepicker_event"); + html += "
"; + scheduler2._els["dhx_cal_data"][0].innerHTML = html; + scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = scheduler2._agendaScrollTop || 0; + var agenda_area = scheduler2._els["dhx_cal_data"][0].childNodes[0]; + var v_border = agenda_area.childNodes[agenda_area.childNodes.length - 1]; + v_border.style.height = agenda_area.offsetHeight < scheduler2._els["dhx_cal_data"][0].offsetHeight ? "100%" : agenda_area.offsetHeight + "px"; + var t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; + var dateElement = scheduler2._getNavDateElement(); + if (dateElement) { + dateElement.innerHTML = scheduler2.templates.agenda_date(scheduler2._min_date, scheduler2._max_date, scheduler2._mode); } - dayElement.classList.add("dhx_cal_datepicker_date"); - dayGridContainer.appendChild(dayElement); - currDate = scheduler2.date.add(currDate, 1, "day"); + scheduler2._rendered = []; + for (var i = 0; i < t.length - 1; i++) + scheduler2._rendered[i] = t[i]; } - container.appendChild(dayGridContainer); - } - _renderMonthGrid(container) { - const { date } = this.getState(); - const wrapper = document.createElement("div"); - wrapper.classList.add("dhx_cal_datepicker_months"); - const months = []; - for (let i = 0; i < 12; i++) { - months.push(new Date(date.getFullYear(), i, 1)); + scheduler2.agenda_legacy_view = function(mode) { + scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_legacy_start(scheduler2._date); + scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda_legacy(scheduler2._min_date, 1); + set_full_view(mode); + if (mode) { + scheduler2._cols = null; + scheduler2._colsS = null; + scheduler2._table_view = true; + fill_agenda_tab(); + } else { + scheduler2._table_view = false; + } + }; + }); + } + function agenda_view(scheduler2) { + scheduler2.date.add_agenda = function(date, inc) { + return scheduler2.date.add(date, 1 * inc, "month"); + }; + scheduler2.templates.agenda_time = function(start, end, ev) { + if (ev._timed) { + return `${this.event_date(start)} - ${this.event_date(end)}`; + } else { + return scheduler2.locale.labels.full_day; } - const formatLabel = this.scheduler.date.date_to_str("%M"); - months.forEach((month) => { - const monthElement = document.createElement("div"); - monthElement.classList.add("dhx_cal_datepicker_month"); - if (date.getMonth() === month.getMonth()) { - monthElement.classList.add("dhx_cal_datepicker_current"); + }; + scheduler2.templates.agenda_text = function(start, end, ev) { + return ev.text; + }; + const dayDateToStr = scheduler2.date.date_to_str("%F %j"); + const dayDowToStr = scheduler2.date.date_to_str("%l"); + scheduler2.templates.agenda_day = function(date) { + return `
${dayDateToStr(date)}
+
${dayDowToStr(date)}
`; + }; + scheduler2.templates.agenda_date = function(start, end) { + return scheduler2.templates.month_date(scheduler2.getState().date); + }; + scheduler2.date.agenda_start = function(date) { + return scheduler2.date.month_start(new Date(date)); + }; + let scrollTop = 0; + scheduler2.attachEvent("onTemplatesReady", function() { + var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; + scheduler2.dblclick_dhx_cal_data = function() { + if (this._mode == "agenda") { + if (!this.config.readonly && this.config.dblclick_create) + this.addEventNow(); + } else { + if (old_dblclick_dhx_cal_data) + return old_dblclick_dhx_cal_data.apply(this, arguments); } - monthElement.setAttribute("data-month", month.getMonth()); - monthElement.innerHTML = formatLabel(month); - this._domEvents.attach(monthElement, "click", () => { - const newDate = new Date(month); - this.setState({ date: newDate, mode: "days" }); + }; + var old = scheduler2.render_data; + scheduler2.render_data = function(evs) { + if (this._mode == "agenda") + fill_agenda_tab(); + else + return old.apply(this, arguments); + }; + var old_render_view_data = scheduler2.render_view_data; + scheduler2.render_view_data = function() { + if (this._mode == "agenda") { + scrollTop = scheduler2._els["dhx_cal_data"][0].scrollTop; + scheduler2._els["dhx_cal_data"][0].scrollTop = 0; + } + return old_render_view_data.apply(this, arguments); + }; + function fill_agenda_tab() { + const events = scheduler2.get_visible_events(); + events.sort(function(a, b) { + return a.start_date > b.start_date ? 1 : -1; }); - wrapper.appendChild(monthElement); - }); - container.appendChild(wrapper); - const doneArea = document.createElement("div"); - doneArea.classList.add("dhx_cal_datepicker_done"); - const doneBtn = document.createElement("button"); - doneBtn.innerText = "Done"; - doneBtn.classList.add("dhx_cal_datepicker_done_btn"); - this._domEvents.attach(doneBtn, "click", () => { - this.setState({ mode: "days" }); - }); - doneArea.appendChild(doneBtn); - container.appendChild(doneArea); - } - _renderYearGrid(container) { - const { date } = this.getState(); - const startYear = Math.floor(date.getFullYear() / 10) * 10; - const wrapper = document.createElement("div"); - wrapper.classList.add("dhx_cal_datepicker_years"); - for (let i = startYear - 1; i <= startYear + 10; i++) { - const yearElement = document.createElement("div"); - yearElement.innerText = i; - yearElement.classList.add("dhx_cal_datepicker_year"); - yearElement.setAttribute("data-year", i); - if (date.getFullYear() === i) { - yearElement.classList.add("dhx_cal_datepicker_current"); + const eventsInDays = {}; + let currDate = scheduler2.getState().min_date; + const maxDate = scheduler2.getState().max_date; + while (currDate.valueOf() < maxDate.valueOf()) { + eventsInDays[currDate.valueOf()] = []; + currDate = scheduler2.date.add(currDate, 1, "day"); + } + let anyEvents = false; + events.forEach((ev) => { + let eventStart = scheduler2.date.day_start(new Date(ev.start_date)); + while (eventStart.valueOf() < ev.end_date.valueOf()) { + if (eventsInDays[eventStart.valueOf()]) { + eventsInDays[eventStart.valueOf()].push(ev); + anyEvents = true; + } + eventStart = scheduler2.date.day_start(scheduler2.date.add(eventStart, 1, "day")); + } + }); + if (!anyEvents) { + scheduler2._els["dhx_cal_data"][0].innerHTML = renderEmptyView(); + } else { + let html = ""; + for (let day in eventsInDays) { + html += renderDay(new Date(day * 1), eventsInDays[day]); + } + scheduler2._els["dhx_cal_data"][0].innerHTML = html; } - this._domEvents.attach(yearElement, "click", () => { - this.setState({ date: new Date(i, date.getMonth(), 1), mode: "months" }); + scheduler2._els["dhx_cal_data"][0].scrollTop = scrollTop; + let t = scheduler2._els["dhx_cal_data"][0].querySelectorAll(".dhx_cal_agenda_event_line"); + scheduler2._rendered = []; + for (var i = 0; i < t.length - 1; i++) { + scheduler2._rendered[i] = t[i]; + } + } + function renderEmptyView() { + return `
${scheduler2.locale.labels.agenda_tab}
`; + } + function renderDay(day, events) { + if (!events.length) { + return ""; + } + let html = ` +
+
${scheduler2.templates.agenda_day(day)}
+
+`; + events.forEach((calendarEvent) => { + html += renderOneEvent(day, calendarEvent); }); - wrapper.appendChild(yearElement); + html += `
`; + return html; } - container.appendChild(wrapper); - const doneArea = document.createElement("div"); - doneArea.classList.add("dhx_cal_datepicker_done"); - const doneBtn = document.createElement("button"); - doneBtn.innerText = "Done"; - doneBtn.classList.add("dhx_cal_datepicker_done_btn"); - this._domEvents.attach(doneBtn, "click", () => { - this.setState({ mode: "months" }); - }); - doneArea.appendChild(doneBtn); - container.appendChild(doneArea); - } - destructor() { - this.onStateChangeHandlers = []; - if (this.element) { - this.element.innerHTML = ""; - this.element.remove(); + function renderOneEvent(day, calendarEvent) { + const dates = scheduler2.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); + const selectedId = scheduler2.getState().select_id; + const cls = scheduler2.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); + const description = scheduler2.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); + let style = ""; + if (calendarEvent.color || calendarEvent.textColor) { + const bg = calendarEvent.color ? "--dhx-scheduler-event-background:" + calendarEvent.color + ";" : ""; + const color = calendarEvent.textColor ? "--dhx-scheduler-event-color:" + calendarEvent.textColor + ";" : ""; + style = ` style="${bg}${color}" `; + } + return `
+
+
${dates}
+
${description}
+
`; } - this._domEvents.detachAll(); - this.callEvent("onDestroy", []); - this.detachAllEvents(); - this.scheduler = null; - } + scheduler2.agenda_view = function(mode) { + if (mode) { + scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_start(scheduler2._date); + scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda(scheduler2._min_date, 1); + scheduler2._cols = null; + scheduler2._colsS = null; + scheduler2._table_view = true; + const dateHeader = scheduler2._getNavDateElement(); + dateHeader.innerHTML = scheduler2.templates.agenda_date(scheduler2._date); + fill_agenda_tab(); + } else { + scheduler2._table_view = false; + } + }; + }); } - function factoryMethod(extensionManager) { - const scheduler2 = { version: "7.0.5" }; - extend$n(scheduler2); - extend$i(scheduler2); - extend$j(scheduler2); - extend$h(scheduler2); - scheduler2.utils = utils; - scheduler2.$domHelpers = dom_helpers; - scheduler2.utils.dom = dom_helpers; - scheduler2.uid = utils.uid; - scheduler2.mixin = utils.mixin; - scheduler2.defined = utils.defined; - scheduler2.assert = assert(scheduler2); - scheduler2.copy = utils.copy; - scheduler2._createDatePicker = function(container, config) { - return new DatePicker(scheduler2, container, config); + function all_timed(scheduler2) { + scheduler2.config.all_timed = "short"; + scheduler2.config.all_timed_month = false; + var is_event_short = function(ev) { + if (!((ev.end_date - ev.start_date) / (1e3 * 60 * 60) >= 24)) { + return true; + } + if (scheduler2._drag_mode == "resize" && scheduler2._drag_id == ev.id) { + return true; + } + return false; }; - scheduler2._getFocusableNodes = dom_helpers.getFocusableNodes; - scheduler2._getClassName = dom_helpers.getClassName; - scheduler2._locate_css = dom_helpers.locateCss; - const messageApi = message(scheduler2); - scheduler2.utils.mixin(scheduler2, messageApi); - scheduler2.env = scheduler2.$env = env; - scheduler2.Promise = window.Promise; - extend$g(scheduler2); - extend$f(scheduler2); - extend$e(scheduler2); - extend$d(scheduler2); - extend$c(scheduler2); - extend$b(scheduler2); - extend$7(scheduler2); - extend$6(scheduler2); - extend$5(scheduler2); - extend$4(scheduler2); - extend$3(scheduler2); - extend$2(); - extend$1(scheduler2); - extend(scheduler2); - extend$m(scheduler2); - const i18n = i18nFactory(); - scheduler2.i18n = { addLocale: i18n.addLocale, setLocale: function(locale) { - if (typeof locale === "string") { - var localeObject = i18n.getLocale(locale); - if (!localeObject) { - localeObject = i18n.getLocale("en"); - } - scheduler2.locale = localeObject; - } else if (locale) { - if (!scheduler2.locale) { - scheduler2.locale = locale; - } else { - for (var i in locale) { - if (locale[i] && typeof locale[i] === "object") { - if (!scheduler2.locale[i]) { - scheduler2.locale[i] = {}; - } - scheduler2.mixin(scheduler2.locale[i], locale[i], true); - } else { - scheduler2.locale[i] = locale[i]; + scheduler2._safe_copy = function(event2) { + var proto = null, copy = scheduler2._copy_event(event2); + if (event2.event_pid) { + proto = scheduler2.getEvent(event2.event_pid); + } + if (proto && proto.isPrototypeOf(event2)) { + delete copy.event_length; + delete copy.event_pid; + delete copy.rec_pattern; + delete copy.rec_type; + } + return copy; + }; + var old_prerender_events_line = scheduler2._pre_render_events_line; + var old_prerender_events_table = scheduler2._pre_render_events_table; + var prerender_events = function(evs, hold) { + if (!this._table_view) { + return old_prerender_events_line.call(this, evs, hold); + } + return old_prerender_events_table.call(this, evs, hold); + }; + scheduler2._pre_render_events_line = scheduler2._pre_render_events_table = function(evs, hold) { + if (!this.config.all_timed || this._table_view && this._mode != "month" || this._mode == "month" && !this.config.all_timed_month) + return prerender_events.call(this, evs, hold); + for (var i = 0; i < evs.length; i++) { + var ev = evs[i]; + if (ev._timed) + continue; + if (this.config.all_timed == "short") { + if (!is_event_short(ev)) { + if (this._mode != "month") { + evs.splice(i--, 1); } + continue; } } - } - var labels = scheduler2.locale.labels; - labels.dhx_save_btn = labels.icon_save; - labels.dhx_cancel_btn = labels.icon_cancel; - labels.dhx_delete_btn = labels.icon_delete; - if (scheduler2.$container) { - scheduler2.get_elements(); - } - }, getLocale: i18n.getLocale }; - scheduler2.i18n.setLocale("en"); - scheduler2.ext = {}; - const activePlugins = {}; - scheduler2.plugins = function(config) { - const extensionList = getExtensionList(config, { treetimeline: ["timeline"], daytimeline: ["timeline"], outerdrag: ["legacy"] }, { legacy: 1, limit: 1, timeline: 2, daytimeline: 3, treetimeline: 3, outerdrag: 6 }); - extensionList.forEach(function(name) { - if (!activePlugins[name]) { - const plugin = extensionManager.getExtension(name); - if (plugin) { - plugin(scheduler2); - activePlugins[name] = true; - } else { - throw new Error("unknown plugin " + name); + var ce = this._safe_copy(ev); + if (!ev._virtual) { + ce._first_chunk = true; + } else { + ce._first_chunk = false; + } + ce._drag_resize = false; + ce._virtual = true; + ce.start_date = new Date(ce.start_date); + if (!isOvernightEvent(ev)) { + ce.end_date = new Date(ev.end_date); + } else { + ce.end_date = getNextDay(ce.start_date); + if (this.config.last_hour != 24) { + ce.end_date = setDateTime(ce.start_date, this.config.last_hour); } } - }); - }; - function getExtensionList(config, dependencies, priorities) { - const result = []; - for (const i in config) { - if (config[i]) { - const extension = i.toLowerCase(); - if (dependencies[extension]) { - dependencies[extension].forEach(function(dep) { - const dependencyName = dep.toLowerCase(); - if (!config[dependencyName]) { - result.push(dependencyName); - } - }); + var event_changed = false; + if (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) { + evs[i] = ce; + event_changed = true; + } + var re = this._safe_copy(ev); + re._virtual = true; + re.end_date = new Date(re.end_date); + if (re.start_date < this._min_date) + re.start_date = setDateTime(this._min_date, this.config.first_hour); + else + re.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour); + if (re.start_date < this._max_date && re.start_date < re.end_date) { + if (event_changed) { + evs.splice(i + 1, 0, re); + } else { + evs[i--] = re; + continue; } - result.push(extension); - } - } - result.sort(function(a, b) { - const orderA = priorities[a] || 0; - const orderB = priorities[b] || 0; - if (orderA > orderB) { - return 1; - } else if (orderA < orderB) { - return -1; + re._last_chunk = false; } else { - return 0; + ce._last_chunk = true; + ce._drag_resize = true; } - }); - return result; - } - return scheduler2; - } - class ExtensionsManager { - constructor(config) { - this._extensions = {}; - for (const i in config) { - this._extensions[i] = config[i]; - } - } - addExtension(name, ext) { - this._extensions[name] = ext; - } - getExtension(name) { - return this._extensions[name]; - } - } - dhtmlxHook(); - class SchedulerFactory { - constructor(extensions) { - this._seed = 0; - this._schedulerPlugins = []; - this._bundledExtensions = extensions; - this._extensionsManager = new ExtensionsManager(extensions); - } - plugin(code) { - this._schedulerPlugins.push(code); - if (global$1.scheduler) { - code(global$1.scheduler); } - } - getSchedulerInstance(initConfig) { - var scheduler2 = factoryMethod(this._extensionsManager); - for (var i = 0; i < this._schedulerPlugins.length; i++) { - this._schedulerPlugins[i](scheduler2); + var redraw = this._drag_mode == "move" ? false : hold; + return prerender_events.call(this, evs, redraw); + function isOvernightEvent(ev2) { + var next_day = getNextDay(ev2.start_date); + return +ev2.end_date > +next_day; } - scheduler2._internal_id = this._seed++; - if (this.$syncFactory) { - this.$syncFactory(scheduler2); + function getNextDay(date) { + var next_day = scheduler2.date.add(date, 1, "day"); + next_day = scheduler2.date.date_part(next_day); + return next_day; } - if (initConfig) { - this._initFromConfig(scheduler2, initConfig); + function setDateTime(date, hours) { + var val = scheduler2.date.date_part(new Date(date)); + val.setHours(hours); + return val; } - return scheduler2; - } - _initFromConfig(scheduler2, initConfig) { - if (initConfig.plugins) { - scheduler2.plugins(initConfig.plugins); + }; + var old_get_visible_events = scheduler2.get_visible_events; + scheduler2.get_visible_events = function(only_timed) { + if (!(this.config.all_timed && this.config.multi_day)) + return old_get_visible_events.call(this, only_timed); + return old_get_visible_events.call(this, false); + }; + scheduler2.attachEvent("onBeforeViewChange", function(old_mode, old_date, mode, date) { + scheduler2._allow_dnd = mode == "day" || mode == "week" || scheduler2.getView(mode); + return true; + }); + scheduler2._is_main_area_event = function(ev) { + return !!(ev._timed || this.config.all_timed === true || this.config.all_timed == "short" && is_event_short(ev)); + }; + var oldUpdate = scheduler2.updateEvent; + scheduler2.updateEvent = function(id2) { + var ev = scheduler2.getEvent(id2); + var fullRedrawNeeded; + var initial; + if (ev) { + fullRedrawNeeded = scheduler2.config.all_timed && !(scheduler2.isOneDayEvent(scheduler2._events[id2]) || scheduler2.getState().drag_id); + if (fullRedrawNeeded) { + initial = scheduler2.config.update_render; + scheduler2.config.update_render = true; + } } - if (initConfig.config) { - scheduler2.mixin(scheduler2.config, initConfig.config, true); + oldUpdate.apply(scheduler2, arguments); + if (ev) { + if (fullRedrawNeeded) { + scheduler2.config.update_render = initial; + } } - if (initConfig.templates) { - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.mixin(scheduler2.templates, initConfig.templates, true); - }, { once: true }); + }; + } + function collision(scheduler2) { + var temp_section; + var before; + scheduler2.config.collision_limit = 1; + function _setTempSection(event_id) { + var checked_mode = scheduler2._get_section_view(); + if (checked_mode && event_id) { + temp_section = scheduler2.getEvent(event_id)[scheduler2._get_section_property()]; } - if (initConfig.events) { - for (const event2 in initConfig.events) { - scheduler2.attachEvent(event2, initConfig.events[event2]); - } + } + scheduler2.attachEvent("onBeforeDrag", function(id2) { + _setTempSection(id2); + return true; + }); + scheduler2.attachEvent("onBeforeLightbox", function(id2) { + var ev = scheduler2.getEvent(id2); + before = [ev.start_date, ev.end_date]; + _setTempSection(id2); + return true; + }); + scheduler2.attachEvent("onEventChanged", function(id2) { + if (!id2 || !scheduler2.getEvent(id2)) + return true; + var ev = scheduler2.getEvent(id2); + if (!scheduler2.checkCollision(ev)) { + if (!before) + return false; + ev.start_date = before[0]; + ev.end_date = before[1]; + ev._timed = this.isOneDayEvent(ev); } - if (initConfig.locale) { - scheduler2.i18n.setLocale(initConfig.locale); + return true; + }); + scheduler2.attachEvent("onBeforeEventChanged", function(ev, e, is_new) { + return scheduler2.checkCollision(ev); + }); + scheduler2.attachEvent("onEventAdded", function(id2, ev) { + var result = scheduler2.checkCollision(ev); + if (!result) + scheduler2.deleteEvent(id2); + }); + scheduler2.attachEvent("onEventSave", function(id2, edited_ev, is_new) { + edited_ev = scheduler2._lame_clone(edited_ev); + edited_ev.id = id2; + if (!(edited_ev.start_date && edited_ev.end_date)) { + var ev = scheduler2.getEvent(id2); + edited_ev.start_date = new Date(ev.start_date); + edited_ev.end_date = new Date(ev.end_date); } - if (Array.isArray(initConfig.calendars)) { - initConfig.calendars.forEach(function(calendar) { - scheduler2.addCalendar(calendar); - }); + if (edited_ev.rec_type) { + scheduler2._roll_back_dates(edited_ev); } - if (initConfig.container) { - scheduler2.init(initConfig.container); + return scheduler2.checkCollision(edited_ev); + }); + scheduler2._check_sections_collision = function(first, second) { + var map_to = scheduler2._get_section_property(); + if (first[map_to] == second[map_to] && first.id != second.id) + return true; + return false; + }; + scheduler2.checkCollision = function(ev) { + var evs = []; + var collision_limit = scheduler2.config.collision_limit; + if (ev.rec_type) { + var evs_dates = scheduler2.getRecDates(ev); + for (var k = 0; k < evs_dates.length; k++) { + var tevs = scheduler2.getEvents(evs_dates[k].start_date, evs_dates[k].end_date); + for (var j = 0; j < tevs.length; j++) { + if ((tevs[j].event_pid || tevs[j].id) != ev.id) + evs.push(tevs[j]); + } + } } else { - scheduler2.init(); - } - if (initConfig.data) { - if (typeof initConfig.data === "string") { - scheduler2.load(initConfig.data); - } else { - scheduler2.parse(initConfig.data); + evs = scheduler2.getEvents(ev.start_date, ev.end_date); + for (var i = 0; i < evs.length; i++) { + var concurrent = evs[i]; + if (concurrent.id == ev.id || concurrent.event_length && [concurrent.event_pid, concurrent.event_length].join("#") == ev.id) { + evs.splice(i, 1); + break; + } } } - } - } - function active_links(scheduler2) { - scheduler2.config.active_link_view = "day"; - scheduler2._active_link_click = function(e) { - var start = e.target; - var to = start.getAttribute("data-link-date"); - var s_d = scheduler2.date.str_to_date(scheduler2.config.api_date, false, true); - if (to) { - scheduler2.setCurrentView(s_d(to), scheduler2.config.active_link_view); - if (e && e.preventDefault) - e.preventDefault(); - return false; + var checked_mode = scheduler2._get_section_view(); + var map_to = scheduler2._get_section_property(); + var single = true; + if (checked_mode) { + var count = 0; + for (var i = 0; i < evs.length; i++) { + if (evs[i].id != ev.id && this._check_sections_collision(evs[i], ev)) + count++; + } + if (count >= collision_limit) { + single = false; + } + } else { + if (evs.length >= collision_limit) + single = false; } - }; - scheduler2.attachEvent("onTemplatesReady", function() { - var do_wrapper = function(key2, fullname) { - fullname = fullname || key2 + "_scale_date"; - if (!scheduler2.templates["_active_links_old_" + fullname]) { - scheduler2.templates["_active_links_old_" + fullname] = scheduler2.templates[fullname]; + if (!single) { + var res = !scheduler2.callEvent("onEventCollision", [ev, evs]); + if (!res) { + ev[map_to] = temp_section || ev[map_to]; } - var week_x = scheduler2.templates["_active_links_old_" + fullname]; - var d_s = scheduler2.date.date_to_str(scheduler2.config.api_date); - scheduler2.templates[fullname] = function(date) { - return "" + week_x(date) + ""; - }; - }; - do_wrapper("week"); - do_wrapper("", "month_day"); - if (this.matrix) { - for (var key in this.matrix) - do_wrapper(key); + return res; } - this._detachDomEvent(this._obj, "click", scheduler2._active_link_click); - scheduler2.event(this._obj, "click", scheduler2._active_link_click); - }); - } - function agenda_legacy(scheduler2) { - scheduler2.date.add_agenda_legacy = function(date) { - return scheduler2.date.add(date, 1, "year"); + return single; }; - scheduler2.templates.agenda_legacy_time = function(start, end, ev) { - if (ev._timed) - return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); + } + function container_autoresize(scheduler2) { + scheduler2.config.container_autoresize = true; + scheduler2.config.month_day_min_height = 90; + scheduler2.config.min_grid_size = 25; + scheduler2.config.min_map_size = 400; + var old_pre_render_event = scheduler2._pre_render_events; + var active = true; + var total_height = 0; + var multiday_height = 0; + scheduler2._pre_render_events = function(evs, hold) { + if (!(scheduler2.config.container_autoresize && active)) { + return old_pre_render_event.apply(this, arguments); + } + var hb = this.xy.bar_height; + var h_old = this._colsS.heights; + var h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0]; + var data = this._els["dhx_cal_data"][0]; + if (!this._table_view) + evs = this._pre_render_events_line(evs, hold); else - return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); - }; - scheduler2.templates.agenda_legacy_text = function(start, end, event2) { - return event2.text; - }; - scheduler2.templates.agenda_legacy_date = function() { - return ""; - }; - scheduler2.date.agenda_legacy_start = function() { - return scheduler2.date.date_part(scheduler2._currentDate()); - }; - scheduler2.attachEvent("onTemplatesReady", function() { - var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; - scheduler2.dblclick_dhx_cal_data = function() { - if (this._mode == "agenda_legacy") { - if (!this.config.readonly && this.config.dblclick_create) - this.addEventNow(); + evs = this._pre_render_events_table(evs, hold); + if (this._table_view) { + if (hold) { + this._colsS.heights = h_old; } else { - if (old_dblclick_dhx_cal_data) - return old_dblclick_dhx_cal_data.apply(this, arguments); - } - }; - var old = scheduler2.render_data; - scheduler2.render_data = function(evs) { - if (this._mode == "agenda_legacy") - fill_agenda_tab(); - else - return old.apply(this, arguments); - }; - var old_render_view_data = scheduler2.render_view_data; - scheduler2.render_view_data = function() { - if (this._mode == "agenda_legacy") { - scheduler2._agendaScrollTop = scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop; - scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0; - } - return old_render_view_data.apply(this, arguments); - }; - function set_full_view(mode) { - if (mode) { - var l = scheduler2.locale.labels; - var rowAttr = scheduler2._waiAria.agendaHeadAttrString(); - var dateHeader = scheduler2._waiAria.agendaHeadDateString(l.date); - var descriptionHeader = scheduler2._waiAria.agendaHeadDescriptionString(l.description); - scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; - scheduler2._table_view = true; - scheduler2.set_sizes(); + var evl = data.firstChild; + const rows = evl.querySelectorAll(".dhx_cal_month_row"); + if (rows) { + for (var i = 0; i < rows.length; i++) { + h[i]++; + if (h[i] * hb > this._colsS.height - this.xy.month_head_height) { + var cells = rows[i].querySelectorAll(".dhx_cal_month_cell"); + var cHeight = this._colsS.height - this.xy.month_head_height; + if (this.config.max_month_events * 1 !== this.config.max_month_events || h[i] <= this.config.max_month_events) { + cHeight = h[i] * hb; + } else if ((this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height) { + cHeight = (this.config.max_month_events + 1) * hb; + } + rows[i].style.height = cHeight + this.xy.month_head_height + "px"; + for (var j = 0; j < cells.length; j++) { + cells[j].childNodes[1].style.height = cHeight + "px"; + } + h[i] = (h[i - 1] || 0) + cells[0].offsetHeight; + } + h[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight; + } + h.unshift(0); + if (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) + ; + } else { + if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible") + h[0] = -1; + if (evs.length || h[0] == -1) { + var dh = (h[0] + 1) * hb + 1; + if (multiday_height != dh + 1) { + this._obj.style.height = total_height - multiday_height + dh - 1 + "px"; + } + dh += "px"; + const navHeight = this._els["dhx_cal_navline"][0].offsetHeight; + const headerHeight = this._els["dhx_cal_header"][0].offsetHeight; + data.style.height = this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0) + "px"; + var last = this._els["dhx_multi_day"][0]; + last.style.height = dh; + last.style.visibility = h[0] == -1 ? "hidden" : "visible"; + last = this._els["dhx_multi_day"][1]; + last.style.height = dh; + last.style.visibility = h[0] == -1 ? "hidden" : "visible"; + if (last.style.visibility == "hidden") { + last.style.display = "none"; + } else { + last.style.display = ""; + } + last.className = h[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small"; + this._dy_shift = (h[0] + 1) * hb; + h[0] = 0; + } + } } } - function fill_agenda_tab() { - var events = scheduler2.get_visible_events(); - events.sort(function(a, b) { - return a.start_date > b.start_date ? 1 : -1; - }); - var tableAttr = scheduler2._waiAria.agendaDataAttrString(); - var agendaEventAttrString; - var html = "
"; - for (var i = 0; i < events.length; i++) { - var ev = events[i]; - var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; - var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; - var ev_class = scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); - agendaEventAttrString = scheduler2._waiAria.agendaEventAttrString(ev); - var agendaDetailsButtonAttr = scheduler2._waiAria.agendaDetailsBtnString(); - html += "
" + (scheduler2.config.rtl ? scheduler2.templates.agenda_time(ev.end_date, ev.start_date, ev) : scheduler2.templates.agenda_time(ev.start_date, ev.end_date, ev)) + "
"; - html += `
- -
`; - html += "" + scheduler2.templates.agenda_text(ev.start_date, ev.end_date, ev) + "
"; - } - html += "
"; - scheduler2._els["dhx_cal_data"][0].innerHTML = html; - scheduler2._els["dhx_cal_data"][0].childNodes[0].scrollTop = scheduler2._agendaScrollTop || 0; - var agenda_area = scheduler2._els["dhx_cal_data"][0].childNodes[0]; - var v_border = agenda_area.childNodes[agenda_area.childNodes.length - 1]; - v_border.style.height = agenda_area.offsetHeight < scheduler2._els["dhx_cal_data"][0].offsetHeight ? "100%" : agenda_area.offsetHeight + "px"; - var t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; - var dateElement = scheduler2._getNavDateElement(); - if (dateElement) { - dateElement.innerHTML = scheduler2.templates.agenda_date(scheduler2._min_date, scheduler2._max_date, scheduler2._mode); + return evs; + }; + var checked_divs = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"]; + var updateContainterHeight = function(is_repaint) { + total_height = 0; + for (var i = 0; i < checked_divs.length; i++) { + var className = checked_divs[i]; + var checked_div = scheduler2._els[className] ? scheduler2._els[className][0] : null; + var height = 0; + switch (className) { + case "dhx_cal_navline": + case "dhx_cal_header": + height = checked_div.offsetHeight; + break; + case "dhx_multi_day": + height = checked_div ? checked_div.offsetHeight - 1 : 0; + multiday_height = height; + break; + case "dhx_cal_data": + var mode = scheduler2.getState().mode; + if (checked_div.childNodes[1] && mode != "month") { + let maxHeight = 0; + for (let i2 = 0; i2 < checked_div.childNodes.length; i2++) { + if (checked_div.childNodes[i2].offsetHeight > maxHeight) { + maxHeight = checked_div.childNodes[i2].offsetHeight; + } + } + height = maxHeight; + } else { + height = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight); + } + if (mode == "month") { + if (scheduler2.config.month_day_min_height && !is_repaint) { + var rows_length = checked_div.querySelectorAll(".dhx_cal_month_row").length; + height = rows_length * scheduler2.config.month_day_min_height; + } + if (is_repaint) { + checked_div.style.height = height + "px"; + } + } else if (mode == "year") { + height = 190 * scheduler2.config.year_y; + } else if (mode == "agenda") { + height = 0; + if (checked_div.childNodes && checked_div.childNodes.length) { + for (var j = 0; j < checked_div.childNodes.length; j++) { + height += checked_div.childNodes[j].offsetHeight; + } + } + if (height + 2 < scheduler2.config.min_grid_size) { + height = scheduler2.config.min_grid_size; + } else { + height += 2; + } + } else if (mode == "week_agenda") { + var min_height = scheduler2.xy.week_agenda_scale_height + scheduler2.config.min_grid_size, cur_height; + var column; + for (var k = 0; k < checked_div.childNodes.length; k++) { + column = checked_div.childNodes[k]; + for (var j = 0; j < column.childNodes.length; j++) { + var innerHeight = 0, eventsContainer = column.childNodes[j].childNodes[1]; + for (var g = 0; g < eventsContainer.childNodes.length; g++) { + innerHeight += eventsContainer.childNodes[g].offsetHeight; + } + cur_height = innerHeight + scheduler2.xy.week_agenda_scale_height; + cur_height = k == 1 && (j == 2 || j == 3) ? cur_height * 2 : cur_height; + if (cur_height > min_height) { + min_height = cur_height; + } + } + } + height = min_height * 3; + } else if (mode == "map") { + height = 0; + var evs = checked_div.querySelectorAll(".dhx_map_line"); + for (var j = 0; j < evs.length; j++) { + height += evs[j].offsetHeight; + } + if (height + 2 < scheduler2.config.min_map_size) { + height = scheduler2.config.min_map_size; + } else { + height += 2; + } + } else if (scheduler2._gridView) { + height = 0; + if (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) { + var evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes; + for (var j = 0; j < evs.length; j++) { + height += evs[j].offsetHeight; + } + height += 2; + if (height < scheduler2.config.min_grid_size) { + height = scheduler2.config.min_grid_size; + } + } else { + height = scheduler2.config.min_grid_size; + } + } + if (scheduler2.matrix && scheduler2.matrix[mode]) { + if (is_repaint) { + height += 0; + checked_div.style.height = height + "px"; + } else { + height = 0; + var cfg = scheduler2.matrix[mode]; + var rows = cfg.y_unit; + for (var r = 0; r < rows.length; r++) { + height += cfg.getSectionHeight(rows[r].key); + } + if (scheduler2.$container.clientWidth != scheduler2.$container.scrollWidth) { + height += getScrollSize(); + } + } + height -= 1; + } + if (mode == "day" || mode == "week" || scheduler2._props && scheduler2._props[mode]) { + height += 2; + } + break; } - scheduler2._rendered = []; - for (var i = 0; i < t.length - 1; i++) - scheduler2._rendered[i] = t[i]; + height += 1; + total_height += height; } - scheduler2.agenda_legacy_view = function(mode) { - scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_legacy_start(scheduler2._date); - scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda_legacy(scheduler2._min_date, 1); - set_full_view(mode); - if (mode) { - scheduler2._cols = null; - scheduler2._colsS = null; - scheduler2._table_view = true; - fill_agenda_tab(); - } else { - scheduler2._table_view = false; - } - }; - }); - } - function agenda_view(scheduler2) { - scheduler2.date.add_agenda = function(date, inc) { - return scheduler2.date.add(date, 1 * inc, "month"); + scheduler2._obj.style.height = total_height + "px"; + if (!is_repaint) + scheduler2.updateView(); }; - scheduler2.templates.agenda_time = function(start, end, ev) { - if (ev._timed) { - return `${this.event_date(start)} - ${this.event_date(end)}`; - } else { - return scheduler2.locale.labels.full_day; + function callUpdate() { + active = false; + scheduler2.callEvent("onAfterSchedulerResize", []); + active = true; + } + var conditionalUpdateContainerHeight = function() { + if (!(scheduler2.config.container_autoresize && active)) + return true; + var mode = scheduler2.getState().mode; + if (!mode) { + return true; } - }; - scheduler2.templates.agenda_text = function(start, end, ev) { - return ev.text; - }; - const dayDateToStr = scheduler2.date.date_to_str("%F %j"); - const dayDowToStr = scheduler2.date.date_to_str("%l"); - scheduler2.templates.agenda_day = function(date) { - return `
${dayDateToStr(date)}
-
${dayDowToStr(date)}
`; - }; - scheduler2.templates.agenda_date = function(start, end) { - return scheduler2.templates.month_date(scheduler2.getState().date); - }; - scheduler2.date.agenda_start = function(date) { - return scheduler2.date.month_start(new Date(date)); - }; - let scrollTop = 0; - scheduler2.attachEvent("onTemplatesReady", function() { - var old_dblclick_dhx_cal_data = scheduler2.dblclick_dhx_cal_data; - scheduler2.dblclick_dhx_cal_data = function() { - if (this._mode == "agenda") { - if (!this.config.readonly && this.config.dblclick_create) - this.addEventNow(); - } else { - if (old_dblclick_dhx_cal_data) - return old_dblclick_dhx_cal_data.apply(this, arguments); - } - }; - var old = scheduler2.render_data; - scheduler2.render_data = function(evs) { - if (this._mode == "agenda") - fill_agenda_tab(); - else - return old.apply(this, arguments); - }; - var old_render_view_data = scheduler2.render_view_data; - scheduler2.render_view_data = function() { - if (this._mode == "agenda") { - scrollTop = scheduler2._els["dhx_cal_data"][0].scrollTop; - scheduler2._els["dhx_cal_data"][0].scrollTop = 0; - } - return old_render_view_data.apply(this, arguments); - }; - function fill_agenda_tab() { - const events = scheduler2.get_visible_events(); - events.sort(function(a, b) { - return a.start_date > b.start_date ? 1 : -1; - }); - const eventsInDays = {}; - let currDate = scheduler2.getState().min_date; - const maxDate = scheduler2.getState().max_date; - while (currDate.valueOf() < maxDate.valueOf()) { - eventsInDays[currDate.valueOf()] = []; - currDate = scheduler2.date.add(currDate, 1, "day"); + var asyncRepaint = window.requestAnimationFrame || window.setTimeout; + var scrollTop = document.documentElement.scrollTop; + asyncRepaint(function() { + if (scheduler2.$destroyed || !scheduler2.$initialized) { + return; } - let anyEvents = false; - events.forEach((ev) => { - let eventStart = scheduler2.date.day_start(new Date(ev.start_date)); - while (eventStart.valueOf() < ev.end_date.valueOf()) { - if (eventsInDays[eventStart.valueOf()]) { - eventsInDays[eventStart.valueOf()].push(ev); - anyEvents = true; - } - eventStart = scheduler2.date.day_start(scheduler2.date.add(eventStart, 1, "day")); - } - }); - if (!anyEvents) { - scheduler2._els["dhx_cal_data"][0].innerHTML = renderEmptyView(); - } else { - let html = ""; - for (let day in eventsInDays) { - html += renderDay(new Date(day * 1), eventsInDays[day]); + updateContainterHeight(); + }); + if (scheduler2.matrix && scheduler2.matrix[mode] || mode == "month") { + asyncRepaint(function() { + if (scheduler2.$destroyed || !scheduler2.$initialized) { + return; } - scheduler2._els["dhx_cal_data"][0].innerHTML = html; - } - scheduler2._els["dhx_cal_data"][0].scrollTop = scrollTop; - let t = scheduler2._els["dhx_cal_data"][0].querySelectorAll(".dhx_cal_agenda_event_line"); - scheduler2._rendered = []; - for (var i = 0; i < t.length - 1; i++) { - scheduler2._rendered[i] = t[i]; - } - } - function renderEmptyView() { - return `
${scheduler2.locale.labels.agenda_tab}
`; + updateContainterHeight(true); + document.documentElement.scrollTop = scrollTop; + callUpdate(); + }, 1); + } else { + callUpdate(); } - function renderDay(day, events) { - if (!events.length) { - return ""; - } - let html = ` -
-
${scheduler2.templates.agenda_day(day)}
-
-`; - events.forEach((calendarEvent) => { - html += renderOneEvent(day, calendarEvent); - }); - html += `
`; - return html; + }; + scheduler2.attachEvent("onBeforeViewChange", function() { + var autosizeEnabled = scheduler2.config.container_autoresize; + if (!scheduler2.xy.$original_scroll_width) { + scheduler2.xy.$original_scroll_width = scheduler2.xy.scroll_width; } - function renderOneEvent(day, calendarEvent) { - const dates = scheduler2.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); - const selectedId = scheduler2.getState().select_id; - const cls = scheduler2.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); - const description = scheduler2.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent); - let style = ""; - if (calendarEvent.color || calendarEvent.textColor) { - const bg = calendarEvent.color ? "--dhx-scheduler-event-background:" + calendarEvent.color + ";" : ""; - const color = calendarEvent.textColor ? "--dhx-scheduler-event-color:" + calendarEvent.textColor + ";" : ""; - style = ` style="${bg}${color}" `; + scheduler2.xy.scroll_width = autosizeEnabled ? 0 : scheduler2.xy.$original_scroll_width; + if (scheduler2.matrix) { + for (var i in scheduler2.matrix) { + var timeline = scheduler2.matrix[i]; + if (!timeline.$original_section_autoheight) { + timeline.$original_section_autoheight = timeline.section_autoheight; + } + if (autosizeEnabled) { + timeline.section_autoheight = false; + } else { + timeline.section_autoheight = timeline.$original_section_autoheight; + } } - return `
-
-
${dates}
-
${description}
-
`; } - scheduler2.agenda_view = function(mode) { - if (mode) { - scheduler2._min_date = scheduler2.config.agenda_start || scheduler2.date.agenda_start(scheduler2._date); - scheduler2._max_date = scheduler2.config.agenda_end || scheduler2.date.add_agenda(scheduler2._min_date, 1); - scheduler2._cols = null; - scheduler2._colsS = null; - scheduler2._table_view = true; - const dateHeader = scheduler2._getNavDateElement(); - dateHeader.innerHTML = scheduler2.templates.agenda_date(scheduler2._date); - fill_agenda_tab(); - } else { - scheduler2._table_view = false; + return true; + }); + scheduler2.attachEvent("onViewChange", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onXLE", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventChanged", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventCreated", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventAdded", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onEventDeleted", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onAfterSchedulerResize", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onClearAll", conditionalUpdateContainerHeight); + scheduler2.attachEvent("onBeforeExpand", function() { + active = false; + return true; + }); + scheduler2.attachEvent("onBeforeCollapse", function() { + active = true; + return true; + }); + function getScrollSize() { + var div = document.createElement("div"); + div.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;"; + document.body.appendChild(div); + var size = div.offsetWidth - div.clientWidth; + document.body.removeChild(div); + return size; + } + } + function cookie(scheduler2) { + function setCookie(name, cookie_param, value) { + var str = name + "=" + value + (cookie_param ? "; " + cookie_param : ""); + document.cookie = str; + } + function getCookie(name) { + var search = name + "="; + if (document.cookie.length > 0) { + var offset = document.cookie.indexOf(search); + if (offset != -1) { + offset += search.length; + var end = document.cookie.indexOf(";", offset); + if (end == -1) + end = document.cookie.length; + return document.cookie.substring(offset, end); } - }; - }); - } - function all_timed(scheduler2) { - scheduler2.config.all_timed = "short"; - scheduler2.config.all_timed_month = false; - var is_event_short = function(ev) { - if (!((ev.end_date - ev.start_date) / (1e3 * 60 * 60) >= 24)) { - return true; } - if (scheduler2._drag_mode == "resize" && scheduler2._drag_id == ev.id) { - return true; - } - return false; - }; - scheduler2._safe_copy = function(event2) { - var proto = null, copy = scheduler2._copy_event(event2); - if (event2.event_pid) { - proto = scheduler2.getEvent(event2.event_pid); + return ""; + } + function getCookieName(scheduler3) { + return (scheduler3._obj.id || "scheduler") + "_settings"; + } + var first = true; + scheduler2.attachEvent("onBeforeViewChange", function(oldMode, oldDate, mode, date) { + if (first && scheduler2._get_url_nav) { + var urlNavigationPlugin = scheduler2._get_url_nav(); + if (urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event) { + first = false; + } } - if (proto && proto.isPrototypeOf(event2)) { - delete copy.event_length; - delete copy.event_pid; - delete copy.rec_pattern; - delete copy.rec_type; + var cookie2 = getCookieName(scheduler2); + if (first) { + first = false; + var schedulerCookie = getCookie(cookie2); + if (schedulerCookie) { + if (!scheduler2._min_date) { + scheduler2._min_date = date; + } + schedulerCookie = unescape(schedulerCookie).split("@"); + schedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]); + var view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode, date = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date; + window.setTimeout(function() { + if (scheduler2.$destroyed) { + return; + } + scheduler2.setCurrentView(date, view); + }, 1); + return false; + } } - return copy; - }; - var old_prerender_events_line = scheduler2._pre_render_events_line; - var old_prerender_events_table = scheduler2._pre_render_events_table; - var prerender_events = function(evs, hold) { - if (!this._table_view) { - return old_prerender_events_line.call(this, evs, hold); + return true; + }); + scheduler2.attachEvent("onViewChange", function(newMode, newDate) { + var cookie2 = getCookieName(scheduler2); + var text = escape(this._helpers.formatDate(newDate) + "@" + newMode); + setCookie(cookie2, "expires=Sun, 31 Jan 9999 22:00:00 GMT", text); + }); + var old_load = scheduler2._load; + scheduler2._load = function() { + var args = arguments; + if (!scheduler2._date) { + var that = this; + window.setTimeout(function() { + old_load.apply(that, args); + }, 1); + } else { + old_load.apply(this, args); } - return old_prerender_events_table.call(this, evs, hold); }; - scheduler2._pre_render_events_line = scheduler2._pre_render_events_table = function(evs, hold) { - if (!this.config.all_timed || this._table_view && this._mode != "month" || this._mode == "month" && !this.config.all_timed_month) - return prerender_events.call(this, evs, hold); - for (var i = 0; i < evs.length; i++) { - var ev = evs[i]; - if (ev._timed) - continue; - if (this.config.all_timed == "short") { - if (!is_event_short(ev)) { - if (this._mode != "month") { - evs.splice(i--, 1); + } + const notImplemented = { alert: (extension, assert2) => { + assert2(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
+ You may need a Professional version of the component.
+ Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`); + } }; + function daytimeline_restricted(scheduler2) { + notImplemented.alert("Day Timeline", scheduler2.assert); + } + function drag_between_restricted(scheduler2) { + notImplemented.alert("Drag Between", scheduler2.assert); + } + function editors(scheduler2) { + scheduler2.form_blocks["combo"] = { render: function(sns) { + if (!sns.cached_options) + sns.cached_options = {}; + var res = ""; + res += "
"; + return res; + }, set_value: function(node, value, ev, config) { + (function() { + resetCombo(); + var id2 = scheduler2.attachEvent("onAfterLightbox", function() { + resetCombo(); + scheduler2.detachEvent(id2); + }); + function resetCombo() { + if (node._combo && node._combo.DOMParent) { + var combo2 = node._combo; + if (combo2.unload) { + combo2.unload(); + } else if (combo2.destructor) { + combo2.destructor(); } - continue; + combo2.DOMParent = combo2.DOMelem = null; } } - var ce = this._safe_copy(ev); - if (!ev._virtual) { - ce._first_chunk = true; - } else { - ce._first_chunk = false; - } - ce._drag_resize = false; - ce._virtual = true; - ce.start_date = new Date(ce.start_date); - if (!isOvernightEvent(ev)) { - ce.end_date = new Date(ev.end_date); - } else { - ce.end_date = getNextDay(ce.start_date); - if (this.config.last_hour != 24) { - ce.end_date = setDateTime(ce.start_date, this.config.last_hour); - } + })(); + window.dhx_globalImgPath = config.image_path || "/"; + node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth - 8); + if (config.onchange) + node._combo.attachEvent("onChange", config.onchange); + if (config.options_height) + node._combo.setOptionHeight(config.options_height); + var combo = node._combo; + combo.enableFilteringMode(config.filtering, config.script_path || null, !!config.cache); + if (!config.script_path) { + var all_options = []; + for (var i = 0; i < config.options.length; i++) { + var option = config.options[i]; + var single_option = [option.key, option.label, option.css]; + all_options.push(single_option); } - var event_changed = false; - if (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) { - evs[i] = ce; - event_changed = true; + combo.addOption(all_options); + if (ev[config.map_to]) { + var index = combo.getIndexByValue(ev[config.map_to]); + combo.selectOption(index); } - var re = this._safe_copy(ev); - re._virtual = true; - re.end_date = new Date(re.end_date); - if (re.start_date < this._min_date) - re.start_date = setDateTime(this._min_date, this.config.first_hour); - else - re.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour); - if (re.start_date < this._max_date && re.start_date < re.end_date) { - if (event_changed) { - evs.splice(i + 1, 0, re); + } else { + var selected_id = ev[config.map_to]; + if (selected_id) { + if (config.cached_options[selected_id]) { + combo.addOption(selected_id, config.cached_options[selected_id]); + combo.disable(1); + combo.selectOption(0); + combo.disable(0); } else { - evs[i--] = re; - continue; + scheduler2.ajax.get(config.script_path + "?id=" + selected_id + "&uid=" + scheduler2.uid(), function(result) { + var responseText = result.xmlDoc.responseText; + var label; + try { + var res = JSON.parse(responseText); + label = res.options[0].text; + } catch (e) { + var option2 = scheduler2.ajax.xpath("//option", result.xmlDoc)[0]; + label = option2.childNodes[0].nodeValue; + } + config.cached_options[selected_id] = label; + combo.addOption(selected_id, label); + combo.disable(1); + combo.selectOption(0); + combo.disable(0); + }); } - re._last_chunk = false; } else { - ce._last_chunk = true; - ce._drag_resize = true; - } - } - var redraw = this._drag_mode == "move" ? false : hold; - return prerender_events.call(this, evs, redraw); - function isOvernightEvent(ev2) { - var next_day = getNextDay(ev2.start_date); - return +ev2.end_date > +next_day; - } - function getNextDay(date) { - var next_day = scheduler2.date.add(date, 1, "day"); - next_day = scheduler2.date.date_part(next_day); - return next_day; - } - function setDateTime(date, hours) { - var val = scheduler2.date.date_part(new Date(date)); - val.setHours(hours); - return val; - } - }; - var old_get_visible_events = scheduler2.get_visible_events; - scheduler2.get_visible_events = function(only_timed) { - if (!(this.config.all_timed && this.config.multi_day)) - return old_get_visible_events.call(this, only_timed); - return old_get_visible_events.call(this, false); - }; - scheduler2.attachEvent("onBeforeViewChange", function(old_mode, old_date, mode, date) { - scheduler2._allow_dnd = mode == "day" || mode == "week" || scheduler2.getView(mode); - return true; - }); - scheduler2._is_main_area_event = function(ev) { - return !!(ev._timed || this.config.all_timed === true || this.config.all_timed == "short" && is_event_short(ev)); - }; - var oldUpdate = scheduler2.updateEvent; - scheduler2.updateEvent = function(id2) { - var ev = scheduler2.getEvent(id2); - var fullRedrawNeeded; - var initial; - if (ev) { - fullRedrawNeeded = scheduler2.config.all_timed && !(scheduler2.isOneDayEvent(scheduler2._events[id2]) || scheduler2.getState().drag_id); - if (fullRedrawNeeded) { - initial = scheduler2.config.update_render; - scheduler2.config.update_render = true; + combo.setComboValue(""); } } - oldUpdate.apply(scheduler2, arguments); - if (ev) { - if (fullRedrawNeeded) { - scheduler2.config.update_render = initial; - } + }, get_value: function(node, ev, config) { + var selected_id = node._combo.getSelectedValue(); + if (config.script_path) { + config.cached_options[selected_id] = node._combo.getSelectedText(); } - }; - } - function collision(scheduler2) { - var temp_section; - var before; - scheduler2.config.collision_limit = 1; - function _setTempSection(event_id) { - var checked_mode = scheduler2._get_section_view(); - if (checked_mode && event_id) { - temp_section = scheduler2.getEvent(event_id)[scheduler2._get_section_property()]; + return selected_id; + }, focus: function(node) { + } }; + scheduler2.form_blocks["radio"] = { render: function(sns) { + var res = ""; + res += `
`; + for (var i = 0; i < sns.options.length; i++) { + var id2 = scheduler2.uid(); + res += ""; } - } - scheduler2.attachEvent("onBeforeDrag", function(id2) { - _setTempSection(id2); - return true; - }); - scheduler2.attachEvent("onBeforeLightbox", function(id2) { - var ev = scheduler2.getEvent(id2); - before = [ev.start_date, ev.end_date]; - _setTempSection(id2); - return true; - }); - scheduler2.attachEvent("onEventChanged", function(id2) { - if (!id2 || !scheduler2.getEvent(id2)) - return true; - var ev = scheduler2.getEvent(id2); - if (!scheduler2.checkCollision(ev)) { - if (!before) - return false; - ev.start_date = before[0]; - ev.end_date = before[1]; - ev._timed = this.isOneDayEvent(ev); + res += "
"; + return res; + }, set_value: function(node, value, ev, config) { + var radiobuttons = node.getElementsByTagName("input"); + for (var i = 0; i < radiobuttons.length; i++) { + radiobuttons[i].checked = false; + var checked_value = ev[config.map_to] || value; + if (radiobuttons[i].value == checked_value) { + radiobuttons[i].checked = true; + } } - return true; - }); - scheduler2.attachEvent("onBeforeEventChanged", function(ev, e, is_new) { - return scheduler2.checkCollision(ev); - }); - scheduler2.attachEvent("onEventAdded", function(id2, ev) { - var result = scheduler2.checkCollision(ev); - if (!result) - scheduler2.deleteEvent(id2); - }); - scheduler2.attachEvent("onEventSave", function(id2, edited_ev, is_new) { - edited_ev = scheduler2._lame_clone(edited_ev); - edited_ev.id = id2; - if (!(edited_ev.start_date && edited_ev.end_date)) { - var ev = scheduler2.getEvent(id2); - edited_ev.start_date = new Date(ev.start_date); - edited_ev.end_date = new Date(ev.end_date); + }, get_value: function(node, ev, config) { + var radiobuttons = node.getElementsByTagName("input"); + for (var i = 0; i < radiobuttons.length; i++) { + if (radiobuttons[i].checked) { + return radiobuttons[i].value; + } } - if (edited_ev.rec_type) { - scheduler2._roll_back_dates(edited_ev); + }, focus: function(node) { + } }; + scheduler2.form_blocks["checkbox"] = { render: function(sns) { + if (scheduler2.config.wide_form) + return '
'; + else + return ""; + }, set_value: function(node, value, ev, config) { + node = scheduler2._lightbox.querySelector(`#${config.id}`); + var id2 = scheduler2.uid(); + var isChecked = typeof config.checked_value != "undefined" ? value == config.checked_value : !!value; + node.className += " dhx_cal_checkbox"; + var check_html = ""; + var label_html = ""; + if (scheduler2.config.wide_form) { + node.innerHTML = label_html; + node.nextSibling.innerHTML = check_html; + } else + node.innerHTML = check_html + label_html; + if (config.handler) { + var checkbox = node.getElementsByTagName("input")[0]; + if (checkbox.$_eventAttached) { + return; + } + checkbox.$_eventAttached = true; + scheduler2.event(checkbox, "click", config.handler); } - return scheduler2.checkCollision(edited_ev); - }); - scheduler2._check_sections_collision = function(first, second) { - var map_to = scheduler2._get_section_property(); - if (first[map_to] == second[map_to] && first.id != second.id) - return true; - return false; + }, get_value: function(node, ev, config) { + node = scheduler2._lightbox.querySelector(`#${config.id}`); + var checkbox = node.getElementsByTagName("input")[0]; + if (!checkbox) + checkbox = node.nextSibling.getElementsByTagName("input")[0]; + return checkbox.checked ? config.checked_value || true : config.unchecked_value || false; + }, focus: function(node) { + } }; + } + function expand(scheduler2) { + scheduler2.ext.fullscreen = { toggleIcon: null }; + scheduler2.expand = function() { + if (!scheduler2.callEvent("onBeforeExpand", [])) + return; + var t = scheduler2._obj; + do { + t._position = t.style.position || ""; + t.style.position = "static"; + } while ((t = t.parentNode) && t.style); + t = scheduler2._obj; + t.style.position = "absolute"; + t._width = t.style.width; + t._height = t.style.height; + t.style.width = t.style.height = "100%"; + t.style.top = t.style.left = "0px"; + var top = document.body; + top.scrollTop = 0; + top = top.parentNode; + if (top) + top.scrollTop = 0; + document.body._overflow = document.body.style.overflow || ""; + document.body.style.overflow = "hidden"; + scheduler2._maximize(); + scheduler2.callEvent("onExpand", []); }; - scheduler2.checkCollision = function(ev) { - var evs = []; - var collision_limit = scheduler2.config.collision_limit; - if (ev.rec_type) { - var evs_dates = scheduler2.getRecDates(ev); - for (var k = 0; k < evs_dates.length; k++) { - var tevs = scheduler2.getEvents(evs_dates[k].start_date, evs_dates[k].end_date); - for (var j = 0; j < tevs.length; j++) { - if ((tevs[j].event_pid || tevs[j].id) != ev.id) - evs.push(tevs[j]); - } - } + scheduler2.collapse = function() { + if (!scheduler2.callEvent("onBeforeCollapse", [])) + return; + var t = scheduler2._obj; + do { + t.style.position = t._position; + } while ((t = t.parentNode) && t.style); + t = scheduler2._obj; + t.style.width = t._width; + t.style.height = t._height; + document.body.style.overflow = document.body._overflow; + scheduler2._maximize(); + scheduler2.callEvent("onCollapse", []); + }; + scheduler2.attachEvent("onTemplatesReady", function() { + var t = document.createElement("div"); + t.className = "dhx_expand_icon"; + scheduler2.ext.fullscreen.toggleIcon = t; + t.innerHTML = ` + + + + + + + + + + + + `; + scheduler2._obj.appendChild(t); + scheduler2.event(t, "click", function() { + if (!scheduler2.expanded) + scheduler2.expand(); + else + scheduler2.collapse(); + }); + }); + scheduler2._maximize = function() { + this.expanded = !this.expanded; + if (this.expanded) { + this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded"); } else { - evs = scheduler2.getEvents(ev.start_date, ev.end_date); - for (var i = 0; i < evs.length; i++) { - var concurrent = evs[i]; - if (concurrent.id == ev.id || concurrent.event_length && [concurrent.event_pid, concurrent.event_length].join("#") == ev.id) { - evs.splice(i, 1); - break; - } - } + this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded"); } - var checked_mode = scheduler2._get_section_view(); - var map_to = scheduler2._get_section_property(); - var single = true; - if (checked_mode) { - var count = 0; - for (var i = 0; i < evs.length; i++) { - if (evs[i].id != ev.id && this._check_sections_collision(evs[i], ev)) - count++; - } - if (count >= collision_limit) { - single = false; + var directions = ["left", "top"]; + for (var i = 0; i < directions.length; i++) { + var prev_margin = scheduler2["_prev_margin_" + directions[i]]; + if (scheduler2.xy["margin_" + directions[i]]) { + scheduler2["_prev_margin_" + directions[i]] = scheduler2.xy["margin_" + directions[i]]; + scheduler2.xy["margin_" + directions[i]] = 0; + } else { + if (prev_margin) { + scheduler2.xy["margin_" + directions[i]] = scheduler2["_prev_margin_" + directions[i]]; + delete scheduler2["_prev_margin_" + directions[i]]; + } } - } else { - if (evs.length >= collision_limit) - single = false; } - if (!single) { - var res = !scheduler2.callEvent("onEventCollision", [ev, evs]); - if (!res) { - ev[map_to] = temp_section || ev[map_to]; + scheduler2.setCurrentView(); + }; + } + function grid_view(scheduler2) { + notImplemented.alert("Grid", scheduler2.assert); + } + function html_templates(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + var els = document.body.getElementsByTagName("DIV"); + for (var i = 0; i < els.length; i++) { + var cs2 = els[i].className || ""; + cs2 = cs2.split(":"); + if (cs2.length == 2 && cs2[0] == "template") { + var code = 'return "' + (els[i].innerHTML || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\n\r]+/g, "") + '";'; + code = unescape(code).replace(/\{event\.([a-z]+)\}/g, function(all, mask) { + return '"+ev.' + mask + '+"'; + }); + scheduler2.templates[cs2[1]] = Function("start", "end", "ev", code); + els[i].style.display = "none"; } - return res; } - return single; - }; + }); } - function container_autoresize(scheduler2) { - scheduler2.config.container_autoresize = true; - scheduler2.config.month_day_min_height = 90; - scheduler2.config.min_grid_size = 25; - scheduler2.config.min_map_size = 400; - var old_pre_render_event = scheduler2._pre_render_events; - var active = true; - var total_height = 0; - var multiday_height = 0; - scheduler2._pre_render_events = function(evs, hold) { - if (!(scheduler2.config.container_autoresize && active)) { - return old_pre_render_event.apply(this, arguments); - } - var hb = this.xy.bar_height; - var h_old = this._colsS.heights; - var h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0]; - var data = this._els["dhx_cal_data"][0]; - if (!this._table_view) - evs = this._pre_render_events_line(evs, hold); - else - evs = this._pre_render_events_table(evs, hold); - if (this._table_view) { - if (hold) { - this._colsS.heights = h_old; - } else { - var evl = data.firstChild; - const rows = evl.querySelectorAll(".dhx_cal_month_row"); - if (rows) { - for (var i = 0; i < rows.length; i++) { - h[i]++; - if (h[i] * hb > this._colsS.height - this.xy.month_head_height) { - var cells = rows[i].querySelectorAll(".dhx_cal_month_cell"); - var cHeight = this._colsS.height - this.xy.month_head_height; - if (this.config.max_month_events * 1 !== this.config.max_month_events || h[i] <= this.config.max_month_events) { - cHeight = h[i] * hb; - } else if ((this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height) { - cHeight = (this.config.max_month_events + 1) * hb; - } - rows[i].style.height = cHeight + this.xy.month_head_height + "px"; - for (var j = 0; j < cells.length; j++) { - cells[j].childNodes[1].style.height = cHeight + "px"; - } - h[i] = (h[i - 1] || 0) + cells[0].offsetHeight; - } - h[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight; - } - h.unshift(0); - if (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) - ; + function keyboard_shortcuts(scheduler2) { + scheduler2.$keyboardNavigation.shortcuts = { createCommand: function() { + return { modifiers: { shift: false, alt: false, ctrl: false, meta: false }, keyCode: null }; + }, parse: function(shortcut) { + var commands = []; + var expr = this.getExpressions(this.trim(shortcut)); + for (var i = 0; i < expr.length; i++) { + var words = this.getWords(expr[i]); + var command = this.createCommand(); + for (var j = 0; j < words.length; j++) { + if (this.commandKeys[words[j]]) { + command.modifiers[words[j]] = true; + } else if (this.specialKeys[words[j]]) { + command.keyCode = this.specialKeys[words[j]]; } else { - if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible") - h[0] = -1; - if (evs.length || h[0] == -1) { - var dh = (h[0] + 1) * hb + 1; - if (multiday_height != dh + 1) { - this._obj.style.height = total_height - multiday_height + dh - 1 + "px"; - } - dh += "px"; - const navHeight = this._els["dhx_cal_navline"][0].offsetHeight; - const headerHeight = this._els["dhx_cal_header"][0].offsetHeight; - data.style.height = this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0) + "px"; - var last = this._els["dhx_multi_day"][0]; - last.style.height = dh; - last.style.visibility = h[0] == -1 ? "hidden" : "visible"; - last = this._els["dhx_multi_day"][1]; - last.style.height = dh; - last.style.visibility = h[0] == -1 ? "hidden" : "visible"; - if (last.style.visibility == "hidden") { - last.style.display = "none"; - } else { - last.style.display = ""; - } - last.className = h[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small"; - this._dy_shift = (h[0] + 1) * hb; - h[0] = 0; - } + command.keyCode = words[j].charCodeAt(0); } } + commands.push(command); } - return evs; - }; - var checked_divs = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"]; - var updateContainterHeight = function(is_repaint) { - total_height = 0; - for (var i = 0; i < checked_divs.length; i++) { - var className = checked_divs[i]; - var checked_div = scheduler2._els[className] ? scheduler2._els[className][0] : null; - var height = 0; - switch (className) { - case "dhx_cal_navline": - case "dhx_cal_header": - height = checked_div.offsetHeight; - break; - case "dhx_multi_day": - height = checked_div ? checked_div.offsetHeight - 1 : 0; - multiday_height = height; - break; - case "dhx_cal_data": - var mode = scheduler2.getState().mode; - if (checked_div.childNodes[1] && mode != "month") { - let maxHeight = 0; - for (let i2 = 0; i2 < checked_div.childNodes.length; i2++) { - if (checked_div.childNodes[i2].offsetHeight > maxHeight) { - maxHeight = checked_div.childNodes[i2].offsetHeight; - } - } - height = maxHeight; - } else { - height = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight); - } - if (mode == "month") { - if (scheduler2.config.month_day_min_height && !is_repaint) { - var rows_length = checked_div.querySelectorAll(".dhx_cal_month_row").length; - height = rows_length * scheduler2.config.month_day_min_height; - } - if (is_repaint) { - checked_div.style.height = height + "px"; - } - } else if (mode == "year") { - height = 190 * scheduler2.config.year_y; - } else if (mode == "agenda") { - height = 0; - if (checked_div.childNodes && checked_div.childNodes.length) { - for (var j = 0; j < checked_div.childNodes.length; j++) { - height += checked_div.childNodes[j].offsetHeight; - } - } - if (height + 2 < scheduler2.config.min_grid_size) { - height = scheduler2.config.min_grid_size; - } else { - height += 2; - } - } else if (mode == "week_agenda") { - var min_height = scheduler2.xy.week_agenda_scale_height + scheduler2.config.min_grid_size, cur_height; - var column; - for (var k = 0; k < checked_div.childNodes.length; k++) { - column = checked_div.childNodes[k]; - for (var j = 0; j < column.childNodes.length; j++) { - var innerHeight = 0, eventsContainer = column.childNodes[j].childNodes[1]; - for (var g = 0; g < eventsContainer.childNodes.length; g++) { - innerHeight += eventsContainer.childNodes[g].offsetHeight; - } - cur_height = innerHeight + scheduler2.xy.week_agenda_scale_height; - cur_height = k == 1 && (j == 2 || j == 3) ? cur_height * 2 : cur_height; - if (cur_height > min_height) { - min_height = cur_height; - } - } - } - height = min_height * 3; - } else if (mode == "map") { - height = 0; - var evs = checked_div.querySelectorAll(".dhx_map_line"); - for (var j = 0; j < evs.length; j++) { - height += evs[j].offsetHeight; - } - if (height + 2 < scheduler2.config.min_map_size) { - height = scheduler2.config.min_map_size; - } else { - height += 2; - } - } else if (scheduler2._gridView) { - height = 0; - if (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) { - var evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes; - for (var j = 0; j < evs.length; j++) { - height += evs[j].offsetHeight; - } - height += 2; - if (height < scheduler2.config.min_grid_size) { - height = scheduler2.config.min_grid_size; - } - } else { - height = scheduler2.config.min_grid_size; - } - } - if (scheduler2.matrix && scheduler2.matrix[mode]) { - if (is_repaint) { - height += 0; - checked_div.style.height = height + "px"; - } else { - height = 0; - var cfg = scheduler2.matrix[mode]; - var rows = cfg.y_unit; - for (var r = 0; r < rows.length; r++) { - height += cfg.getSectionHeight(rows[r].key); - } - if (scheduler2.$container.clientWidth != scheduler2.$container.scrollWidth) { - height += getScrollSize(); - } - } - height -= 1; - } - if (mode == "day" || mode == "week" || scheduler2._props && scheduler2._props[mode]) { - height += 2; - } - break; + return commands; + }, getCommandFromEvent: function(domEvent) { + var command = this.createCommand(); + command.modifiers.shift = !!domEvent.shiftKey; + command.modifiers.alt = !!domEvent.altKey; + command.modifiers.ctrl = !!domEvent.ctrlKey; + command.modifiers.meta = !!domEvent.metaKey; + command.keyCode = domEvent.which || domEvent.keyCode; + if (command.keyCode >= 96 && command.keyCode <= 105) { + command.keyCode -= 48; + } + var printableKey = String.fromCharCode(command.keyCode); + if (printableKey) { + command.keyCode = printableKey.toLowerCase().charCodeAt(0); + } + return command; + }, getHashFromEvent: function(domEvent) { + return this.getHash(this.getCommandFromEvent(domEvent)); + }, getHash: function(command) { + var parts = []; + for (var i in command.modifiers) { + if (command.modifiers[i]) { + parts.push(i); } - height += 1; - total_height += height; } - scheduler2._obj.style.height = total_height + "px"; - if (!is_repaint) - scheduler2.updateView(); - }; - function callUpdate() { - active = false; - scheduler2.callEvent("onAfterSchedulerResize", []); - active = true; - } - var conditionalUpdateContainerHeight = function() { - if (!(scheduler2.config.container_autoresize && active)) - return true; - var mode = scheduler2.getState().mode; - if (!mode) { - return true; + parts.push(command.keyCode); + return parts.join(this.junctionChar); + }, getExpressions: function(shortcut) { + return shortcut.split(this.junctionChar); + }, getWords: function(term) { + return term.split(this.combinationChar); + }, trim: function(shortcut) { + return shortcut.replace(/\s/g, ""); + }, junctionChar: ",", combinationChar: "+", commandKeys: { shift: 16, alt: 18, ctrl: 17, meta: true }, specialKeys: { backspace: 8, tab: 9, enter: 13, esc: 27, space: 32, up: 38, down: 40, left: 37, right: 39, home: 36, end: 35, pageup: 33, pagedown: 34, delete: 46, insert: 45, plus: 107, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 } }; + } + function eventhandler(scheduler2) { + scheduler2.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(command) { + if (!this._handlers) + this._handlers = {}; + var shortcuts = scheduler2.$keyboardNavigation.shortcuts; + var hash = shortcuts.getHash(command); + return this._handlers[hash]; + }, doAction: function(command, e) { + var handler = this.findHandler(command); + if (handler) { + handler.call(this, e); + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; + } + }, bind: function(shortcut, handler) { + if (!this._handlers) + this._handlers = {}; + var shortcuts = scheduler2.$keyboardNavigation.shortcuts; + var commands = shortcuts.parse(shortcut); + for (var i = 0; i < commands.length; i++) { + this._handlers[shortcuts.getHash(commands[i])] = handler; } - var asyncRepaint = window.requestAnimationFrame || window.setTimeout; - var scrollTop = document.documentElement.scrollTop; - asyncRepaint(function() { - if (scheduler2.$destroyed || !scheduler2.$initialized) { - return; + }, unbind: function(shortcut) { + var shortcuts = scheduler2.$keyboardNavigation.shortcuts; + var commands = shortcuts.parse(shortcut); + for (var i = 0; i < commands.length; i++) { + if (this._handlers[shortcuts.getHash(commands[i])]) { + delete this._handlers[shortcuts.getHash(commands[i])]; } - updateContainterHeight(); - }); - if (scheduler2.matrix && scheduler2.matrix[mode] || mode == "month") { - asyncRepaint(function() { - if (scheduler2.$destroyed || !scheduler2.$initialized) { - return; - } - updateContainterHeight(true); - document.documentElement.scrollTop = scrollTop; - callUpdate(); - }, 1); - } else { - callUpdate(); } - }; - scheduler2.attachEvent("onBeforeViewChange", function() { - var autosizeEnabled = scheduler2.config.container_autoresize; - if (!scheduler2.xy.$original_scroll_width) { - scheduler2.xy.$original_scroll_width = scheduler2.xy.scroll_width; + }, bindAll: function(map) { + for (var i in map) { + this.bind(i, map[i]); } - scheduler2.xy.scroll_width = autosizeEnabled ? 0 : scheduler2.xy.$original_scroll_width; - if (scheduler2.matrix) { - for (var i in scheduler2.matrix) { - var timeline = scheduler2.matrix[i]; - if (!timeline.$original_section_autoheight) { - timeline.$original_section_autoheight = timeline.section_autoheight; + }, initKeys: function() { + if (!this._handlers) + this._handlers = {}; + if (this.keys) { + this.bindAll(this.keys); + } + } }; + } + function trap_modal_focus(scheduler2) { + (function() { + scheduler2.$keyboardNavigation.getFocusableNodes = scheduler2._getFocusableNodes; + scheduler2.$keyboardNavigation.trapFocus = function trapFocus(root, e) { + if (e.keyCode != 9) + return false; + var focusable = scheduler2.$keyboardNavigation.getFocusableNodes(root); + var currentFocus = document.activeElement; + var currentIndex = -1; + for (var i = 0; i < focusable.length; i++) { + if (focusable[i] == currentFocus) { + currentIndex = i; + break; } - if (autosizeEnabled) { - timeline.section_autoheight = false; - } else { - timeline.section_autoheight = timeline.$original_section_autoheight; + } + var nextIndex, nextItem; + if (e.shiftKey) { + nextIndex = currentIndex <= 0 ? focusable.length - 1 : currentIndex - 1; + nextItem = focusable[nextIndex]; + if (nextItem) { + nextItem.focus(); + e.preventDefault(); + return true; + } + } else { + nextIndex = currentIndex >= focusable.length - 1 ? 0 : currentIndex + 1; + nextItem = focusable[nextIndex]; + if (nextItem) { + nextItem.focus(); + e.preventDefault(); + return true; } } - } - return true; - }); - scheduler2.attachEvent("onViewChange", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onXLE", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventChanged", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventCreated", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventAdded", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onEventDeleted", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onAfterSchedulerResize", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onClearAll", conditionalUpdateContainerHeight); - scheduler2.attachEvent("onBeforeExpand", function() { - active = false; - return true; - }); - scheduler2.attachEvent("onBeforeCollapse", function() { - active = true; - return true; - }); - function getScrollSize() { - var div = document.createElement("div"); - div.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;"; - document.body.appendChild(div); - var size = div.offsetWidth - div.clientWidth; - document.body.removeChild(div); - return size; - } + return false; + }; + })(); } - function cookie(scheduler2) { - function setCookie(name, cookie_param, value) { - var str = name + "=" + value + (cookie_param ? "; " + cookie_param : ""); - document.cookie = str; - } - function getCookie(name) { - var search = name + "="; - if (document.cookie.length > 0) { - var offset = document.cookie.indexOf(search); - if (offset != -1) { - offset += search.length; - var end = document.cookie.indexOf(";", offset); - if (end == -1) - end = document.cookie.length; - return document.cookie.substring(offset, end); + function marker(scheduler2) { + scheduler2.$keyboardNavigation.marker = { clear: function() { + var divs = scheduler2.$container.querySelectorAll(".dhx_focus_slot"); + for (var i = 0; i < divs.length; i++) { + divs[i].parentNode.removeChild(divs[i]); + } + }, createElement: function() { + var element = document.createElement("div"); + element.setAttribute("tabindex", -1); + element.className = "dhx_focus_slot"; + return element; + }, renderMultiple: function(start, end, method) { + var divs = []; + var currentStart = new Date(start); + var currentEnd = new Date(Math.min(end.valueOf(), scheduler2.date.add(scheduler2.date.day_start(new Date(start)), 1, "day").valueOf())); + while (currentStart.valueOf() < end.valueOf()) { + divs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf())))); + currentStart = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); + currentEnd = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); + currentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf())); + } + return divs; + }, render: function(start, end, section) { + this.clear(); + var divs = []; + var modes = scheduler2.$keyboardNavigation.TimeSlot.prototype._modes; + var view = scheduler2.$keyboardNavigation.TimeSlot.prototype._getMode(); + switch (view) { + case modes.units: + divs = this.renderVerticalMarker(start, end, section); + break; + case modes.timeline: + divs = this.renderTimelineMarker(start, end, section); + break; + case modes.year: + divs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker)); + break; + case modes.month: + divs = this.renderMonthMarker(start, end); + break; + case modes.weekAgenda: + divs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker)); + break; + case modes.list: + divs = this.renderAgendaMarker(start, end); + break; + case modes.dayColumns: + divs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker)); + break; + } + this.addWaiAriaLabel(divs, start, end, section); + this.addDataAttributes(divs, start, end, section); + for (var i = divs.length - 1; i >= 0; i--) { + if (divs[i].offsetWidth) { + return divs[i]; + } + } + return null; + }, addDataAttributes: function(divs, start, end, section) { + var dateToStr = scheduler2.date.date_to_str(scheduler2.config.api_date); + var from = dateToStr(start), to = dateToStr(end); + for (var i = 0; i < divs.length; i++) { + divs[i].setAttribute("data-start-date", from); + divs[i].setAttribute("data-end-date", to); + if (section) { + divs[i].setAttribute("data-section", section); + } + } + }, addWaiAriaLabel: function(divs, start, end, section) { + var label = ""; + var state = scheduler2.getState(); + var mode = state.mode; + var dateTimeLabel = false; + label += scheduler2.templates.day_date(start); + if (scheduler2.date.day_start(new Date(start)).valueOf() != start.valueOf()) { + label += " " + scheduler2.templates.hour_scale(start); + dateTimeLabel = true; + } + if (scheduler2.date.day_start(new Date(start)).valueOf() != scheduler2.date.day_start(new Date(end)).valueOf()) { + label += " - " + scheduler2.templates.day_date(end); + if (dateTimeLabel || scheduler2.date.day_start(new Date(end)).valueOf() != end.valueOf()) { + label += " " + scheduler2.templates.hour_scale(end); + } + } + if (section) { + if (scheduler2.matrix && scheduler2.matrix[mode]) { + const timeline = scheduler2.matrix[mode]; + const sectionObject = timeline.y_unit[timeline.order[section]]; + label += ", " + scheduler2.templates[mode + "_scale_label"](sectionObject.key, sectionObject.label, sectionObject); + } else if (scheduler2._props && scheduler2._props[mode]) { + const units = scheduler2._props[mode]; + const sectionObject = units.options[units.order[section]]; + label += ", " + scheduler2.templates[mode + "_scale_text"](sectionObject.key, sectionObject.label, sectionObject); } } - return ""; - } - function getCookieName(scheduler3) { - return (scheduler3._obj.id || "scheduler") + "_settings"; - } - var first = true; - scheduler2.attachEvent("onBeforeViewChange", function(oldMode, oldDate, mode, date) { - if (first && scheduler2._get_url_nav) { - var urlNavigationPlugin = scheduler2._get_url_nav(); - if (urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event) { - first = false; - } + for (var i = 0; i < divs.length; i++) { + scheduler2._waiAria.setAttributes(divs[i], { "aria-label": label, "aria-live": "polite" }); } - var cookie2 = getCookieName(scheduler2); - if (first) { - first = false; - var schedulerCookie = getCookie(cookie2); - if (schedulerCookie) { - if (!scheduler2._min_date) { - scheduler2._min_date = date; - } - schedulerCookie = unescape(schedulerCookie).split("@"); - schedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]); - var view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode, date = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date; - window.setTimeout(function() { - if (scheduler2.$destroyed) { - return; - } - scheduler2.setCurrentView(date, view); - }, 1); - return false; + }, renderWeekAgendaMarker: function(start_date, end_date) { + var divs = scheduler2.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar"); + var currDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); + var index = -1; + var markerDate = scheduler2.date.day_start(new Date(start_date)); + for (var i = 0; i < divs.length; i++) { + index++; + if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { + break; + } else { + currDate = scheduler2.date.add(currDate, 1, "day"); } } - return true; - }); - scheduler2.attachEvent("onViewChange", function(newMode, newDate) { - var cookie2 = getCookieName(scheduler2); - var text = escape(this._helpers.formatDate(newDate) + "@" + newMode); - setCookie(cookie2, "expires=Sun, 31 Jan 9999 22:00:00 GMT", text); - }); - var old_load = scheduler2._load; - scheduler2._load = function() { - var args = arguments; - if (!scheduler2._date) { - var that = this; - window.setTimeout(function() { - old_load.apply(that, args); - }, 1); + if (index != -1) + return this._wrapDiv(divs[index]); + return []; + }, _wrapDiv: function(cell) { + var marker2 = this.createElement(); + marker2.style.top = cell.offsetTop + "px"; + marker2.style.left = cell.offsetLeft + "px"; + marker2.style.width = cell.offsetWidth + "px"; + marker2.style.height = cell.offsetHeight + "px"; + cell.appendChild(marker2); + return [marker2]; + }, renderYearMarker: function(start_date, end_date) { + var cell = scheduler2._get_year_cell(start_date); + cell.style.position = "relative"; + var marker2 = this.createElement(); + marker2.style.top = "0px"; + marker2.style.left = "0px"; + marker2.style.width = "100%"; + marker2.style.height = "100%"; + cell.appendChild(marker2); + return [marker2]; + }, renderAgendaMarker: function(start_date, end_date) { + var block = this.createElement(); + block.style.height = "1px"; + block.style.width = "100%"; + block.style.opacity = 1; + block.style.top = "0px"; + block.style.left = "0px"; + scheduler2.$container.querySelector(".dhx_cal_data").appendChild(block); + return [block]; + }, renderTimelineMarker: function(start_date, end_date, section) { + var view_opts = scheduler2._lame_copy({}, scheduler2.matrix[scheduler2._mode]); + var areas = view_opts._scales; + view_opts.round_position = false; + var blocks = []; + var min_date = start_date ? new Date(start_date) : scheduler2._min_date; + var max_date = end_date ? new Date(end_date) : scheduler2._max_date; + if (min_date.valueOf() < scheduler2._min_date.valueOf()) + min_date = new Date(scheduler2._min_date); + if (max_date.valueOf() > scheduler2._max_date.valueOf()) + max_date = new Date(scheduler2._max_date); + if (!view_opts._trace_x) + return blocks; + for (var i = 0; i < view_opts._trace_x.length; i++) { + if (scheduler2._is_column_visible(view_opts._trace_x[i])) + break; + } + if (i == view_opts._trace_x.length) + return blocks; + var area = areas[section]; + if (!(min_date < end_date && max_date > start_date)) + return blocks; + var block = this.createElement(); + let start_pos; + let end_pos; + function set_date_part(source, target) { + target.setDate(1); + target.setFullYear(source.getFullYear()); + target.setMonth(source.getMonth()); + target.setDate(source.getDate()); + } + if (!scheduler2.getView().days) { + start_pos = scheduler2._timeline_getX({ start_date }, false, view_opts); + end_pos = scheduler2._timeline_getX({ start_date: end_date }, false, view_opts); } else { - old_load.apply(this, args); + const tempStart = new Date(start_date); + set_date_part(scheduler2._min_date, tempStart); + const tempEnd = new Date(end_date); + set_date_part(scheduler2._min_date, tempEnd); + start_pos = scheduler2._timeline_getX({ start_date: tempStart }, false, view_opts); + end_pos = scheduler2._timeline_getX({ start_date: tempEnd }, false, view_opts); } - }; - } - const notImplemented = { alert: (extension, assert2) => { - assert2(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
- You may need a Professional version of the component.
- Contact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`); - } }; - function daytimeline_restricted(scheduler2) { - notImplemented.alert("Day Timeline", scheduler2.assert); - } - function drag_between_restricted(scheduler2) { - notImplemented.alert("Drag Between", scheduler2.assert); - } - function editors(scheduler2) { - scheduler2.form_blocks["combo"] = { render: function(sns) { - if (!sns.cached_options) - sns.cached_options = {}; - var res = ""; - res += "
"; - return res; - }, set_value: function(node, value, ev, config) { - (function() { - resetCombo(); - var id2 = scheduler2.attachEvent("onAfterLightbox", function() { - resetCombo(); - scheduler2.detachEvent(id2); - }); - function resetCombo() { - if (node._combo && node._combo.DOMParent) { - var combo2 = node._combo; - if (combo2.unload) { - combo2.unload(); - } else if (combo2.destructor) { - combo2.destructor(); - } - combo2.DOMParent = combo2.DOMelem = null; - } - } - })(); - window.dhx_globalImgPath = config.image_path || "/"; - node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth - 8); - if (config.onchange) - node._combo.attachEvent("onChange", config.onchange); - if (config.options_height) - node._combo.setOptionHeight(config.options_height); - var combo = node._combo; - combo.enableFilteringMode(config.filtering, config.script_path || null, !!config.cache); - if (!config.script_path) { - var all_options = []; - for (var i = 0; i < config.options.length; i++) { - var option = config.options[i]; - var single_option = [option.key, option.label, option.css]; - all_options.push(single_option); - } - combo.addOption(all_options); - if (ev[config.map_to]) { - var index = combo.getIndexByValue(ev[config.map_to]); - combo.selectOption(index); + var height = view_opts._section_height[section] - 1 || view_opts.dy - 1; + var top = 0; + if (scheduler2._isRender("cell")) { + top = area.offsetTop; + start_pos += view_opts.dx; + end_pos += view_opts.dx; + area = scheduler2.$container.querySelector(".dhx_cal_data"); + } + var width = Math.max(1, end_pos - start_pos - 1); + let direction = "left"; + if (scheduler2.config.rtl) { + direction = "right"; + } + block.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`; + if (area) { + area.appendChild(block); + blocks.push(block); + } + return blocks; + }, renderMonthCell: function(date) { + var cells = scheduler2.$container.querySelectorAll(".dhx_month_head"); + var divs = []; + for (var i = 0; i < cells.length; i++) { + divs.push(cells[i].parentNode); + } + var firstDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); + var index = -1; + var weekNumber = 0; + var dayIndex = -1; + var currDate = firstDate; + var markerDate = scheduler2.date.day_start(new Date(date)); + for (var i = 0; i < divs.length; i++) { + index++; + if (dayIndex == 6) { + weekNumber++; + dayIndex = 0; + } else { + dayIndex++; } - } else { - var selected_id = ev[config.map_to]; - if (selected_id) { - if (config.cached_options[selected_id]) { - combo.addOption(selected_id, config.cached_options[selected_id]); - combo.disable(1); - combo.selectOption(0); - combo.disable(0); - } else { - scheduler2.ajax.get(config.script_path + "?id=" + selected_id + "&uid=" + scheduler2.uid(), function(result) { - var responseText = result.xmlDoc.responseText; - var label; - try { - var res = JSON.parse(responseText); - label = res.options[0].text; - } catch (e) { - var option2 = scheduler2.ajax.xpath("//option", result.xmlDoc)[0]; - label = option2.childNodes[0].nodeValue; - } - config.cached_options[selected_id] = label; - combo.addOption(selected_id, label); - combo.disable(1); - combo.selectOption(0); - combo.disable(0); - }); - } + if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { + break; } else { - combo.setComboValue(""); + currDate = scheduler2.date.add(currDate, 1, "day"); } } - }, get_value: function(node, ev, config) { - var selected_id = node._combo.getSelectedValue(); - if (config.script_path) { - config.cached_options[selected_id] = node._combo.getSelectedText(); + if (index == -1) { + return []; + } + var left = scheduler2._colsS[dayIndex]; + var top = scheduler2._colsS.heights[weekNumber]; + var div = this.createElement(); + div.style.top = top + "px"; + div.style.left = left + "px"; + div.style.width = scheduler2._cols[dayIndex] + "px"; + div.style.height = (scheduler2._colsS.heights[weekNumber + 1] - top || scheduler2._colsS.height) + "px"; + var container = scheduler2.$container.querySelector(".dhx_cal_data"); + var datatable = container.querySelector(".dhx_cal_month_table"); + if (datatable.nextSibling) { + container.insertBefore(div, datatable.nextSibling); + } else { + container.appendChild(div); } - return selected_id; - }, focus: function(node) { - } }; - scheduler2.form_blocks["radio"] = { render: function(sns) { - var res = ""; - res += `
`; - for (var i = 0; i < sns.options.length; i++) { - var id2 = scheduler2.uid(); - res += ""; + return div; + }, renderMonthMarker: function(start_date, end_date) { + var res = []; + var currentDate = start_date; + while (currentDate.valueOf() < end_date.valueOf()) { + res.push(this.renderMonthCell(currentDate)); + currentDate = scheduler2.date.add(currentDate, 1, "day"); } - res += "
"; return res; - }, set_value: function(node, value, ev, config) { - var radiobuttons = node.getElementsByTagName("input"); - for (var i = 0; i < radiobuttons.length; i++) { - radiobuttons[i].checked = false; - var checked_value = ev[config.map_to] || value; - if (radiobuttons[i].value == checked_value) { - radiobuttons[i].checked = true; + }, renderVerticalMarker: function(start_date, end_date, section) { + var index = scheduler2.locate_holder_day(start_date); + var divs = []; + var area = null; + var c = scheduler2.config; + if (scheduler2._ignores[index]) + return divs; + if (scheduler2._props && scheduler2._props[scheduler2._mode] && section) { + var view = scheduler2._props[scheduler2._mode]; + index = view.order[section]; + var inner_index = view.order[section]; + if (!(view.days > 1)) { + index = inner_index; + if (view.size && index > view.position + view.size) { + index = 0; + } + } else { + index = scheduler2.locate_holder_day(start_date) + inner_index; } } - }, get_value: function(node, ev, config) { - var radiobuttons = node.getElementsByTagName("input"); - for (var i = 0; i < radiobuttons.length; i++) { - if (radiobuttons[i].checked) { - return radiobuttons[i].value; - } + area = scheduler2.locate_holder(index); + if (!area || area.querySelector(".dhx_scale_hour")) { + return document.createElement("div"); } - }, focus: function(node) { - } }; - scheduler2.form_blocks["checkbox"] = { render: function(sns) { - if (scheduler2.config.wide_form) - return '
'; - else - return ""; - }, set_value: function(node, value, ev, config) { - node = scheduler2._lightbox.querySelector(`#${config.id}`); - var id2 = scheduler2.uid(); - var isChecked = typeof config.checked_value != "undefined" ? value == config.checked_value : !!value; - node.className += " dhx_cal_checkbox"; - var check_html = ""; - var label_html = ""; - if (scheduler2.config.wide_form) { - node.innerHTML = label_html; - node.nextSibling.innerHTML = check_html; - } else - node.innerHTML = check_html + label_html; - if (config.handler) { - var checkbox = node.getElementsByTagName("input")[0]; - if (checkbox.$_eventAttached) { - return; - } - checkbox.$_eventAttached = true; - scheduler2.event(checkbox, "click", config.handler); + var start = Math.max(start_date.getHours() * 60 + start_date.getMinutes(), c.first_hour * 60); + var end = Math.min(end_date.getHours() * 60 + end_date.getMinutes(), c.last_hour * 60); + if (!end && scheduler2.date.day_start(new Date(end_date)).valueOf() > scheduler2.date.day_start(new Date(start_date)).valueOf()) { + end = c.last_hour * 60; } - }, get_value: function(node, ev, config) { - node = scheduler2._lightbox.querySelector(`#${config.id}`); - var checkbox = node.getElementsByTagName("input")[0]; - if (!checkbox) - checkbox = node.nextSibling.getElementsByTagName("input")[0]; - return checkbox.checked ? config.checked_value || true : config.unchecked_value || false; - }, focus: function(node) { + if (end <= start) { + return []; + } + var block = this.createElement(); + var all_hours_height = scheduler2.config.hour_size_px * c.last_hour + 1; + var hour_ms = 60 * 60 * 1e3; + block.style.top = Math.round((start * 60 * 1e3 - scheduler2.config.first_hour * hour_ms) * scheduler2.config.hour_size_px / hour_ms) % all_hours_height + "px"; + block.style.lineHeight = block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * scheduler2.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; + block.style.width = "100%"; + area.appendChild(block); + divs.push(block); + return divs[0]; } }; } - function expand(scheduler2) { - scheduler2.ext.fullscreen = { toggleIcon: null }; - scheduler2.expand = function() { - if (!scheduler2.callEvent("onBeforeExpand", [])) - return; - var t = scheduler2._obj; - do { - t._position = t.style.position || ""; - t.style.position = "static"; - } while ((t = t.parentNode) && t.style); - t = scheduler2._obj; - t.style.position = "absolute"; - t._width = t.style.width; - t._height = t.style.height; - t.style.width = t.style.height = "100%"; - t.style.top = t.style.left = "0px"; - var top = document.body; - top.scrollTop = 0; - top = top.parentNode; - if (top) - top.scrollTop = 0; - document.body._overflow = document.body.style.overflow || ""; - document.body.style.overflow = "hidden"; - scheduler2._maximize(); - scheduler2.callEvent("onExpand", []); - }; - scheduler2.collapse = function() { - if (!scheduler2.callEvent("onBeforeCollapse", [])) - return; - var t = scheduler2._obj; - do { - t.style.position = t._position; - } while ((t = t.parentNode) && t.style); - t = scheduler2._obj; - t.style.width = t._width; - t.style.height = t._height; - document.body.style.overflow = document.body._overflow; - scheduler2._maximize(); - scheduler2.callEvent("onCollapse", []); + function scheduler_node(scheduler2) { + scheduler2.$keyboardNavigation.SchedulerNode = function() { }; - scheduler2.attachEvent("onTemplatesReady", function() { - var t = document.createElement("div"); - t.className = "dhx_expand_icon"; - scheduler2.ext.fullscreen.toggleIcon = t; - t.innerHTML = ` - - - - - - - - - - - - `; - scheduler2._obj.appendChild(t); - scheduler2.event(t, "click", function() { - if (!scheduler2.expanded) - scheduler2.expand(); - else - scheduler2.collapse(); - }); - }); - scheduler2._maximize = function() { - this.expanded = !this.expanded; - if (this.expanded) { - this.ext.fullscreen.toggleIcon.classList.add("dhx_expand_icon--expanded"); + scheduler2.$keyboardNavigation.SchedulerNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { getDefaultNode: function() { + var node = new scheduler2.$keyboardNavigation.TimeSlot(); + if (!node.isValid()) { + node = node.fallback(); + } + return node; + }, _modes: { month: "month", year: "year", dayColumns: "dayColumns", timeline: "timeline", units: "units", weekAgenda: "weekAgenda", list: "list" }, getMode: function() { + var state = scheduler2.getState(); + var mode = state.mode; + if (scheduler2.matrix && scheduler2.matrix[mode]) { + return this._modes.timeline; + } else if (scheduler2._props && scheduler2._props[mode]) { + return this._modes.units; + } else if (mode == "month") { + return this._modes.month; + } else if (mode == "year") { + return this._modes.year; + } else if (mode == "week_agenda") { + return this._modes.weekAgenda; + } else if (mode == "map" || mode == "agenda" || scheduler2._grid && scheduler2["grid_" + mode]) { + return this._modes.list; } else { - this.ext.fullscreen.toggleIcon.classList.remove("dhx_expand_icon--expanded"); + return this._modes.dayColumns; + } + }, focus: function() { + scheduler2.focus(); + }, blur: function() { + }, disable: function() { + scheduler2.$container.setAttribute("tabindex", "0"); + }, enable: function() { + if (scheduler2.$container) + scheduler2.$container.removeAttribute("tabindex"); + }, isEnabled: function() { + return scheduler2.$container.hasAttribute("tabindex"); + }, _compareEvents: function(a, b) { + if (a.start_date.valueOf() == b.start_date.valueOf()) + return a.id > b.id ? 1 : -1; + return a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1; + }, _pickEvent: function(from, to, startId, reverse) { + var range2 = scheduler2.getState(); + from = new Date(Math.max(range2.min_date.valueOf(), from.valueOf())); + to = new Date(Math.min(range2.max_date.valueOf(), to.valueOf())); + var evs = scheduler2.getEvents(from, to); + evs.sort(this._compareEvents); + if (reverse) { + evs = evs.reverse(); + } + var trim = !!startId; + for (var i = 0; i < evs.length && trim; i++) { + if (evs[i].id == startId) { + trim = false; + } + evs.splice(i, 1); + i--; + } + for (var i = 0; i < evs.length; i++) { + var eventElement = new scheduler2.$keyboardNavigation.Event(evs[i].id); + if (eventElement.getNode()) + return evs[i]; + } + return null; + }, nextEventHandler: function(id2) { + var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; + var startId = id2 || activeNode && activeNode.eventId; + var nextEvent = null; + if (startId && scheduler2.getEvent(startId)) { + var currEvent = scheduler2.getEvent(startId); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(currEvent.start_date, scheduler2.date.add(currEvent.start_date, 1, "year"), currEvent.id, false); + } + if (!nextEvent && !id2) { + var visibleDates = scheduler2.getState(); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(visibleDates.min_date, scheduler2.date.add(visibleDates.min_date, 1, "year"), null, false); } - var directions = ["left", "top"]; - for (var i = 0; i < directions.length; i++) { - var prev_margin = scheduler2["_prev_margin_" + directions[i]]; - if (scheduler2.xy["margin_" + directions[i]]) { - scheduler2["_prev_margin_" + directions[i]] = scheduler2.xy["margin_" + directions[i]]; - scheduler2.xy["margin_" + directions[i]] = 0; + if (nextEvent) { + var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); + if (!nextEv.isValid()) { + this.nextEventHandler(nextEvent.id); } else { - if (prev_margin) { - scheduler2.xy["margin_" + directions[i]] = scheduler2["_prev_margin_" + directions[i]]; - delete scheduler2["_prev_margin_" + directions[i]]; + if (activeNode) { + activeNode.blur(); } + scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); } } - scheduler2.setCurrentView(); - }; - } - function grid_view(scheduler2) { - notImplemented.alert("Grid", scheduler2.assert); + }, prevEventHandler: function(id2) { + var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; + var startId = id2 || activeNode && activeNode.eventId; + var nextEvent = null; + if (startId && scheduler2.getEvent(startId)) { + var currEvent = scheduler2.getEvent(startId); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(currEvent.end_date, -1, "year"), currEvent.end_date, currEvent.id, true); + } + if (!nextEvent && !id2) { + var visibleDates = scheduler2.getState(); + nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(visibleDates.max_date, -1, "year"), visibleDates.max_date, null, true); + } + if (nextEvent) { + var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); + if (!nextEv.isValid()) { + this.prevEventHandler(nextEvent.id); + } else { + if (activeNode) { + activeNode.blur(); + } + scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); + } + } + }, keys: { "alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9": function(e) { + var tabs = scheduler2.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab"); + var key = e.key; + if (key === void 0) { + key = e.keyCode - 48; + } + if (tabs[key * 1 - 1]) { + tabs[key * 1 - 1].click(); + } + }, "ctrl+left,meta+left": function(e) { + scheduler2._click.dhx_cal_prev_button(); + }, "ctrl+right,meta+right": function(e) { + scheduler2._click.dhx_cal_next_button(); + }, "ctrl+up,meta+up": function(e) { + var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); + dataArea.scrollTop -= 20; + }, "ctrl+down,meta+down": function(e) { + var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); + dataArea.scrollTop += 20; + }, e: function() { + this.nextEventHandler(); + }, home: function() { + scheduler2.setCurrentView(/* @__PURE__ */ new Date()); + }, "shift+e": function() { + this.prevEventHandler(); + }, "ctrl+enter,meta+enter": function() { + scheduler2.addEventNow({ start_date: new Date(scheduler2.getState().date) }); + }, "ctrl+c,meta+c": function(e) { + scheduler2._key_nav_copy_paste(e); + }, "ctrl+v,meta+v": function(e) { + scheduler2._key_nav_copy_paste(e); + }, "ctrl+x,meta+x": function(e) { + scheduler2._key_nav_copy_paste(e); + } } }); + scheduler2.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler2.$keyboardNavigation.SchedulerNode.prototype.keys); } - function html_templates(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - var els = document.body.getElementsByTagName("DIV"); - for (var i = 0; i < els.length; i++) { - var cs2 = els[i].className || ""; - cs2 = cs2.split(":"); - if (cs2.length == 2 && cs2[0] == "template") { - var code = 'return "' + (els[i].innerHTML || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\n\r]+/g, "") + '";'; - code = unescape(code).replace(/\{event\.([a-z]+)\}/g, function(all, mask) { - return '"+ev.' + mask + '+"'; - }); - scheduler2.templates[cs2[1]] = Function("start", "end", "ev", code); - els[i].style.display = "none"; + function nav_node(scheduler2) { + scheduler2.$keyboardNavigation.KeyNavNode = function() { + }; + scheduler2.$keyboardNavigation.KeyNavNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { isValid: function() { + return true; + }, fallback: function() { + return null; + }, moveTo: function(element) { + scheduler2.$keyboardNavigation.dispatcher.setActiveNode(element); + }, compareTo: function(b) { + if (!b) + return false; + for (var i in this) { + if (!!this[i] != !!b[i]) + return false; + var canStringifyThis = !!(this[i] && this[i].toString); + var canStringifyThat = !!(b[i] && b[i].toString); + if (canStringifyThat != canStringifyThis) + return false; + if (!(canStringifyThat && canStringifyThis)) { + if (b[i] != this[i]) + return false; + } else { + if (b[i].toString() != this[i].toString()) + return false; } } - }); + return true; + }, getNode: function() { + }, focus: function() { + var node = this.getNode(); + if (node) { + node.setAttribute("tabindex", "-1"); + if (node.focus) + node.focus(); + } + }, blur: function() { + var node = this.getNode(); + if (node) { + node.setAttribute("tabindex", "-1"); + } + } }); } - function keyboard_shortcuts(scheduler2) { - scheduler2.$keyboardNavigation.shortcuts = { createCommand: function() { - return { modifiers: { shift: false, alt: false, ctrl: false, meta: false }, keyCode: null }; - }, parse: function(shortcut) { - var commands = []; - var expr = this.getExpressions(this.trim(shortcut)); - for (var i = 0; i < expr.length; i++) { - var words = this.getWords(expr[i]); - var command = this.createCommand(); - for (var j = 0; j < words.length; j++) { - if (this.commandKeys[words[j]]) { - command.modifiers[words[j]] = true; - } else if (this.specialKeys[words[j]]) { - command.keyCode = this.specialKeys[words[j]]; - } else { - command.keyCode = words[j].charCodeAt(0); + function header_cell(scheduler2) { + scheduler2.$keyboardNavigation.HeaderCell = function(index) { + this.index = index || 0; + }; + scheduler2.$keyboardNavigation.HeaderCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { + index = index || this.index || 0; + var nodes = this.getNodes(); + if (nodes[index]) + return nodes[index]; + }, getNodes: function(selector) { + selector = selector || [".dhx_cal_navline .dhx_cal_prev_button", ".dhx_cal_navline .dhx_cal_next_button", ".dhx_cal_navline .dhx_cal_today_button", ".dhx_cal_navline .dhx_cal_tab"].join(", "); + var nodes = Array.prototype.slice.call(scheduler2.$container.querySelectorAll(selector)); + nodes.sort(function(a, b) { + return a.offsetLeft - b.offsetLeft; + }); + return nodes; + }, _handlers: null, isValid: function() { + return !!this.getNode(this.index); + }, fallback: function() { + var defaultCell = this.getNode(0); + if (!defaultCell) { + defaultCell = new scheduler2.$keyboardNavigation.TimeSlot(); + } + return defaultCell; + }, keys: { left: function() { + var newIndex = this.index - 1; + if (newIndex < 0) { + newIndex = this.getNodes().length - 1; + } + this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); + }, right: function() { + var newIndex = this.index + 1; + if (newIndex >= this.getNodes().length) { + newIndex = 0; + } + this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); + }, down: function() { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + }, enter: function() { + var node = this.getNode(); + if (node) { + node.click(); + } + } } }); + scheduler2.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler2.$keyboardNavigation.HeaderCell.prototype.keys); + } + function event(scheduler2) { + scheduler2.$keyboardNavigation.Event = function(id2) { + this.eventId = null; + if (scheduler2.getEvent(id2)) { + var ev = scheduler2.getEvent(id2); + this.start = new Date(ev.start_date); + this.end = new Date(ev.end_date); + this.section = this._getSection(ev); + this.eventId = id2; + } + }; + scheduler2.$keyboardNavigation.Event.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _getNodes: function() { + return Array.prototype.slice.call(scheduler2.$container.querySelectorAll("[" + scheduler2.config.event_attribute + "]")); + }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { + return !!(scheduler2.getEvent(this.eventId) && this.getNode()); + }, fallback: function() { + var eventNode = this._getNodes()[0]; + var defaultElement = null; + if (!eventNode || !scheduler2._locate_event(eventNode)) { + defaultElement = new scheduler2.$keyboardNavigation.TimeSlot(); + } else { + var id2 = scheduler2._locate_event(eventNode); + defaultElement = new scheduler2.$keyboardNavigation.Event(id2); + } + return defaultElement; + }, isScrolledIntoView: function(el2) { + var eventBox = el2.getBoundingClientRect(); + var viewPort = scheduler2.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); + if (eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom) { + return false; + } + return true; + }, getNode: function() { + var idSelector = "[" + scheduler2.config.event_attribute + "='" + this.eventId + "']"; + var inlineEditor = scheduler2.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); + if (inlineEditor) { + return inlineEditor; + } else { + if (scheduler2.isMultisectionEvent && scheduler2.isMultisectionEvent(scheduler2.getEvent(this.eventId))) { + var nodes = scheduler2.$container.querySelectorAll(idSelector); + for (var i = 0; i < nodes.length; i++) { + if (this.isScrolledIntoView(nodes[i])) { + return nodes[i]; + } } + return nodes[0]; + } else { + return scheduler2.$container.querySelector(idSelector); } - commands.push(command); } - return commands; - }, getCommandFromEvent: function(domEvent) { - var command = this.createCommand(); - command.modifiers.shift = !!domEvent.shiftKey; - command.modifiers.alt = !!domEvent.altKey; - command.modifiers.ctrl = !!domEvent.ctrlKey; - command.modifiers.meta = !!domEvent.metaKey; - command.keyCode = domEvent.which || domEvent.keyCode; - if (command.keyCode >= 96 && command.keyCode <= 105) { - command.keyCode -= 48; + }, focus: function() { + var event2 = scheduler2.getEvent(this.eventId); + var calendar = scheduler2.getState(); + if (event2.start_date.valueOf() > calendar.max_date.valueOf() || event2.end_date.valueOf() <= calendar.min_date.valueOf()) { + scheduler2.setCurrentView(event2.start_date); } - var printableKey = String.fromCharCode(command.keyCode); - if (printableKey) { - command.keyCode = printableKey.toLowerCase().charCodeAt(0); + var node = this.getNode(); + if (this.isScrolledIntoView(node)) { + scheduler2.$keyboardNavigation.dispatcher.keepScrollPosition((function() { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }).bind(this)); + } else { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); } - return command; - }, getHashFromEvent: function(domEvent) { - return this.getHash(this.getCommandFromEvent(domEvent)); - }, getHash: function(command) { - var parts = []; - for (var i in command.modifiers) { - if (command.modifiers[i]) { - parts.push(i); - } + }, blur: function() { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + }, _getSection: function(ev) { + var section = null; + var mode = scheduler2.getState().mode; + if (scheduler2.matrix && scheduler2.matrix[mode]) { + var timeline = scheduler2.matrix[scheduler2.getState().mode]; + section = ev[timeline.y_property]; + } else if (scheduler2._props && scheduler2._props[mode]) { + var unit = scheduler2._props[mode]; + section = ev[unit.map_to]; } - parts.push(command.keyCode); - return parts.join(this.junctionChar); - }, getExpressions: function(shortcut) { - return shortcut.split(this.junctionChar); - }, getWords: function(term) { - return term.split(this.combinationChar); - }, trim: function(shortcut) { - return shortcut.replace(/\s/g, ""); - }, junctionChar: ",", combinationChar: "+", commandKeys: { shift: 16, alt: 18, ctrl: 17, meta: true }, specialKeys: { backspace: 8, tab: 9, enter: 13, esc: 27, space: 32, up: 38, down: 40, left: 37, right: 39, home: 36, end: 35, pageup: 33, pagedown: 34, delete: 46, insert: 45, plus: 107, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 } }; - } - function eventhandler(scheduler2) { - scheduler2.$keyboardNavigation.EventHandler = { _handlers: null, findHandler: function(command) { - if (!this._handlers) - this._handlers = {}; - var shortcuts = scheduler2.$keyboardNavigation.shortcuts; - var hash = shortcuts.getHash(command); - return this._handlers[hash]; - }, doAction: function(command, e) { - var handler = this.findHandler(command); - if (handler) { - handler.call(this, e); - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; + return section; + }, _moveToSlot: function(dir) { + var ev = scheduler2.getEvent(this.eventId); + if (ev) { + var section = this._getSection(ev); + var slot = new scheduler2.$keyboardNavigation.TimeSlot(ev.start_date, null, section); + this.moveTo(slot.nextSlot(slot, dir)); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); } - }, bind: function(shortcut, handler) { - if (!this._handlers) - this._handlers = {}; - var shortcuts = scheduler2.$keyboardNavigation.shortcuts; - var commands = shortcuts.parse(shortcut); - for (var i = 0; i < commands.length; i++) { - this._handlers[shortcuts.getHash(commands[i])] = handler; + }, keys: { left: function() { + this._moveToSlot("left"); + }, right: function() { + this._moveToSlot("right"); + }, down: function() { + if (this.getMode() == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); + } else { + this._moveToSlot("down"); } - }, unbind: function(shortcut) { - var shortcuts = scheduler2.$keyboardNavigation.shortcuts; - var commands = shortcuts.parse(shortcut); - for (var i = 0; i < commands.length; i++) { - if (this._handlers[shortcuts.getHash(commands[i])]) { - delete this._handlers[shortcuts.getHash(commands[i])]; - } + }, space: function() { + var node = this.getNode(); + if (node && node.click) { + node.click(); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); } - }, bindAll: function(map) { - for (var i in map) { - this.bind(i, map[i]); + }, up: function() { + if (this.getMode() == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); + } else { + this._moveToSlot("up"); } - }, initKeys: function() { - if (!this._handlers) - this._handlers = {}; - if (this.keys) { - this.bindAll(this.keys); + }, delete: function() { + if (scheduler2.getEvent(this.eventId)) { + scheduler2._click.buttons["delete"](this.eventId); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); } - } }; + }, enter: function() { + if (scheduler2.getEvent(this.eventId)) { + scheduler2.showLightbox(this.eventId); + } else { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + } + } } }); + scheduler2.$keyboardNavigation.Event.prototype.bindAll(scheduler2.$keyboardNavigation.Event.prototype.keys); } - function trap_modal_focus(scheduler2) { - (function() { - scheduler2.$keyboardNavigation.getFocusableNodes = scheduler2._getFocusableNodes; - scheduler2.$keyboardNavigation.trapFocus = function trapFocus(root, e) { - if (e.keyCode != 9) - return false; - var focusable = scheduler2.$keyboardNavigation.getFocusableNodes(root); - var currentFocus = document.activeElement; - var currentIndex = -1; - for (var i = 0; i < focusable.length; i++) { - if (focusable[i] == currentFocus) { - currentIndex = i; - break; - } - } - var nextIndex, nextItem; - if (e.shiftKey) { - nextIndex = currentIndex <= 0 ? focusable.length - 1 : currentIndex - 1; - nextItem = focusable[nextIndex]; - if (nextItem) { - nextItem.focus(); - e.preventDefault(); - return true; - } + function time_slot(scheduler2) { + scheduler2.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate) { + var state = scheduler2.getState(); + var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; + if (!from) { + from = this.getDefaultDate(); + } + if (!to) { + if (timeline) { + to = scheduler2.date.add(from, timeline.x_step, timeline.x_unit); } else { - nextIndex = currentIndex >= focusable.length - 1 ? 0 : currentIndex + 1; - nextItem = focusable[nextIndex]; - if (nextItem) { - nextItem.focus(); - e.preventDefault(); - return true; - } + to = scheduler2.date.add(from, scheduler2.config.key_nav_step, "minute"); } - return false; - }; - })(); - } - function marker(scheduler2) { - scheduler2.$keyboardNavigation.marker = { clear: function() { - var divs = scheduler2.$container.querySelectorAll(".dhx_focus_slot"); - for (var i = 0; i < divs.length; i++) { - divs[i].parentNode.removeChild(divs[i]); - } - }, createElement: function() { - var element = document.createElement("div"); - element.setAttribute("tabindex", -1); - element.className = "dhx_focus_slot"; - return element; - }, renderMultiple: function(start, end, method) { - var divs = []; - var currentStart = new Date(start); - var currentEnd = new Date(Math.min(end.valueOf(), scheduler2.date.add(scheduler2.date.day_start(new Date(start)), 1, "day").valueOf())); - while (currentStart.valueOf() < end.valueOf()) { - divs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf())))); - currentStart = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); - currentEnd = scheduler2.date.day_start(scheduler2.date.add(currentStart, 1, "day")); - currentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf())); } - return divs; - }, render: function(start, end, section) { - this.clear(); - var divs = []; - var modes = scheduler2.$keyboardNavigation.TimeSlot.prototype._modes; - var view = scheduler2.$keyboardNavigation.TimeSlot.prototype._getMode(); - switch (view) { - case modes.units: - divs = this.renderVerticalMarker(start, end, section); - break; - case modes.timeline: - divs = this.renderTimelineMarker(start, end, section); - break; - case modes.year: - divs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker)); - break; - case modes.month: - divs = this.renderMonthMarker(start, end); - break; - case modes.weekAgenda: - divs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker)); - break; - case modes.list: - divs = this.renderAgendaMarker(start, end); - break; - case modes.dayColumns: - divs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker)); - break; + this.section = section || this._getDefaultSection(); + this.start_date = new Date(from); + this.end_date = new Date(to); + this.movingDate = movingDate || null; + }; + scheduler2.$keyboardNavigation.TimeSlot.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _handlers: null, getDefaultDate: function() { + var from; + var state = scheduler2.getState(); + var visibleTime = new Date(state.date); + visibleTime.setSeconds(0); + visibleTime.setMilliseconds(0); + var nowTime = /* @__PURE__ */ new Date(); + nowTime.setSeconds(0); + nowTime.setMilliseconds(0); + var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; + var showNowTime = false; + if (visibleTime.valueOf() === nowTime.valueOf()) { + showNowTime = true; } - this.addWaiAriaLabel(divs, start, end, section); - this.addDataAttributes(divs, start, end, section); - for (var i = divs.length - 1; i >= 0; i--) { - if (divs[i].offsetWidth) { - return divs[i]; + if (timeline) { + if (showNowTime) { + if (timeline.x_unit === "day") { + nowTime.setHours(0); + nowTime.setMinutes(0); + } else if (timeline.x_unit === "hour") { + nowTime.setMinutes(0); + } + from = nowTime; + } else { + from = scheduler2.date[timeline.name + "_start"](new Date(state.date)); + } + from = this.findVisibleColumn(from); + } else { + from = new Date(scheduler2.getState().min_date); + if (showNowTime) { + from = nowTime; } - } - return null; - }, addDataAttributes: function(divs, start, end, section) { - var dateToStr = scheduler2.date.date_to_str(scheduler2.config.api_date); - var from = dateToStr(start), to = dateToStr(end); - for (var i = 0; i < divs.length; i++) { - divs[i].setAttribute("data-start-date", from); - divs[i].setAttribute("data-end-date", to); - if (section) { - divs[i].setAttribute("data-section", section); + from = this.findVisibleColumn(from); + if (!showNowTime) { + from.setHours(scheduler2.config.first_hour); + } + if (!scheduler2._table_view) { + var dataContainer = scheduler2.$container.querySelector(".dhx_cal_data"); + if (dataContainer.scrollTop) { + from.setHours(scheduler2.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler2.config.hour_size_px)); + } } } - }, addWaiAriaLabel: function(divs, start, end, section) { - var label = ""; + return from; + }, clone: function(timeslot) { + return new scheduler2.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate); + }, _getMultisectionView: function() { var state = scheduler2.getState(); - var mode = state.mode; - var dateTimeLabel = false; - label += scheduler2.templates.day_date(start); - if (scheduler2.date.day_start(new Date(start)).valueOf() != start.valueOf()) { - label += " " + scheduler2.templates.hour_scale(start); - dateTimeLabel = true; - } - if (scheduler2.date.day_start(new Date(start)).valueOf() != scheduler2.date.day_start(new Date(end)).valueOf()) { - label += " - " + scheduler2.templates.day_date(end); - if (dateTimeLabel || scheduler2.date.day_start(new Date(end)).valueOf() != end.valueOf()) { - label += " " + scheduler2.templates.hour_scale(end); - } + var view; + if (scheduler2._props && scheduler2._props[state.mode]) { + view = scheduler2._props[state.mode]; + } else if (scheduler2.matrix && scheduler2.matrix[state.mode]) { + view = scheduler2.matrix[state.mode]; } - if (section) { - if (scheduler2.matrix && scheduler2.matrix[mode]) { - const timeline = scheduler2.matrix[mode]; - const sectionObject = timeline.y_unit[timeline.order[section]]; - label += ", " + scheduler2.templates[mode + "_scale_label"](sectionObject.key, sectionObject.label, sectionObject); - } else if (scheduler2._props && scheduler2._props[mode]) { - const units = scheduler2._props[mode]; - const sectionObject = units.options[units.order[section]]; - label += ", " + scheduler2.templates[mode + "_scale_text"](sectionObject.key, sectionObject.label, sectionObject); - } + return view; + }, _getDefaultSection: function() { + var section = null; + var view = this._getMultisectionView(); + if (view && !section) { + section = this._getNextSection(); } - for (var i = 0; i < divs.length; i++) { - scheduler2._waiAria.setAttributes(divs[i], { "aria-label": label, "aria-live": "polite" }); + return section; + }, _getNextSection: function(sectionId, dir) { + var view = this._getMultisectionView(); + var currentIndex = view.order[sectionId]; + var nextIndex = currentIndex; + if (currentIndex !== void 0) { + nextIndex = currentIndex + dir; + } else { + nextIndex = view.size && view.position ? view.position : 0; } - }, renderWeekAgendaMarker: function(start_date, end_date) { - var divs = scheduler2.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar"); - var currDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); - var index = -1; - var markerDate = scheduler2.date.day_start(new Date(start_date)); - for (var i = 0; i < divs.length; i++) { - index++; - if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { - break; - } else { - currDate = scheduler2.date.add(currDate, 1, "day"); - } + if (nextIndex < 0) { + nextIndex = 0; } - if (index != -1) - return this._wrapDiv(divs[index]); - return []; - }, _wrapDiv: function(cell) { - var marker2 = this.createElement(); - marker2.style.top = cell.offsetTop + "px"; - marker2.style.left = cell.offsetLeft + "px"; - marker2.style.width = cell.offsetWidth + "px"; - marker2.style.height = cell.offsetHeight + "px"; - cell.appendChild(marker2); - return [marker2]; - }, renderYearMarker: function(start_date, end_date) { - var cell = scheduler2._get_year_cell(start_date); - cell.style.position = "relative"; - var marker2 = this.createElement(); - marker2.style.top = "0px"; - marker2.style.left = "0px"; - marker2.style.width = "100%"; - marker2.style.height = "100%"; - cell.appendChild(marker2); - return [marker2]; - }, renderAgendaMarker: function(start_date, end_date) { - var block = this.createElement(); - block.style.height = "1px"; - block.style.width = "100%"; - block.style.opacity = 1; - block.style.top = "0px"; - block.style.left = "0px"; - scheduler2.$container.querySelector(".dhx_cal_data").appendChild(block); - return [block]; - }, renderTimelineMarker: function(start_date, end_date, section) { - var view_opts = scheduler2._lame_copy({}, scheduler2.matrix[scheduler2._mode]); - var areas = view_opts._scales; - view_opts.round_position = false; - var blocks = []; - var min_date = start_date ? new Date(start_date) : scheduler2._min_date; - var max_date = end_date ? new Date(end_date) : scheduler2._max_date; - if (min_date.valueOf() < scheduler2._min_date.valueOf()) - min_date = new Date(scheduler2._min_date); - if (max_date.valueOf() > scheduler2._max_date.valueOf()) - max_date = new Date(scheduler2._max_date); - if (!view_opts._trace_x) - return blocks; - for (var i = 0; i < view_opts._trace_x.length; i++) { - if (scheduler2._is_column_visible(view_opts._trace_x[i])) - break; + var options = view.options || view.y_unit; + if (nextIndex >= options.length) { + nextIndex = options.length - 1; } - if (i == view_opts._trace_x.length) - return blocks; - var area = areas[section]; - if (!(min_date < end_date && max_date > start_date)) - return blocks; - var block = this.createElement(); - let start_pos; - let end_pos; - function set_date_part(source, target) { - target.setDate(1); - target.setFullYear(source.getFullYear()); - target.setMonth(source.getMonth()); - target.setDate(source.getDate()); + if (options[nextIndex]) { + return options[nextIndex].key; + } else { + return null; } - if (!scheduler2.getView().days) { - start_pos = scheduler2._timeline_getX({ start_date }, false, view_opts); - end_pos = scheduler2._timeline_getX({ start_date: end_date }, false, view_opts); + }, isValid: function() { + var state = scheduler2.getState(); + var isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf()); + if (!isInRange) + return false; + if (!this.isVisible(this.start_date, this.end_date)) + return false; + var view = this._getMultisectionView(); + if (view) { + return view.order[this.section] !== void 0; } else { - const tempStart = new Date(start_date); - set_date_part(scheduler2._min_date, tempStart); - const tempEnd = new Date(end_date); - set_date_part(scheduler2._min_date, tempEnd); - start_pos = scheduler2._timeline_getX({ start_date: tempStart }, false, view_opts); - end_pos = scheduler2._timeline_getX({ start_date: tempEnd }, false, view_opts); + return true; } - var height = view_opts._section_height[section] - 1 || view_opts.dy - 1; - var top = 0; - if (scheduler2._isRender("cell")) { - top = area.offsetTop; - start_pos += view_opts.dx; - end_pos += view_opts.dx; - area = scheduler2.$container.querySelector(".dhx_cal_data"); + }, fallback: function() { + var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); + if (!defaultSlot.isValid()) { + return new scheduler2.$keyboardNavigation.DataArea(); + } else { + return defaultSlot; } - var width = Math.max(1, end_pos - start_pos - 1); - let direction = "left"; - if (scheduler2.config.rtl) { - direction = "right"; + }, getNodes: function() { + return Array.prototype.slice.call(scheduler2.$container.querySelectorAll(".dhx_focus_slot")); + }, getNode: function() { + return this.getNodes()[0]; + }, focus: function() { + if (this.section && scheduler2.getView() && scheduler2.getView().smart_rendering && scheduler2.getView().scrollTo && !scheduler2.$container.querySelector(`[data-section-id="${this.section}"]`)) { + scheduler2.getView().scrollTo({ section: this.section }); } - block.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`; - if (area) { - area.appendChild(block); - blocks.push(block); + scheduler2.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + scheduler2.$keyboardNavigation._pasteDate = this.start_date; + scheduler2.$keyboardNavigation._pasteSection = this.section; + }, blur: function() { + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + scheduler2.$keyboardNavigation.marker.clear(); + }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, _getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, addMonthDate: function(date, dir, extend2) { + var res; + switch (dir) { + case "up": + res = scheduler2.date.add(date, -1, "week"); + break; + case "down": + res = scheduler2.date.add(date, 1, "week"); + break; + case "left": + res = scheduler2.date.day_start(scheduler2.date.add(date, -1, "day")); + res = this.findVisibleColumn(res, -1); + break; + case "right": + res = scheduler2.date.day_start(scheduler2.date.add(date, 1, "day")); + res = this.findVisibleColumn(res, 1); + break; + default: + res = scheduler2.date.day_start(new Date(date)); + break; } - return blocks; - }, renderMonthCell: function(date) { - var cells = scheduler2.$container.querySelectorAll(".dhx_month_head"); - var divs = []; - for (var i = 0; i < cells.length; i++) { - divs.push(cells[i].parentNode); + var state = scheduler2.getState(); + if (date.valueOf() < state.min_date.valueOf() || !extend2 && date.valueOf() >= state.max_date.valueOf()) { + res = new Date(state.min_date); } - var firstDate = scheduler2.date.week_start(new Date(scheduler2.getState().min_date)); - var index = -1; - var weekNumber = 0; - var dayIndex = -1; - var currDate = firstDate; - var markerDate = scheduler2.date.day_start(new Date(date)); - for (var i = 0; i < divs.length; i++) { - index++; - if (dayIndex == 6) { - weekNumber++; - dayIndex = 0; - } else { - dayIndex++; - } - if (scheduler2.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()) { - break; - } else { - currDate = scheduler2.date.add(currDate, 1, "day"); - } + return res; + }, nextMonthSlot: function(slot, dir, extend2) { + var start, end; + start = this.addMonthDate(slot.start_date, dir, extend2); + start.setHours(scheduler2.config.first_hour); + end = new Date(start); + end.setHours(scheduler2.config.last_hour); + return { start_date: start, end_date: end }; + }, _alignTimeSlot: function(date, minDate, unit, step) { + var currentDate = new Date(minDate); + while (currentDate.valueOf() < date.valueOf()) { + currentDate = scheduler2.date.add(currentDate, step, unit); } - if (index == -1) { - return []; + if (currentDate.valueOf() > date.valueOf()) { + currentDate = scheduler2.date.add(currentDate, -step, unit); } - var left = scheduler2._colsS[dayIndex]; - var top = scheduler2._colsS.heights[weekNumber]; - var div = this.createElement(); - div.style.top = top + "px"; - div.style.left = left + "px"; - div.style.width = scheduler2._cols[dayIndex] + "px"; - div.style.height = (scheduler2._colsS.heights[weekNumber + 1] - top || scheduler2._colsS.height) + "px"; - var container = scheduler2.$container.querySelector(".dhx_cal_data"); - var datatable = container.querySelector(".dhx_cal_month_table"); - if (datatable.nextSibling) { - container.insertBefore(div, datatable.nextSibling); - } else { - container.appendChild(div); + return currentDate; + }, nextTimelineSlot: function(slot, dir, extend2) { + var state = scheduler2.getState(); + var view = scheduler2.matrix[state.mode]; + var startDate = this._alignTimeSlot(slot.start_date, scheduler2.date[view.name + "_start"](new Date(slot.start_date)), view.x_unit, view.x_step); + var endDate = this._alignTimeSlot(slot.end_date, scheduler2.date[view.name + "_start"](new Date(slot.end_date)), view.x_unit, view.x_step); + if (endDate.valueOf() <= startDate.valueOf()) { + endDate = scheduler2.date.add(startDate, view.x_step, view.x_unit); } - return div; - }, renderMonthMarker: function(start_date, end_date) { - var res = []; - var currentDate = start_date; - while (currentDate.valueOf() < end_date.valueOf()) { - res.push(this.renderMonthCell(currentDate)); - currentDate = scheduler2.date.add(currentDate, 1, "day"); + var newPos = this.clone(slot); + newPos.start_date = startDate; + newPos.end_date = endDate; + newPos.section = slot.section || this._getNextSection(); + switch (dir) { + case "up": + newPos.section = this._getNextSection(slot.section, -1); + break; + case "down": + newPos.section = this._getNextSection(slot.section, 1); + break; + case "left": + newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, -view.x_step, view.x_unit), -1); + newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); + break; + case "right": + newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit), 1); + newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); + break; } - return res; - }, renderVerticalMarker: function(start_date, end_date, section) { - var index = scheduler2.locate_holder_day(start_date); - var divs = []; - var area = null; - var c = scheduler2.config; - if (scheduler2._ignores[index]) - return divs; - if (scheduler2._props && scheduler2._props[scheduler2._mode] && section) { - var view = scheduler2._props[scheduler2._mode]; - index = view.order[section]; - var inner_index = view.order[section]; - if (!(view.days > 1)) { - index = inner_index; - if (view.size && index > view.position + view.size) { - index = 0; - } + if (newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()) { + if (extend2 && newPos.start_date.valueOf() >= state.max_date.valueOf()) { + newPos.start_date = new Date(state.max_date); } else { - index = scheduler2.locate_holder_day(start_date) + inner_index; + newPos.start_date = scheduler2.date[state.mode + "_start"](scheduler2.date.add(state.date, dir == "left" ? -1 : 1, state.mode)); + newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); } } - area = scheduler2.locate_holder(index); - if (!area || area.querySelector(".dhx_scale_hour")) { - return document.createElement("div"); + return newPos; + }, nextUnitsSlot: function(slot, dir, extend2) { + var newPos = this.clone(slot); + newPos.section = slot.section || this._getNextSection(); + var section = slot.section || this._getNextSection(); + var state = scheduler2.getState(); + var view = scheduler2._props[state.mode]; + switch (dir) { + case "left": + section = this._getNextSection(slot.section, -1); + var optionsCount = view.size ? view.size - 1 : view.options.length; + if (view.days > 1 && view.order[section] == optionsCount - 1) { + if (scheduler2.date.add(slot.start_date, -1, "day").valueOf() >= state.min_date.valueOf()) { + newPos = this.nextDaySlot(slot, dir, extend2); + } + } + break; + case "right": + section = this._getNextSection(slot.section, 1); + if (view.days > 1 && !view.order[section]) { + if (scheduler2.date.add(slot.start_date, 1, "day").valueOf() < state.max_date.valueOf()) { + newPos = this.nextDaySlot(slot, dir, extend2); + } + } + break; + default: + newPos = this.nextDaySlot(slot, dir, extend2); + section = slot.section; + break; } - var start = Math.max(start_date.getHours() * 60 + start_date.getMinutes(), c.first_hour * 60); - var end = Math.min(end_date.getHours() * 60 + end_date.getMinutes(), c.last_hour * 60); - if (!end && scheduler2.date.day_start(new Date(end_date)).valueOf() > scheduler2.date.day_start(new Date(start_date)).valueOf()) { - end = c.last_hour * 60; + newPos.section = section; + return newPos; + }, _moveDate: function(oldDate, dir) { + var newDate = this.findVisibleColumn(scheduler2.date.add(oldDate, dir, "day"), dir); + newDate.setHours(oldDate.getHours()); + newDate.setMinutes(oldDate.getMinutes()); + return newDate; + }, isBeforeLastHour: function(date, isStartDate) { + var minutes = date.getMinutes(), hours = date.getHours(), last_hour = scheduler2.config.last_hour; + return hours < last_hour || !isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes); + }, isAfterFirstHour: function(date, isStartDate) { + var minutes = date.getMinutes(), hours = date.getHours(), first_hour = scheduler2.config.first_hour, last_hour = scheduler2.config.last_hour; + return hours >= first_hour || !isStartDate && (!minutes && (!hours && last_hour == 24 || hours == last_hour)); + }, isInVisibleDayTime: function(date, isStartDate) { + return this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate); + }, nextDaySlot: function(slot, dir, extend2) { + var start, end; + var key_nav_step = scheduler2.config.key_nav_step; + var date = this._alignTimeSlot(slot.start_date, scheduler2.date.day_start(new Date(slot.start_date)), "minute", key_nav_step); + var oldStart = slot.start_date; + switch (dir) { + case "up": + start = scheduler2.date.add(date, -key_nav_step, "minute"); + if (!this.isInVisibleDayTime(start, true)) { + if (!extend2 || this.isInVisibleDayTime(oldStart, true)) { + var toNextDay = true; + if (extend2 && scheduler2.date.date_part(new Date(start)).valueOf() != scheduler2.date.date_part(new Date(oldStart)).valueOf()) + toNextDay = false; + if (toNextDay) + start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, -1, "day"), -1); + start.setHours(scheduler2.config.last_hour); + start.setMinutes(0); + start = scheduler2.date.add(start, -key_nav_step, "minute"); + } + } + end = scheduler2.date.add(start, key_nav_step, "minute"); + break; + case "down": + start = scheduler2.date.add(date, key_nav_step, "minute"); + var testEnd = extend2 ? start : scheduler2.date.add(start, key_nav_step, "minute"); + if (!this.isInVisibleDayTime(testEnd, false)) { + if (!extend2 || this.isInVisibleDayTime(oldStart, false)) { + if (!extend2) { + start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); + start.setHours(scheduler2.config.first_hour); + start.setMinutes(0); + } else { + var toNextDay = true; + if (scheduler2.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) { + toNextDay = false; + } + if (toNextDay) { + start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); + } + start.setHours(scheduler2.config.first_hour); + start.setMinutes(0); + start = scheduler2.date.add(start, key_nav_step, "minute"); + } + } + } + end = scheduler2.date.add(start, key_nav_step, "minute"); + break; + case "left": + start = this._moveDate(slot.start_date, -1); + end = this._moveDate(slot.end_date, -1); + break; + case "right": + start = this._moveDate(slot.start_date, 1); + end = this._moveDate(slot.end_date, 1); + break; + default: + start = date; + end = scheduler2.date.add(start, key_nav_step, "minute"); + break; } - if (end <= start) { - return []; + return { start_date: start, end_date: end }; + }, nextWeekAgendaSlot: function(slot, dir) { + var start, end; + var state = scheduler2.getState(); + switch (dir) { + case "down": + case "left": + start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, -1, "day")); + start = this.findVisibleColumn(start, -1); + break; + case "up": + case "right": + start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, 1, "day")); + start = this.findVisibleColumn(start, 1); + break; + default: + start = scheduler2.date.day_start(slot.start_date); + break; } - var block = this.createElement(); - var all_hours_height = scheduler2.config.hour_size_px * c.last_hour + 1; - var hour_ms = 60 * 60 * 1e3; - block.style.top = Math.round((start * 60 * 1e3 - scheduler2.config.first_hour * hour_ms) * scheduler2.config.hour_size_px / hour_ms) % all_hours_height + "px"; - block.style.lineHeight = block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * scheduler2.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; - block.style.width = "100%"; - area.appendChild(block); - divs.push(block); - return divs[0]; - } }; - } - function scheduler_node(scheduler2) { - scheduler2.$keyboardNavigation.SchedulerNode = function() { - }; - scheduler2.$keyboardNavigation.SchedulerNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { getDefaultNode: function() { - var node = new scheduler2.$keyboardNavigation.TimeSlot(); - if (!node.isValid()) { - node = node.fallback(); + if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { + start = new Date(state.min_date); } - return node; - }, _modes: { month: "month", year: "year", dayColumns: "dayColumns", timeline: "timeline", units: "units", weekAgenda: "weekAgenda", list: "list" }, getMode: function() { - var state = scheduler2.getState(); - var mode = state.mode; - if (scheduler2.matrix && scheduler2.matrix[mode]) { - return this._modes.timeline; - } else if (scheduler2._props && scheduler2._props[mode]) { - return this._modes.units; - } else if (mode == "month") { - return this._modes.month; - } else if (mode == "year") { - return this._modes.year; - } else if (mode == "week_agenda") { - return this._modes.weekAgenda; - } else if (mode == "map" || mode == "agenda" || scheduler2._grid && scheduler2["grid_" + mode]) { - return this._modes.list; + end = new Date(start); + end.setHours(scheduler2.config.last_hour); + return { start_date: start, end_date: end }; + }, nextAgendaSlot: function(slot, dir) { + return { start_date: slot.start_date, end_date: slot.end_date }; + }, isDateVisible: function(date) { + if (!scheduler2._ignores_detected) + return true; + var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; + var index; + if (timeline) { + index = scheduler2._get_date_index(timeline, date); } else { - return this._modes.dayColumns; + index = scheduler2.locate_holder_day(date); } - }, focus: function() { - scheduler2.focus(); - }, blur: function() { - }, disable: function() { - scheduler2.$container.setAttribute("tabindex", "0"); - }, enable: function() { - if (scheduler2.$container) - scheduler2.$container.removeAttribute("tabindex"); - }, isEnabled: function() { - return scheduler2.$container.hasAttribute("tabindex"); - }, _compareEvents: function(a, b) { - if (a.start_date.valueOf() == b.start_date.valueOf()) - return a.id > b.id ? 1 : -1; - return a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1; - }, _pickEvent: function(from, to, startId, reverse) { - var range = scheduler2.getState(); - from = new Date(Math.max(range.min_date.valueOf(), from.valueOf())); - to = new Date(Math.min(range.max_date.valueOf(), to.valueOf())); - var evs = scheduler2.getEvents(from, to); - evs.sort(this._compareEvents); - if (reverse) { - evs = evs.reverse(); + return !scheduler2._ignores[index]; + }, findVisibleColumn: function(start, dir) { + var date = start; + dir = dir || 1; + var range2 = scheduler2.getState(); + while (!this.isDateVisible(date) && (dir > 0 && date.valueOf() <= range2.max_date.valueOf() || dir < 0 && date.valueOf() >= range2.min_date.valueOf())) { + date = this.nextDateColumn(date, dir); } - var trim = !!startId; - for (var i = 0; i < evs.length && trim; i++) { - if (evs[i].id == startId) { - trim = false; - } - evs.splice(i, 1); - i--; + return date; + }, nextDateColumn: function(start, dir) { + dir = dir || 1; + var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; + var date; + if (timeline) { + date = scheduler2.date.add(start, dir * timeline.x_step, timeline.x_unit); + } else { + date = scheduler2.date.day_start(scheduler2.date.add(start, dir, "day")); } - for (var i = 0; i < evs.length; i++) { - var eventElement = new scheduler2.$keyboardNavigation.Event(evs[i].id); - if (eventElement.getNode()) - return evs[i]; + return date; + }, isVisible: function(from, to) { + if (!scheduler2._ignores_detected) + return true; + var current = new Date(from); + while (current.valueOf() < to.valueOf()) { + if (this.isDateVisible(current)) + return true; + current = this.nextDateColumn(current); } - return null; - }, nextEventHandler: function(id2) { - var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; - var startId = id2 || activeNode && activeNode.eventId; - var nextEvent = null; - if (startId && scheduler2.getEvent(startId)) { - var currEvent = scheduler2.getEvent(startId); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(currEvent.start_date, scheduler2.date.add(currEvent.start_date, 1, "year"), currEvent.id, false); + return false; + }, nextSlot: function(slot, dir, view, extend2) { + var next; + view = view || this._getMode(); + var tempSlot = scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); + switch (view) { + case this._modes.units: + next = this.nextUnitsSlot(tempSlot, dir, extend2); + break; + case this._modes.timeline: + next = this.nextTimelineSlot(tempSlot, dir, extend2); + break; + case this._modes.year: + next = this.nextMonthSlot(tempSlot, dir, extend2); + break; + case this._modes.month: + next = this.nextMonthSlot(tempSlot, dir, extend2); + break; + case this._modes.weekAgenda: + next = this.nextWeekAgendaSlot(tempSlot, dir, extend2); + break; + case this._modes.list: + next = this.nextAgendaSlot(tempSlot, dir, extend2); + break; + case this._modes.dayColumns: + next = this.nextDaySlot(tempSlot, dir, extend2); + break; } - if (!nextEvent && !id2) { - var visibleDates = scheduler2.getState(); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(visibleDates.min_date, scheduler2.date.add(visibleDates.min_date, 1, "year"), null, false); + if (next.start_date.valueOf() >= next.end_date.valueOf()) { + next = this.nextSlot(next, dir, view); } - if (nextEvent) { - var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); - if (!nextEv.isValid()) { - this.nextEventHandler(nextEvent.id); - } else { - if (activeNode) { - activeNode.blur(); + return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); + }, extendSlot: function(slot, dir) { + var view = this._getMode(); + var next; + switch (view) { + case this._modes.units: + if (dir == "left" || dir == "right") { + next = this.nextUnitsSlot(slot, dir); + } else { + next = this.extendUnitsSlot(slot, dir); } - scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); - } - } - }, prevEventHandler: function(id2) { - var activeNode = scheduler2.$keyboardNavigation.dispatcher.activeNode; - var startId = id2 || activeNode && activeNode.eventId; - var nextEvent = null; - if (startId && scheduler2.getEvent(startId)) { - var currEvent = scheduler2.getEvent(startId); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(currEvent.end_date, -1, "year"), currEvent.end_date, currEvent.id, true); + break; + case this._modes.timeline: + if (dir == "down" || dir == "up") { + next = this.nextTimelineSlot(slot, dir); + } else { + next = this.extendTimelineSlot(slot, dir); + } + break; + case this._modes.year: + next = this.extendMonthSlot(slot, dir); + break; + case this._modes.month: + next = this.extendMonthSlot(slot, dir); + break; + case this._modes.dayColumns: + next = this.extendDaySlot(slot, dir); + break; + case this._modes.weekAgenda: + next = this.extendWeekAgendaSlot(slot, dir); + break; + default: + next = slot; + break; } - if (!nextEvent && !id2) { - var visibleDates = scheduler2.getState(); - nextEvent = scheduler2.$keyboardNavigation.SchedulerNode.prototype._pickEvent(scheduler2.date.add(visibleDates.max_date, -1, "year"), visibleDates.max_date, null, true); + var range2 = scheduler2.getState(); + if (next.start_date.valueOf() < range2.min_date.valueOf()) { + next.start_date = this.findVisibleColumn(range2.min_date); + next.start_date.setHours(scheduler2.config.first_hour); } - if (nextEvent) { - var nextEv = new scheduler2.$keyboardNavigation.Event(nextEvent.id); - if (!nextEv.isValid()) { - this.prevEventHandler(nextEvent.id); - } else { - if (activeNode) { - activeNode.blur(); - } - scheduler2.$keyboardNavigation.dispatcher.setActiveNode(nextEv); - } + if (next.end_date.valueOf() > range2.max_date.valueOf()) { + next.end_date = this.findVisibleColumn(range2.max_date, -1); } - }, keys: { "alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9": function(e) { - var tabs = scheduler2.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab"); - var key = e.key; - if (key === void 0) { - key = e.keyCode - 48; + return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); + }, extendTimelineSlot: function(slot, direction) { + return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "timeline"); + }, extendWeekAgendaSlot: function(slot, direction) { + return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "weekAgenda"); + }, extendGenericSlot: function(allowedDirections, slot, direction, type) { + var next; + var moveDate = slot.movingDate; + if (!moveDate) { + moveDate = allowedDirections[direction]; } - if (tabs[key * 1 - 1]) { - tabs[key * 1 - 1].click(); + if (!moveDate || !allowedDirections[direction]) { + return slot; } - }, "ctrl+left,meta+left": function(e) { - scheduler2._click.dhx_cal_prev_button(); - }, "ctrl+right,meta+right": function(e) { - scheduler2._click.dhx_cal_next_button(); - }, "ctrl+up,meta+up": function(e) { - var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); - dataArea.scrollTop -= 20; - }, "ctrl+down,meta+down": function(e) { - var dataArea = scheduler2.$container.querySelector(".dhx_cal_data"); - dataArea.scrollTop += 20; - }, e: function() { - this.nextEventHandler(); - }, home: function() { - scheduler2.setCurrentView(/* @__PURE__ */ new Date()); - }, "shift+e": function() { - this.prevEventHandler(); - }, "ctrl+enter,meta+enter": function() { - scheduler2.addEventNow({ start_date: new Date(scheduler2.getState().date) }); - }, "ctrl+c,meta+c": function(e) { - scheduler2._key_nav_copy_paste(e); - }, "ctrl+v,meta+v": function(e) { - scheduler2._key_nav_copy_paste(e); - }, "ctrl+x,meta+x": function(e) { - scheduler2._key_nav_copy_paste(e); - } } }); - scheduler2.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler2.$keyboardNavigation.SchedulerNode.prototype.keys); - } - function nav_node(scheduler2) { - scheduler2.$keyboardNavigation.KeyNavNode = function() { - }; - scheduler2.$keyboardNavigation.KeyNavNode.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.EventHandler, { isValid: function() { - return true; - }, fallback: function() { - return null; - }, moveTo: function(element) { - scheduler2.$keyboardNavigation.dispatcher.setActiveNode(element); - }, compareTo: function(b) { - if (!b) - return false; - for (var i in this) { - if (!!this[i] != !!b[i]) - return false; - var canStringifyThis = !!(this[i] && this[i].toString); - var canStringifyThat = !!(b[i] && b[i].toString); - if (canStringifyThat != canStringifyThis) - return false; - if (!(canStringifyThat && canStringifyThis)) { - if (b[i] != this[i]) - return false; - } else { - if (b[i].toString() != this[i].toString()) - return false; + if (direction) { + next = this.nextSlot({ start_date: slot[moveDate], section: slot.section }, direction, type, true); + if (next.start_date.valueOf() == slot.start_date.valueOf()) { + next = this.nextSlot({ start_date: next.start_date, section: next.section }, direction, type, true); } + next.movingDate = moveDate; + } else { + return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); + } + var newDates = this.extendSlotDates(slot, next, next.movingDate); + if (newDates.end_date.valueOf() <= newDates.start_date.valueOf()) { + next.movingDate = next.movingDate == "end_date" ? "start_date" : "end_date"; + } + newDates = this.extendSlotDates(slot, next, next.movingDate); + next.start_date = newDates.start_date; + next.end_date = newDates.end_date; + return next; + }, extendSlotDates: function(oldSlot, newSlot, dateDirection) { + var res = { start_date: null, end_date: null }; + if (dateDirection == "start_date") { + res.start_date = newSlot.start_date; + res.end_date = oldSlot.end_date; + } else { + res.start_date = oldSlot.start_date; + res.end_date = newSlot.start_date; } - return true; - }, getNode: function() { - }, focus: function() { - var node = this.getNode(); - if (node) { - node.setAttribute("tabindex", "-1"); - if (node.focus) - node.focus(); + return res; + }, extendMonthSlot: function(slot, direction) { + var slot = this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "month"); + slot.start_date.setHours(scheduler2.config.first_hour); + slot.end_date = scheduler2.date.add(slot.end_date, -1, "day"); + slot.end_date.setHours(scheduler2.config.last_hour); + return slot; + }, extendUnitsSlot: function(slot, direction) { + var next; + switch (direction) { + case "down": + case "up": + next = this.extendDaySlot(slot, direction); + break; + default: + next = slot; + break; } - }, blur: function() { - var node = this.getNode(); - if (node) { - node.setAttribute("tabindex", "-1"); + next.section = slot.section; + return next; + }, extendDaySlot: function(slot, direction) { + return this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "dayColumns"); + }, scrollSlot: function(dir) { + var state = scheduler2.getState(); + var slot = this.nextSlot(this, dir); + if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { + scheduler2.setCurrentView(new Date(slot.start_date)); } - } }); + this.moveTo(slot); + }, keys: { left: function() { + this.scrollSlot("left"); + }, right: function() { + this.scrollSlot("right"); + }, down: function() { + var mode = this._getMode(); + if (mode == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); + } else { + this.scrollSlot("down"); + } + }, up: function() { + var mode = this._getMode(); + if (mode == this._modes.list) { + scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); + } else { + this.scrollSlot("up"); + } + }, "shift+down": function() { + this.moveTo(this.extendSlot(this, "down")); + }, "shift+up": function() { + this.moveTo(this.extendSlot(this, "up")); + }, "shift+right": function() { + this.moveTo(this.extendSlot(this, "right")); + }, "shift+left": function() { + this.moveTo(this.extendSlot(this, "left")); + }, enter: function() { + var obj = { start_date: new Date(this.start_date), end_date: new Date(this.end_date) }; + var mode = scheduler2.getState().mode; + if (scheduler2.matrix && scheduler2.matrix[mode]) { + var timeline = scheduler2.matrix[scheduler2.getState().mode]; + obj[timeline.y_property] = this.section; + } else if (scheduler2._props && scheduler2._props[mode]) { + var unit = scheduler2._props[mode]; + obj[unit.map_to] = this.section; + } + scheduler2.addEventNow(obj); + } } }); + scheduler2.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler2.$keyboardNavigation.TimeSlot.prototype.keys); } - function header_cell(scheduler2) { - scheduler2.$keyboardNavigation.HeaderCell = function(index) { + function minical_button(scheduler2) { + scheduler2.$keyboardNavigation.MinicalButton = function(div, index) { + this.container = div; this.index = index || 0; }; - scheduler2.$keyboardNavigation.HeaderCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { - index = index || this.index || 0; - var nodes = this.getNodes(); - if (nodes[index]) - return nodes[index]; - }, getNodes: function(selector) { - selector = selector || [".dhx_cal_navline .dhx_cal_prev_button", ".dhx_cal_navline .dhx_cal_next_button", ".dhx_cal_navline .dhx_cal_today_button", ".dhx_cal_navline .dhx_cal_tab"].join(", "); - var nodes = Array.prototype.slice.call(scheduler2.$container.querySelectorAll(selector)); - nodes.sort(function(a, b) { - return a.offsetLeft - b.offsetLeft; - }); - return nodes; - }, _handlers: null, isValid: function() { - return !!this.getNode(this.index); + scheduler2.$keyboardNavigation.MinicalButton.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { + var container = this.container; + return !!container.offsetWidth; }, fallback: function() { - var defaultCell = this.getNode(0); - if (!defaultCell) { - defaultCell = new scheduler2.$keyboardNavigation.TimeSlot(); - } - return defaultCell; - }, keys: { left: function() { - var newIndex = this.index - 1; - if (newIndex < 0) { - newIndex = this.getNodes().length - 1; + var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); + if (defaultSlot.isValid()) { + return defaultSlot; + } else { + return new scheduler2.$keyboardNavigation.DataArea(); } - this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); - }, right: function() { - var newIndex = this.index + 1; - if (newIndex >= this.getNodes().length) { - newIndex = 0; + }, focus: function() { + scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); + this.container.removeAttribute("tabindex"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }, blur: function() { + this.container.setAttribute("tabindex", "0"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + }, getNode: function() { + if (!this.index) { + return this.container.querySelector(".dhx_cal_prev_button"); + } else { + return this.container.querySelector(".dhx_cal_next_button"); } - this.moveTo(new scheduler2.$keyboardNavigation.HeaderCell(newIndex)); + }, keys: { right: function(e) { + this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); + }, left: function(e) { + this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); }, down: function() { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); - }, enter: function() { - var node = this.getNode(); - if (node) { - node.click(); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, 0, 0); + if (next && !next.isValid()) { + next = next.fallback(); } + this.moveTo(next); + }, enter: function(e) { + this.getNode().click(); } } }); - scheduler2.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler2.$keyboardNavigation.HeaderCell.prototype.keys); + scheduler2.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalButton.prototype.keys); } - function event(scheduler2) { - scheduler2.$keyboardNavigation.Event = function(id2) { - this.eventId = null; - if (scheduler2.getEvent(id2)) { - var ev = scheduler2.getEvent(id2); - this.start = new Date(ev.start_date); - this.end = new Date(ev.end_date); - this.section = this._getSection(ev); - this.eventId = id2; - } + function minical_cell(scheduler2) { + scheduler2.$keyboardNavigation.MinicalCell = function(div, row, col) { + this.container = div; + this.row = row || 0; + this.col = col || 0; }; - scheduler2.$keyboardNavigation.Event.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _getNodes: function() { - return Array.prototype.slice.call(scheduler2.$container.querySelectorAll("[" + scheduler2.config.event_attribute + "]")); - }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, _handlers: null, isValid: function() { - return !!(scheduler2.getEvent(this.eventId) && this.getNode()); + scheduler2.$keyboardNavigation.MinicalCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { + var grid = this._getGrid(); + return !!(grid[this.row] && grid[this.row][this.col]); }, fallback: function() { - var eventNode = this._getNodes()[0]; - var defaultElement = null; - if (!eventNode || !scheduler2._locate_event(eventNode)) { - defaultElement = new scheduler2.$keyboardNavigation.TimeSlot(); - } else { - var id2 = scheduler2._locate_event(eventNode); - defaultElement = new scheduler2.$keyboardNavigation.Event(id2); + var row = this.row; + var col = this.col; + var grid = this._getGrid(); + if (!grid[row]) { + row = 0; } - return defaultElement; - }, isScrolledIntoView: function(el2) { - var eventBox = el2.getBoundingClientRect(); - var viewPort = scheduler2.$container.querySelector(".dhx_cal_data").getBoundingClientRect(); - if (eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom) { - return false; + var dir = true; + if (row > grid.length / 2) { + dir = false; } - return true; - }, getNode: function() { - var idSelector = "[" + scheduler2.config.event_attribute + "='" + this.eventId + "']"; - var inlineEditor = scheduler2.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId); - if (inlineEditor) { - return inlineEditor; + if (!grid[row]) { + var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); + if (defaultSlot.isValid()) { + return defaultSlot; + } else { + return new scheduler2.$keyboardNavigation.DataArea(); + } + } + if (dir) { + for (var c = col; grid[row] && c < grid[row].length; c++) { + if (!grid[row][c] && c == grid[row].length - 1) { + row++; + col = 0; + } + if (grid[row][c]) { + return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); + } + } } else { - if (scheduler2.isMultisectionEvent && scheduler2.isMultisectionEvent(scheduler2.getEvent(this.eventId))) { - var nodes = scheduler2.$container.querySelectorAll(idSelector); - for (var i = 0; i < nodes.length; i++) { - if (this.isScrolledIntoView(nodes[i])) { - return nodes[i]; - } + for (var c = col; grid[row] && c < grid[row].length; c--) { + if (!grid[row][c] && !c) { + row--; + col = grid[row].length - 1; + } + if (grid[row][c]) { + return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); + } + } + } + return new scheduler2.$keyboardNavigation.MinicalButton(this.container, 0); + }, focus: function() { + scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); + this.container.removeAttribute("tabindex"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + }, blur: function() { + this.container.setAttribute("tabindex", "0"); + scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); + }, _getNode: function(row, col) { + return this.container.querySelector(".dhx_year_body tr:nth-child(" + (row + 1) + ") td:nth-child(" + (col + 1) + ")"); + }, getNode: function() { + return this._getNode(this.row, this.col); + }, _getGrid: function() { + var rows = this.container.querySelectorAll(".dhx_year_body tr"); + var grid = []; + for (var i = 0; i < rows.length; i++) { + grid[i] = []; + var row = rows[i]; + var cells = row.querySelectorAll("td"); + for (var c = 0; c < cells.length; c++) { + var cell = cells[c]; + var enabled = true; + var css = scheduler2._getClassName(cell); + if (css.indexOf("dhx_after") > -1 || css.indexOf("dhx_before") > -1 || css.indexOf("dhx_scale_ignore") > -1) { + enabled = false; } - return nodes[0]; - } else { - return scheduler2.$container.querySelector(idSelector); + grid[i][c] = enabled; } } - }, focus: function() { - var event2 = scheduler2.getEvent(this.eventId); - var calendar = scheduler2.getState(); - if (event2.start_date.valueOf() > calendar.max_date.valueOf() || event2.end_date.valueOf() <= calendar.min_date.valueOf()) { - scheduler2.setCurrentView(event2.start_date); + return grid; + }, keys: { right: function(e) { + var grid = this._getGrid(); + var newRow = this.row; + var newCol = this.col + 1; + if (!grid[newRow] || !grid[newRow][newCol]) { + if (grid[newRow + 1]) { + newRow = newRow + 1; + newCol = 0; + } else { + newCol = this.col; + } } - var node = this.getNode(); - if (this.isScrolledIntoView(node)) { - scheduler2.$keyboardNavigation.dispatcher.keepScrollPosition((function() { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }).bind(this)); - } else { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); } - }, blur: function() { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - }, _getSection: function(ev) { - var section = null; - var mode = scheduler2.getState().mode; - if (scheduler2.matrix && scheduler2.matrix[mode]) { - var timeline = scheduler2.matrix[scheduler2.getState().mode]; - section = ev[timeline.y_property]; - } else if (scheduler2._props && scheduler2._props[mode]) { - var unit = scheduler2._props[mode]; - section = ev[unit.map_to]; + this.moveTo(next); + }, left: function(e) { + var grid = this._getGrid(); + var newRow = this.row; + var newCol = this.col - 1; + if (!grid[newRow] || !grid[newRow][newCol]) { + if (grid[newRow - 1]) { + newRow = newRow - 1; + newCol = grid[newRow].length - 1; + } else { + newCol = this.col; + } } - return section; - }, _moveToSlot: function(dir) { - var ev = scheduler2.getEvent(this.eventId); - if (ev) { - var section = this._getSection(ev); - var slot = new scheduler2.$keyboardNavigation.TimeSlot(ev.start_date, null, section); - this.moveTo(slot.nextSlot(slot, dir)); - } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); } - }, keys: { left: function() { - this._moveToSlot("left"); - }, right: function() { - this._moveToSlot("right"); + this.moveTo(next); }, down: function() { - if (this.getMode() == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); - } else { - this._moveToSlot("down"); + var grid = this._getGrid(); + var newRow = this.row + 1; + var newCol = this.col; + if (!grid[newRow] || !grid[newRow][newCol]) { + newRow = this.row; } - }, space: function() { - var node = this.getNode(); - if (node && node.click) { - node.click(); - } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); } + this.moveTo(next); }, up: function() { - if (this.getMode() == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); - } else { - this._moveToSlot("up"); - } - }, delete: function() { - if (scheduler2.getEvent(this.eventId)) { - scheduler2._click.buttons["delete"](this.eventId); - } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); - } - }, enter: function() { - if (scheduler2.getEvent(this.eventId)) { - scheduler2.showLightbox(this.eventId); + var grid = this._getGrid(); + var newRow = this.row - 1; + var newCol = this.col; + if (!grid[newRow] || !grid[newRow][newCol]) { + var index = 0; + if (this.col > grid[this.row].length / 2) { + index = 1; + } + this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, index)); } else { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); + if (!next.isValid()) { + next = next.fallback(); + } + this.moveTo(next); } + }, enter: function(e) { + this.getNode().querySelector(".dhx_month_head").click(); } } }); - scheduler2.$keyboardNavigation.Event.prototype.bindAll(scheduler2.$keyboardNavigation.Event.prototype.keys); + scheduler2.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalCell.prototype.keys); } - function time_slot(scheduler2) { - scheduler2.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate) { - var state = scheduler2.getState(); - var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; - if (!from) { - from = this.getDefaultDate(); + function data_area(scheduler2) { + scheduler2.$keyboardNavigation.DataArea = function(index) { + this.index = index || 0; + }; + scheduler2.$keyboardNavigation.DataArea.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { + return scheduler2.$container.querySelector(".dhx_cal_data"); + }, _handlers: null, isValid: function() { + return true; + }, fallback: function() { + return this; + }, keys: { "up,down,right,left": function() { + this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); + } } }); + scheduler2.$keyboardNavigation.DataArea.prototype.bindAll(scheduler2.$keyboardNavigation.DataArea.prototype.keys); + } + function modals(scheduler2) { + (function() { + var modalsStack = []; + function isModal() { + return !!modalsStack.length; } - if (!to) { - if (timeline) { - to = scheduler2.date.add(from, timeline.x_step, timeline.x_unit); - } else { - to = scheduler2.date.add(from, scheduler2.config.key_nav_step, "minute"); + function isChildOf(child, parent) { + while (child && child != parent) { + child = child.parentNode; } + return !!(child == parent); } - this.section = section || this._getDefaultSection(); - this.start_date = new Date(from); - this.end_date = new Date(to); - this.movingDate = movingDate || null; - }; - scheduler2.$keyboardNavigation.TimeSlot.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { _handlers: null, getDefaultDate: function() { - var from; - var state = scheduler2.getState(); - var visibleTime = new Date(state.date); - visibleTime.setSeconds(0); - visibleTime.setMilliseconds(0); - var nowTime = /* @__PURE__ */ new Date(); - nowTime.setSeconds(0); - nowTime.setMilliseconds(0); - var timeline = scheduler2.matrix && scheduler2.matrix[state.mode]; - var showNowTime = false; - if (visibleTime.valueOf() === nowTime.valueOf()) { - showNowTime = true; - } - if (timeline) { - if (showNowTime) { - if (timeline.x_unit === "day") { - nowTime.setHours(0); - nowTime.setMinutes(0); - } else if (timeline.x_unit === "hour") { - nowTime.setMinutes(0); + function afterPopup(box) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; } - from = nowTime; - } else { - from = scheduler2.date[timeline.name + "_start"](new Date(state.date)); - } - from = this.findVisibleColumn(from); - } else { - from = new Date(scheduler2.getState().min_date); - if (showNowTime) { - from = nowTime; - } - from = this.findVisibleColumn(from); - if (!showNowTime) { - from.setHours(scheduler2.config.first_hour); + if (!isModal() && !isChildOf(document.activeElement, scheduler2.$container)) { + scheduler2.focus(); + } + }, 1); + } + function startModal(box) { + scheduler2.eventRemove(box, "keydown", trapFocus); + scheduler2.event(box, "keydown", trapFocus); + modalsStack.push(box); + } + function endModal() { + var box = modalsStack.pop(); + if (box) { + scheduler2.eventRemove(box, "keydown", trapFocus); } - if (!scheduler2._table_view) { - var dataContainer = scheduler2.$container.querySelector(".dhx_cal_data"); - if (dataContainer.scrollTop) { - from.setHours(scheduler2.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler2.config.hour_size_px)); + afterPopup(); + } + function isTopModal(box) { + return box == modalsStack[modalsStack.length - 1]; + } + function trapFocus(event2) { + var event2 = event2 || window.event; + var target = event2.currentTarget; + if (!isTopModal(target)) + return; + scheduler2.$keyboardNavigation.trapFocus(target, event2); + } + function traceLightbox() { + startModal(scheduler2.getLightbox()); + } + scheduler2.attachEvent("onLightbox", traceLightbox); + scheduler2.attachEvent("onAfterLightbox", endModal); + scheduler2.attachEvent("onAfterQuickInfo", function() { + afterPopup(); + }); + if (!scheduler2._keyNavMessagePopup) { + scheduler2._keyNavMessagePopup = true; + var focusElement = null; + var backupFocus = null; + const modalsStack2 = []; + scheduler2.attachEvent("onMessagePopup", function(box) { + focusElement = document.activeElement; + backupFocus = focusElement; + while (backupFocus && scheduler2._getClassName(backupFocus).indexOf("dhx_cal_data") < 0) { + backupFocus = backupFocus.parentNode; + } + if (backupFocus) { + backupFocus = backupFocus.parentNode; } - } + scheduler2.eventRemove(box, "keydown", trapFocus); + scheduler2.event(box, "keydown", trapFocus); + modalsStack2.push(box); + }); + scheduler2.attachEvent("onAfterMessagePopup", function() { + var box = modalsStack2.pop(); + if (box) { + scheduler2.eventRemove(box, "keydown", trapFocus); + } + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + var currentTarget = document.activeElement; + while (currentTarget && scheduler2._getClassName(currentTarget).indexOf("dhx_cal_light") < 0) { + currentTarget = currentTarget.parentNode; + } + if (currentTarget) + return; + if (focusElement && focusElement.parentNode) { + focusElement.focus(); + } else if (backupFocus && backupFocus.parentNode) { + backupFocus.focus(); + } + focusElement = null; + backupFocus = null; + }, 1); + }); } - return from; - }, clone: function(timeslot) { - return new scheduler2.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate); - }, _getMultisectionView: function() { - var state = scheduler2.getState(); - var view; - if (scheduler2._props && scheduler2._props[state.mode]) { - view = scheduler2._props[state.mode]; - } else if (scheduler2.matrix && scheduler2.matrix[state.mode]) { - view = scheduler2.matrix[state.mode]; + scheduler2.$keyboardNavigation.isModal = isModal; + })(); + } + function core(scheduler2) { + scheduler2.$keyboardNavigation.dispatcher = { isActive: false, activeNode: null, globalNode: new scheduler2.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(callback) { + var top, left; + var scrollable = scheduler2.$container.querySelector(".dhx_timeline_scrollable_data"); + if (!scrollable) { + scrollable = scheduler2.$container.querySelector(".dhx_cal_data"); } - return view; - }, _getDefaultSection: function() { - var section = null; - var view = this._getMultisectionView(); - if (view && !section) { - section = this._getNextSection(); + if (scrollable) { + top = scrollable.scrollTop; + left = scrollable.scrollLeft; } - return section; - }, _getNextSection: function(sectionId, dir) { - var view = this._getMultisectionView(); - var currentIndex = view.order[sectionId]; - var nextIndex = currentIndex; - if (currentIndex !== void 0) { - nextIndex = currentIndex + dir; - } else { - nextIndex = view.size && view.position ? view.position : 0; + callback(); + if (scrollable) { + scrollable.scrollTop = top; + scrollable.scrollLeft = left; } - if (nextIndex < 0) { - nextIndex = 0; + }, enable: function() { + if (!scheduler2.$container) { + return; } - var options = view.options || view.y_unit; - if (nextIndex >= options.length) { - nextIndex = options.length - 1; + this.isActive = true; + var self2 = this; + this.keepScrollPosition(function() { + self2.globalNode.enable(); + self2.setActiveNode(self2.getActiveNode()); + }); + }, disable: function() { + this.isActive = false; + this.globalNode.disable(); + }, isEnabled: function() { + return !!this.isActive; + }, getDefaultNode: function() { + return this.globalNode.getDefaultNode(); + }, setDefaultNode: function() { + this.setActiveNode(this.getDefaultNode()); + }, getActiveNode: function() { + var node = this.activeNode; + if (node && !node.isValid()) { + node = node.fallback(); } - if (options[nextIndex]) { - return options[nextIndex].key; - } else { - return null; + return node; + }, focusGlobalNode: function() { + this.blurNode(this.globalNode); + this.focusNode(this.globalNode); + }, setActiveNode: function(el2) { + if (!el2 || !el2.isValid()) + return; + if (this.activeNode) { + if (this.activeNode.compareTo(el2)) { + return; + } } - }, isValid: function() { - var state = scheduler2.getState(); - var isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf()); - if (!isInRange) - return false; - if (!this.isVisible(this.start_date, this.end_date)) - return false; - var view = this._getMultisectionView(); - if (view) { - return view.order[this.section] !== void 0; - } else { - return true; + if (this.isEnabled()) { + this.blurNode(this.activeNode); + this.activeNode = el2; + this.focusNode(this.activeNode); } - }, fallback: function() { - var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); - if (!defaultSlot.isValid()) { - return new scheduler2.$keyboardNavigation.DataArea(); - } else { - return defaultSlot; + }, focusNode: function(el2) { + if (el2 && el2.focus) { + el2.focus(); + if (el2.getNode && document.activeElement != el2.getNode()) { + this.setActiveNode(new scheduler2.$keyboardNavigation.DataArea()); + } } - }, getNodes: function() { - return Array.prototype.slice.call(scheduler2.$container.querySelectorAll(".dhx_focus_slot")); - }, getNode: function() { - return this.getNodes()[0]; - }, focus: function() { - if (this.section && scheduler2.getView() && scheduler2.getView().smart_rendering && scheduler2.getView().scrollTo && !scheduler2.$container.querySelector(`[data-section-id="${this.section}"]`)) { - scheduler2.getView().scrollTo({ section: this.section }); + }, blurNode: function(el2) { + if (el2 && el2.blur) { + el2.blur(); } - scheduler2.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - scheduler2.$keyboardNavigation._pasteDate = this.start_date; - scheduler2.$keyboardNavigation._pasteSection = this.section; - }, blur: function() { - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - scheduler2.$keyboardNavigation.marker.clear(); - }, _modes: scheduler2.$keyboardNavigation.SchedulerNode.prototype._modes, _getMode: scheduler2.$keyboardNavigation.SchedulerNode.prototype.getMode, addMonthDate: function(date, dir, extend2) { - var res; - switch (dir) { - case "up": - res = scheduler2.date.add(date, -1, "week"); - break; - case "down": - res = scheduler2.date.add(date, 1, "week"); - break; - case "left": - res = scheduler2.date.day_start(scheduler2.date.add(date, -1, "day")); - res = this.findVisibleColumn(res, -1); - break; - case "right": - res = scheduler2.date.day_start(scheduler2.date.add(date, 1, "day")); - res = this.findVisibleColumn(res, 1); - break; - default: - res = scheduler2.date.day_start(new Date(date)); - break; + }, getInlineEditor: function(id2) { + var editor = scheduler2.$container.querySelector(".dhx_cal_editor[" + scheduler2.config.event_attribute + "='" + id2 + "'] textarea"); + if (editor && editor.offsetWidth) { + return editor; } - var state = scheduler2.getState(); - if (date.valueOf() < state.min_date.valueOf() || !extend2 && date.valueOf() >= state.max_date.valueOf()) { - res = new Date(state.min_date); + return null; + }, keyDownHandler: function(e) { + if (e.defaultPrevented) { + return; } - return res; - }, nextMonthSlot: function(slot, dir, extend2) { - var start, end; - start = this.addMonthDate(slot.start_date, dir, extend2); - start.setHours(scheduler2.config.first_hour); - end = new Date(start); - end.setHours(scheduler2.config.last_hour); - return { start_date: start, end_date: end }; - }, _alignTimeSlot: function(date, minDate, unit, step) { - var currentDate = new Date(minDate); - while (currentDate.valueOf() < date.valueOf()) { - currentDate = scheduler2.date.add(currentDate, step, unit); + var activeElement = this.getActiveNode(); + if (scheduler2.$keyboardNavigation.isModal() && !(activeElement && activeElement.container && scheduler2.utils.dom.locateCss({ target: activeElement.container }, "dhx_minical_popup", false))) + return; + if (scheduler2.getState().editor_id && this.getInlineEditor(scheduler2.getState().editor_id)) + return; + if (!this.isEnabled()) + return; + e = e || window.event; + var schedulerNode = this.globalNode; + var command = scheduler2.$keyboardNavigation.shortcuts.getCommandFromEvent(e); + if (!activeElement) { + this.setDefaultNode(); + } else if (activeElement.findHandler(command)) { + activeElement.doAction(command, e); + } else if (schedulerNode.findHandler(command)) { + schedulerNode.doAction(command, e); } - if (currentDate.valueOf() > date.valueOf()) { - currentDate = scheduler2.date.add(currentDate, -step, unit); + }, _timeout: null, delay: function(callback, delay2) { + clearTimeout(this._timeout); + this._timeout = setTimeout(callback, delay2 || 1); + } }; + } + function key_nav_legacy(scheduler2) { + scheduler2._temp_key_scope = function() { + scheduler2.config.key_nav = true; + scheduler2.$keyboardNavigation._pasteDate = null; + scheduler2.$keyboardNavigation._pasteSection = null; + var isCopy = null; + var pos = {}; + if (!document.body) { + scheduler2.event(window, "load", function() { + scheduler2.event(document.body, "mousemove", trackMousePosition); + }); + } else { + scheduler2.event(document.body, "mousemove", trackMousePosition); } - return currentDate; - }, nextTimelineSlot: function(slot, dir, extend2) { - var state = scheduler2.getState(); - var view = scheduler2.matrix[state.mode]; - var startDate = this._alignTimeSlot(slot.start_date, scheduler2.date[view.name + "_start"](new Date(slot.start_date)), view.x_unit, view.x_step); - var endDate = this._alignTimeSlot(slot.end_date, scheduler2.date[view.name + "_start"](new Date(slot.end_date)), view.x_unit, view.x_step); - if (endDate.valueOf() <= startDate.valueOf()) { - endDate = scheduler2.date.add(startDate, view.x_step, view.x_unit); + function trackMousePosition(event2) { + event2 = event2 || window.event; + pos.x = event2.clientX; + pos.y = event2.clientY; + } + function currentTarget() { + var mousePointer = false; + var keyNavPointer = false; + var target = document.elementFromPoint(pos.x, pos.y); + while (target && target != scheduler2._obj) { + target = target.parentNode; + } + mousePointer = !!(target == scheduler2._obj); + keyNavPointer = scheduler2.$keyboardNavigation.dispatcher.isEnabled(); + return mousePointer || keyNavPointer; } - var newPos = this.clone(slot); - newPos.start_date = startDate; - newPos.end_date = endDate; - newPos.section = slot.section || this._getNextSection(); - switch (dir) { - case "up": - newPos.section = this._getNextSection(slot.section, -1); - break; - case "down": - newPos.section = this._getNextSection(slot.section, 1); - break; - case "left": - newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, -view.x_step, view.x_unit), -1); - newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); - break; - case "right": - newPos.start_date = this.findVisibleColumn(scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit), 1); - newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); - break; + scheduler2.attachEvent("onMouseMove", function(id2, e) { + var state = scheduler2.getState(); + if (!(state.mode && state.min_date)) { + return; + } + var position = scheduler2.getActionData(e); + scheduler2.$keyboardNavigation._pasteDate = position.date; + scheduler2.$keyboardNavigation._pasteSection = position.section; + }); + function clear_event_after(ev) { + delete ev.rec_type; + delete ev.rec_pattern; + delete ev.event_pid; + delete ev.event_length; } - if (newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()) { - if (extend2 && newPos.start_date.valueOf() >= state.max_date.valueOf()) { - newPos.start_date = new Date(state.max_date); - } else { - newPos.start_date = scheduler2.date[state.mode + "_start"](scheduler2.date.add(state.date, dir == "left" ? -1 : 1, state.mode)); - newPos.end_date = scheduler2.date.add(newPos.start_date, view.x_step, view.x_unit); + function copyEvent(ev) { + return scheduler2._lame_copy({}, ev); + } + scheduler2._make_pasted_event = function(ev) { + var date = scheduler2.$keyboardNavigation._pasteDate; + var section = scheduler2.$keyboardNavigation._pasteSection; + var event_duration = ev.end_date - ev.start_date; + var copy = copyEvent(ev); + clear_event_after(copy); + copy.start_date = new Date(date); + copy.end_date = new Date(copy.start_date.valueOf() + event_duration); + if (section) { + var property = scheduler2._get_section_property(); + if (scheduler2.config.multisection) + copy[property] = ev[property]; + else + copy[property] = section; + } + return copy; + }; + scheduler2._do_paste = function(is_copy, modified_ev, original_ev) { + if (scheduler2.callEvent("onBeforeEventPasted", [is_copy, modified_ev, original_ev]) === false) { + return; + } + scheduler2.addEvent(modified_ev); + scheduler2.callEvent("onEventPasted", [is_copy, modified_ev, original_ev]); + }; + scheduler2._is_key_nav_active = function() { + if (this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav) { + return true; } + return false; + }; + function getSelectedEvent() { + var node = scheduler2.$keyboardNavigation.dispatcher.getActiveNode(); + if (node && node.eventId) + return node.eventId; + return scheduler2._select_id; } - return newPos; - }, nextUnitsSlot: function(slot, dir, extend2) { - var newPos = this.clone(slot); - newPos.section = slot.section || this._getNextSection(); - var section = slot.section || this._getNextSection(); - var state = scheduler2.getState(); - var view = scheduler2._props[state.mode]; - switch (dir) { - case "left": - section = this._getNextSection(slot.section, -1); - var optionsCount = view.size ? view.size - 1 : view.options.length; - if (view.days > 1 && view.order[section] == optionsCount - 1) { - if (scheduler2.date.add(slot.start_date, -1, "day").valueOf() >= state.min_date.valueOf()) { - newPos = this.nextDaySlot(slot, dir, extend2); - } + scheduler2.event(document, "keydown", function(e) { + if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && scheduler2._buffer_event && !scheduler2.$keyboardNavigation.dispatcher.isEnabled()) { + scheduler2.$keyboardNavigation.dispatcher.isActive = currentTarget(); + } + }); + scheduler2._key_nav_copy_paste = function(e) { + if (!scheduler2._is_key_nav_active()) + return true; + if (e.keyCode == 37 || e.keyCode == 39) { + e.cancelBubble = true; + var next = scheduler2.date.add(scheduler2._date, e.keyCode == 37 ? -1 : 1, scheduler2._mode); + scheduler2.setCurrentView(next); + return true; + } + var select_id = getSelectedEvent(); + if ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { + if (select_id) { + scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); + isCopy = true; + scheduler2.callEvent("onEventCopied", [scheduler2.getEvent(select_id)]); } - break; - case "right": - section = this._getNextSection(slot.section, 1); - if (view.days > 1 && !view.order[section]) { - if (scheduler2.date.add(slot.start_date, 1, "day").valueOf() < state.max_date.valueOf()) { - newPos = this.nextDaySlot(slot, dir, extend2); - } + return true; + } + if ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { + if (select_id) { + isCopy = false; + var ev = scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); + scheduler2.updateEvent(ev.id); + scheduler2.callEvent("onEventCut", [ev]); } - break; - default: - newPos = this.nextDaySlot(slot, dir, extend2); - section = slot.section; - break; - } - newPos.section = section; - return newPos; - }, _moveDate: function(oldDate, dir) { - var newDate = this.findVisibleColumn(scheduler2.date.add(oldDate, dir, "day"), dir); - newDate.setHours(oldDate.getHours()); - newDate.setMinutes(oldDate.getMinutes()); - return newDate; - }, isBeforeLastHour: function(date, isStartDate) { - var minutes = date.getMinutes(), hours = date.getHours(), last_hour = scheduler2.config.last_hour; - return hours < last_hour || !isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes); - }, isAfterFirstHour: function(date, isStartDate) { - var minutes = date.getMinutes(), hours = date.getHours(), first_hour = scheduler2.config.first_hour, last_hour = scheduler2.config.last_hour; - return hours >= first_hour || !isStartDate && (!minutes && (!hours && last_hour == 24 || hours == last_hour)); - }, isInVisibleDayTime: function(date, isStartDate) { - return this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate); - }, nextDaySlot: function(slot, dir, extend2) { - var start, end; - var key_nav_step = scheduler2.config.key_nav_step; - var date = this._alignTimeSlot(slot.start_date, scheduler2.date.day_start(new Date(slot.start_date)), "minute", key_nav_step); - var oldStart = slot.start_date; - switch (dir) { - case "up": - start = scheduler2.date.add(date, -key_nav_step, "minute"); - if (!this.isInVisibleDayTime(start, true)) { - if (!extend2 || this.isInVisibleDayTime(oldStart, true)) { - var toNextDay = true; - if (extend2 && scheduler2.date.date_part(new Date(start)).valueOf() != scheduler2.date.date_part(new Date(oldStart)).valueOf()) - toNextDay = false; - if (toNextDay) - start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, -1, "day"), -1); - start.setHours(scheduler2.config.last_hour); - start.setMinutes(0); - start = scheduler2.date.add(start, -key_nav_step, "minute"); + } + if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget()) { + var ev = scheduler2._buffer_event ? scheduler2.getEvent(scheduler2._buffer_event.id) : scheduler2._buffer_event; + ev = ev || scheduler2._buffer_event; + if (ev) { + var new_ev = scheduler2._make_pasted_event(ev); + if (isCopy) { + new_ev.id = scheduler2.uid(); + scheduler2._do_paste(isCopy, new_ev, ev); + } else { + var res = scheduler2.callEvent("onBeforeEventChanged", [new_ev, e, false, ev]); + if (res) { + scheduler2._do_paste(isCopy, new_ev, ev); + isCopy = true; + } } } - end = scheduler2.date.add(start, key_nav_step, "minute"); - break; - case "down": - start = scheduler2.date.add(date, key_nav_step, "minute"); - var testEnd = extend2 ? start : scheduler2.date.add(start, key_nav_step, "minute"); - if (!this.isInVisibleDayTime(testEnd, false)) { - if (!extend2 || this.isInVisibleDayTime(oldStart, false)) { - if (!extend2) { - start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); - start.setHours(scheduler2.config.first_hour); - start.setMinutes(0); - } else { - var toNextDay = true; - if (scheduler2.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) { - toNextDay = false; - } - if (toNextDay) { - start = this.findVisibleColumn(scheduler2.date.add(slot.start_date, 1, "day"), 1); - } - start.setHours(scheduler2.config.first_hour); - start.setMinutes(0); - start = scheduler2.date.add(start, key_nav_step, "minute"); - } + return true; + } + }; + }; + scheduler2._temp_key_scope(); + } + function scheduler_handlers(scheduler2) { + scheduler2.$keyboardNavigation.attachSchedulerHandlers = function() { + var dispatcher = scheduler2.$keyboardNavigation.dispatcher; + var keyDownHandler = function(e) { + if (!scheduler2.config.key_nav) + return; + return dispatcher.keyDownHandler(e); + }; + var focusHandler = function() { + dispatcher.keepScrollPosition(function() { + dispatcher.focusGlobalNode(); + }); + }; + var waitCall; + scheduler2.attachEvent("onDataRender", function() { + if (!scheduler2.config.key_nav) + return; + if (!(dispatcher.isEnabled() && !scheduler2.getState().editor_id)) + return; + clearTimeout(waitCall); + waitCall = setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + if (!dispatcher.isEnabled()) + dispatcher.enable(); + reFocusActiveNode(); + }); + }); + var reFocusActiveNode = function() { + if (!dispatcher.isEnabled()) + return; + var activeNode = dispatcher.getActiveNode(); + if (!activeNode) + return; + if (!activeNode.isValid()) { + activeNode = activeNode.fallback(); + } + if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) + return; + dispatcher.keepScrollPosition(function() { + activeNode.focus(true); + }); + }; + scheduler2.attachEvent("onSchedulerReady", function() { + var container = scheduler2.$container; + scheduler2.eventRemove(document, "keydown", keyDownHandler); + scheduler2.eventRemove(container, "mousedown", mousedownHandler); + scheduler2.eventRemove(container, "focus", focusHandler); + if (scheduler2.config.key_nav) { + scheduler2.event(document, "keydown", keyDownHandler); + scheduler2.event(container, "mousedown", mousedownHandler); + scheduler2.event(container, "focus", focusHandler); + container.setAttribute("tabindex", "0"); + } else { + container.removeAttribute("tabindex"); + } + }); + function mousedownHandler(e) { + if (!scheduler2.config.key_nav) + return true; + const view = scheduler2.getView(); + let dataAreaClick = false; + if (scheduler2.getState().mode === "month") { + dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_cal_month_table")); + } else if (view && view.layout === "timeline") { + dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_timeline_data_col")); + } else { + const listOfScales = scheduler2.$container.querySelectorAll(".dhx_scale_holder"); + const arrOfScales = Array.from(listOfScales); + dataAreaClick = arrOfScales.some((scale) => scale === e.target.parentNode); + } + var pos = scheduler2.getActionData(e); + var focusNode; + if (scheduler2._locate_event(e.target || e.srcElement)) { + focusNode = new scheduler2.$keyboardNavigation.Event(scheduler2._locate_event(e.target || e.srcElement)); + } else if (dataAreaClick) { + focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); + if (pos.date && dataAreaClick) { + focusNode = focusNode.nextSlot(new scheduler2.$keyboardNavigation.TimeSlot(pos.date, null, pos.section)); + } + } + if (focusNode) { + if (!dispatcher.isEnabled()) { + dispatcher.activeNode = focusNode; + } else { + if (pos.date && dataAreaClick) { + dispatcher.delay(function() { + dispatcher.setActiveNode(focusNode); + }); } } - end = scheduler2.date.add(start, key_nav_step, "minute"); - break; - case "left": - start = this._moveDate(slot.start_date, -1); - end = this._moveDate(slot.end_date, -1); - break; - case "right": - start = this._moveDate(slot.start_date, 1); - end = this._moveDate(slot.end_date, 1); - break; - default: - start = date; - end = scheduler2.date.add(start, key_nav_step, "minute"); - break; - } - return { start_date: start, end_date: end }; - }, nextWeekAgendaSlot: function(slot, dir) { - var start, end; - var state = scheduler2.getState(); - switch (dir) { - case "down": - case "left": - start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, -1, "day")); - start = this.findVisibleColumn(start, -1); - break; - case "up": - case "right": - start = scheduler2.date.day_start(scheduler2.date.add(slot.start_date, 1, "day")); - start = this.findVisibleColumn(start, 1); - break; - default: - start = scheduler2.date.day_start(slot.start_date); - break; - } - if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { - start = new Date(state.min_date); - } - end = new Date(start); - end.setHours(scheduler2.config.last_hour); - return { start_date: start, end_date: end }; - }, nextAgendaSlot: function(slot, dir) { - return { start_date: slot.start_date, end_date: slot.end_date }; - }, isDateVisible: function(date) { - if (!scheduler2._ignores_detected) - return true; - var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; - var index; - if (timeline) { - index = scheduler2._get_date_index(timeline, date); - } else { - index = scheduler2.locate_holder_day(date); - } - return !scheduler2._ignores[index]; - }, findVisibleColumn: function(start, dir) { - var date = start; - dir = dir || 1; - var range = scheduler2.getState(); - while (!this.isDateVisible(date) && (dir > 0 && date.valueOf() <= range.max_date.valueOf() || dir < 0 && date.valueOf() >= range.min_date.valueOf())) { - date = this.nextDateColumn(date, dir); + } } - return date; - }, nextDateColumn: function(start, dir) { - dir = dir || 1; - var timeline = scheduler2.matrix && scheduler2.matrix[scheduler2.getState().mode]; - var date; - if (timeline) { - date = scheduler2.date.add(start, dir * timeline.x_step, timeline.x_unit); - } else { - date = scheduler2.date.day_start(scheduler2.date.add(start, dir, "day")); + function focusEvent(evNode) { + if (!scheduler2.config.key_nav) + return; + if (!dispatcher.isEnabled()) + return; + var prevState = evNode; + var focusNode = new scheduler2.$keyboardNavigation.Event(prevState.eventId); + if (!focusNode.isValid()) { + var lastStart = focusNode.start || prevState.start; + var lastEnd = focusNode.end || prevState.end; + var lastSection = focusNode.section || prevState.section; + focusNode = new scheduler2.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection); + if (!focusNode.isValid()) { + focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); + } + } + dispatcher.setActiveNode(focusNode); + var node = dispatcher.getActiveNode(); + if (node && node.getNode && document.activeElement != node.getNode()) { + dispatcher.focusNode(dispatcher.getActiveNode()); + } } - return date; - }, isVisible: function(from, to) { - if (!scheduler2._ignores_detected) + var updateEvent = scheduler2.updateEvent; + scheduler2.updateEvent = function(id2) { + var res = updateEvent.apply(this, arguments); + if (scheduler2.config.key_nav && dispatcher.isEnabled()) { + if (scheduler2.getState().select_id == id2) { + var element = new scheduler2.$keyboardNavigation.Event(id2); + if (!scheduler2.getState().lightbox_id) { + focusEvent(element); + } + } + } + return res; + }; + scheduler2.attachEvent("onEventDeleted", function(id2) { + if (!scheduler2.config.key_nav) + return true; + if (dispatcher.isEnabled()) { + var activeNode = dispatcher.getActiveNode(); + if (activeNode.eventId == id2) { + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); + } + } return true; - var current = new Date(from); - while (current.valueOf() < to.valueOf()) { - if (this.isDateVisible(current)) + }); + scheduler2.attachEvent("onClearAll", function() { + if (!scheduler2.config.key_nav) + return true; + if (dispatcher.isEnabled()) { + if (dispatcher.getActiveNode() instanceof scheduler2.$keyboardNavigation.Event) { + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); + } + } + }); + }; + } + function minical_handlers(scheduler2) { + scheduler2.$keyboardNavigation._minicalendars = []; + scheduler2.$keyboardNavigation.isMinical = function(node) { + var minicalendars = scheduler2.$keyboardNavigation._minicalendars; + for (var i = 0; i < minicalendars.length; i++) { + if (this.isChildOf(node, minicalendars[i])) return true; - current = this.nextDateColumn(current); } return false; - }, nextSlot: function(slot, dir, view, extend2) { - var next; - view = view || this._getMode(); - var tempSlot = scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); - switch (view) { - case this._modes.units: - next = this.nextUnitsSlot(tempSlot, dir, extend2); - break; - case this._modes.timeline: - next = this.nextTimelineSlot(tempSlot, dir, extend2); - break; - case this._modes.year: - next = this.nextMonthSlot(tempSlot, dir, extend2); - break; - case this._modes.month: - next = this.nextMonthSlot(tempSlot, dir, extend2); - break; - case this._modes.weekAgenda: - next = this.nextWeekAgendaSlot(tempSlot, dir, extend2); - break; - case this._modes.list: - next = this.nextAgendaSlot(tempSlot, dir, extend2); - break; - case this._modes.dayColumns: - next = this.nextDaySlot(tempSlot, dir, extend2); - break; + }; + scheduler2.$keyboardNavigation.isChildOf = function(child, parent) { + while (child && child !== parent) { + child = child.parentNode; } - if (next.start_date.valueOf() >= next.end_date.valueOf()) { - next = this.nextSlot(next, dir, view); + return !!(child === parent); + }; + scheduler2.$keyboardNavigation.patchMinicalendar = function() { + var dispatcher = scheduler2.$keyboardNavigation.dispatcher; + function focusMinical(e) { + var target = e.target; + dispatcher.enable(); + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(target, 0)); + } + function minicalClick(e) { + var target = e.target || e.srcElement; + var prev = scheduler2.utils.dom.locateCss(e, "dhx_cal_prev_button", false); + var next = scheduler2.utils.dom.locateCss(e, "dhx_cal_next_button", false); + var cell = scheduler2.utils.dom.locateCss(e, "dhx_year_body", false); + var rowIndex = 0; + var cellIndex = 0; + if (cell) { + var tr2; + var td; + var current = target; + while (current && current.tagName.toLowerCase() != "td") { + current = current.parentNode; + } + if (current) { + td = current; + tr2 = td.parentNode; + } + if (tr2 && td) { + var rows = tr2.parentNode.querySelectorAll("tr"); + for (var i = 0; i < rows.length; i++) { + if (rows[i] == tr2) { + rowIndex = i; + break; + } + } + var cells = tr2.querySelectorAll("td"); + for (var i = 0; i < cells.length; i++) { + if (cells[i] == td) { + cellIndex = i; + break; + } + } + } + } + var root = e.currentTarget; + dispatcher.delay(function() { + if (prev || next || cell) { + var element; + if (prev) { + element = new scheduler2.$keyboardNavigation.MinicalButton(root, 0); + dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(root, 0)); + } else if (next) { + element = new scheduler2.$keyboardNavigation.MinicalButton(root, 1); + } else if (cell) { + element = new scheduler2.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex); + } + if (element) { + dispatcher.enable(); + if (element.isValid()) { + dispatcher.activeNode = null; + dispatcher.setActiveNode(element); + } + } + } + }); } - return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); - }, extendSlot: function(slot, dir) { - var view = this._getMode(); - var next; - switch (view) { - case this._modes.units: - if (dir == "left" || dir == "right") { - next = this.nextUnitsSlot(slot, dir); - } else { - next = this.extendUnitsSlot(slot, dir); + if (scheduler2.renderCalendar) { + var renderMinical = scheduler2.renderCalendar; + scheduler2.renderCalendar = function() { + var cal = renderMinical.apply(this, arguments); + var minicalendars = scheduler2.$keyboardNavigation._minicalendars; + scheduler2.eventRemove(cal, "click", minicalClick); + scheduler2.event(cal, "click", minicalClick); + scheduler2.eventRemove(cal, "focus", focusMinical); + scheduler2.event(cal, "focus", focusMinical); + var added = false; + for (var i = 0; i < minicalendars.length; i++) { + if (minicalendars[i] == cal) { + added = true; + break; + } } - break; - case this._modes.timeline: - if (dir == "down" || dir == "up") { - next = this.nextTimelineSlot(slot, dir); + if (!added) + minicalendars.push(cal); + if (dispatcher.isEnabled()) { + var node = dispatcher.getActiveNode(); + if (node && node.container == cal) { + dispatcher.focusNode(node); + } else { + cal.setAttribute("tabindex", "0"); + } } else { - next = this.extendTimelineSlot(slot, dir); + cal.setAttribute("tabindex", "0"); } - break; - case this._modes.year: - next = this.extendMonthSlot(slot, dir); - break; - case this._modes.month: - next = this.extendMonthSlot(slot, dir); - break; - case this._modes.dayColumns: - next = this.extendDaySlot(slot, dir); - break; - case this._modes.weekAgenda: - next = this.extendWeekAgendaSlot(slot, dir); - break; - default: - next = slot; - break; - } - var range = scheduler2.getState(); - if (next.start_date.valueOf() < range.min_date.valueOf()) { - next.start_date = this.findVisibleColumn(range.min_date); - next.start_date.setHours(scheduler2.config.first_hour); - } - if (next.end_date.valueOf() > range.max_date.valueOf()) { - next.end_date = this.findVisibleColumn(range.max_date, -1); + return cal; + }; } - return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(next); - }, extendTimelineSlot: function(slot, direction) { - return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "timeline"); - }, extendWeekAgendaSlot: function(slot, direction) { - return this.extendGenericSlot({ left: "start_date", right: "end_date" }, slot, direction, "weekAgenda"); - }, extendGenericSlot: function(allowedDirections, slot, direction, type) { - var next; - var moveDate = slot.movingDate; - if (!moveDate) { - moveDate = allowedDirections[direction]; + if (scheduler2.destroyCalendar) { + var destroyMinical = scheduler2.destroyCalendar; + scheduler2.destroyCalendar = function(cal, force) { + cal = cal || (scheduler2._def_count ? scheduler2._def_count.firstChild : null); + var res = destroyMinical.apply(this, arguments); + if (!cal || !cal.parentNode) { + var minicalendars = scheduler2.$keyboardNavigation._minicalendars; + for (var i = 0; i < minicalendars.length; i++) { + if (minicalendars[i] == cal) { + scheduler2.eventRemove(minicalendars[i], "focus", focusMinical); + minicalendars.splice(i, 1); + i--; + } + } + } + return res; + }; } - if (!moveDate || !allowedDirections[direction]) { - return slot; + }; + } + function key_nav(scheduler2) { + scheduler2.config.key_nav = true; + scheduler2.config.key_nav_step = 30; + scheduler2.addShortcut = function(shortcut, handler, scope) { + var scopeObject = getScope(scope); + if (scopeObject) { + scopeObject.prototype.bind(shortcut, handler); } - if (direction) { - next = this.nextSlot({ start_date: slot[moveDate], section: slot.section }, direction, type, true); - if (next.start_date.valueOf() == slot.start_date.valueOf()) { - next = this.nextSlot({ start_date: next.start_date, section: next.section }, direction, type, true); + }; + scheduler2.getShortcutHandler = function(shortcut, scope) { + var scopeObject = getScope(scope); + if (scopeObject) { + var commands = scheduler2.$keyboardNavigation.shortcuts.parse(shortcut); + if (commands.length) { + return scopeObject.prototype.findHandler(commands[0]); } - next.movingDate = moveDate; - } else { - return scheduler2.$keyboardNavigation.TimeSlot.prototype.clone(slot); - } - var newDates = this.extendSlotDates(slot, next, next.movingDate); - if (newDates.end_date.valueOf() <= newDates.start_date.valueOf()) { - next.movingDate = next.movingDate == "end_date" ? "start_date" : "end_date"; - } - newDates = this.extendSlotDates(slot, next, next.movingDate); - next.start_date = newDates.start_date; - next.end_date = newDates.end_date; - return next; - }, extendSlotDates: function(oldSlot, newSlot, dateDirection) { - var res = { start_date: null, end_date: null }; - if (dateDirection == "start_date") { - res.start_date = newSlot.start_date; - res.end_date = oldSlot.end_date; - } else { - res.start_date = oldSlot.start_date; - res.end_date = newSlot.start_date; - } - return res; - }, extendMonthSlot: function(slot, direction) { - var slot = this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "month"); - slot.start_date.setHours(scheduler2.config.first_hour); - slot.end_date = scheduler2.date.add(slot.end_date, -1, "day"); - slot.end_date.setHours(scheduler2.config.last_hour); - return slot; - }, extendUnitsSlot: function(slot, direction) { - var next; - switch (direction) { - case "down": - case "up": - next = this.extendDaySlot(slot, direction); - break; - default: - next = slot; - break; - } - next.section = slot.section; - return next; - }, extendDaySlot: function(slot, direction) { - return this.extendGenericSlot({ up: "start_date", down: "end_date", left: "start_date", right: "end_date" }, slot, direction, "dayColumns"); - }, scrollSlot: function(dir) { - var state = scheduler2.getState(); - var slot = this.nextSlot(this, dir); - if (slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()) { - scheduler2.setCurrentView(new Date(slot.start_date)); - } - this.moveTo(slot); - }, keys: { left: function() { - this.scrollSlot("left"); - }, right: function() { - this.scrollSlot("right"); - }, down: function() { - var mode = this._getMode(); - if (mode == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler(); - } else { - this.scrollSlot("down"); - } - }, up: function() { - var mode = this._getMode(); - if (mode == this._modes.list) { - scheduler2.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler(); - } else { - this.scrollSlot("up"); } - }, "shift+down": function() { - this.moveTo(this.extendSlot(this, "down")); - }, "shift+up": function() { - this.moveTo(this.extendSlot(this, "up")); - }, "shift+right": function() { - this.moveTo(this.extendSlot(this, "right")); - }, "shift+left": function() { - this.moveTo(this.extendSlot(this, "left")); - }, enter: function() { - var obj = { start_date: new Date(this.start_date), end_date: new Date(this.end_date) }; - var mode = scheduler2.getState().mode; - if (scheduler2.matrix && scheduler2.matrix[mode]) { - var timeline = scheduler2.matrix[scheduler2.getState().mode]; - obj[timeline.y_property] = this.section; - } else if (scheduler2._props && scheduler2._props[mode]) { - var unit = scheduler2._props[mode]; - obj[unit.map_to] = this.section; + }; + scheduler2.removeShortcut = function(shortcut, scope) { + var scopeObject = getScope(scope); + if (scopeObject) { + scopeObject.prototype.unbind(shortcut); } - scheduler2.addEventNow(obj); - } } }); - scheduler2.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler2.$keyboardNavigation.TimeSlot.prototype.keys); - } - function minical_button(scheduler2) { - scheduler2.$keyboardNavigation.MinicalButton = function(div, index) { - this.container = div; - this.index = index || 0; }; - scheduler2.$keyboardNavigation.MinicalButton.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { - var container = this.container; - return !!container.offsetWidth; - }, fallback: function() { - var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); - if (defaultSlot.isValid()) { - return defaultSlot; - } else { - return new scheduler2.$keyboardNavigation.DataArea(); + scheduler2.focus = function() { + if (!scheduler2.config.key_nav) { + return; } - }, focus: function() { - scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); - this.container.removeAttribute("tabindex"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }, blur: function() { - this.container.setAttribute("tabindex", "0"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - }, getNode: function() { - if (!this.index) { - return this.container.querySelector(".dhx_cal_prev_button"); + var disp = scheduler2.$keyboardNavigation.dispatcher; + disp.enable(); + var activeNode = disp.getActiveNode(); + if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) { + disp.setDefaultNode(); } else { - return this.container.querySelector(".dhx_cal_next_button"); - } - }, keys: { right: function(e) { - this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); - }, left: function(e) { - this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1)); - }, down: function() { - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, 0, 0); - if (next && !next.isValid()) { - next = next.fallback(); + disp.focusNode(disp.getActiveNode()); } - this.moveTo(next); - }, enter: function(e) { - this.getNode().click(); - } } }); - scheduler2.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalButton.prototype.keys); - } - function minical_cell(scheduler2) { - scheduler2.$keyboardNavigation.MinicalCell = function(div, row, col) { - this.container = div; - this.row = row || 0; - this.col = col || 0; }; - scheduler2.$keyboardNavigation.MinicalCell.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { isValid: function() { - var grid = this._getGrid(); - return !!(grid[this.row] && grid[this.row][this.col]); - }, fallback: function() { - var row = this.row; - var col = this.col; - var grid = this._getGrid(); - if (!grid[row]) { - row = 0; + function getScope(mode) { + var scopes = { minicalButton: scheduler2.$keyboardNavigation.MinicalButton, minicalDate: scheduler2.$keyboardNavigation.MinicalCell, scheduler: scheduler2.$keyboardNavigation.SchedulerNode, dataArea: scheduler2.$keyboardNavigation.DataArea, timeSlot: scheduler2.$keyboardNavigation.TimeSlot, event: scheduler2.$keyboardNavigation.Event }; + var searchMap = {}; + for (var i in scopes) + searchMap[i.toLowerCase()] = scopes[i]; + mode = (mode + "").toLowerCase(); + return searchMap[mode] || scopes.scheduler; + } + scheduler2.$keyboardNavigation = {}; + scheduler2._compose = function() { + var parts = Array.prototype.slice.call(arguments, 0); + var res = {}; + for (var i = 0; i < parts.length; i++) { + var obj = parts[i]; + if (typeof obj == "function") { + obj = new obj(); + } + for (var p in obj) { + res[p] = obj[p]; + } } - var dir = true; - if (row > grid.length / 2) { - dir = false; + return res; + }; + keyboard_shortcuts(scheduler2); + eventhandler(scheduler2); + trap_modal_focus(scheduler2); + marker(scheduler2); + scheduler_node(scheduler2); + nav_node(scheduler2); + header_cell(scheduler2); + event(scheduler2); + time_slot(scheduler2); + minical_button(scheduler2); + minical_cell(scheduler2); + data_area(scheduler2); + modals(scheduler2); + core(scheduler2); + key_nav_legacy(scheduler2); + (function() { + scheduler_handlers(scheduler2); + minical_handlers(scheduler2); + var dispatcher = scheduler2.$keyboardNavigation.dispatcher; + scheduler2.$keyboardNavigation.attachSchedulerHandlers(); + if (scheduler2.renderCalendar) { + scheduler2.$keyboardNavigation.patchMinicalendar(); + } else { + var attachOnce = scheduler2.attachEvent("onSchedulerReady", function() { + scheduler2.detachEvent(attachOnce); + scheduler2.$keyboardNavigation.patchMinicalendar(); + }); } - if (!grid[row]) { - var defaultSlot = new scheduler2.$keyboardNavigation.TimeSlot(); - if (defaultSlot.isValid()) { - return defaultSlot; + function isSchedulerSelected() { + if (!scheduler2.config.key_nav) + return; + var enable; + var focusElement = document.activeElement; + if (!focusElement || scheduler2.utils.dom.locateCss(focusElement, "dhx_cal_quick_info", false)) { + enable = false; } else { - return new scheduler2.$keyboardNavigation.DataArea(); + enable = scheduler2.$keyboardNavigation.isChildOf(focusElement, scheduler2.$container) || scheduler2.$keyboardNavigation.isMinical(focusElement); + } + return enable; + } + function changeState(enable) { + if (enable && !dispatcher.isEnabled()) { + dispatcher.enable(); + } else if (!enable && dispatcher.isEnabled()) { + dispatcher.disable(); + } + } + const intervalId = setInterval(function() { + if (!scheduler2.$container || !scheduler2.$keyboardNavigation.isChildOf(scheduler2.$container, document.body)) { + return; + } + var enable = isSchedulerSelected(); + if (enable) { + changeState(enable); + } else if (!enable && dispatcher.isEnabled()) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return; + } + if (scheduler2.config.key_nav) { + changeState(isSchedulerSelected()); + } else { + scheduler2.$container.removeAttribute("tabindex"); + } + }, 100); + } + }, 500); + scheduler2.attachEvent("onDestroy", function() { + clearInterval(intervalId); + }); + })(); + } + function layer(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + this.layers.sort(function(a, b) { + return a.zIndex - b.zIndex; + }); + scheduler2._dp_init = function(dp) { + dp._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"]; + this.attachEvent("onEventAdded", function(id2) { + if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) + dp.setUpdated(id2, true, "inserted"); + }); + this.attachEvent("onBeforeEventDelete", function(id2) { + if (this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) { + if (!this.validId(id2)) + return; + var z = dp.getState(id2); + if (z == "inserted" || this._new_event) { + dp.setUpdated(id2, false); + return true; + } + if (z == "deleted") + return false; + if (z == "true_deleted") + return true; + dp.setUpdated(id2, true, "deleted"); + return false; + } else + return true; + }); + this.attachEvent("onEventChanged", function(id2) { + if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) + dp.setUpdated(id2, true, "updated"); + }); + dp._getRowData = function(id2, pref) { + var ev = this.obj.getEvent(id2); + var data = {}; + for (var a in ev) { + if (a.indexOf("_") === 0) + continue; + if (ev[a] && ev[a].getUTCFullYear) + data[a] = this.obj._helpers.formatDate(ev[a]); + else + data[a] = ev[a]; + } + return data; + }; + dp._clearUpdateFlag = function() { + }; + dp.attachEvent("insertCallback", scheduler2._update_callback); + dp.attachEvent("updateCallback", scheduler2._update_callback); + dp.attachEvent("deleteCallback", function(upd, id2) { + this.obj.setUserData(id2, this.action_param, "true_deleted"); + this.obj.deleteEvent(id2); + }); + }; + (function() { + var _cloneObj = function(obj) { + if (obj === null || typeof obj != "object") + return obj; + var temp = new obj.constructor(); + for (var key in obj) + temp[key] = _cloneObj(obj[key]); + return temp; + }; + scheduler2._dataprocessors = []; + scheduler2._layers_zindex = {}; + for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { + scheduler2.config["lightbox_" + scheduler2.layers[i2].name] = {}; + scheduler2.config["lightbox_" + scheduler2.layers[i2].name].sections = _cloneObj(scheduler2.config.lightbox.sections); + scheduler2._layers_zindex[scheduler2.layers[i2].name] = scheduler2.config.initial_layer_zindex || 5 + i2 * 3; + if (scheduler2.layers[i2].url) { + var dp = scheduler2.createDataProcessor({ url: scheduler2.layers[i2].url }); + dp.layer = scheduler2.layers[i2].name; + scheduler2._dataprocessors.push(dp); + scheduler2._dataprocessors[i2].init(scheduler2); + } + if (scheduler2.layers[i2].isDefault) + scheduler2.defaultLayer = scheduler2.layers[i2].name; + } + })(); + scheduler2.showLayer = function(tlayer) { + this.toggleLayer(tlayer, true); + }; + scheduler2.hideLayer = function(tlayer) { + this.toggleLayer(tlayer, false); + }; + scheduler2.toggleLayer = function(tlayer, visible) { + var layer2 = this.getLayer(tlayer); + if (typeof visible != "undefined") + layer2.visible = !!visible; + else + layer2.visible = !layer2.visible; + this.setCurrentView(this._date, this._mode); + }; + scheduler2.getLayer = function(tlayer) { + var layer2, layer_name; + if (typeof tlayer == "string") + layer_name = tlayer; + if (typeof tlayer == "object") + layer_name = tlayer.layer; + for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { + if (scheduler2.layers[i2].name == layer_name) + layer2 = scheduler2.layers[i2]; + } + return layer2; + }; + scheduler2.attachEvent("onBeforeLightbox", function(event_id) { + var ev = this.getEvent(event_id); + this.config.lightbox.sections = this.config["lightbox_" + ev.layer].sections; + scheduler2.resetLightbox(); + return true; + }); + scheduler2.attachEvent("onClick", function(event_id, native_event_object) { + var ev = scheduler2.getEvent(event_id); + return !scheduler2.getLayer(ev.layer).noMenu; + }); + scheduler2.attachEvent("onEventCollision", function(ev, evs) { + var layer2 = this.getLayer(ev); + if (!layer2.checkCollision) + return false; + var count = 0; + for (var i2 = 0; i2 < evs.length; i2++) { + if (evs[i2].layer == layer2.name && evs[i2].id != ev.id) + count++; + } + return count >= scheduler2.config.collision_limit; + }); + scheduler2.addEvent = function(start_date, end_date, text, id2, extra_data) { + var ev = start_date; + if (arguments.length != 1) { + ev = extra_data || {}; + ev.start_date = start_date; + ev.end_date = end_date; + ev.text = text; + ev.id = id2; + ev.layer = this.defaultLayer; } + ev.id = ev.id || scheduler2.uid(); + ev.text = ev.text || ""; + if (typeof ev.start_date == "string") + ev.start_date = this.templates.api_date(ev.start_date); + if (typeof ev.end_date == "string") + ev.end_date = this.templates.api_date(ev.end_date); + ev._timed = this.isOneDayEvent(ev); + var is_new = !this._events[ev.id]; + this._events[ev.id] = ev; + this.event_updated(ev); + if (!this._loading) + this.callEvent(is_new ? "onEventAdded" : "onEventChanged", [ev.id, ev]); + }; + this._evs_layer = {}; + for (var i = 0; i < this.layers.length; i++) { + this._evs_layer[this.layers[i].name] = []; } - if (dir) { - for (var c = col; grid[row] && c < grid[row].length; c++) { - if (!grid[row][c] && c == grid[row].length - 1) { - row++; - col = 0; - } - if (grid[row][c]) { - return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); - } + scheduler2.addEventNow = function(start, end, e) { + var base = {}; + if (typeof start == "object") { + base = start; + start = null; } - } else { - for (var c = col; grid[row] && c < grid[row].length; c--) { - if (!grid[row][c] && !c) { - row--; - col = grid[row].length - 1; - } - if (grid[row][c]) { - return new scheduler2.$keyboardNavigation.MinicalCell(this.container, row, c); + var d = (this.config.event_duration || this.config.time_step) * 6e4; + if (!start) + start = Math.round(scheduler2._currentDate().valueOf() / d) * d; + var start_date = new Date(start); + if (!end) { + var start_hour = this.config.first_hour; + if (start_hour > start_date.getHours()) { + start_date.setHours(start_hour); + start = start_date.valueOf(); } + end = start + d; } - } - return new scheduler2.$keyboardNavigation.MinicalButton(this.container, 0); - }, focus: function() { - scheduler2.$keyboardNavigation.dispatcher.globalNode.disable(); - this.container.removeAttribute("tabindex"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this); - }, blur: function() { - this.container.setAttribute("tabindex", "0"); - scheduler2.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this); - }, _getNode: function(row, col) { - return this.container.querySelector(".dhx_year_body tr:nth-child(" + (row + 1) + ") td:nth-child(" + (col + 1) + ")"); - }, getNode: function() { - return this._getNode(this.row, this.col); - }, _getGrid: function() { - var rows = this.container.querySelectorAll(".dhx_year_body tr"); - var grid = []; - for (var i = 0; i < rows.length; i++) { - grid[i] = []; - var row = rows[i]; - var cells = row.querySelectorAll("td"); - for (var c = 0; c < cells.length; c++) { - var cell = cells[c]; - var enabled = true; - var css = scheduler2._getClassName(cell); - if (css.indexOf("dhx_after") > -1 || css.indexOf("dhx_before") > -1 || css.indexOf("dhx_scale_ignore") > -1) { - enabled = false; + base.start_date = base.start_date || start_date; + base.end_date = base.end_date || new Date(end); + base.text = base.text || this.locale.labels.new_event; + base.id = this._drag_id = this.uid(); + base.layer = this.defaultLayer; + this._drag_mode = "new-size"; + this._loading = true; + this.addEvent(base); + this.callEvent("onEventCreated", [this._drag_id, e]); + this._loading = false; + this._drag_event = {}; + this._on_mouse_up(e); + }; + scheduler2._t_render_view_data = function(events) { + if (this.config.multi_day && !this._table_view) { + var tvs = []; + var tvd = []; + for (var k = 0; k < events.length; k++) { + if (events[k]._timed) + tvs.push(events[k]); + else + tvd.push(events[k]); } - grid[i][c] = enabled; + this._table_view = true; + this.render_data(tvd); + this._table_view = false; + this.render_data(tvs); + } else + this.render_data(events); + }; + scheduler2.render_view_data = function() { + if (this._not_render) { + this._render_wait = true; + return; } - } - return grid; - }, keys: { right: function(e) { - var grid = this._getGrid(); - var newRow = this.row; - var newCol = this.col + 1; - if (!grid[newRow] || !grid[newRow][newCol]) { - if (grid[newRow + 1]) { - newRow = newRow + 1; - newCol = 0; - } else { - newCol = this.col; + this._render_wait = false; + this.clear_view(); + this._evs_layer = {}; + for (var i2 = 0; i2 < this.layers.length; i2++) { + this._evs_layer[this.layers[i2].name] = []; } - } - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); - } - this.moveTo(next); - }, left: function(e) { - var grid = this._getGrid(); - var newRow = this.row; - var newCol = this.col - 1; - if (!grid[newRow] || !grid[newRow][newCol]) { - if (grid[newRow - 1]) { - newRow = newRow - 1; - newCol = grid[newRow].length - 1; + var evs = this.get_visible_events(); + for (var i2 = 0; i2 < evs.length; i2++) { + if (this._evs_layer[evs[i2].layer]) + this._evs_layer[evs[i2].layer].push(evs[i2]); + } + if (this._mode == "month") { + var tevs = []; + for (var i2 = 0; i2 < this.layers.length; i2++) { + if (this.layers[i2].visible) + tevs = tevs.concat(this._evs_layer[this.layers[i2].name]); + } + this._t_render_view_data(tevs); } else { - newCol = this.col; + for (var i2 = 0; i2 < this.layers.length; i2++) { + if (this.layers[i2].visible) { + var evs_layer = this._evs_layer[this.layers[i2].name]; + this._t_render_view_data(evs_layer); + } + } } - } - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); - } - this.moveTo(next); - }, down: function() { - var grid = this._getGrid(); - var newRow = this.row + 1; - var newCol = this.col; - if (!grid[newRow] || !grid[newRow][newCol]) { - newRow = this.row; - } - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); - } - this.moveTo(next); - }, up: function() { - var grid = this._getGrid(); - var newRow = this.row - 1; - var newCol = this.col; - if (!grid[newRow] || !grid[newRow][newCol]) { - var index = 0; - if (this.col > grid[this.row].length / 2) { - index = 1; + }; + scheduler2._render_v_bar = function(ev, x, y, w, h, style, contentA, contentB, bottom) { + var id2 = ev.id; + if (contentA.indexOf("
'; + html += '
 
'; + html += '
' + contentA + "
"; + html += '
' + contentB + "
"; + html += '
'; + d.innerHTML = html; + d.style.zIndex = 100; + return d.firstChild; + }; + scheduler2.render_event_bar = function(ev) { + var parent = this._els["dhx_cal_data"][0]; + var x = this._colsS[ev._sday]; + var x2 = this._colsS[ev._eday]; + if (x2 == x) + x2 = this._colsS[ev._eday + 1]; + var hb = this.xy.bar_height; + var y = this._colsS.heights[ev._sweek] + (this._colsS.height ? this.xy.month_scale_height + 2 : 2) + ev._sorder * hb; + var d = document.createElement("div"); + var cs2 = ev._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line"; + var cse = scheduler2.templates["event_class_" + ev.layer] ? scheduler2.templates["event_class_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); + if (cse) + cs2 = cs2 + " " + cse; + var html = '
'; + if (ev._timed) + html += scheduler2.templates["event_bar_date_" + ev.layer] ? scheduler2.templates["event_bar_date_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_date(ev.start_date, ev.end_date, ev); + html += scheduler2.templates["event_bar_text_" + ev.layer] ? scheduler2.templates["event_bar_text_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_text(ev.start_date, ev.end_date, ev) + "
)"; + html += "
"; + d.innerHTML = html; + this._rendered.push(d.firstChild); + parent.appendChild(d.firstChild); + }; + scheduler2.render_event = function(ev) { + var menu = scheduler2.xy.menu_width; + if (scheduler2.getLayer(ev.layer).noMenu) + menu = 0; + if (ev._sday < 0) + return; + var parent = scheduler2.locate_holder(ev._sday); + if (!parent) + return; + var sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes(); + var em = ev.end_date.getHours() * 60 + ev.end_date.getMinutes() || scheduler2.config.last_hour * 60; + var top = Math.round((sm * 60 * 1e3 - this.config.first_hour * 60 * 60 * 1e3) * this.config.hour_size_px / (60 * 60 * 1e3)) % (this.config.hour_size_px * 24) + 1; + var height = Math.max(scheduler2.xy.min_event_height, (em - sm) * this.config.hour_size_px / 60) + 1; + var width = Math.floor((parent.clientWidth - menu) / ev._count); + var left = ev._sorder * width + 1; + if (!ev._inner) + width = width * (ev._count - ev._sorder); + var d = this._render_v_bar(ev.id, menu + left, top, width, height, ev._text_style, scheduler2.templates.event_header(ev.start_date, ev.end_date, ev), scheduler2.templates.event_text(ev.start_date, ev.end_date, ev)); + this._rendered.push(d); + parent.appendChild(d); + left = left + parseInt(parent.style.left, 10) + menu; + top += this._dy_shift; + d.style.zIndex = this._layers_zindex[ev.layer]; + if (this._edit_id == ev.id) { + d.style.zIndex = parseInt(d.style.zIndex) + 1; + var new_zIndex = d.style.zIndex; + width = Math.max(width - 4, scheduler2.xy.editor_width); + var d = document.createElement("div"); + d.setAttribute("event_id", ev.id); + d.setAttribute(this.config.event_attribute, ev.id); + this.set_xy(d, width, height - 20, left, top + 14); + d.className = "dhx_cal_editor"; + d.style.zIndex = new_zIndex; + var d2 = document.createElement("div"); + this.set_xy(d2, width - 6, height - 26); + d2.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;"; + d2.style.zIndex = new_zIndex; + d.appendChild(d2); + this._els["dhx_cal_data"][0].appendChild(d); + this._rendered.push(d); + d2.innerHTML = ""; + this._editor = d2.firstChild; + this._editor.addEventListener("keypress", function(e) { + if (e.shiftKey) + return true; + var code = e.keyCode; + if (code == scheduler2.keys.edit_save) + scheduler2.editStop(true); + if (code == scheduler2.keys.edit_cancel) + scheduler2.editStop(false); + }); + this._editor.addEventListener("selectstart", function(e) { + e.cancelBubble = true; + return true; + }); + d2.firstChild.focus(); + this._els["dhx_cal_data"][0].scrollLeft = 0; + d2.firstChild.select(); } - this.moveTo(new scheduler2.$keyboardNavigation.MinicalButton(this.container, index)); - } else { - var next = new scheduler2.$keyboardNavigation.MinicalCell(this.container, newRow, newCol); - if (!next.isValid()) { - next = next.fallback(); + if (this._select_id == ev.id) { + d.style.zIndex = parseInt(d.style.zIndex) + 1; + var icons = this.config["icons_" + (this._edit_id == ev.id ? "edit" : "select")]; + var icons_str = ""; + for (var i2 = 0; i2 < icons.length; i2++) + icons_str += "
"; + var obj = this._render_v_bar(ev.id, left - menu + 1, top, menu, icons.length * 20 + 26, "", "
", icons_str, true); + obj.style.left = left - menu + 1; + obj.style.zIndex = d.style.zIndex; + this._els["dhx_cal_data"][0].appendChild(obj); + this._rendered.push(obj); } - this.moveTo(next); - } - }, enter: function(e) { - this.getNode().querySelector(".dhx_month_head").click(); - } } }); - scheduler2.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler2.$keyboardNavigation.MinicalCell.prototype.keys); - } - function data_area(scheduler2) { - scheduler2.$keyboardNavigation.DataArea = function(index) { - this.index = index || 0; - }; - scheduler2.$keyboardNavigation.DataArea.prototype = scheduler2._compose(scheduler2.$keyboardNavigation.KeyNavNode, { getNode: function(index) { - return scheduler2.$container.querySelector(".dhx_cal_data"); - }, _handlers: null, isValid: function() { - return true; - }, fallback: function() { - return this; - }, keys: { "up,down,right,left": function() { - this.moveTo(new scheduler2.$keyboardNavigation.TimeSlot()); - } } }); - scheduler2.$keyboardNavigation.DataArea.prototype.bindAll(scheduler2.$keyboardNavigation.DataArea.prototype.keys); + }; + scheduler2.filter_agenda = function(id2, event2) { + var layer2 = scheduler2.getLayer(event2.layer); + return layer2 && layer2.visible; + }; + }); } - function modals(scheduler2) { - (function() { - var modalsStack = []; - function isModal() { - return !!modalsStack.length; - } - function isChildOf(child, parent) { - while (child && child != parent) { - child = child.parentNode; + function limit(scheduler2) { + scheduler2.config.limit_start = null; + scheduler2.config.limit_end = null; + scheduler2.config.limit_view = false; + scheduler2.config.check_limits = true; + scheduler2._temp_limit_scope = function() { + var before = null; + var dhx_time_block = "dhx_time_block"; + scheduler2.attachEvent("onBeforeViewChange", function(om, od, nm, nd) { + function isBlocked(date, mode) { + var limit_start = scheduler2.config.limit_start, limit_end = scheduler2.config.limit_end, date_end = scheduler2.date.add(date, 1, mode); + return date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf(); } - return !!(child == parent); - } - function afterPopup(box) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - if (!isModal() && !isChildOf(document.activeElement, scheduler2.$container)) { - scheduler2.focus(); + if (scheduler2.config.limit_view) { + nd = nd || od; + nm = nm || om; + if (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + var resetDate = !isBlocked(od, nm) ? od : scheduler2.config.limit_start; + scheduler2.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm); + }, 1); + return false; } - }, 1); - } - function startModal(box) { - scheduler2.eventRemove(box, "keydown", trapFocus); - scheduler2.event(box, "keydown", trapFocus); - modalsStack.push(box); - } - function endModal() { - var box = modalsStack.pop(); - if (box) { - scheduler2.eventRemove(box, "keydown", trapFocus); } - afterPopup(); - } - function isTopModal(box) { - return box == modalsStack[modalsStack.length - 1]; - } - function trapFocus(event2) { - var event2 = event2 || window.event; - var target = event2.currentTarget; - if (!isTopModal(target)) - return; - scheduler2.$keyboardNavigation.trapFocus(target, event2); - } - function traceLightbox() { - startModal(scheduler2.getLightbox()); - } - scheduler2.attachEvent("onLightbox", traceLightbox); - scheduler2.attachEvent("onAfterLightbox", endModal); - scheduler2.attachEvent("onAfterQuickInfo", function() { - afterPopup(); + return true; }); - if (!scheduler2._keyNavMessagePopup) { - scheduler2._keyNavMessagePopup = true; - var focusElement = null; - var backupFocus = null; - const modalsStack2 = []; - scheduler2.attachEvent("onMessagePopup", function(box) { - focusElement = document.activeElement; - backupFocus = focusElement; - while (backupFocus && scheduler2._getClassName(backupFocus).indexOf("dhx_cal_data") < 0) { - backupFocus = backupFocus.parentNode; + scheduler2.attachEvent("onMouseDown", function(classname) { + return !(classname == dhx_time_block); + }); + scheduler2.attachEvent("onBeforeDrag", function(id2) { + if (!id2) + return true; + return scheduler2.checkLimitViolation(scheduler2.getEvent(id2)); + }); + scheduler2.attachEvent("onClick", function(event_id, native_event_object) { + return scheduler2.checkLimitViolation(scheduler2.getEvent(event_id)); + }); + scheduler2.attachEvent("onBeforeLightbox", function(id2) { + var ev = scheduler2.getEvent(id2); + before = [ev.start_date, ev.end_date]; + return scheduler2.checkLimitViolation(ev); + }); + scheduler2.attachEvent("onEventSave", function(id2, data, is_new_event) { + if (!(data.start_date && data.end_date)) { + var ev = scheduler2.getEvent(id2); + data.start_date = new Date(ev.start_date); + data.end_date = new Date(ev.end_date); + } + if (data.rec_type) { + var data_copy = scheduler2._lame_clone(data); + scheduler2._roll_back_dates(data_copy); + return scheduler2.checkLimitViolation(data_copy); + } + return scheduler2.checkLimitViolation(data); + }); + scheduler2.attachEvent("onEventAdded", function(id2) { + if (!id2) + return true; + var ev = scheduler2.getEvent(id2); + if (!scheduler2.checkLimitViolation(ev) && scheduler2.config.limit_start && scheduler2.config.limit_end) { + if (ev.start_date < scheduler2.config.limit_start) { + ev.start_date = new Date(scheduler2.config.limit_start); } - if (backupFocus) { - backupFocus = backupFocus.parentNode; + if (ev.start_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { + ev.start_date = this.date.add(scheduler2.config.limit_end, -1, "day"); } - scheduler2.eventRemove(box, "keydown", trapFocus); - scheduler2.event(box, "keydown", trapFocus); - modalsStack2.push(box); - }); - scheduler2.attachEvent("onAfterMessagePopup", function() { - var box = modalsStack2.pop(); - if (box) { - scheduler2.eventRemove(box, "keydown", trapFocus); + if (ev.end_date < scheduler2.config.limit_start) { + ev.end_date = new Date(scheduler2.config.limit_start); } - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - var currentTarget = document.activeElement; - while (currentTarget && scheduler2._getClassName(currentTarget).indexOf("dhx_cal_light") < 0) { - currentTarget = currentTarget.parentNode; - } - if (currentTarget) - return; - if (focusElement && focusElement.parentNode) { - focusElement.focus(); - } else if (backupFocus && backupFocus.parentNode) { - backupFocus.focus(); + if (ev.end_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { + ev.end_date = this.date.add(scheduler2.config.limit_end, -1, "day"); + } + if (ev.start_date.valueOf() >= ev.end_date.valueOf()) { + ev.end_date = this.date.add(ev.start_date, this.config.event_duration || this.config.time_step, "minute"); + } + ev._timed = this.isOneDayEvent(ev); + } + return true; + }); + scheduler2.attachEvent("onEventChanged", function(id2) { + if (!id2) + return true; + var ev = scheduler2.getEvent(id2); + if (!scheduler2.checkLimitViolation(ev)) { + if (!before) + return false; + ev.start_date = before[0]; + ev.end_date = before[1]; + ev._timed = this.isOneDayEvent(ev); + } + return true; + }); + scheduler2.attachEvent("onBeforeEventChanged", function(ev, native_object, is_new) { + return scheduler2.checkLimitViolation(ev); + }); + scheduler2.attachEvent("onBeforeEventCreated", function(ev) { + var start_date = scheduler2.getActionData(ev).date; + var event2 = { _timed: true, start_date, end_date: scheduler2.date.add(start_date, scheduler2.config.time_step, "minute") }; + return scheduler2.checkLimitViolation(event2); + }); + scheduler2.attachEvent("onViewChange", function() { + scheduler2._mark_now(); + }); + scheduler2.attachEvent("onAfterSchedulerResize", function() { + window.setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + scheduler2._mark_now(); + }, 1); + return true; + }); + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2._mark_now_timer = window.setInterval(function() { + if (!scheduler2._is_initialized()) + return; + scheduler2._mark_now(); + }, 6e4); + }); + scheduler2.attachEvent("onDestroy", function() { + clearInterval(scheduler2._mark_now_timer); + }); + }; + scheduler2._temp_limit_scope(); + } + class GoogleMapAdapter { + constructor(scheduler2) { + this.map = null; + this._markers = []; + this.scheduler = scheduler2; + } + onEventClick(event2) { + if (this._markers && this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + if (event2.id == this._markers[i].event.id) { + let zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom; + if (event2.lat && event2.lng) { + this.map.setCenter({ lat: event2.lat, lng: event2.lng }); + this.map.setZoom(zoom); + } else { + this.map.setCenter({ lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }); + this.map.setZoom(zoom); } - focusElement = null; - backupFocus = null; - }, 1); - }); + google.maps.event.trigger(this._markers[i].marker, "click"); + } + } } - scheduler2.$keyboardNavigation.isModal = isModal; - })(); - } - function core(scheduler2) { - scheduler2.$keyboardNavigation.dispatcher = { isActive: false, activeNode: null, globalNode: new scheduler2.$keyboardNavigation.SchedulerNode(), keepScrollPosition: function(callback) { - var top, left; - var scrollable = scheduler2.$container.querySelector(".dhx_timeline_scrollable_data"); - if (!scrollable) { - scrollable = scheduler2.$container.querySelector(".dhx_cal_data"); + } + initialize(container, options) { + this.settings = options; + let scheduler2 = this.scheduler; + let mapOptions = { center: { lat: options.initial_position.lat, lng: options.initial_position.lng }, zoom: options.initial_zoom, mapId: container.id, scrollwheel: true, mapTypeId: options.type }; + if (this.map === null) { + this.map = new google.maps.Map(container, mapOptions); + } else { + let map = this.map; + container.appendChild(this.map.__gm.messageOverlay); + container.appendChild(this.map.__gm.outerContainer); + setTimeout(function() { + map.setOptions({ container: container.id }); + }, 500); } - if (scrollable) { - top = scrollable.scrollTop; - left = scrollable.scrollLeft; + google.maps.event.addListener(this.map, "dblclick", function(event2) { + const geocoder = new google.maps.Geocoder(); + if (!scheduler2.config.readonly && scheduler2.config.dblclick_create) { + let point = event2.latLng; + geocoder.geocode({ latLng: point }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + point = results[0].geometry.location; + scheduler2.addEventNow({ lat: point.lat(), lng: point.lng(), event_location: results[0].formatted_address, start_date: scheduler2.getState().date, end_date: scheduler2.date.add(scheduler2.getState().date, scheduler2.config.time_step, "minute") }); + } else { + console.error("Geocode was not successful for the following reason: " + status); + } + }); + } + }); + } + destroy(container) { + google.maps.event.clearInstanceListeners(window); + google.maps.event.clearInstanceListeners(document); + google.maps.event.clearInstanceListeners(container); + while (container.firstChild) { + container.firstChild.remove(); + } + container.innerHTML = ""; + } + async addEventMarker(event2) { + let config = { title: event2.text, position: {}, map: {} }; + if (event2.lat && event2.lng) { + config.position = { lat: event2.lat, lng: event2.lng }; + } else { + config.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }; } - callback(); - if (scrollable) { - scrollable.scrollTop = top; - scrollable.scrollLeft = left; + const { AdvancedMarkerElement } = await google.maps.importLibrary("marker"); + let marker2; + if (this.scheduler.ext.mapView.createMarker) { + config.map = this.map; + marker2 = this.scheduler.ext.mapView.createMarker(config); + } else { + marker2 = new AdvancedMarkerElement(config); + marker2.map = this.map; } - }, enable: function() { - if (!scheduler2.$container) { - return; + marker2.setMap(this.map); + if (event2["!nativeeditor_status"] == "true_deleted") { + marker2.setMap(null); } - this.isActive = true; - var self2 = this; - this.keepScrollPosition(function() { - self2.globalNode.enable(); - self2.setActiveNode(self2.getActiveNode()); + google.maps.event.addListener(marker2, "click", () => { + if (this.infoWindow) { + this.infoWindow.close(); + } + this.infoWindow = new google.maps.InfoWindow({ maxWidth: this.settings.info_window_max_width }); + this.infoWindow.setContent(this.scheduler.templates.map_info_content(event2)); + this.infoWindow.open({ anchor: marker2, map: this.map }); }); - }, disable: function() { - this.isActive = false; - this.globalNode.disable(); - }, isEnabled: function() { - return !!this.isActive; - }, getDefaultNode: function() { - return this.globalNode.getDefaultNode(); - }, setDefaultNode: function() { - this.setActiveNode(this.getDefaultNode()); - }, getActiveNode: function() { - var node = this.activeNode; - if (node && !node.isValid()) { - node = node.fallback(); - } - return node; - }, focusGlobalNode: function() { - this.blurNode(this.globalNode); - this.focusNode(this.globalNode); - }, setActiveNode: function(el2) { - if (!el2 || !el2.isValid()) - return; - if (this.activeNode) { - if (this.activeNode.compareTo(el2)) { - return; + let markerInfo = { event: event2, ...config, marker: marker2 }; + this._markers.push(markerInfo); + } + removeEventMarker(eventId) { + for (let i = 0; i < this._markers.length; i++) { + if (eventId == this._markers[i].event.id) { + this._markers[i].marker.setVisible(false); + this._markers[i].marker.setMap(null); + this._markers[i].marker.setPosition(null); + this._markers[i].marker = null; + this._markers.splice(i, 1); + i--; } } - if (this.isEnabled()) { - this.blurNode(this.activeNode); - this.activeNode = el2; - this.focusNode(this.activeNode); - } - }, focusNode: function(el2) { - if (el2 && el2.focus) { - el2.focus(); - if (el2.getNode && document.activeElement != el2.getNode()) { - this.setActiveNode(new scheduler2.$keyboardNavigation.DataArea()); + } + updateEventMarker(event2) { + for (let i = 0; i < this._markers.length; i++) { + if (this._markers[i].event.id == event2.id) { + this._markers[i].event = event2; + this._markers[i].position.lat = event2.lat; + this._markers[i].position.lng = event2.lng; + this._markers[i].text = event2.text; + let latlng = new google.maps.LatLng(event2.lat, event2.lng); + this._markers[i].marker.setPosition(latlng); } } - }, blurNode: function(el2) { - if (el2 && el2.blur) { - el2.blur(); - } - }, getInlineEditor: function(id2) { - var editor = scheduler2.$container.querySelector(".dhx_cal_editor[" + scheduler2.config.event_attribute + "='" + id2 + "'] textarea"); - if (editor && editor.offsetWidth) { - return editor; - } - return null; - }, keyDownHandler: function(e) { - if (e.defaultPrevented) { - return; - } - var activeElement = this.getActiveNode(); - if (scheduler2.$keyboardNavigation.isModal() && !(activeElement && activeElement.container && scheduler2.utils.dom.locateCss({ target: activeElement.container }, "dhx_minical_popup", false))) - return; - if (scheduler2.getState().editor_id && this.getInlineEditor(scheduler2.getState().editor_id)) - return; - if (!this.isEnabled()) - return; - e = e || window.event; - var schedulerNode = this.globalNode; - var command = scheduler2.$keyboardNavigation.shortcuts.getCommandFromEvent(e); - if (!activeElement) { - this.setDefaultNode(); - } else if (activeElement.findHandler(command)) { - activeElement.doAction(command, e); - } else if (schedulerNode.findHandler(command)) { - schedulerNode.doAction(command, e); + } + clearEventMarkers() { + if (this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + this._markers[i].marker.setMap(null); + } + this._markers = []; } - }, _timeout: null, delay: function(callback, delay2) { - clearTimeout(this._timeout); - this._timeout = setTimeout(callback, delay2 || 1); - } }; - } - function key_nav_legacy(scheduler2) { - scheduler2._temp_key_scope = function() { - scheduler2.config.key_nav = true; - scheduler2.$keyboardNavigation._pasteDate = null; - scheduler2.$keyboardNavigation._pasteSection = null; - var isCopy = null; - var pos = {}; - if (!document.body) { - scheduler2.event(window, "load", function() { - scheduler2.event(document.body, "mousemove", trackMousePosition); + } + setView(latitude, longitude, zoom) { + this.map.setCenter({ lat: latitude, lng: longitude }); + this.map.setZoom(zoom); + } + async resolveAddress(string) { + const geocoder = new google.maps.Geocoder(); + let position = await new Promise((resolve) => { + geocoder.geocode({ address: string }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + resolve({ lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng() }); + } else { + console.error("Geocode was not successful for the following reason: " + status); + resolve({}); + } }); - } else { - scheduler2.event(document.body, "mousemove", trackMousePosition); - } - function trackMousePosition(event2) { - event2 = event2 || window.event; - pos.x = event2.clientX; - pos.y = event2.clientY; - } - function currentTarget() { - var mousePointer = false; - var keyNavPointer = false; - var target = document.elementFromPoint(pos.x, pos.y); - while (target && target != scheduler2._obj) { - target = target.parentNode; + }); + return position; + } + } + class OpenStreetMapAdapter { + constructor(scheduler2) { + this.map = null; + this._markers = []; + this.scheduler = scheduler2; + } + onEventClick(event2) { + if (this._markers && this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + if (event2.id == this._markers[i].event.id) { + this._markers[i].marker.openPopup(); + this._markers[i].marker.closeTooltip(); + if (event2.lat && event2.lng) { + this.setView(event2.lat, event2.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } else { + this.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } + } } - mousePointer = !!(target == scheduler2._obj); - keyNavPointer = scheduler2.$keyboardNavigation.dispatcher.isEnabled(); - return mousePointer || keyNavPointer; } - scheduler2.attachEvent("onMouseMove", function(id2, e) { - var state = scheduler2.getState(); - if (!(state.mode && state.min_date)) { - return; + } + initialize(container, options) { + let scheduler2 = this.scheduler; + let mapWrapper = document.createElement("div"); + mapWrapper.className = "mapWrapper"; + mapWrapper.id = "mapWrapper"; + mapWrapper.style.width = container.style.width; + mapWrapper.style.height = container.style.height; + container.appendChild(mapWrapper); + let map = L.map(mapWrapper, { center: L.latLng(options.initial_position.lat, options.initial_position.lng), zoom: options.initial_zoom, keyboard: false }); + L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(map); + map.on("dblclick", async function(e) { + const settings = { method: "GET", headers: { "Accept-Language": "en" } }; + let response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then((response2) => response2.json()); + if (response.address) { + let address = response.address.country; + scheduler2.addEventNow({ lat: e.latlng.lat, lng: e.latlng.lng, event_location: address, start_date: scheduler2.getState().date, end_date: scheduler2.date.add(scheduler2.getState().date, scheduler2.config.time_step, "minute") }); + } else { + console.error("unable recieve a position of the event", response.error); } - var position = scheduler2.getActionData(e); - scheduler2.$keyboardNavigation._pasteDate = position.date; - scheduler2.$keyboardNavigation._pasteSection = position.section; }); - function clear_event_after(ev) { - delete ev.rec_type; - delete ev.rec_pattern; - delete ev.event_pid; - delete ev.event_length; + this.map = map; + this.settings = options; + } + destroy(container) { + this.map.remove(); + while (container.firstChild) { + container.firstChild.remove(); } - function copyEvent(ev) { - return scheduler2._lame_copy({}, ev); + container.innerHTML = ""; + } + addEventMarker(event2) { + const myIcon = L.icon({ iconUrl: "https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png", iconSize: [25, 41], shadowSize: [30, 65], iconAnchor: [12, 41], shadowAnchor: [7, 65] }); + let popupConfig = { minWidth: 180, maxWidth: this.settings.info_window_max_width }; + const markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event2)); + const tooltip2 = L.tooltip().setContent(event2.text); + let markerConfig = [event2.lat, event2.lng]; + if (!event2.lat || !event2.lng) { + markerConfig = [this.settings.error_position.lat, this.settings.error_position.lng]; + } + const marker2 = L.marker(markerConfig, { icon: myIcon }).bindPopup(markerPopup).bindTooltip(tooltip2).addTo(this.map); + const markerInfo = { event: event2, marker: marker2 }; + this._markers.push(markerInfo); + } + removeEventMarker(eventId) { + for (let i = 0; i < this._markers.length; i++) { + if (eventId == this._markers[i].event.id) { + this.map.removeLayer(this._markers[i].marker); + this._markers.splice(i, 1); + i--; + } } - scheduler2._make_pasted_event = function(ev) { - var date = scheduler2.$keyboardNavigation._pasteDate; - var section = scheduler2.$keyboardNavigation._pasteSection; - var event_duration = ev.end_date - ev.start_date; - var copy = copyEvent(ev); - clear_event_after(copy); - copy.start_date = new Date(date); - copy.end_date = new Date(copy.start_date.valueOf() + event_duration); - if (section) { - var property = scheduler2._get_section_property(); - if (scheduler2.config.multisection) - copy[property] = ev[property]; - else - copy[property] = section; + } + updateEventMarker(event2) { + for (let i = 0; i < this._markers.length; i++) { + if (this._markers[i].event.id == event2.id) { + this._markers[i].event = event2; + if (!event2.lat || !event2.lng) { + this._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]); + } else { + this._markers[i].marker.setLatLng([event2.lat, event2.lng]); + } } - return copy; - }; - scheduler2._do_paste = function(is_copy, modified_ev, original_ev) { - if (scheduler2.callEvent("onBeforeEventPasted", [is_copy, modified_ev, original_ev]) === false) { - return; + } + } + clearEventMarkers() { + if (this._markers) { + for (let i = 0; i < this._markers.length; i++) { + this.map.removeLayer(this._markers[i].marker); } - scheduler2.addEvent(modified_ev); - scheduler2.callEvent("onEventPasted", [is_copy, modified_ev, original_ev]); - }; - scheduler2._is_key_nav_active = function() { - if (this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav) { - return true; + this._markers = []; + } + } + setView(latitude, longitude, zoom) { + this.map.setView([latitude, longitude], zoom); + } + async resolveAddress(string) { + const settings = { method: "GET", headers: { "Accept-Language": "en" } }; + let position = {}; + let response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then((response2) => response2.json()); + if (response && response.length) { + position.lat = +response[0].lat; + position.lng = +response[0].lon; + } else { + console.error(`Unable recieve a position of the event's location: ${string}`); + } + return position; + } + } + class MapboxAdapter { + constructor(scheduler2) { + this.map = null; + this._markers = []; + this.scheduler = scheduler2; + } + onEventClick(event2) { + if (this._markers && this._markers.length > 0) { + for (let i = 0; i < this._markers.length; i++) { + const popup = this._markers[i].marker.getPopup(); + if (popup.isOpen()) { + popup.remove(); + } + if (event2.id == this._markers[i].event.id) { + this._markers[i].marker.togglePopup(); + if (event2.lat && event2.lng) { + this.setView(event2.lat, event2.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } else { + this.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom); + } + } } - return false; - }; - function getSelectedEvent() { - var node = scheduler2.$keyboardNavigation.dispatcher.getActiveNode(); - if (node && node.eventId) - return node.eventId; - return scheduler2._select_id; } - scheduler2.event(document, "keydown", function(e) { - if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && scheduler2._buffer_event && !scheduler2.$keyboardNavigation.dispatcher.isEnabled()) { - scheduler2.$keyboardNavigation.dispatcher.isActive = currentTarget(); + } + initialize(container, options) { + let scheduler2 = this.scheduler; + mapboxgl.accessToken = options.accessToken; + const map = new mapboxgl.Map({ container, center: [options.initial_position.lng, options.initial_position.lat], zoom: options.initial_zoom + 1 }); + map.on("dblclick", async function(e) { + let response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${e.lngLat.lat}.json?access_token=${options.accessToken}`).then((response2) => response2.json()); + if (response.features) { + let address = response.features[0].place_name; + scheduler2.addEventNow({ lat: e.lngLat.lat, lng: e.lngLat.lng, event_location: address, start_date: scheduler2.getState().date, end_date: scheduler2.date.add(scheduler2.getState().date, scheduler2.config.time_step, "minute") }); + } else { + console.error("unable recieve a position of the event"); } }); - scheduler2._key_nav_copy_paste = function(e) { - if (!scheduler2._is_key_nav_active()) - return true; - if (e.keyCode == 37 || e.keyCode == 39) { - e.cancelBubble = true; - var next = scheduler2.date.add(scheduler2._date, e.keyCode == 37 ? -1 : 1, scheduler2._mode); - scheduler2.setCurrentView(next); - return true; + this.map = map; + this.settings = options; + } + destroy(container) { + this.map.remove(); + while (container.firstChild) { + container.firstChild.remove(); + } + container.innerHTML = ""; + } + addEventMarker(event2) { + let config = [event2.lng, event2.lat]; + if (!event2.lat || !event2.lng) { + config = [this.settings.error_position.lng, this.settings.error_position.lat]; + } + const popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false }).setMaxWidth(`${this.settings.info_window_max_width}px`).setHTML(this.scheduler.templates.map_info_content(event2)); + const marker2 = new mapboxgl.Marker().setLngLat(config).setPopup(popup).addTo(this.map); + const markerInfo = { event: event2, marker: marker2 }; + this._markers.push(markerInfo); + } + removeEventMarker(eventId) { + for (let i = 0; i < this._markers.length; i++) { + if (eventId == this._markers[i].event.id) { + this._markers[i].marker.remove(); + this._markers.splice(i, 1); + i--; } - var select_id = getSelectedEvent(); - if ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { - if (select_id) { - scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); - isCopy = true; - scheduler2.callEvent("onEventCopied", [scheduler2.getEvent(select_id)]); + } + } + updateEventMarker(event2) { + for (let i = 0; i < this._markers.length; i++) { + if (this._markers[i].event.id == event2.id) { + this._markers[i].event = event2; + if (!event2.lat || !event2.lng) { + this._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]); + } else { + this._markers[i].marker.setLngLat([event2.lng, event2.lat]); } - return true; } - if ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { - if (select_id) { - isCopy = false; - var ev = scheduler2._buffer_event = copyEvent(scheduler2.getEvent(select_id)); - scheduler2.updateEvent(ev.id); - scheduler2.callEvent("onEventCut", [ev]); - } + } + } + clearEventMarkers() { + for (let i = 0; i < this._markers.length; i++) { + this._markers[i].marker.remove(); + } + this._markers = []; + } + setView(latitude, longitude, zoom) { + this.map.setCenter([longitude, latitude]); + this.map.setZoom(zoom); + } + async resolveAddress(string) { + let response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then((response2) => response2.json()); + let position = {}; + if (response && response.features.length) { + position.lng = response.features[0].center[0]; + position.lat = response.features[0].center[1]; + } else { + console.error(`Unable recieve a position of the event's location: ${string}`); + } + return position; + } + } + function map_view(scheduler2) { + let mapAdapter = null; + let eventHandlerIds = []; + const adapters = { googleMap: new GoogleMapAdapter(scheduler2), openStreetMaps: new OpenStreetMapAdapter(scheduler2), mapbox: new MapboxAdapter(scheduler2) }; + if (!scheduler2.ext) { + scheduler2.ext = {}; + } + scheduler2.ext.mapView = { createAdapter: function() { + return adapters[scheduler2.config.map_view_provider]; + }, createMarker: function(config) { + return new google.maps.Marker(config); + }, currentAdapter: null, adapters }; + scheduler2._latLngUpdate = false; + scheduler2._eventLocationChanged = false; + scheduler2.config.map_view_provider = "googleMap"; + scheduler2.config.map_settings = { initial_position: { lat: 48.724, lng: 8.215 }, error_position: { lat: 15, lng: 15 }, initial_zoom: 1, zoom_after_resolve: 15, info_window_max_width: 300, resolve_user_location: true, resolve_event_location: true, view_provider: "googleMap" }; + if (scheduler2.config.map_initial_position) { + scheduler2.config.map_settings.initial_position = { lat: scheduler2.config.map_initial_position.lat(), lng: scheduler2.config.map_initial_position.lng() }; + } + if (scheduler2.config.map_error_position) { + scheduler2.config.map_settings.error_position = { lat: scheduler2.config.map_error_position.lat(), lng: scheduler2.config.map_error_position.lng() }; + } + scheduler2.xy.map_date_width = 188; + scheduler2.xy.map_icon_width = 25; + scheduler2.xy.map_description_width = 400; + scheduler2.date.add_map = function(date, inc, mode) { + return new Date(date.valueOf()); + }; + scheduler2.templates.map_date = function(dd, ed, mode) { + return ""; + }; + scheduler2.templates.map_time = function(start, end, ev) { + if (scheduler2.config.rtl && !ev._timed) { + return scheduler2.templates.day_date(end) + " – " + scheduler2.templates.day_date(start); + } else if (ev._timed) { + return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); + } else { + return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); + } + }; + scheduler2.templates.map_text = function(start, end, ev) { + return ev.text; + }; + scheduler2.templates.map_info_content = function(event2) { + return `
Event's text: ${event2.text} +
Location: ${event2.event_location}
+
Starts: ${scheduler2.templates.tooltip_date_format(event2.start_date)}
+
Ends: ${scheduler2.templates.tooltip_date_format(event2.end_date)}
+
`; + }; + scheduler2.date.map_start = function(d) { + return d; + }; + function setupMapView(scheduler22) { + mapAdapter = scheduler22.ext.mapView.createAdapter(); + attachSchedulerEvents(); + } + async function addEventWithLocation(event2, mapAdapter2) { + let coordinates = await mapAdapter2.resolveAddress(event2.event_location); + event2.lat = coordinates.lat; + event2.lng = coordinates.lng; + mapAdapter2.removeEventMarker(String(event2.id)); + mapAdapter2.addEventMarker(event2); + return event2; + } + function setUserLocation(options, adapter) { + if (options.resolve_user_location) { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(function(position) { + adapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom); + }); } - if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget()) { - var ev = scheduler2._buffer_event ? scheduler2.getEvent(scheduler2._buffer_event.id) : scheduler2._buffer_event; - ev = ev || scheduler2._buffer_event; - if (ev) { - var new_ev = scheduler2._make_pasted_event(ev); - if (isCopy) { - new_ev.id = scheduler2.uid(); - scheduler2._do_paste(isCopy, new_ev, ev); + } else { + adapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom); + } + } + scheduler2.dblclick_dhx_map_area = function(e) { + let eventNode = e.target.closest(`[${scheduler2.config.event_attribute}]`); + if (eventNode) { + let eventId = eventNode.getAttribute(`${scheduler2.config.event_attribute}`); + scheduler2.showLightbox(eventId); + } + if (!this.config.readonly && this.config.dblclick_create && !eventNode) { + this.addEventNow({ start_date: scheduler2.config.map_start, end_date: scheduler2.date.add(scheduler2.config.map_start, scheduler2.config.time_step, "minute") }); + } + }; + function attachSchedulerEvents() { + eventHandlerIds.push(scheduler2.attachEvent("onEventSave", function(id2, ev, is_new) { + let unmodifiedEvent = scheduler2.getEvent(id2); + if (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) { + scheduler2._eventLocationChanged = true; + } + return true; + }), scheduler2.attachEvent("onEventChanged", (id2, event2) => { + const { start_date, end_date } = event2; + const { min_date, max_date } = scheduler2.getState(); + if (start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()) { + if (mapAdapter) { + if (scheduler2.config.map_settings.resolve_event_location && event2.event_location && !scheduler2._latLngUpdate) { + addEventWithLocation(event2, mapAdapter); } else { - var res = scheduler2.callEvent("onBeforeEventChanged", [new_ev, e, false, ev]); - if (res) { - scheduler2._do_paste(isCopy, new_ev, ev); - isCopy = true; - } + mapAdapter.updateEventMarker(event2); } } - return true; } - }; - }; - scheduler2._temp_key_scope(); - } - function scheduler_handlers(scheduler2) { - scheduler2.$keyboardNavigation.attachSchedulerHandlers = function() { - var dispatcher = scheduler2.$keyboardNavigation.dispatcher; - var keyDownHandler = function(e) { - if (!scheduler2.config.key_nav) - return; - return dispatcher.keyDownHandler(e); - }; - var focusHandler = function() { - dispatcher.keepScrollPosition(function() { - dispatcher.focusGlobalNode(); - }); - }; - var waitCall; - scheduler2.attachEvent("onDataRender", function() { - if (!scheduler2.config.key_nav) - return; - if (!(dispatcher.isEnabled() && !scheduler2.getState().editor_id)) - return; - clearTimeout(waitCall); - waitCall = setTimeout(function() { - if (scheduler2.$destroyed) { - return true; + scheduler2._latLngUpdate = false; + return true; + }), scheduler2.attachEvent("onEventIdChange", function(old_id, new_id) { + let newIdEvent = scheduler2.getEvent(new_id); + mapAdapter == null ? void 0 : mapAdapter.removeEventMarker(old_id); + mapAdapter == null ? void 0 : mapAdapter.addEventMarker(newIdEvent); + }), scheduler2.attachEvent("onEventAdded", (id2, event2) => { + const { start_date, end_date } = event2; + const { min_date, max_date } = scheduler2.getState(); + if (start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()) { + if (mapAdapter) { + if (scheduler2.config.map_settings.resolve_event_location && event2.event_location && scheduler2._eventLocationChanged) { + addEventWithLocation(event2, mapAdapter); + scheduler2._eventLocationChanged = false; + } else { + mapAdapter.addEventMarker(event2); + mapAdapter.onEventClick(event2); + } } - if (!dispatcher.isEnabled()) - dispatcher.enable(); - reFocusActiveNode(); - }); - }); - var reFocusActiveNode = function() { - if (!dispatcher.isEnabled()) - return; - var activeNode = dispatcher.getActiveNode(); - if (!activeNode) - return; - if (!activeNode.isValid()) { - activeNode = activeNode.fallback(); } - if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) - return; - dispatcher.keepScrollPosition(function() { - activeNode.focus(true); - }); - }; - scheduler2.attachEvent("onSchedulerReady", function() { - var container = scheduler2.$container; - scheduler2.eventRemove(document, "keydown", keyDownHandler); - scheduler2.eventRemove(container, "mousedown", mousedownHandler); - scheduler2.eventRemove(container, "focus", focusHandler); - if (scheduler2.config.key_nav) { - scheduler2.event(document, "keydown", keyDownHandler); - scheduler2.event(container, "mousedown", mousedownHandler); - scheduler2.event(container, "focus", focusHandler); - container.setAttribute("tabindex", "0"); - } else { - container.removeAttribute("tabindex"); + }), scheduler2.attachEvent("onClick", function(id2, e) { + const event2 = scheduler2.getEvent(id2); + if (mapAdapter && event2) + mapAdapter.onEventClick(event2); + return false; + }), scheduler2.attachEvent("onBeforeEventDelete", (id2, event2) => { + if (mapAdapter) { + mapAdapter.removeEventMarker(id2); } - }); - function mousedownHandler(e) { - if (!scheduler2.config.key_nav) - return true; - const view = scheduler2.getView(); - let dataAreaClick = false; - if (scheduler2.getState().mode === "month") { - dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_cal_month_table")); - } else if (view && view.layout === "timeline") { - dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_timeline_data_col")); + return true; + })); + } + function detachSchedulerEvents() { + eventHandlerIds.forEach((id2) => scheduler2.detachEvent(id2)); + eventHandlerIds = []; + } + scheduler2.attachEvent("onSchedulerReady", function() { + if (scheduler2.config.map_initial_zoom !== void 0) { + scheduler2.config.map_settings.initial_zoom = scheduler2.config.map_initial_zoom; + } + if (scheduler2.config.map_zoom_after_resolve !== void 0) { + scheduler2.config.map_settings.zoom_after_resolve = scheduler2.config.map_zoom_after_resolve; + } + if (scheduler2.config.map_infowindow_max_width !== void 0) { + scheduler2.config.map_settings.info_window_max_width = scheduler2.config.map_infowindow_max_width; + } + if (scheduler2.config.map_resolve_user_location !== void 0) { + scheduler2.config.map_settings.resolve_user_location = scheduler2.config.map_resolve_user_location; + } + if (scheduler2.config.map_view_provider !== void 0) { + scheduler2.config.map_settings.view_provider = scheduler2.config.map_view_provider; + } + if (scheduler2.config.map_type !== void 0) { + scheduler2.config.map_settings.type = scheduler2.config.map_type; + } + if (scheduler2.config.map_resolve_event_location !== void 0) { + scheduler2.config.map_settings.resolve_event_location = scheduler2.config.map_resolve_event_location; + } + scheduler2.ext.mapView.currentAdapter = scheduler2.config.map_view_provider; + let map = document.createElement("div"); + map.className = "mapContainer"; + map.id = "mapContainer"; + map.style.display = "none"; + map.style.zIndex = "1"; + scheduler2._obj.appendChild(map); + const old = scheduler2.render_data; + scheduler2.render_data = function(evs, hold) { + if (this._mode == "map") { + fill_map_tab(); + let events = scheduler2.get_visible_events(); + if (mapAdapter) { + mapAdapter.clearEventMarkers(); + events.forEach((event2) => mapAdapter == null ? void 0 : mapAdapter.addEventMarker(event2)); + } + } else + return old.apply(this, arguments); + }; + scheduler2.map_view = function(mode) { + scheduler2._els.dhx_cal_data[0].style.width = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; + scheduler2._min_date = scheduler2.config.map_start || scheduler2._currentDate(); + scheduler2._max_date = scheduler2.config.map_end || scheduler2.date.add(scheduler2._currentDate(), 1, "year"); + scheduler2._table_view = true; + set_full_view(mode); + let mapContainer = document.getElementById("mapContainer"); + _setMapSize("mapContainer"); + if (mode && mapContainer) { + map.style.display = "block"; + fill_map_tab(); + if (scheduler2.config.map_view_provider == scheduler2.ext.mapView.currentAdapter) { + mapAdapter == null ? void 0 : mapAdapter.destroy(mapContainer); + setupMapView(scheduler2); + mapAdapter == null ? void 0 : mapAdapter.initialize(mapContainer, scheduler2.config.map_settings); + } else { + mapAdapter == null ? void 0 : mapAdapter.destroy(mapContainer); + setupMapView(scheduler2); + mapAdapter == null ? void 0 : mapAdapter.initialize(mapContainer, scheduler2.config.map_settings); + scheduler2.ext.mapView.currentAdapter = scheduler2.config.map_view_provider; + } + if (mapAdapter) { + setUserLocation(scheduler2.config.map_settings, mapAdapter); + } } else { - const listOfScales = scheduler2.$container.querySelectorAll(".dhx_scale_holder"); - const arrOfScales = Array.from(listOfScales); - dataAreaClick = arrOfScales.some((scale) => scale === e.target.parentNode); - } - var pos = scheduler2.getActionData(e); - var focusNode; - if (scheduler2._locate_event(e.target || e.srcElement)) { - focusNode = new scheduler2.$keyboardNavigation.Event(scheduler2._locate_event(e.target || e.srcElement)); - } else if (dataAreaClick) { - focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); - if (pos.date && dataAreaClick) { - focusNode = focusNode.nextSlot(new scheduler2.$keyboardNavigation.TimeSlot(pos.date, null, pos.section)); + map.style.display = "none"; + scheduler2._els.dhx_cal_data[0].style.width = "100%"; + if (mapAdapter && mapContainer) { + mapAdapter.destroy(mapContainer); + mapAdapter = null; + scheduler2.ext.mapView.currentAdapter = scheduler2.config.map_view_provider; } + detachSchedulerEvents(); } - if (focusNode) { - if (!dispatcher.isEnabled()) { - dispatcher.activeNode = focusNode; + }; + function _setMapSize(elem_id) { + let map2 = document.getElementById(elem_id); + if (map2) { + const nav_height = scheduler2.$container.querySelector(".dhx_cal_navline").offsetHeight; + let height = scheduler2.$container.querySelector(".dhx_cal_data").offsetHeight + scheduler2.$container.querySelector(".dhx_cal_header").offsetHeight; + if (height < 0) + height = 0; + let width = scheduler2._x - scheduler2.xy.map_date_width - scheduler2.xy.map_description_width - 1; + if (width < 0) + width = 0; + map2.style.height = height + "px"; + map2.style.width = width + "px"; + map2.style.position = "absolute"; + map2.style.top = nav_height + "px"; + if (scheduler2.config.rtl) { + map2.style.marginRight = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; } else { - if (pos.date && dataAreaClick) { - dispatcher.delay(function() { - dispatcher.setActiveNode(focusNode); - }); - } + map2.style.marginLeft = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; } + map2.style.marginTop = scheduler2.xy.nav_height + 2 + "px"; + } + } + function fill_map_tab() { + let events = scheduler2.get_visible_events(); + events.sort(function(a, b) { + if (a.start_date.valueOf() == b.start_date.valueOf()) + return a.id > b.id ? 1 : -1; + return a.start_date > b.start_date ? 1 : -1; + }); + let ariaAttr = scheduler2._waiAria.mapAttrString(); + let html = "
"; + for (let i = 0; i < events.length; i++) { + let ev = events[i]; + let event_class = ev.id == scheduler2._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line"; + let bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; + let color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; + let ariaAttr2 = scheduler2._waiAria.mapRowAttrString(ev); + let ariaButtonAttr = scheduler2._waiAria.mapDetailsBtnString(); + html += "
" + scheduler2.templates.map_time(ev.start_date, ev.end_date, ev) + "
"; + html += `
+ +
`; + html += "
" + scheduler2.templates.map_text(ev.start_date, ev.end_date, ev) + "
"; + } + html += "
"; + scheduler2._els["dhx_cal_data"][0].scrollTop = 0; + scheduler2._els["dhx_cal_data"][0].innerHTML = html; + let t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; + let dateElement = scheduler2._getNavDateElement(); + if (dateElement) { + dateElement.innerHTML = scheduler2.templates[scheduler2._mode + "_date"](scheduler2._min_date, scheduler2._max_date, scheduler2._mode); + } + scheduler2._rendered = []; + for (let i = 0; i < t.length - 2; i++) { + scheduler2._rendered[i] = t[i]; } } - function focusEvent(evNode) { - if (!scheduler2.config.key_nav) - return; - if (!dispatcher.isEnabled()) - return; - var prevState = evNode; - var focusNode = new scheduler2.$keyboardNavigation.Event(prevState.eventId); - if (!focusNode.isValid()) { - var lastStart = focusNode.start || prevState.start; - var lastEnd = focusNode.end || prevState.end; - var lastSection = focusNode.section || prevState.section; - focusNode = new scheduler2.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection); - if (!focusNode.isValid()) { - focusNode = new scheduler2.$keyboardNavigation.TimeSlot(); - } - } - dispatcher.setActiveNode(focusNode); - var node = dispatcher.getActiveNode(); - if (node && node.getNode && document.activeElement != node.getNode()) { - dispatcher.focusNode(dispatcher.getActiveNode()); + function set_full_view(mode) { + if (mode) { + const l = scheduler2.locale.labels; + scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; + scheduler2._table_view = true; + scheduler2.set_sizes(); } } - var updateEvent = scheduler2.updateEvent; - scheduler2.updateEvent = function(id2) { - var res = updateEvent.apply(this, arguments); - if (scheduler2.config.key_nav && dispatcher.isEnabled()) { - if (scheduler2.getState().select_id == id2) { - var element = new scheduler2.$keyboardNavigation.Event(id2); - if (!scheduler2.getState().lightbox_id) { - focusEvent(element); - } + scheduler2.attachEvent("onLocationError", function(id2) { + alert("Location can't be found"); + return google.maps.LatLng(51.47784, -1492e-6); + }); + let _updateEventLocation = async function(event2) { + if (mapAdapter) { + const coordinates = await mapAdapter.resolveAddress(event2.event_location); + if (coordinates.lat && coordinates.lng) { + event2.lat = +coordinates.lat; + event2.lng = +coordinates.lng; + } else { + scheduler2.callEvent("onLocationError", [event2.id]); + event2.lng = scheduler2.config.map_settings.error_position.lng; + event2.lat = scheduler2.config.map_settings.error_position.lat; } + scheduler2._latLngUpdate = true; + scheduler2.callEvent("onEventChanged", [event2.id, event2]); } - return res; }; - scheduler2.attachEvent("onEventDeleted", function(id2) { - if (!scheduler2.config.key_nav) - return true; - if (dispatcher.isEnabled()) { - var activeNode = dispatcher.getActiveNode(); - if (activeNode.eventId == id2) { - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); + let _delay = function(method, object, params, delay2) { + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; } + let ret = method.apply(object, params); + method = object = params = null; + return ret; + }, delay2 || 1); + }; + scheduler2._event_resolve_delay = 1500; + scheduler2.attachEvent("onEventLoading", function(event2) { + if (event2.lat && event2.lng) { + event2.lat = +event2.lat; + event2.lng = +event2.lng; } - return true; - }); - scheduler2.attachEvent("onClearAll", function() { - if (!scheduler2.config.key_nav) - return true; - if (dispatcher.isEnabled()) { - if (dispatcher.getActiveNode() instanceof scheduler2.$keyboardNavigation.Event) { - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.TimeSlot()); - } + if (scheduler2.config.map_settings.resolve_event_location && event2.event_location && !event2.lat && !event2.lng) { + scheduler2._event_resolve_delay += 1500; + _delay(_updateEventLocation, this, [event2], scheduler2._event_resolve_delay); } + return true; }); - }; + }); } - function minical_handlers(scheduler2) { - scheduler2.$keyboardNavigation._minicalendars = []; - scheduler2.$keyboardNavigation.isMinical = function(node) { - var minicalendars = scheduler2.$keyboardNavigation._minicalendars; - for (var i = 0; i < minicalendars.length; i++) { - if (this.isChildOf(node, minicalendars[i])) - return true; - } - return false; - }; - scheduler2.$keyboardNavigation.isChildOf = function(child, parent) { - while (child && child !== parent) { - child = child.parentNode; - } - return !!(child === parent); - }; - scheduler2.$keyboardNavigation.patchMinicalendar = function() { - var dispatcher = scheduler2.$keyboardNavigation.dispatcher; - function focusMinical(e) { - var target = e.target; - dispatcher.enable(); - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(target, 0)); - } - function minicalClick(e) { - var target = e.target || e.srcElement; - var prev = scheduler2.utils.dom.locateCss(e, "dhx_cal_prev_button", false); - var next = scheduler2.utils.dom.locateCss(e, "dhx_cal_next_button", false); - var cell = scheduler2.utils.dom.locateCss(e, "dhx_year_body", false); - var rowIndex = 0; - var cellIndex = 0; - if (cell) { - var tr2; - var td; - var current = target; - while (current && current.tagName.toLowerCase() != "td") { - current = current.parentNode; - } - if (current) { - td = current; - tr2 = td.parentNode; - } - if (tr2 && td) { - var rows = tr2.parentNode.querySelectorAll("tr"); - for (var i = 0; i < rows.length; i++) { - if (rows[i] == tr2) { - rowIndex = i; - break; - } - } - var cells = tr2.querySelectorAll("td"); - for (var i = 0; i < cells.length; i++) { - if (cells[i] == td) { - cellIndex = i; - break; - } - } - } + function minical(scheduler2) { + const minicalDomEvents = scheduler2._createDomEventScope(); + scheduler2.config.minicalendar = { mark_events: true }; + scheduler2._synced_minicalendars = []; + scheduler2.renderCalendar = function(obj, _prev, is_refresh) { + var cal = null; + var date = obj.date || scheduler2._currentDate(); + if (typeof date == "string") + date = this.templates.api_date(date); + if (!_prev) { + var cont = obj.container; + var pos = obj.position; + if (typeof cont == "string") + cont = document.getElementById(cont); + if (typeof pos == "string") + pos = document.getElementById(pos); + if (pos && (typeof pos.left == "undefined" && typeof pos.right == "undefined")) { + var tpos = scheduler2.$domHelpers.getOffset(pos); + pos = { top: tpos.top + pos.offsetHeight, left: tpos.left }; } - var root = e.currentTarget; - dispatcher.delay(function() { - if (prev || next || cell) { - var element; - if (prev) { - element = new scheduler2.$keyboardNavigation.MinicalButton(root, 0); - dispatcher.setActiveNode(new scheduler2.$keyboardNavigation.MinicalButton(root, 0)); - } else if (next) { - element = new scheduler2.$keyboardNavigation.MinicalButton(root, 1); - } else if (cell) { - element = new scheduler2.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex); - } - if (element) { - dispatcher.enable(); - if (element.isValid()) { - dispatcher.activeNode = null; - dispatcher.setActiveNode(element); + if (!cont) + cont = scheduler2._get_def_cont(pos); + cal = this._render_calendar(cont, date, obj); + if (!cal.$_eventAttached) { + cal.$_eventAttached = true; + minicalDomEvents.attach(cal, "click", (function(e) { + var src = e.target || e.srcElement; + var $dom = scheduler2.$domHelpers; + if ($dom.closest(src, ".dhx_month_head")) { + if (!$dom.closest(src, ".dhx_after") && !$dom.closest(src, ".dhx_before")) { + var cellRoot = $dom.closest(src, "[data-cell-date]"); + var dateAttribute = cellRoot.getAttribute("data-cell-date"); + var newDate = scheduler2.templates.parse_date(dateAttribute); + scheduler2.unmarkCalendar(this); + scheduler2.markCalendar(this, newDate, "dhx_calendar_click"); + this._last_date = newDate; + if (this.conf.handler) + this.conf.handler.call(scheduler2, newDate, this); } } - } - }); + }).bind(cal)); + } + } else { + cal = this._render_calendar(_prev.parentNode, date, obj, _prev); + scheduler2.unmarkCalendar(cal); } - if (scheduler2.renderCalendar) { - var renderMinical = scheduler2.renderCalendar; - scheduler2.renderCalendar = function() { - var cal = renderMinical.apply(this, arguments); - var minicalendars = scheduler2.$keyboardNavigation._minicalendars; - scheduler2.eventRemove(cal, "click", minicalClick); - scheduler2.event(cal, "click", minicalClick); - scheduler2.eventRemove(cal, "focus", focusMinical); - scheduler2.event(cal, "focus", focusMinical); - var added = false; - for (var i = 0; i < minicalendars.length; i++) { - if (minicalendars[i] == cal) { - added = true; - break; - } - } - if (!added) - minicalendars.push(cal); - if (dispatcher.isEnabled()) { - var node = dispatcher.getActiveNode(); - if (node && node.container == cal) { - dispatcher.focusNode(node); - } else { - cal.setAttribute("tabindex", "0"); + if (scheduler2.config.minicalendar.mark_events) { + var start = scheduler2.date.month_start(date); + var end = scheduler2.date.add(start, 1, "month"); + var evs = this.getEvents(start, end); + var filter = this["filter_" + this._mode]; + var markedDates = {}; + for (var i = 0; i < evs.length; i++) { + var ev = evs[i]; + if (filter && !filter(ev.id, ev)) + continue; + var d = ev.start_date; + if (d.valueOf() < start.valueOf()) + d = start; + d = scheduler2.date.date_part(new Date(d.valueOf())); + while (d < ev.end_date) { + if (!markedDates[+d]) { + markedDates[+d] = true; + this.markCalendar(cal, d, "dhx_year_event"); } - } else { - cal.setAttribute("tabindex", "0"); + d = this.date.add(d, 1, "day"); + if (d.valueOf() >= end.valueOf()) + break; } - return cal; - }; + } } - if (scheduler2.destroyCalendar) { - var destroyMinical = scheduler2.destroyCalendar; - scheduler2.destroyCalendar = function(cal, force) { - cal = cal || (scheduler2._def_count ? scheduler2._def_count.firstChild : null); - var res = destroyMinical.apply(this, arguments); - if (!cal || !cal.parentNode) { - var minicalendars = scheduler2.$keyboardNavigation._minicalendars; - for (var i = 0; i < minicalendars.length; i++) { - if (minicalendars[i] == cal) { - scheduler2.eventRemove(minicalendars[i], "focus", focusMinical); - minicalendars.splice(i, 1); - i--; - } - } - } - return res; - }; + this._markCalendarCurrentDate(cal); + cal.conf = obj; + if (obj.sync && !is_refresh) + this._synced_minicalendars.push(cal); + if (!cal.conf._on_xle_handler) { + cal.conf._on_xle_handler = scheduler2.attachEvent("onXLE", function refreshOnLoad() { + scheduler2.updateCalendar(cal, cal.conf.date); + }); } - }; - } - function key_nav(scheduler2) { - scheduler2.config.key_nav = true; - scheduler2.config.key_nav_step = 30; - scheduler2.addShortcut = function(shortcut, handler, scope) { - var scopeObject = getScope(scope); - if (scopeObject) { - scopeObject.prototype.bind(shortcut, handler); + if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { + cal.setAttribute("role", "application"); } + return cal; }; - scheduler2.getShortcutHandler = function(shortcut, scope) { - var scopeObject = getScope(scope); - if (scopeObject) { - var commands = scheduler2.$keyboardNavigation.shortcuts.parse(shortcut); - if (commands.length) { - return scopeObject.prototype.findHandler(commands[0]); - } + scheduler2._get_def_cont = function(pos) { + if (!this._def_count) { + this._def_count = document.createElement("div"); + this._def_count.className = "dhx_minical_popup"; + scheduler2.event(this._def_count, "click", function(e) { + e.cancelBubble = true; + }); + document.body.appendChild(this._def_count); } - }; - scheduler2.removeShortcut = function(shortcut, scope) { - var scopeObject = getScope(scope); - if (scopeObject) { - scopeObject.prototype.unbind(shortcut); + if (pos.left) { + this._def_count.style.left = pos.left + "px"; } - }; - scheduler2.focus = function() { - if (!scheduler2.config.key_nav) { - return; + if (pos.right) { + this._def_count.style.right = pos.right + "px"; } - var disp = scheduler2.$keyboardNavigation.dispatcher; - disp.enable(); - var activeNode = disp.getActiveNode(); - if (!activeNode || activeNode instanceof scheduler2.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler2.$keyboardNavigation.MinicalCell) { - disp.setDefaultNode(); - } else { - disp.focusNode(disp.getActiveNode()); + if (pos.top) { + this._def_count.style.top = pos.top + "px"; } - }; - function getScope(mode) { - var scopes = { minicalButton: scheduler2.$keyboardNavigation.MinicalButton, minicalDate: scheduler2.$keyboardNavigation.MinicalCell, scheduler: scheduler2.$keyboardNavigation.SchedulerNode, dataArea: scheduler2.$keyboardNavigation.DataArea, timeSlot: scheduler2.$keyboardNavigation.TimeSlot, event: scheduler2.$keyboardNavigation.Event }; - var searchMap = {}; - for (var i in scopes) - searchMap[i.toLowerCase()] = scopes[i]; - mode = (mode + "").toLowerCase(); - return searchMap[mode] || scopes.scheduler; - } - scheduler2.$keyboardNavigation = {}; - scheduler2._compose = function() { - var parts = Array.prototype.slice.call(arguments, 0); - var res = {}; - for (var i = 0; i < parts.length; i++) { - var obj = parts[i]; - if (typeof obj == "function") { - obj = new obj(); - } - for (var p in obj) { - res[p] = obj[p]; - } + if (pos.bottom) { + this._def_count.style.bottom = pos.bottom + "px"; } - return res; + this._def_count._created = /* @__PURE__ */ new Date(); + return this._def_count; }; - keyboard_shortcuts(scheduler2); - eventhandler(scheduler2); - trap_modal_focus(scheduler2); - marker(scheduler2); - scheduler_node(scheduler2); - nav_node(scheduler2); - header_cell(scheduler2); - event(scheduler2); - time_slot(scheduler2); - minical_button(scheduler2); - minical_cell(scheduler2); - data_area(scheduler2); - modals(scheduler2); - core(scheduler2); - key_nav_legacy(scheduler2); - (function() { - scheduler_handlers(scheduler2); - minical_handlers(scheduler2); - var dispatcher = scheduler2.$keyboardNavigation.dispatcher; - scheduler2.$keyboardNavigation.attachSchedulerHandlers(); - if (scheduler2.renderCalendar) { - scheduler2.$keyboardNavigation.patchMinicalendar(); - } else { - var attachOnce = scheduler2.attachEvent("onSchedulerReady", function() { - scheduler2.detachEvent(attachOnce); - scheduler2.$keyboardNavigation.patchMinicalendar(); - }); + scheduler2._locateCalendar = function(cal, date) { + if (typeof date == "string") + date = scheduler2.templates.api_date(date); + if (+date > +cal._max_date || +date < +cal._min_date) + return null; + var table = cal.querySelector(".dhx_year_body").childNodes[0]; + var weekNum = 0; + var dat = new Date(cal._min_date); + while (+this.date.add(dat, 1, "week") <= +date) { + dat = this.date.add(dat, 1, "week"); + weekNum++; } - function isSchedulerSelected() { - if (!scheduler2.config.key_nav) - return; - var enable; - var focusElement = document.activeElement; - if (!focusElement || scheduler2.utils.dom.locateCss(focusElement, "dhx_cal_quick_info", false)) { - enable = false; - } else { - enable = scheduler2.$keyboardNavigation.isChildOf(focusElement, scheduler2.$container) || scheduler2.$keyboardNavigation.isMinical(focusElement); - } - return enable; + var sm = scheduler2.config.start_on_monday; + var day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0); + const dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`); + if (dayCell) { + return dayCell.firstChild; + } else { + return null; } - function changeState(enable) { - if (enable && !dispatcher.isEnabled()) { - dispatcher.enable(); - } else if (!enable && dispatcher.isEnabled()) { - dispatcher.disable(); - } + }; + scheduler2.markCalendar = function(cal, date, css) { + var div = this._locateCalendar(cal, date); + if (!div) + return; + div.className += " " + css; + }; + scheduler2.unmarkCalendar = function(cal, date, css) { + date = date || cal._last_date; + css = css || "dhx_calendar_click"; + if (!date) + return; + var el2 = this._locateCalendar(cal, date); + if (!el2) + return; + el2.className = (el2.className || "").replace(RegExp(css, "g")); + }; + scheduler2._week_template = function(width) { + var summ = width || 250; + var left = 0; + var week_template = document.createElement("div"); + var dummy_date = this.date.week_start(scheduler2._currentDate()); + for (var i = 0; i < 7; i++) { + this._cols[i] = Math.floor(summ / (7 - i)); + this._render_x_header(i, left, dummy_date, week_template); + dummy_date = this.date.add(dummy_date, 1, "day"); + summ -= this._cols[i]; + left += this._cols[i]; } - const intervalId = setInterval(function() { - if (!scheduler2.$container || !scheduler2.$keyboardNavigation.isChildOf(scheduler2.$container, document.body)) { - return; - } - var enable = isSchedulerSelected(); - if (enable) { - changeState(enable); - } else if (!enable && dispatcher.isEnabled()) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return; - } - if (scheduler2.config.key_nav) { - changeState(isSchedulerSelected()); - } else { - scheduler2.$container.removeAttribute("tabindex"); - } - }, 100); - } - }, 500); - scheduler2.attachEvent("onDestroy", function() { - clearInterval(intervalId); - }); - })(); - } - function layer(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - this.layers.sort(function(a, b) { - return a.zIndex - b.zIndex; - }); - scheduler2._dp_init = function(dp) { - dp._methods = ["_set_event_text_style", "", "changeEventId", "deleteEvent"]; - this.attachEvent("onEventAdded", function(id2) { - if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) - dp.setUpdated(id2, true, "inserted"); - }); - this.attachEvent("onBeforeEventDelete", function(id2) { - if (this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) { - if (!this.validId(id2)) - return; - var z = dp.getState(id2); - if (z == "inserted" || this._new_event) { - dp.setUpdated(id2, false); - return true; - } - if (z == "deleted") - return false; - if (z == "true_deleted") - return true; - dp.setUpdated(id2, true, "deleted"); - return false; - } else - return true; - }); - this.attachEvent("onEventChanged", function(id2) { - if (!this._loading && this.validId(id2) && this.getEvent(id2) && this.getEvent(id2).layer == dp.layer) - dp.setUpdated(id2, true, "updated"); - }); - dp._getRowData = function(id2, pref) { - var ev = this.obj.getEvent(id2); - var data = {}; - for (var a in ev) { - if (a.indexOf("_") === 0) - continue; - if (ev[a] && ev[a].getUTCFullYear) - data[a] = this.obj._helpers.formatDate(ev[a]); - else - data[a] = ev[a]; + week_template.lastChild.className += " dhx_scale_bar_last"; + return week_template; + }; + scheduler2.updateCalendar = function(obj, sd) { + obj.conf.date = sd; + this.renderCalendar(obj.conf, obj, true); + }; + scheduler2._mini_cal_arrows = [" ", " "]; + scheduler2._render_calendar = function(obj, sd, conf, previous) { + var ts = scheduler2.templates; + var temp = this._cols; + this._cols = []; + var temp2 = this._mode; + this._mode = "calendar"; + var temp3 = this._colsS; + this._colsS = { height: 0 }; + var temp4 = new Date(this._min_date); + var temp5 = new Date(this._max_date); + var temp6 = new Date(scheduler2._date); + var temp7 = ts.month_day; + var temp8 = this._ignores_detected; + this._ignores_detected = 0; + ts.month_day = ts.calendar_date; + sd = this.date.month_start(sd); + var week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding); + var d; + if (previous) { + d = previous; + } else { + d = document.createElement("div"); + d.className = "dhx_cal_container dhx_mini_calendar"; + } + d.setAttribute("date", this._helpers.formatDate(sd)); + d.innerHTML = "
" : "'>") + "
" + (week_template ? week_template.innerHTML : "") + "
"; + var header = d.querySelector(".dhx_year_month"); + var weekHeader = d.querySelector(".dhx_year_week"); + var body = d.querySelector(".dhx_year_body"); + header.innerHTML = this.templates.calendar_month(sd); + if (conf.navigation) { + var move_minicalendar_date = function(calendar, diff) { + var date = scheduler2.date.add(calendar._date, diff, "month"); + scheduler2.updateCalendar(calendar, date); + if (scheduler2._date.getMonth() == calendar._date.getMonth() && scheduler2._date.getFullYear() == calendar._date.getFullYear()) { + scheduler2._markCalendarCurrentDate(calendar); } - return data; - }; - dp._clearUpdateFlag = function() { }; - dp.attachEvent("insertCallback", scheduler2._update_callback); - dp.attachEvent("updateCallback", scheduler2._update_callback); - dp.attachEvent("deleteCallback", function(upd, id2) { - this.obj.setUserData(id2, this.action_param, "true_deleted"); - this.obj.deleteEvent(id2); - }); - }; - (function() { - var _cloneObj = function(obj) { - if (obj === null || typeof obj != "object") - return obj; - var temp = new obj.constructor(); - for (var key in obj) - temp[key] = _cloneObj(obj[key]); - return temp; + var css_classnames = ["dhx_cal_prev_button", "dhx_cal_next_button"]; + var css_texts = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"]; + var diffs = [-1, 1]; + var handler = function(diff) { + return function() { + if (conf.sync) { + var calendars = scheduler2._synced_minicalendars; + for (var k = 0; k < calendars.length; k++) { + move_minicalendar_date(calendars[k], diff); + } + } else { + if (scheduler2.config.rtl) { + diff = -diff; + } + move_minicalendar_date(d, diff); + } + }; }; - scheduler2._dataprocessors = []; - scheduler2._layers_zindex = {}; - for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { - scheduler2.config["lightbox_" + scheduler2.layers[i2].name] = {}; - scheduler2.config["lightbox_" + scheduler2.layers[i2].name].sections = _cloneObj(scheduler2.config.lightbox.sections); - scheduler2._layers_zindex[scheduler2.layers[i2].name] = scheduler2.config.initial_layer_zindex || 5 + i2 * 3; - if (scheduler2.layers[i2].url) { - var dp = scheduler2.createDataProcessor({ url: scheduler2.layers[i2].url }); - dp.layer = scheduler2.layers[i2].name; - scheduler2._dataprocessors.push(dp); - scheduler2._dataprocessors[i2].init(scheduler2); - } - if (scheduler2.layers[i2].isDefault) - scheduler2.defaultLayer = scheduler2.layers[i2].name; - } - })(); - scheduler2.showLayer = function(tlayer) { - this.toggleLayer(tlayer, true); - }; - scheduler2.hideLayer = function(tlayer) { - this.toggleLayer(tlayer, false); - }; - scheduler2.toggleLayer = function(tlayer, visible) { - var layer2 = this.getLayer(tlayer); - if (typeof visible != "undefined") - layer2.visible = !!visible; - else - layer2.visible = !layer2.visible; - this.setCurrentView(this._date, this._mode); - }; - scheduler2.getLayer = function(tlayer) { - var layer2, layer_name; - if (typeof tlayer == "string") - layer_name = tlayer; - if (typeof tlayer == "object") - layer_name = tlayer.layer; - for (var i2 = 0; i2 < scheduler2.layers.length; i2++) { - if (scheduler2.layers[i2].name == layer_name) - layer2 = scheduler2.layers[i2]; - } - return layer2; - }; - scheduler2.attachEvent("onBeforeLightbox", function(event_id) { - var ev = this.getEvent(event_id); - this.config.lightbox.sections = this.config["lightbox_" + ev.layer].sections; - scheduler2.resetLightbox(); - return true; - }); - scheduler2.attachEvent("onClick", function(event_id, native_event_object) { - var ev = scheduler2.getEvent(event_id); - return !scheduler2.getLayer(ev.layer).noMenu; - }); - scheduler2.attachEvent("onEventCollision", function(ev, evs) { - var layer2 = this.getLayer(ev); - if (!layer2.checkCollision) - return false; - var count = 0; - for (var i2 = 0; i2 < evs.length; i2++) { - if (evs[i2].layer == layer2.name && evs[i2].id != ev.id) - count++; - } - return count >= scheduler2.config.collision_limit; - }); - scheduler2.addEvent = function(start_date, end_date, text, id2, extra_data) { - var ev = start_date; - if (arguments.length != 1) { - ev = extra_data || {}; - ev.start_date = start_date; - ev.end_date = end_date; - ev.text = text; - ev.id = id2; - ev.layer = this.defaultLayer; + var labels = [scheduler2.locale.labels.prev, scheduler2.locale.labels.next]; + for (var j = 0; j < 2; j++) { + var arrow = document.createElement("div"); + arrow.className = css_classnames[j]; + scheduler2._waiAria.headerButtonsAttributes(arrow, labels[j]); + arrow.style.cssText = css_texts[j]; + arrow.innerHTML = this._mini_cal_arrows[j]; + header.appendChild(arrow); + minicalDomEvents.attach(arrow, "click", handler(diffs[j])); } - ev.id = ev.id || scheduler2.uid(); - ev.text = ev.text || ""; - if (typeof ev.start_date == "string") - ev.start_date = this.templates.api_date(ev.start_date); - if (typeof ev.end_date == "string") - ev.end_date = this.templates.api_date(ev.end_date); - ev._timed = this.isOneDayEvent(ev); - var is_new = !this._events[ev.id]; - this._events[ev.id] = ev; - this.event_updated(ev); - if (!this._loading) - this.callEvent(is_new ? "onEventAdded" : "onEventChanged", [ev.id, ev]); - }; - this._evs_layer = {}; - for (var i = 0; i < this.layers.length; i++) { - this._evs_layer[this.layers[i].name] = []; } - scheduler2.addEventNow = function(start, end, e) { - var base = {}; - if (typeof start == "object") { - base = start; - start = null; - } - var d = (this.config.event_duration || this.config.time_step) * 6e4; - if (!start) - start = Math.round(scheduler2._currentDate().valueOf() / d) * d; - var start_date = new Date(start); - if (!end) { - var start_hour = this.config.first_hour; - if (start_hour > start_date.getHours()) { - start_date.setHours(start_hour); - start = start_date.valueOf(); - } - end = start + d; - } - base.start_date = base.start_date || start_date; - base.end_date = base.end_date || new Date(end); - base.text = base.text || this.locale.labels.new_event; - base.id = this._drag_id = this.uid(); - base.layer = this.defaultLayer; - this._drag_mode = "new-size"; - this._loading = true; - this.addEvent(base); - this.callEvent("onEventCreated", [this._drag_id, e]); - this._loading = false; - this._drag_event = {}; - this._on_mouse_up(e); - }; - scheduler2._t_render_view_data = function(events) { - if (this.config.multi_day && !this._table_view) { - var tvs = []; - var tvd = []; - for (var k = 0; k < events.length; k++) { - if (events[k]._timed) - tvs.push(events[k]); - else - tvd.push(events[k]); - } - this._table_view = true; - this.render_data(tvd); - this._table_view = false; - this.render_data(tvs); - } else - this.render_data(events); + d._date = new Date(sd); + d.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7; + var dd = d._min_date = this.date.week_start(sd); + d._max_date = this.date.add(d._min_date, 6, "week"); + this._reset_month_scale(body, sd, dd, 6); + if (!previous) + obj.appendChild(d); + weekHeader.style.height = weekHeader.childNodes[0].offsetHeight - 1 + "px"; + var headerId = scheduler2.uid(); + scheduler2._waiAria.minicalHeader(header, headerId); + scheduler2._waiAria.minicalGrid(d.querySelector(".dhx_year_grid"), headerId); + scheduler2._waiAria.minicalRow(weekHeader); + var dayHeaders = weekHeader.querySelectorAll(".dhx_scale_bar"); + for (var i = 0; i < dayHeaders.length; i++) { + scheduler2._waiAria.minicalHeadCell(dayHeaders[i]); + } + var dayCells = body.querySelectorAll(".dhx_cal_month_cell"); + var firstDate = new Date(dd); + for (var i = 0; i < dayCells.length; i++) { + scheduler2._waiAria.minicalDayCell(dayCells[i], new Date(firstDate)); + firstDate = scheduler2.date.add(firstDate, 1, "day"); + } + scheduler2._waiAria.minicalHeader(header, headerId); + this._cols = temp; + this._mode = temp2; + this._colsS = temp3; + this._min_date = temp4; + this._max_date = temp5; + scheduler2._date = temp6; + ts.month_day = temp7; + this._ignores_detected = temp8; + return d; + }; + scheduler2.destroyCalendar = function(cal, force) { + if (!cal && this._def_count && this._def_count.firstChild) { + if (force || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) + cal = this._def_count.firstChild; + } + if (!cal) + return; + minicalDomEvents.detachAll(); + cal.innerHTML = ""; + if (cal.parentNode) + cal.parentNode.removeChild(cal); + if (this._def_count) + this._def_count.style.top = "-1000px"; + if (cal.conf && cal.conf._on_xle_handler) + scheduler2.detachEvent(cal.conf._on_xle_handler); + }; + scheduler2.isCalendarVisible = function() { + if (this._def_count && parseInt(this._def_count.style.top, 10) > 0) + return this._def_count; + return false; + }; + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.event(document.body, "click", function() { + scheduler2.destroyCalendar(); + }); + }, { once: true }); + scheduler2.form_blocks.calendar_time = { render: function(sns) { + var html = ""; + var cfg = scheduler2.config; + var dt = this.date.date_part(scheduler2._currentDate()); + var last = 24 * 60, first = 0; + if (cfg.limit_time_select) { + first = 60 * cfg.first_hour; + last = 60 * cfg.last_hour + 1; + } + dt.setHours(first / 60); + sns._time_values = []; + html += " "; + return "
" + html + "  –  " + html + "
"; + }, set_value: function(node, value, ev, config) { + var inputs = node.getElementsByTagName("input"); + var selects = node.getElementsByTagName("select"); + var start_date, end_date; + var _init_once = function(inp, date, number) { + scheduler2.event(inp, "click", function() { + scheduler2.destroyCalendar(null, true); + scheduler2.renderCalendar({ position: inp, date: new Date(this._date), navigation: true, handler: function(new_date) { + inp.value = scheduler2.templates.calendar_time(new_date); + inp._date = new Date(new_date); + scheduler2.destroyCalendar(); + if (scheduler2.config.event_duration && scheduler2.config.auto_end_date && number === 0) { + _update_minical_select(); + } + } }); + }); }; - scheduler2.render_view_data = function() { - if (this._not_render) { - this._render_wait = true; - return; - } - this._render_wait = false; - this.clear_view(); - this._evs_layer = {}; - for (var i2 = 0; i2 < this.layers.length; i2++) { - this._evs_layer[this.layers[i2].name] = []; - } - var evs = this.get_visible_events(); - for (var i2 = 0; i2 < evs.length; i2++) { - if (this._evs_layer[evs[i2].layer]) - this._evs_layer[evs[i2].layer].push(evs[i2]); + if (scheduler2.config.full_day) { + if (!node._full_day) { + var html = ""; + if (!scheduler2.config.wide_form) + html = node.previousSibling.innerHTML + html; + node.previousSibling.innerHTML = html; + node._full_day = true; } - if (this._mode == "month") { - var tevs = []; - for (var i2 = 0; i2 < this.layers.length; i2++) { - if (this.layers[i2].visible) - tevs = tevs.concat(this._evs_layer[this.layers[i2].name]); - } - this._t_render_view_data(tevs); - } else { - for (var i2 = 0; i2 < this.layers.length; i2++) { - if (this.layers[i2].visible) { - var evs_layer = this._evs_layer[this.layers[i2].name]; - this._t_render_view_data(evs_layer); + var input = node.previousSibling.getElementsByTagName("input")[0]; + var isFulldayEvent = scheduler2.date.time_part(ev.start_date) === 0 && scheduler2.date.time_part(ev.end_date) === 0; + input.checked = isFulldayEvent; + selects[0].disabled = input.checked; + selects[1].disabled = input.checked; + if (!input.$_eventAttached) { + input.$_eventAttached = true; + scheduler2.event(input, "click", function() { + if (input.checked === true) { + var obj = {}; + scheduler2.form_blocks.calendar_time.get_value(node, obj); + start_date = scheduler2.date.date_part(obj.start_date); + end_date = scheduler2.date.date_part(obj.end_date); + if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) + end_date = scheduler2.date.add(end_date, 1, "day"); } + var start = start_date || ev.start_date; + var end = end_date || ev.end_date; + _attach_action(inputs[0], start); + _attach_action(inputs[1], end); + selects[0].value = start.getHours() * 60 + start.getMinutes(); + selects[1].value = end.getHours() * 60 + end.getMinutes(); + selects[0].disabled = input.checked; + selects[1].disabled = input.checked; + }); + } + } + if (scheduler2.config.event_duration && scheduler2.config.auto_end_date) { + var _update_minical_select = function() { + if (!(scheduler2.config.auto_end_date && scheduler2.config.event_duration)) { + return; } + start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); + end_date = new Date(start_date.getTime() + scheduler2.config.event_duration * 60 * 1e3); + inputs[1].value = scheduler2.templates.calendar_time(end_date); + inputs[1]._date = scheduler2.date.date_part(new Date(end_date)); + selects[1].value = end_date.getHours() * 60 + end_date.getMinutes(); + }; + if (!selects[0].$_eventAttached) { + selects[0].addEventListener("change", _update_minical_select); } + } + function _attach_action(inp, date, number) { + _init_once(inp, date, number); + inp.value = scheduler2.templates.calendar_time(date); + inp._date = scheduler2.date.date_part(new Date(date)); + } + _attach_action(inputs[0], ev.start_date, 0); + _attach_action(inputs[1], ev.end_date, 1); + _init_once = function() { }; - scheduler2._render_v_bar = function(ev, x, y, w, h, style, contentA, contentB, bottom) { - var id2 = ev.id; - if (contentA.indexOf("
'; - html += '
 
'; - html += '
' + contentA + "
"; - html += '
' + contentB + "
"; - html += '
'; - d.innerHTML = html; - d.style.zIndex = 100; - return d.firstChild; - }; - scheduler2.render_event_bar = function(ev) { - var parent = this._els["dhx_cal_data"][0]; - var x = this._colsS[ev._sday]; - var x2 = this._colsS[ev._eday]; - if (x2 == x) - x2 = this._colsS[ev._eday + 1]; - var hb = this.xy.bar_height; - var y = this._colsS.heights[ev._sweek] + (this._colsS.height ? this.xy.month_scale_height + 2 : 2) + ev._sorder * hb; - var d = document.createElement("div"); - var cs2 = ev._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line"; - var cse = scheduler2.templates["event_class_" + ev.layer] ? scheduler2.templates["event_class_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_class(ev.start_date, ev.end_date, ev); - if (cse) - cs2 = cs2 + " " + cse; - var html = '
'; - if (ev._timed) - html += scheduler2.templates["event_bar_date_" + ev.layer] ? scheduler2.templates["event_bar_date_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_date(ev.start_date, ev.end_date, ev); - html += scheduler2.templates["event_bar_text_" + ev.layer] ? scheduler2.templates["event_bar_text_" + ev.layer](ev.start_date, ev.end_date, ev) : scheduler2.templates.event_bar_text(ev.start_date, ev.end_date, ev) + "
)"; - html += ""; - d.innerHTML = html; - this._rendered.push(d.firstChild); - parent.appendChild(d.firstChild); - }; - scheduler2.render_event = function(ev) { - var menu = scheduler2.xy.menu_width; - if (scheduler2.getLayer(ev.layer).noMenu) - menu = 0; - if (ev._sday < 0) - return; - var parent = scheduler2.locate_holder(ev._sday); - if (!parent) - return; - var sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes(); - var em = ev.end_date.getHours() * 60 + ev.end_date.getMinutes() || scheduler2.config.last_hour * 60; - var top = Math.round((sm * 60 * 1e3 - this.config.first_hour * 60 * 60 * 1e3) * this.config.hour_size_px / (60 * 60 * 1e3)) % (this.config.hour_size_px * 24) + 1; - var height = Math.max(scheduler2.xy.min_event_height, (em - sm) * this.config.hour_size_px / 60) + 1; - var width = Math.floor((parent.clientWidth - menu) / ev._count); - var left = ev._sorder * width + 1; - if (!ev._inner) - width = width * (ev._count - ev._sorder); - var d = this._render_v_bar(ev.id, menu + left, top, width, height, ev._text_style, scheduler2.templates.event_header(ev.start_date, ev.end_date, ev), scheduler2.templates.event_text(ev.start_date, ev.end_date, ev)); - this._rendered.push(d); - parent.appendChild(d); - left = left + parseInt(parent.style.left, 10) + menu; - top += this._dy_shift; - d.style.zIndex = this._layers_zindex[ev.layer]; - if (this._edit_id == ev.id) { - d.style.zIndex = parseInt(d.style.zIndex) + 1; - var new_zIndex = d.style.zIndex; - width = Math.max(width - 4, scheduler2.xy.editor_width); - var d = document.createElement("div"); - d.setAttribute("event_id", ev.id); - d.setAttribute(this.config.event_attribute, ev.id); - this.set_xy(d, width, height - 20, left, top + 14); - d.className = "dhx_cal_editor"; - d.style.zIndex = new_zIndex; - var d2 = document.createElement("div"); - this.set_xy(d2, width - 6, height - 26); - d2.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;"; - d2.style.zIndex = new_zIndex; - d.appendChild(d2); - this._els["dhx_cal_data"][0].appendChild(d); - this._rendered.push(d); - d2.innerHTML = ""; - this._editor = d2.firstChild; - this._editor.addEventListener("keypress", function(e) { - if (e.shiftKey) - return true; - var code = e.keyCode; - if (code == scheduler2.keys.edit_save) - scheduler2.editStop(true); - if (code == scheduler2.keys.edit_cancel) - scheduler2.editStop(false); - }); - this._editor.addEventListener("selectstart", function(e) { - e.cancelBubble = true; - return true; - }); - d2.firstChild.focus(); - this._els["dhx_cal_data"][0].scrollLeft = 0; - d2.firstChild.select(); + function _round_minutes(date) { + var time_values = config._time_values; + var direct_value = date.getHours() * 60 + date.getMinutes(); + var fixed_value = direct_value; + var value_found = false; + for (var k = 0; k < time_values.length; k++) { + var t_v = time_values[k]; + if (t_v === direct_value) { + value_found = true; + break; + } + if (t_v < direct_value) + fixed_value = t_v; } - if (this._select_id == ev.id) { - d.style.zIndex = parseInt(d.style.zIndex) + 1; - var icons = this.config["icons_" + (this._edit_id == ev.id ? "edit" : "select")]; - var icons_str = ""; - for (var i2 = 0; i2 < icons.length; i2++) - icons_str += "
"; - var obj = this._render_v_bar(ev.id, left - menu + 1, top, menu, icons.length * 20 + 26, "", "
", icons_str, true); - obj.style.left = left - menu + 1; - obj.style.zIndex = d.style.zIndex; - this._els["dhx_cal_data"][0].appendChild(obj); - this._rendered.push(obj); + if (!(value_found || fixed_value)) + return -1; + return value_found ? direct_value : fixed_value; + } + selects[0].value = _round_minutes(ev.start_date); + selects[1].value = _round_minutes(ev.end_date); + }, get_value: function(node, ev) { + var inputs = node.getElementsByTagName("input"); + var selects = node.getElementsByTagName("select"); + ev.start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); + ev.end_date = scheduler2.date.add(inputs[1]._date, selects[1].value, "minute"); + if (ev.end_date <= ev.start_date) + ev.end_date = scheduler2.date.add(ev.start_date, scheduler2.config.time_step, "minute"); + return { start_date: new Date(ev.start_date), end_date: new Date(ev.end_date) }; + }, focus: function(node) { + } }; + scheduler2.linkCalendar = function(calendar, datediff) { + var action = function() { + var date = scheduler2._date; + var dateNew = new Date(date.valueOf()); + if (datediff) + dateNew = datediff(dateNew); + dateNew.setDate(1); + scheduler2.updateCalendar(calendar, dateNew); + return true; + }; + scheduler2.attachEvent("onViewChange", action); + scheduler2.attachEvent("onXLE", action); + scheduler2.attachEvent("onEventAdded", action); + scheduler2.attachEvent("onEventChanged", action); + scheduler2.attachEvent("onEventDeleted", action); + action(); + }; + scheduler2._markCalendarCurrentDate = function(calendar) { + var state = scheduler2.getState(); + var from = state.min_date; + var to = state.max_date; + var mode = state.mode; + var month_start = scheduler2.date.month_start(new Date(calendar._date)); + var month_end = scheduler2.date.add(month_start, 1, "month"); + var noHighlight = { month: true, year: true, agenda: true, grid: true }; + if (noHighlight[mode] || from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf()) { + return; + } + var current = from; + while (current.valueOf() < to.valueOf()) { + if (month_start.valueOf() <= current.valueOf() && month_end > current) { + scheduler2.markCalendar(calendar, current, "dhx_calendar_click"); } + current = scheduler2.date.add(current, 1, "day"); + } + }; + scheduler2.attachEvent("onEventCancel", function() { + scheduler2.destroyCalendar(null, true); + }); + scheduler2.attachEvent("onDestroy", function() { + scheduler2.destroyCalendar(); + }); + } + function monthheight(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.xy.scroll_width = 0; + var old = scheduler2.render_view_data; + scheduler2.render_view_data = function() { + var data = this._els["dhx_cal_data"][0]; + data.firstChild._h_fix = true; + old.apply(scheduler2, arguments); + var height = parseInt(data.style.height); + data.style.height = "1px"; + data.style.height = data.scrollHeight + "px"; + this._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + "px"; }; - scheduler2.filter_agenda = function(id2, event2) { - var layer2 = scheduler2.getLayer(event2.layer); - return layer2 && layer2.visible; + var old_s = scheduler2._reset_month_scale; + scheduler2._reset_month_scale = function(a, b, c, d) { + var dummy = { clientHeight: 100 }; + old_s.apply(scheduler2, [dummy, b, c, d]); + a.innerHTML = dummy.innerHTML; }; }); } - function limit(scheduler2) { - scheduler2.config.limit_start = null; - scheduler2.config.limit_end = null; - scheduler2.config.limit_view = false; - scheduler2.config.check_limits = true; - scheduler2.config.mark_now = true; - scheduler2.config.display_marked_timespans = true; - scheduler2.config.overwrite_marked_timespans = true; - scheduler2._temp_limit_scope = function() { - var before = null; - var dhx_time_block = "dhx_time_block"; - var default_timespan_type = "default"; - var fix_options = function(options, days, zones) { - if (days instanceof Date && zones instanceof Date) { - options.start_date = days; - options.end_date = zones; - } else { - options.days = days; - options.zones = zones; + function multisection_restricted(scheduler2) { + notImplemented.alert("Multisection", scheduler2.assert); + } + function multiselect(scheduler2) { + function parseXMLOptions(loader, config) { + var items = scheduler2.ajax.xpath("//data/item", loader.xmlDoc); + var ids = {}; + for (var i = 0; i < items.length; i++) { + ids[items[i].getAttribute(config.map_to)] = true; + } + return ids; + } + function parseJSONOptions(loader, config) { + try { + var items = JSON.parse(loader.xmlDoc.responseText); + var ids = {}; + for (var i = 0; i < items.length; i++) { + var option = items[i]; + ids[option.value || option.key || option.id] = true; } - return options; - }; - var get_resulting_options = function(days, zones, sections) { - var options = typeof days == "object" ? days : { days }; - options.type = dhx_time_block; - options.css = ""; - if (zones) { - if (sections) - options.sections = sections; - options = fix_options(options, days, zones); + return ids; + } catch (e) { + return null; + } + } + scheduler2.form_blocks["multiselect"] = { render: function(sns) { + var css = "dhx_multi_select_control dhx_multi_select_" + sns.name; + if (!!sns.vertical) { + css += " dhx_multi_select_control_vertical"; + } + var _result = "
"; + for (var i = 0; i < sns.options.length; i++) { + _result += ""; + } + _result += "
"; + return _result; + }, set_value: function(node, value, ev, config) { + var _children = node.getElementsByTagName("input"); + for (var i = 0; i < _children.length; i++) { + _children[i].checked = false; + } + function _mark_inputs(ids) { + var _children2 = node.getElementsByTagName("input"); + for (var i2 = 0; i2 < _children2.length; i2++) { + _children2[i2].checked = !!ids[_children2[i2].value]; } - return options; - }; - scheduler2.blockTime = function(days, zones, sections) { - var options = get_resulting_options(days, zones, sections); - return scheduler2.addMarkedTimespan(options); - }; - scheduler2.unblockTime = function(days, zones, sections) { - zones = zones || "fullday"; - var options = get_resulting_options(days, zones, sections); - return scheduler2.deleteMarkedTimespan(options); - }; - scheduler2.attachEvent("onBeforeViewChange", function(om, od, nm, nd) { - function isBlocked(date, mode) { - var limit_start = scheduler2.config.limit_start, limit_end = scheduler2.config.limit_end, date_end = scheduler2.date.add(date, 1, mode); - return date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf(); + } + var _ids = {}; + if (ev[config.map_to]) { + var results = (ev[config.map_to] + "").split(config.delimiter || scheduler2.config.section_delimiter || ","); + for (var i = 0; i < results.length; i++) { + _ids[results[i]] = true; } - if (scheduler2.config.limit_view) { - nd = nd || od; - nm = nm || om; - if (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - var resetDate = !isBlocked(od, nm) ? od : scheduler2.config.limit_start; - scheduler2.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm); - }, 1); - return false; + _mark_inputs(_ids); + } else { + if (scheduler2._new_event || !config.script_url) + return; + var divLoading = document.createElement("div"); + divLoading.className = "dhx_loading"; + divLoading.style.cssText = "position: absolute; top: 40%; left: 40%;"; + node.appendChild(divLoading); + var url2 = [config.script_url, config.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + config.map_to + "=" + ev.id + "&uid=" + scheduler2.uid()].join(""); + scheduler2.ajax.get(url2, function(loader) { + var options = parseJSONOptions(loader); + if (!options) { + options = parseXMLOptions(loader, config); } + _mark_inputs(options); + node.removeChild(divLoading); + }); + } + }, get_value: function(node, ev, config) { + var _result = []; + var _children = node.getElementsByTagName("input"); + for (var i = 0; i < _children.length; i++) { + if (_children[i].checked) + _result.push(_children[i].value); + } + return _result.join(config.delimiter || scheduler2.config.section_delimiter || ","); + }, focus: function(node) { + } }; + } + function multisource(scheduler2) { + function backup(obj) { + var t = function() { + }; + t.prototype = obj; + return t; + } + var old = scheduler2._load; + scheduler2._load = function(url2, from) { + url2 = url2 || this._load_url; + if (typeof url2 == "object") { + var t = backup(this._loaded); + for (var i = 0; i < url2.length; i++) { + this._loaded = new t(); + old.call(this, url2[i], from); } - return true; + } else + old.apply(this, arguments); + }; + } + function mvc(scheduler2) { + var cfg = { use_id: false }; + function sanitize(ev) { + var obj = {}; + for (var key in ev) + if (key.indexOf("_") !== 0) + obj[key] = ev[key]; + if (!cfg.use_id) + delete obj.id; + return obj; + } + var update_timer; + function update_view() { + clearTimeout(update_timer); + update_timer = setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + scheduler2.updateView(); + }, 1); + } + function _start_ext_load(cal) { + cal._loading = true; + cal._not_render = true; + cal.callEvent("onXLS", []); + } + function _finish_ext_load(cal) { + cal._not_render = false; + if (cal._render_wait) + cal.render_view_data(); + cal._loading = false; + cal.callEvent("onXLE", []); + } + function _get_id(model) { + return cfg.use_id ? model.id : model.cid; + } + scheduler2.backbone = function(events, config) { + if (config) + cfg = config; + events.bind("change", function(model, info) { + var cid = _get_id(model); + var ev = scheduler2._events[cid] = model.toJSON(); + ev.id = cid; + scheduler2._init_event(ev); + update_view(); + }); + events.bind("remove", function(model, changes) { + var cid = _get_id(model); + if (scheduler2._events[cid]) + scheduler2.deleteEvent(cid); }); - scheduler2.checkInMarkedTimespan = function(ev, timespan_type, on_overlap) { - timespan_type = timespan_type || default_timespan_type; - var res = true; - var temp_start_date = new Date(ev.start_date.valueOf()); - var temp_end_date = scheduler2.date.add(temp_start_date, 1, "day"); - var timespans = scheduler2._marked_timespans; - for (; temp_start_date < ev.end_date; temp_start_date = scheduler2.date.date_part(temp_end_date), temp_end_date = scheduler2.date.add(temp_start_date, 1, "day")) { - var day_value = +scheduler2.date.date_part(new Date(temp_start_date)); - var day_index = temp_start_date.getDay(); - var zones = getZones(ev, timespans, day_index, day_value, timespan_type); - if (zones) { - for (var i = 0; i < zones.length; i += 2) { - var eventStart = scheduler2._get_zone_minutes(temp_start_date); - var eventEnd = ev.end_date > temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ? 1440 : scheduler2._get_zone_minutes(ev.end_date); - var markerStart = zones[i]; - var markerEnd = zones[i + 1]; - if (markerStart < eventEnd && markerEnd > eventStart) { - if (typeof on_overlap == "function") { - res = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd); - } else { - res = false; - } - if (!res) - break; - } - } - } - } - return !res; - }; - var blocker = scheduler2.checkLimitViolation = function(event2) { - if (!event2) - return true; - if (!scheduler2.config.check_limits) + var queue = []; + function add_from_queue() { + if (scheduler2.$destroyed) { return true; - var s = scheduler2; - var c = s.config; - var evs = []; - if (event2.rec_type) { - var dates = scheduler2.getRecDates(event2); - for (var i = 0; i < dates.length; i++) { - var ev = scheduler2._copy_event(event2); - scheduler2._lame_copy(ev, dates[i]); - evs.push(ev); - } - } else { - evs = [event2]; - } - var complete_res = true; - for (var p = 0; p < evs.length; p++) { - var res = true; - var ev = evs[p]; - ev._timed = scheduler2.isOneDayEvent(ev); - res = c.limit_start && c.limit_end ? ev.start_date.valueOf() >= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf() : true; - if (res) { - res = !scheduler2.checkInMarkedTimespan(ev, dhx_time_block, function(event3, eventStart, eventEnd, markerStart, markerEnd) { - var allow = true; - if (eventStart <= markerEnd && eventStart >= markerStart) { - if (markerEnd == 24 * 60 || eventEnd <= markerEnd) { - allow = false; - } - if (event3._timed && s._drag_id && s._drag_mode == "new-size") { - event3.start_date.setHours(0); - event3.start_date.setMinutes(markerEnd); - } else { - allow = false; - } - } - if (eventEnd >= markerStart && eventEnd <= markerEnd || eventStart < markerStart && eventEnd > markerEnd) { - if (event3._timed && s._drag_id && s._drag_mode == "new-size") { - event3.end_date.setHours(0); - event3.end_date.setMinutes(markerStart); - } else { - allow = false; - } - } - return allow; - }); - } - if (!res) { - res = s.checkEvent("onLimitViolation") ? s.callEvent("onLimitViolation", [ev.id, ev]) : res; - } - complete_res = complete_res && res; - } - if (!complete_res) { - s._drag_id = null; - s._drag_mode = null; - } - return complete_res; - }; - scheduler2._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type) { - var zones = []; - if (timespans && timespans[property]) { - var timeline_zones = timespans[property]; - var blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type); - for (var i = 0; i < blocked_timeline_zones.length; i++) { - zones = this._add_timespan_zones(zones, blocked_timeline_zones[i].zones); - } } - return zones; - }; - scheduler2._get_relevant_blocked_zones = function(day_index, day_value, zones, timespan_type) { - var resultZones; - if (scheduler2.config.overwrite_marked_timespans) { - resultZones = zones[day_value] && zones[day_value][timespan_type] ? zones[day_value][timespan_type] : zones[day_index] && zones[day_index][timespan_type] ? zones[day_index][timespan_type] : []; - } else { - resultZones = []; - if (zones[day_value] && zones[day_value][timespan_type]) { - resultZones = resultZones.concat(zones[day_value][timespan_type]); - } - if (zones[day_index] && zones[day_index][timespan_type]) { - resultZones = resultZones.concat(zones[day_index][timespan_type]); - } + if (queue.length) { + scheduler2.parse(queue, "json"); + queue = []; } - return resultZones; - }; - function getZones(ev, timespans, day_index, day_value, timespan_type) { - var s = scheduler2; - var zones = []; - var containers = { _props: "map_to", matrix: "y_property" }; - for (var container in containers) { - var property = containers[container]; - if (s[container]) { - for (var view in s[container]) { - var view_config = s[container][view]; - var linker = view_config[property]; - if (!ev[linker]) - continue; - zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans[view], ev[linker], day_index, day_value, timespan_type)); - } - } - } - zones = s._add_timespan_zones(zones, scheduler2._get_blocked_zones(timespans, "global", day_index, day_value, timespan_type)); - return zones; } - scheduler2.attachEvent("onMouseDown", function(classname) { - return !(classname == dhx_time_block); + events.bind("add", function(model, changes) { + var cid = _get_id(model); + if (!scheduler2._events[cid]) { + var ev = model.toJSON(); + ev.id = cid; + scheduler2._init_event(ev); + queue.push(ev); + if (queue.length == 1) + setTimeout(add_from_queue, 1); + } }); - scheduler2.attachEvent("onBeforeDrag", function(id2) { - if (!id2) - return true; - return blocker(scheduler2.getEvent(id2)); + events.bind("request", function(obj) { + if (obj instanceof Backbone.Collection) + _start_ext_load(scheduler2); }); - scheduler2.attachEvent("onClick", function(event_id, native_event_object) { - return blocker(scheduler2.getEvent(event_id)); + events.bind("sync", function(obj) { + if (obj instanceof Backbone.Collection) + _finish_ext_load(scheduler2); }); - scheduler2.attachEvent("onBeforeLightbox", function(id2) { - var ev = scheduler2.getEvent(id2); - before = [ev.start_date, ev.end_date]; - return blocker(ev); + events.bind("error", function(obj) { + if (obj instanceof Backbone.Collection) + _finish_ext_load(scheduler2); }); - scheduler2.attachEvent("onEventSave", function(id2, data, is_new_event) { - if (!(data.start_date && data.end_date)) { - var ev = scheduler2.getEvent(id2); - data.start_date = new Date(ev.start_date); - data.end_date = new Date(ev.end_date); - } - if (data.rec_type) { - var data_copy = scheduler2._lame_clone(data); - scheduler2._roll_back_dates(data_copy); - return blocker(data_copy); - } - return blocker(data); + scheduler2.attachEvent("onEventCreated", function(id2) { + var ev = new events.model(scheduler2.getEvent(id2)); + scheduler2._events[id2] = ev.toJSON(); + scheduler2._events[id2].id = id2; + return true; }); scheduler2.attachEvent("onEventAdded", function(id2) { - if (!id2) - return true; - var ev = scheduler2.getEvent(id2); - if (!blocker(ev) && scheduler2.config.limit_start && scheduler2.config.limit_end) { - if (ev.start_date < scheduler2.config.limit_start) { - ev.start_date = new Date(scheduler2.config.limit_start); - } - if (ev.start_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { - ev.start_date = this.date.add(scheduler2.config.limit_end, -1, "day"); - } - if (ev.end_date < scheduler2.config.limit_start) { - ev.end_date = new Date(scheduler2.config.limit_start); - } - if (ev.end_date.valueOf() >= scheduler2.config.limit_end.valueOf()) { - ev.end_date = this.date.add(scheduler2.config.limit_end, -1, "day"); - } - if (ev.start_date.valueOf() >= ev.end_date.valueOf()) { - ev.end_date = this.date.add(ev.start_date, this.config.event_duration || this.config.time_step, "minute"); - } - ev._timed = this.isOneDayEvent(ev); + if (!events.get(id2)) { + var data = sanitize(scheduler2.getEvent(id2)); + var model = new events.model(data); + var cid = _get_id(model); + if (cid != id2) + this.changeEventId(id2, cid); + events.add(model); + events.trigger("scheduler:add", model); } return true; }); scheduler2.attachEvent("onEventChanged", function(id2) { - if (!id2) - return true; - var ev = scheduler2.getEvent(id2); - if (!blocker(ev)) { - if (!before) - return false; - ev.start_date = before[0]; - ev.end_date = before[1]; - ev._timed = this.isOneDayEvent(ev); - } + var ev = events.get(id2); + var upd = sanitize(scheduler2.getEvent(id2)); + ev.set(upd); + events.trigger("scheduler:change", ev); return true; }); - scheduler2.attachEvent("onBeforeEventChanged", function(ev, native_object, is_new) { - return blocker(ev); - }); - scheduler2.attachEvent("onBeforeEventCreated", function(ev) { - var start_date = scheduler2.getActionData(ev).date; - var event2 = { _timed: true, start_date, end_date: scheduler2.date.add(start_date, scheduler2.config.time_step, "minute") }; - return blocker(event2); - }); - scheduler2.attachEvent("onViewChange", function() { - scheduler2._mark_now(); - }); - scheduler2.attachEvent("onAfterSchedulerResize", function() { - window.setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - scheduler2._mark_now(); - }, 1); + scheduler2.attachEvent("onEventDeleted", function(id2) { + var model = events.get(id2); + if (model) { + events.trigger("scheduler:remove", model); + events.remove(id2); + } return true; }); - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2._mark_now_timer = window.setInterval(function() { - if (!scheduler2._is_initialized()) - return; - scheduler2._mark_now(); - }, 6e4); - }); - scheduler2.attachEvent("onDestroy", function() { - clearInterval(scheduler2._mark_now_timer); - }); - scheduler2._mark_now = function(hide) { - var dhx_now_time = "dhx_now_time"; - if (!this._els[dhx_now_time]) { - this._els[dhx_now_time] = []; - } - var now = scheduler2._currentDate(); - var cfg = this.config; - scheduler2._remove_mark_now(); - if (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() < cfg.last_hour) { - var day_index = this.locate_holder_day(now); - this._els[dhx_now_time] = scheduler2._append_mark_now(day_index, now); + }; + } + function outerdrag(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + var dragger = new dhtmlDragAndDropObject(); + var old = dragger.stopDrag; + var last_event; + dragger.stopDrag = function(e) { + last_event = e; + return old.apply(this, arguments); + }; + function on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { + if (scheduler2.checkEvent("onBeforeExternalDragIn") && !scheduler2.callEvent("onBeforeExternalDragIn", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event])) + return; + var temp = scheduler2.attachEvent("onEventCreated", function(id2) { + if (!scheduler2.callEvent("onExternalDragIn", [id2, sourceHtmlObject, last_event])) { + this._drag_mode = this._drag_id = null; + this.deleteEvent(id2); + } + }); + var action_data = scheduler2.getActionData(last_event); + var event_data = { start_date: new Date(action_data.date) }; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + var view_options = scheduler2.matrix[scheduler2._mode]; + event_data[view_options.y_property] = action_data.section; + var pos = scheduler2._locate_cell_timeline(last_event); + event_data.start_date = view_options._trace_x[pos.x]; + event_data.end_date = scheduler2.date.add(event_data.start_date, view_options.x_step, view_options.x_unit); + } + if (scheduler2._props && scheduler2._props[scheduler2._mode]) { + event_data[scheduler2._props[scheduler2._mode].map_to] = action_data.section; + } + scheduler2.addEventNow(event_data); + scheduler2.detachEvent(temp); + } + dragger.addDragLanding(scheduler2._els["dhx_cal_data"][0], { _drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { + on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml); + }, _dragIn: function(htmlObject, shtmlObject) { + return htmlObject; + }, _dragOut: function(htmlObject) { + return this; + } }); + if (dhtmlx.DragControl) { + dhtmlx.DragControl.addDrop(scheduler2._els["dhx_cal_data"][0], { onDrop: function(source, target, d, e) { + var sourceDhtmlx = dhtmlx.DragControl.getMaster(source); + last_event = e; + on_drop(source, sourceDhtmlx, target, e.target || e.srcElement); + }, onDragIn: function(source, target, e) { + return target; + } }, true); + } + }); + } + function pdf(scheduler2) { + var dx, dy, html_regexp = new RegExp("<[^>]*>", "g"), newline_regexp = new RegExp("]*>", "g"); + function clean_html(val) { + return val.replace(newline_regexp, "\n").replace(html_regexp, ""); + } + function x_norm(x, offset) { + x = parseFloat(x); + offset = parseFloat(offset); + if (!isNaN(offset)) + x -= offset; + var w = colsWidth(x); + x = x - w.width + w.cols * dx; + return isNaN(x) ? "auto" : 100 * x / dx; + } + function x_norm_event(x, offset, is_left) { + x = parseFloat(x); + offset = parseFloat(offset); + if (!isNaN(offset) && is_left) + x -= offset; + var w = colsWidth(x); + x = x - w.width + w.cols * dx; + return isNaN(x) ? "auto" : 100 * x / (dx - (!isNaN(offset) ? offset : 0)); + } + function colsWidth(width) { + var r = 0; + var header = scheduler2._els.dhx_cal_header[0].childNodes; + var els = header[1] ? header[1].childNodes : header[0].childNodes; + for (var i = 0; i < els.length; i++) { + var el2 = els[i].style ? els[i] : els[i].parentNode; + var w = parseFloat(el2.style.width); + if (width > w) { + width -= w + 1; + r += w + 1; + } else + break; + } + return { width: r, cols: i }; + } + function y_norm(y) { + y = parseFloat(y); + if (isNaN(y)) + return "auto"; + return 100 * y / dy; + } + function get_style(node, style) { + return (window.getComputedStyle ? window.getComputedStyle(node, null)[style] : node.currentStyle ? node.currentStyle[style] : null) || ""; + } + function de_day(node, n) { + var x = parseInt(node.style.left, 10); + for (var dx2 = 0; dx2 < scheduler2._cols.length; dx2++) { + x -= scheduler2._cols[dx2]; + if (x < 0) + return dx2; + } + return n; + } + function de_week(node, n) { + var y = parseInt(node.style.top, 10); + for (var dy2 = 0; dy2 < scheduler2._colsS.heights.length; dy2++) + if (scheduler2._colsS.heights[dy2] > y) + return dy2; + return n; + } + function xml_start(tag) { + return tag ? "<" + tag + ">" : ""; + } + function xml_end(tag) { + return tag ? "" : ""; + } + function xml_top(tag, profile, header, footer) { + var xml = "<" + tag + " profile='" + profile + "'"; + if (header) + xml += " header='" + header + "'"; + if (footer) + xml += " footer='" + footer + "'"; + xml += ">"; + return xml; + } + function xml_body_header() { + var xml = ""; + var mode = scheduler2._mode; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) + mode = scheduler2.matrix[scheduler2._mode].render == "cell" ? "matrix" : "timeline"; + xml += ""; + if (scheduler2._mode == "week_agenda") { + var xh = scheduler2._els.dhx_cal_data[0].getElementsByTagName("DIV"); + for (var i = 0; i < xh.length; i++) + if (xh[i].className == "dhx_wa_scale_bar") + xml += "" + clean_html(xh[i].innerHTML) + ""; + } else if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { + var xh = scheduler2._els.dhx_cal_header[0].childNodes[0].childNodes; + xml += "" + clean_html(xh[0].innerHTML) + "" + clean_html(xh[1].innerHTML) + ""; + } else if (scheduler2._mode == "year") { + var xh = scheduler2._els.dhx_cal_data[0].childNodes; + for (var i = 0; i < xh.length; i++) { + xml += ""; + xml += xml_month_scale(xh[i].querySelector(".dhx_year_week").childNodes); + xml += xml_month(xh[i].querySelector(".dhx_year_body")); + xml += ""; } - }; - scheduler2._append_mark_now = function(day_index, now) { - var dhx_now_time = "dhx_now_time"; - var zone_start = scheduler2._get_zone_minutes(now); - var options = { zones: [zone_start, zone_start + 1], css: dhx_now_time, type: dhx_now_time }; - if (!this._table_view) { - if (this._props && this._props[this._mode]) { - var start_index, end_index; - var view = this._props[this._mode]; - var units_l = view.size || view.options.length; - if (view.days > 1) { - if (view.size && view.options.length) { - day_index = (view.position + day_index) / view.options.length * view.size; - } - start_index = day_index; - end_index = day_index + units_l; - } else { - start_index = 0; - end_index = start_index + units_l; - } - var r_divs = []; - for (var i = start_index; i < end_index; i++) { - var t_day = i; - options.days = t_day; - var t_div = scheduler2._render_marked_timespan(options, null, t_day)[0]; - r_divs.push(t_div); - } - return r_divs; - } else { - options.days = day_index; - return scheduler2._render_marked_timespan(options, null, day_index); + } else { + xml += ""; + var xh = scheduler2._els.dhx_cal_header[0].childNodes; + xml += xml_month_scale(xh); + xml += ""; + var yh = scheduler2._els.dhx_cal_data[0]; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + xml += ""; + for (var i = 0; i < yh.firstChild.rows.length; i++) { + var el2 = yh.firstChild.rows[i]; + xml += ""; } + xml += ""; + dy = yh.firstChild.rows[0].cells[0].offsetHeight; + } else if (yh.firstChild.tagName == "TABLE") { + xml += xml_month(yh); } else { - if (this._mode == "month") { - options.days = +scheduler2.date.date_part(now); - return scheduler2._render_marked_timespan(options, null, null); - } + yh = yh.childNodes[yh.childNodes.length - 1]; + while (yh.className.indexOf("dhx_scale_holder") == -1) + yh = yh.previousSibling; + yh = yh.childNodes; + xml += ""; + for (var i = 0; i < yh.length; i++) + xml += "\n"; + xml += ""; + dy = yh[0].offsetHeight; } - }; - scheduler2._remove_mark_now = function() { - var dhx_now_time = "dhx_now_time"; - var els = this._els[dhx_now_time]; - for (var i = 0; i < els.length; i++) { - var div = els[i]; - var parent = div.parentNode; - if (parent) { - parent.removeChild(div); + } + xml += ""; + return xml; + } + function xml_month(yh) { + var xml = ""; + var r = yh.querySelectorAll("tr"); + for (var i = 0; i < r.length; i++) { + var days = []; + var cells = r[i].querySelectorAll("td"); + for (var j = 0; j < cells.length; j++) + days.push(cells[j].querySelector(".dhx_month_head").innerHTML); + xml += "\n"; + dy = cells[0].offsetHeight; + } + return xml; + } + function xml_month_scale(xh) { + var xhs, xml = ""; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + if (scheduler2.matrix[scheduler2._mode].second_scale) + xhs = xh[1].childNodes; + xh = xh[0].childNodes; + } + for (var i = 0; i < xh.length; i++) + xml += "\n"; + dx = xh[0].offsetWidth; + if (xhs) { + var width = 0; + var top_width = xh[0].offsetWidth; + var top_col = 1; + for (var i = 0; i < xhs.length; i++) { + xml += "\n"; + width += xhs[i].offsetWidth; + if (width >= top_width) { + top_width += xh[top_col] ? xh[top_col].offsetWidth : 0; + top_col++; } + dx = xhs[0].offsetWidth; } - this._els[dhx_now_time] = []; - }; - scheduler2._marked_timespans = { global: {} }; - scheduler2._get_zone_minutes = function(date) { - return date.getHours() * 60 + date.getMinutes(); - }; - scheduler2._prepare_timespan_options = function(config) { - var r_configs = []; - var temp_configs = []; - if (config.days == "fullweek") - config.days = [0, 1, 2, 3, 4, 5, 6]; - if (config.days instanceof Array) { - var t_days = config.days.slice(); - for (var i = 0; i < t_days.length; i++) { - var cloned_config = scheduler2._lame_clone(config); - cloned_config.days = t_days[i]; - r_configs.push.apply(r_configs, scheduler2._prepare_timespan_options(cloned_config)); - } - return r_configs; - } - if (!config || !(config.start_date && config.end_date && config.end_date > config.start_date || config.days !== void 0 && config.zones) && !config.type) - return r_configs; - var min = 0; - var max = 24 * 60; - if (config.zones == "fullday") - config.zones = [min, max]; - if (config.zones && config.invert_zones) { - config.zones = scheduler2.invertZones(config.zones); - } - config.id = scheduler2.uid(); - config.css = config.css || ""; - config.type = config.type || default_timespan_type; - var sections = config.sections; - if (sections) { - for (var view_key in sections) { - if (sections.hasOwnProperty(view_key)) { - var ids = sections[view_key]; - if (!(ids instanceof Array)) - ids = [ids]; - for (var i = 0; i < ids.length; i++) { - var t_config = scheduler2._lame_copy({}, config); - t_config.sections = {}; - t_config.sections[view_key] = ids[i]; - temp_configs.push(t_config); - } - } - } - } else { - temp_configs.push(config); - } - for (var k = 0; k < temp_configs.length; k++) { - var c_config = temp_configs[k]; - var start_date = c_config.start_date; - var end_date = c_config.end_date; - if (start_date && end_date) { - var t_sd = scheduler2.date.date_part(new Date(start_date)); - var t_ed = scheduler2.date.add(t_sd, 1, "day"); - while (t_sd < end_date) { - var t_config = scheduler2._lame_copy({}, c_config); - delete t_config.start_date; - delete t_config.end_date; - t_config.days = t_sd.valueOf(); - var zone_start = start_date > t_sd ? scheduler2._get_zone_minutes(start_date) : min; - var zone_end = end_date > t_ed || end_date.getDate() != t_sd.getDate() ? max : scheduler2._get_zone_minutes(end_date); - t_config.zones = [zone_start, zone_end]; - r_configs.push(t_config); - t_sd = t_ed; - t_ed = scheduler2.date.add(t_ed, 1, "day"); - } - } else { - if (c_config.days instanceof Date) - c_config.days = scheduler2.date.date_part(c_config.days).valueOf(); - c_config.zones = config.zones.slice(); - r_configs.push(c_config); + } + return xml; + } + function xml_body(colors) { + var xml = ""; + var evs = scheduler2._rendered; + var matrix = scheduler2.matrix && scheduler2.matrix[scheduler2._mode]; + if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { + for (var i = 0; i < evs.length; i++) + xml += ""; + } else if (scheduler2._mode == "week_agenda") { + for (var i = 0; i < evs.length; i++) + xml += "" + clean_html(evs[i].innerHTML) + ""; + } else if (scheduler2._mode == "year") { + var evs = scheduler2.get_visible_events(); + for (var i = 0; i < evs.length; i++) { + var d = evs[i].start_date; + if (d.valueOf() < scheduler2._min_date.valueOf()) + d = scheduler2._min_date; + while (d < evs[i].end_date) { + var m = d.getMonth() + 12 * (d.getFullYear() - scheduler2._min_date.getFullYear()) - scheduler2.week_starts._month; + var day = scheduler2.week_starts[m] + d.getDate() - 1; + var text_color = colors ? get_style(scheduler2._get_year_cell(d), "color") : ""; + var bg_color = colors ? get_style(scheduler2._get_year_cell(d), "backgroundColor") : ""; + xml += ""; + d = scheduler2.date.add(d, 1, "day"); + if (d.valueOf() >= scheduler2._max_date.valueOf()) + break; } } - return r_configs; - }; - scheduler2._get_dates_by_index = function(index, start, end) { - var dates = []; - start = scheduler2.date.date_part(new Date(start || scheduler2._min_date)); - end = new Date(end || scheduler2._max_date); - var start_day = start.getDay(); - var delta = index - start_day >= 0 ? index - start_day : 7 - start.getDay() + index; - var t_date = scheduler2.date.add(start, delta, "day"); - for (; t_date < end; t_date = scheduler2.date.add(t_date, 1, "week")) { - dates.push(t_date); - } - return dates; - }; - scheduler2._get_css_classes_by_config = function(config) { - var css_classes = []; - if (config.type == dhx_time_block) { - css_classes.push(dhx_time_block); - if (config.css) - css_classes.push(dhx_time_block + "_reset"); - } - css_classes.push("dhx_marked_timespan", config.css); - return css_classes.join(" "); - }; - scheduler2._get_block_by_config = function(config) { - var block = document.createElement("div"); - if (config.html) { - if (typeof config.html == "string") - block.innerHTML = config.html; - else - block.appendChild(config.html); - } - return block; - }; - scheduler2._render_marked_timespan = function(options, area, day) { - var blocks = []; - var c = scheduler2.config; - var min_date = this._min_date; - var max_date = this._max_date; - var day_value = false; - if (!c.display_marked_timespans) - return blocks; - if (!day && day !== 0) { - if (options.days < 7) - day = options.days; - else { - var date_to_display = new Date(options.days); - day_value = +date_to_display; - if (!(+max_date > +date_to_display && +min_date <= +date_to_display)) - return blocks; - day = date_to_display.getDay(); - } - var min_day = min_date.getDay(); - if (min_day > day) { - day = 7 - (min_day - day); - } else { - day = day - min_day; - } + } else if (matrix && matrix.render == "cell") { + var evs = scheduler2._els.dhx_cal_data[0].getElementsByTagName("TD"); + for (var i = 0; i < evs.length; i++) { + var text_color = colors ? get_style(evs[i], "color") : ""; + var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; + xml += "\n"; } - var zones = options.zones; - var css_classes = scheduler2._get_css_classes_by_config(options); - if (scheduler2._table_view && scheduler2._mode == "month") { - var areas = []; - var days = []; - if (!area) { - days = day_value ? [day_value] : scheduler2._get_dates_by_index(day); - for (var i = 0; i < days.length; i++) { - areas.push(this._scales[days[i]]); - } + } else { + for (var i = 0; i < evs.length; i++) { + var zx, zdx; + if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + zx = x_norm(evs[i].style.left); + zdx = x_norm(evs[i].offsetWidth) - 1; } else { - areas.push(area); - days.push(day); - } - for (var i = 0; i < areas.length; i++) { - area = areas[i]; - day = days[i]; - var sday = this.locate_holder_day(day, false) % this._cols.length; - if (this._ignores[sday]) - continue; - var block_proto = scheduler2._get_block_by_config(options); - block_proto.className = css_classes; - block_proto.style.top = "0px"; - block_proto.style.height = "100%"; - for (var k = 0; k < zones.length; k += 2) { - var start = zones[i]; - var end = zones[i + 1]; - if (end <= start) - return []; - var block = block_proto.cloneNode(true); - block.style.left = "0px"; - block.style.width = "100%"; - area.appendChild(block); - blocks.push(block); - } - } - } else { - var index = day; - if (this._ignores[this.locate_holder_day(day, false)]) - return blocks; - if (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) { - var view = this._props[this._mode]; - index = view.order[options.sections[this._mode]]; - var inner_index = view.order[options.sections[this._mode]]; - if (!(view.days > 1)) { - index = inner_index; - if (view.size && index > view.position + view.size) { - index = 0; - } - } else { - var units_l = view.size || view.options.length; - index = index * units_l + inner_index; - } - } - area = area ? area : scheduler2.locate_holder(index); - for (var i = 0; i < zones.length; i += 2) { - var start = Math.max(zones[i], c.first_hour * 60); - var end = Math.min(zones[i + 1], c.last_hour * 60); - if (end <= start) { - if (i + 2 < zones.length) - continue; - else - return []; - } - var block = scheduler2._get_block_by_config(options); - block.className = css_classes; - var all_hours_height = this.config.hour_size_px * 24 + 1; - var hour_ms = 60 * 60 * 1e3; - block.style.top = Math.round((start * 60 * 1e3 - this.config.first_hour * hour_ms) * this.config.hour_size_px / hour_ms) % all_hours_height + "px"; - block.style.height = Math.max(Math.round((end - start) * 60 * 1e3 * this.config.hour_size_px / hour_ms) % all_hours_height, 1) + "px"; - area.appendChild(block); - blocks.push(block); - } - } - return blocks; - }; - scheduler2._mark_timespans = function() { - var data = this._els["dhx_cal_data"][0]; - var divs = []; - if (scheduler2._table_view && scheduler2._mode == "month") { - for (var day in this._scales) { - var date = /* @__PURE__ */ new Date(+day); - divs.push.apply(divs, scheduler2._on_scale_add_marker(this._scales[day], date)); - } - } else { - var date = new Date(scheduler2._min_date); - for (var i = 0, len = data.childNodes.length; i < len; i++) { - var area = data.childNodes[i]; - if (area.firstChild && scheduler2._getClassName(area.firstChild).indexOf("dhx_scale_hour") > -1) { - continue; - } - divs.push.apply(divs, scheduler2._on_scale_add_marker(area, date)); - date = scheduler2.date.add(date, 1, "day"); - } - } - return divs; - }; - scheduler2.markTimespan = function(configuration) { - if (!this._els) { - throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`."); - } - var rebuild_els = false; - if (!this._els["dhx_cal_data"]) { - scheduler2.get_elements(); - rebuild_els = true; - } - var timespans_ids = scheduler2._marked_timespans_ids, timespan_types = scheduler2._marked_timespans_types, timespans = scheduler2._marked_timespans; - scheduler2.deleteMarkedTimespan(); - scheduler2.addMarkedTimespan(configuration); - var divs = scheduler2._mark_timespans(); - if (rebuild_els) - scheduler2._els = []; - scheduler2._marked_timespans_ids = timespans_ids; - scheduler2._marked_timespans_types = timespan_types; - scheduler2._marked_timespans = timespans; - return divs; - }; - scheduler2.unmarkTimespan = function(divs) { - if (!divs) - return; - for (var i = 0; i < divs.length; i++) { - var div = divs[i]; - if (div.parentNode) { - div.parentNode.removeChild(div); - } - } - }; - scheduler2._addMarkerTimespanConfig = function(config) { - var global2 = "global"; - var timespans = scheduler2._marked_timespans; - var id2 = config.id; - var ids = scheduler2._marked_timespans_ids; - if (!ids[id2]) - ids[id2] = []; - var day = config.days; - var sections = config.sections; - var type = config.type; - config.id = id2; - if (sections) { - for (var view_key in sections) { - if (sections.hasOwnProperty(view_key)) { - if (!timespans[view_key]) - timespans[view_key] = {}; - var unit_id = sections[view_key]; - var timespans_view = timespans[view_key]; - if (!timespans_view[unit_id]) - timespans_view[unit_id] = {}; - if (!timespans_view[unit_id][day]) - timespans_view[unit_id][day] = {}; - if (!timespans_view[unit_id][day][type]) { - timespans_view[unit_id][day][type] = []; - if (!scheduler2._marked_timespans_types) - scheduler2._marked_timespans_types = {}; - if (!scheduler2._marked_timespans_types[type]) - scheduler2._marked_timespans_types[type] = true; - } - var day_configs = timespans_view[unit_id][day][type]; - config._array = day_configs; - day_configs.push(config); - ids[id2].push(config); - } - } - } else { - if (!timespans[global2][day]) - timespans[global2][day] = {}; - if (!timespans[global2][day][type]) - timespans[global2][day][type] = []; - if (!scheduler2._marked_timespans_types) - scheduler2._marked_timespans_types = {}; - if (!scheduler2._marked_timespans_types[type]) - scheduler2._marked_timespans_types[type] = true; - var day_configs = timespans[global2][day][type]; - config._array = day_configs; - day_configs.push(config); - ids[id2].push(config); - } - }; - scheduler2._marked_timespans_ids = {}; - scheduler2.addMarkedTimespan = function(configuration) { - var configs = scheduler2._prepare_timespan_options(configuration); - if (!configs.length) - return; - var id2 = configs[0].id; - for (var i = 0; i < configs.length; i++) { - scheduler2._addMarkerTimespanConfig(configs[i]); - } - return id2; - }; - scheduler2._add_timespan_zones = function(current_zones, zones) { - var resulting_zones = current_zones.slice(); - zones = zones.slice(); - if (!resulting_zones.length) - return zones; - for (var i = 0; i < resulting_zones.length; i += 2) { - var c_zone_start = resulting_zones[i]; - var c_zone_end = resulting_zones[i + 1]; - var isLast = i + 2 == resulting_zones.length; - for (var k = 0; k < zones.length; k += 2) { - var zone_start = zones[k]; - var zone_end = zones[k + 1]; - if (zone_end > c_zone_end && zone_start <= c_zone_end || zone_start < c_zone_start && zone_end >= c_zone_start) { - resulting_zones[i] = Math.min(c_zone_start, zone_start); - resulting_zones[i + 1] = Math.max(c_zone_end, zone_end); - i -= 2; - } else { - if (!isLast) - continue; - var offset = c_zone_start > zone_start ? 0 : 2; - resulting_zones.splice(i + offset, 0, zone_start, zone_end); - } - zones.splice(k--, 2); - break; + var left_norm = scheduler2.config.use_select_menu_space ? 0 : 26; + zx = x_norm_event(evs[i].style.left, left_norm, true); + zdx = x_norm_event(evs[i].style.width, left_norm) - 1; } - } - return resulting_zones; - }; - scheduler2._subtract_timespan_zones = function(current_zones, zones) { - var resulting_zones = current_zones.slice(); - for (var i = 0; i < resulting_zones.length; i += 2) { - var c_zone_start = resulting_zones[i]; - var c_zone_end = resulting_zones[i + 1]; - for (var k = 0; k < zones.length; k += 2) { - var zone_start = zones[k]; - var zone_end = zones[k + 1]; - if (zone_end > c_zone_start && zone_start < c_zone_end) { - var is_modified = false; - if (c_zone_start >= zone_start && c_zone_end <= zone_end) { - resulting_zones.splice(i, 2); - } - if (c_zone_start < zone_start) { - resulting_zones.splice(i, 2, c_zone_start, zone_start); - is_modified = true; - } - if (c_zone_end > zone_end) { - resulting_zones.splice(is_modified ? i + 2 : i, is_modified ? 0 : 2, zone_end, c_zone_end); - } - i -= 2; - break; - } else { + if (isNaN(zdx * 1)) + continue; + var zy = y_norm(evs[i].style.top); + var zdy = y_norm(evs[i].style.height); + var e_type = evs[i].className.split(" ")[0].replace("dhx_cal_", ""); + if (e_type === "dhx_tooltip_line") + continue; + var dets = scheduler2.getEvent(evs[i].getAttribute(scheduler2.config.event_attribute)); + if (!dets) + continue; + var day = dets._sday; + var week = dets._sweek; + var length = dets._length || 0; + if (scheduler2._mode == "month") { + zdy = parseInt(evs[i].offsetHeight, 10); + zy = parseInt(evs[i].style.top, 10) - scheduler2.xy.month_head_height; + day = de_day(evs[i], day); + week = de_week(evs[i], week); + } else if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { + day = 0; + var el2 = evs[i].parentNode.parentNode.parentNode; + week = el2.rowIndex; + var dy_copy = dy; + dy = evs[i].parentNode.offsetHeight; + zy = y_norm(evs[i].style.top); + zy -= zy * 0.2; + dy = dy_copy; + } else { + if (evs[i].parentNode == scheduler2._els.dhx_cal_data[0]) continue; - } + var parent = scheduler2._els["dhx_cal_data"][0].childNodes[0]; + var offset = parseFloat(parent.className.indexOf("dhx_scale_holder") != -1 ? parent.style.left : 0); + zx += x_norm(evs[i].parentNode.style.left, offset); } - } - return resulting_zones; - }; - scheduler2.invertZones = function(zones) { - return scheduler2._subtract_timespan_zones([0, 1440], zones.slice()); - }; - scheduler2._delete_marked_timespan_by_id = function(id2) { - var configs = scheduler2._marked_timespans_ids[id2]; - if (configs) { - for (var i = 0; i < configs.length; i++) { - var config = configs[i]; - var parent_array = config._array; - for (var k = 0; k < parent_array.length; k++) { - if (parent_array[k] == config) { - parent_array.splice(k, 1); - break; - } - } + xml += "\n"; + if (e_type == "event") { + xml += "
"; + var text_color = colors ? get_style(evs[i].childNodes[2], "color") : ""; + var bg_color = colors ? get_style(evs[i].childNodes[2], "backgroundColor") : ""; + xml += ""; + } else { + var text_color = colors ? get_style(evs[i], "color") : ""; + var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; + xml += ""; } + xml += "
"; } - }; - scheduler2._delete_marked_timespan_by_config = function(config) { - var timespans = scheduler2._marked_timespans; - var sections = config.sections; - var day = config.days; - var type = config.type || default_timespan_type; - var viewspans; - if (sections) { - for (var view_key in sections) { - if (sections.hasOwnProperty(view_key) && timespans[view_key]) { - var unit_id = sections[view_key]; - if (timespans[view_key][unit_id]) { - viewspans = timespans[view_key][unit_id]; - } - } - } - } else { - viewspans = timespans.global; + } + return xml; + } + function toXML(start, end, view, mode, header, footer) { + var colors = false; + if (mode == "fullcolor") { + colors = true; + mode = "color"; + } + mode = mode || "color"; + var xml = ""; + if (start) { + var original_date = scheduler2._date; + var original_mode = scheduler2._mode; + end = scheduler2.date[view + "_start"](end); + end = scheduler2.date["get_" + view + "_end"] ? scheduler2.date["get_" + view + "_end"](end) : scheduler2.date.add(end, 1, view); + xml = xml_top("pages", mode, header, footer); + for (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) { + this.setCurrentView(temp_date, view); + xml += xml_start("page") + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("page"); } - if (viewspans) { - if (day !== void 0) { - if (viewspans[day] && viewspans[day][type]) { - scheduler2._addMarkerTimespanConfig(config); - scheduler2._delete_marked_timespans_list(viewspans[day][type], config); - } - } else { - for (var d in viewspans) { - if (viewspans[d][type]) { - var dayConfig = scheduler2._lame_clone(config); - config.days = d; - scheduler2._addMarkerTimespanConfig(dayConfig); - scheduler2._delete_marked_timespans_list(viewspans[d][type], config); - } - } + xml += xml_end("pages"); + this.setCurrentView(original_date, original_mode); + } else { + xml = xml_top("data", mode, header, footer) + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("data"); + } + return xml; + } + scheduler2.getPDFData = toXML; + function send_xml(xml, url2) { + var uid2 = scheduler2.uid(); + var d = document.createElement("div"); + d.style.display = "none"; + document.body.appendChild(d); + d.innerHTML = '
'; + document.getElementById(uid2).firstChild.value = encodeURIComponent(xml); + document.getElementById(uid2).submit(); + d.parentNode.removeChild(d); + } + function to_pdf(start, end, view, url2, mode, header, footer) { + var xml = ""; + if (typeof mode == "object") { + xml = schedulersToPdf(mode); + } else { + xml = toXML.apply(this, [start, end, view, mode, header, footer]); + } + send_xml(xml, url2); + } + function schedulersToPdf(objects) { + var xml = ""; + for (var i = 0; i < objects.length; i++) { + xml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer); + } + xml += ""; + return xml; + } + scheduler2.toPDF = function(url2, mode, header, footer) { + return to_pdf.apply(this, [null, null, null, url2, mode, header, footer]); + }; + scheduler2.toPDFRange = function(start, end, view, url2, mode, header, footer) { + if (typeof start == "string") { + start = scheduler2.templates.api_date(start); + end = scheduler2.templates.api_date(end); + } + return to_pdf.apply(this, arguments); + }; + } + function quick_info(scheduler2) { + scheduler2.config.icons_select = ["icon_form", "icon_delete"]; + scheduler2.config.details_on_create = true; + scheduler2.config.show_quick_info = true; + scheduler2.xy.menu_width = 0; + let clickedElementPosition = null; + scheduler2.attachEvent("onSchedulerReady", function() { + const container = scheduler2.$container; + if (container._$quickInfoHandler) { + return; + } else { + container._$quickInfoHandler = true; + scheduler2.event(container, "mousedown", function(e) { + const eventElement = e.target.closest(`[${scheduler2.config.event_attribute}]`); + if (eventElement) { + clickedElementPosition = { id: eventElement.getAttribute(scheduler2.config.event_attribute), position: getPositionInsideScheduler(eventElement) }; } - } + }); + scheduler2.attachEvent("onDestroy", () => { + delete container._$quickInfoHandler; + }); + } + }); + scheduler2.attachEvent("onClick", function(id2) { + if (!scheduler2.config.show_quick_info) { + return; + } + scheduler2.showQuickInfo(id2); + return true; + }); + (function() { + var events = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"]; + var hiding_function = function() { + scheduler2.hideQuickInfo(true); + return true; }; - scheduler2._delete_marked_timespans_list = function(day_timespans, config) { - for (var i = 0; i < day_timespans.length; i++) { - var d_t = day_timespans[i]; - var zones = scheduler2._subtract_timespan_zones(d_t.zones, config.zones); - if (zones.length) - d_t.zones = zones; - else { - day_timespans.splice(i, 1); - i--; - var related_zones = scheduler2._marked_timespans_ids[d_t.id]; - for (var k = 0; k < related_zones.length; k++) { - if (related_zones[k] == d_t) { - related_zones.splice(k, 1); - break; - } - } - } + for (var i = 0; i < events.length; i++) { + scheduler2.attachEvent(events[i], hiding_function); + } + })(); + scheduler2.templates.quick_info_title = function(start, end, ev) { + return ev.text.substr(0, 50); + }; + scheduler2.templates.quick_info_content = function(start, end, ev) { + return ev.details || ""; + }; + scheduler2.templates.quick_info_date = function(start, end, ev) { + if (scheduler2.isOneDayEvent(ev) && scheduler2.config.rtl) { + return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(end, start, ev); + } else if (scheduler2.isOneDayEvent(ev)) { + return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(start, end, ev); + } else if (scheduler2.config.rtl) { + return scheduler2.templates.week_date(end, start, ev); + } else { + return scheduler2.templates.week_date(start, end, ev); + } + }; + scheduler2.showQuickInfo = function(id2) { + if (id2 == this._quick_info_box_id) + return; + this.hideQuickInfo(true); + if (this.callEvent("onBeforeQuickInfo", [id2]) === false) { + return; + } + let pos; + if (clickedElementPosition && clickedElementPosition.id == id2) { + pos = clickedElementPosition.position; + } else { + pos = this._get_event_counter_part(id2); + } + if (pos) { + this._quick_info_box = this._init_quick_info(pos); + this._fill_quick_data(id2); + this._show_quick_info(pos); + this.callEvent("onQuickInfo", [id2]); + } + }; + (function() { + function cssTimeToMs(time) { + time = time || ""; + var num = parseFloat(time), unit = time.match(/m?s/), milliseconds; + if (unit) { + unit = unit[0]; } - }; - scheduler2.deleteMarkedTimespan = function(configuration) { - if (!arguments.length) { - scheduler2._marked_timespans = { global: {} }; - scheduler2._marked_timespans_ids = {}; - scheduler2._marked_timespans_types = {}; + switch (unit) { + case "s": + milliseconds = num * 1e3; + break; + case "ms": + milliseconds = num; + break; + default: + milliseconds = 0; + break; } - if (typeof configuration != "object") { - scheduler2._delete_marked_timespan_by_id(configuration); - } else { - if (!(configuration.start_date && configuration.end_date)) { - if (configuration.days === void 0 && !configuration.type) - configuration.days = "fullweek"; - if (!configuration.zones) - configuration.zones = "fullday"; + return milliseconds; + } + scheduler2.hideQuickInfo = function(forced) { + var qi = this._quick_info_box; + var eventId = this._quick_info_box_id; + this._quick_info_box_id = 0; + if (qi && qi.parentNode) { + var width = qi.offsetWidth; + if (scheduler2.config.quick_info_detached) { + this.callEvent("onAfterQuickInfo", [eventId]); + return qi.parentNode.removeChild(qi); } - var types = []; - if (!configuration.type) { - for (var type in scheduler2._marked_timespans_types) { - types.push(type); - } + if (qi.style.right == "auto") + qi.style.left = -width + "px"; + else + qi.style.right = -width + "px"; + if (forced) { + qi.parentNode.removeChild(qi); } else { - types.push(configuration.type); - } - var configs = scheduler2._prepare_timespan_options(configuration); - for (var i = 0; i < configs.length; i++) { - var config = configs[i]; - for (var t = 0; t < types.length; t++) { - var typedConfig = scheduler2._lame_clone(config); - typedConfig.type = types[t]; - scheduler2._delete_marked_timespan_by_config(typedConfig); + var style; + if (window.getComputedStyle) { + style = window.getComputedStyle(qi, null); + } else if (qi.currentStyle) { + style = qi.currentStyle; } + var delay2 = cssTimeToMs(style["transition-delay"]) + cssTimeToMs(style["transition-duration"]); + setTimeout(function() { + if (qi.parentNode) { + qi.parentNode.removeChild(qi); + } + }, delay2); } + this.callEvent("onAfterQuickInfo", [eventId]); } }; - scheduler2._get_types_to_render = function(common, specific) { - var types_to_render = common ? scheduler2._lame_copy({}, common) : {}; - for (var type in specific || {}) { - if (specific.hasOwnProperty(type)) { - types_to_render[type] = specific[type]; - } - } - return types_to_render; - }; - scheduler2._get_configs_to_render = function(types) { - var configs = []; - for (var type in types) { - if (types.hasOwnProperty(type)) { - configs.push.apply(configs, types[type]); - } - } - return configs; - }; - scheduler2._on_scale_add_marker = function(area, day) { - if (scheduler2._table_view && scheduler2._mode != "month") - return; - var day_index = day.getDay(); - var day_value = day.valueOf(); - var mode = this._mode; - var timespans = scheduler2._marked_timespans; - var r_configs = []; - var divs = []; - if (this._props && this._props[mode]) { - var view = this._props[mode]; - var units = view.options; - var index = scheduler2._get_unit_index(view, day); - var unit = units[index]; - if (!(view.days > 1)) { - day = scheduler2.date.date_part(new Date(this._date)); + })(); + scheduler2.event(window, "keydown", function(e) { + if (e.keyCode == 27) + scheduler2.hideQuickInfo(); + }); + scheduler2._show_quick_info = function(pos) { + var qi = scheduler2._quick_info_box; + scheduler2._obj.appendChild(qi); + var width = qi.offsetWidth; + var height = qi.offsetHeight; + if (scheduler2.config.quick_info_detached) { + var left = pos.left - pos.dx * (width - pos.width); + if (scheduler2.getView() && scheduler2.getView()._x_scroll) { + if (scheduler2.config.rtl) { + left += scheduler2.getView()._x_scroll; } else { - var dx = 24 * 60 * 60 * 1e3; - var day_ind = Math.round((day - scheduler2._min_date) / dx); - var unitsPerDay = view.size || units.length; - day = scheduler2.date.add(scheduler2._min_date, Math.floor(day_ind / unitsPerDay), "day"); - day = scheduler2.date.date_part(day); - } - day_index = day.getDay(); - day_value = day.valueOf(); - if (timespans[mode] && timespans[mode][unit.key]) { - var unit_zones = timespans[mode][unit.key]; - var unit_types = scheduler2._get_types_to_render(unit_zones[day_index], unit_zones[day_value]); - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(unit_types)); - } - } - var global_data = timespans["global"]; - if (scheduler2.config.overwrite_marked_timespans) { - var day_types = global_data[day_value] || global_data[day_index]; - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(day_types)); - } else { - if (global_data[day_value]) { - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_value])); - } - if (global_data[day_index]) { - r_configs.push.apply(r_configs, scheduler2._get_configs_to_render(global_data[day_index])); + left -= scheduler2.getView()._x_scroll; } } - for (var i = 0; i < r_configs.length; i++) { - divs.push.apply(divs, scheduler2._render_marked_timespan(r_configs[i], area, day)); + var right = left + width; + if (right > window.innerWidth) { + left = window.innerWidth - width; } - return divs; - }; - scheduler2.attachEvent("onScaleAdd", function() { - scheduler2._on_scale_add_marker.apply(scheduler2, arguments); - }); - scheduler2.dblclick_dhx_marked_timespan = function(e, src) { - scheduler2.callEvent("onScaleDblClick", [scheduler2.getActionData(e).date, src, e]); - if (scheduler2.config.dblclick_create) { - scheduler2.addEventNow(scheduler2.getActionData(e).date, null, e); + left = Math.max(0, left); + qi.style.left = left + "px"; + qi.style.top = pos.top - (pos.dy ? height : -pos.height) + "px"; + } else { + const dataPos = scheduler2.$container.querySelector(".dhx_cal_data").offsetTop; + qi.style.top = dataPos + 20 + "px"; + if (pos.dx == 1) { + qi.style.right = "auto"; + qi.style.left = -width + "px"; + setTimeout(function() { + qi.style.left = "-10px"; + }, 1); + } else { + qi.style.left = "auto"; + qi.style.right = -width + "px"; + setTimeout(function() { + qi.style.right = "-10px"; + }, 1); } + qi.className = qi.className.replace(" dhx_qi_left", "").replace(" dhx_qi_right", "") + " dhx_qi_" + (pos.dx == 1 ? "left" : "right"); + } + qi.ontransitionend = () => { + fitQIInsideWindow(qi); + qi.ontransitionend = null; }; + setTimeout(() => { + fitQIInsideWindow(qi); + }, 1); }; - scheduler2._temp_limit_scope(); - } - function map_view(scheduler2) { - if (!scheduler2.ext) { - scheduler2.ext = {}; + function fitQIInsideWindow(quickInfoPopup) { + const popupRect = quickInfoPopup.getBoundingClientRect(); + const containerRect = scheduler2.$container.getBoundingClientRect(); + const offsetBottom = containerRect.bottom - popupRect.bottom; + if (offsetBottom < 0) { + quickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`; + } } - scheduler2.ext.mapView = { geocoder: null, map: null, points: null, markers: null, infoWindow: null, createMarker: function(config) { - return new google.maps.Marker(config); - } }; - scheduler2.xy.map_date_width = 188; - scheduler2.xy.map_icon_width = 25; - scheduler2.xy.map_description_width = 400; - scheduler2.config.map_resolve_event_location = true; - scheduler2.config.map_resolve_user_location = true; - scheduler2.config.map_initial_position = new google.maps.LatLng(48.724, 8.215); - scheduler2.config.map_error_position = new google.maps.LatLng(15, 15); - scheduler2.config.map_infowindow_max_width = 300; - scheduler2.config.map_type = google.maps.MapTypeId.ROADMAP; - scheduler2.config.map_zoom_after_resolve = 15; - scheduler2.locale.labels.marker_geo_success = "It seems you are here."; - scheduler2.locale.labels.marker_geo_fail = "Sorry, could not get your current position using geolocation."; - scheduler2.templates.marker_date = scheduler2.date.date_to_str("%Y-%m-%d %H:%i"); - scheduler2.templates.marker_text = function(start, end, ev) { - return "
" + ev.text + "

" + (ev.event_location || "") + "

" + scheduler2.templates.marker_date(start) + " - " + scheduler2.templates.marker_date(end) + "
"; - }; - scheduler2.dblclick_dhx_map_area = function() { - if (!this.config.readonly && this.config.dblclick_create) - this.addEventNow({ start_date: scheduler2._date, end_date: scheduler2.date.add(scheduler2._date, scheduler2.config.time_step, "minute") }); - }; - scheduler2.templates.map_time = function(start, end, ev) { - if (scheduler2.config.rtl && !ev._timed) { - return scheduler2.templates.day_date(end) + " – " + scheduler2.templates.day_date(start); - } else if (ev._timed) { - return this.day_date(ev.start_date, ev.end_date, ev) + " " + this.event_date(start); - } else { - return scheduler2.templates.day_date(start) + " – " + scheduler2.templates.day_date(end); + scheduler2.attachEvent("onTemplatesReady", function() { + scheduler2.hideQuickInfo(); + if (this._quick_info_box) { + var box = this._quick_info_box; + if (box.parentNode) { + box.parentNode.removeChild(box); + } + this._quick_info_box = null; } + }); + scheduler2._quick_info_onscroll_handler = function(e) { + scheduler2.hideQuickInfo(); }; - scheduler2.templates.map_text = function(start, end, ev) { - return ev.text; - }; - scheduler2.date.map_start = function(d) { - return d; - }; - scheduler2.date.add_map = function(date, inc, mode) { - return new Date(date.valueOf()); - }; - scheduler2.templates.map_date = function(dd, ed, mode) { - return ""; - }; - scheduler2._latLngUpdate = false; - scheduler2.attachEvent("onSchedulerReady", function() { - scheduler2._isMapPositionSet = false; - const gmap = document.createElement("div"); - gmap.className = "dhx_map"; - gmap.id = "dhx_gmap"; - gmap.style.display = "none"; - scheduler2._obj.appendChild(gmap); - scheduler2._els.dhx_gmap = []; - scheduler2._els.dhx_gmap.push(gmap); - _setMapSize("dhx_gmap"); - const mapOptions = { zoom: scheduler2.config.map_initial_zoom || 10, center: scheduler2.config.map_initial_position, mapTypeId: scheduler2.config.map_type || google.maps.MapTypeId.ROADMAP }; - const map = new google.maps.Map(document.getElementById("dhx_gmap"), mapOptions); - map.disableDefaultUI = false; - map.disableDoubleClickZoom = !scheduler2.config.readonly; - google.maps.event.addListener(map, "dblclick", function(event2) { - const geocoder = scheduler2.ext.mapView.geocoder; - if (!scheduler2.config.readonly && scheduler2.config.dblclick_create) { - var point = event2.latLng; - geocoder.geocode({ latLng: point }, function(results, status) { - if (status == google.maps.GeocoderStatus.OK) { - point = results[0].geometry.location; - scheduler2.addEventNow({ lat: point.lat(), lng: point.lng(), event_location: results[0].formatted_address, start_date: scheduler2._date, end_date: scheduler2.date.add(scheduler2._date, scheduler2.config.time_step, "minute") }); - } - }); + scheduler2._init_quick_info = function() { + if (!this._quick_info_box) { + var qi = this._quick_info_box = document.createElement("div"); + this._waiAria.quickInfoAttr(qi); + qi.className = "dhx_cal_quick_info"; + if (scheduler2.$testmode) + qi.className += " dhx_no_animate"; + if (scheduler2.config.rtl) + qi.className += " dhx_quick_info_rtl"; + var ariaAttr = this._waiAria.quickInfoHeaderAttrString(); + var html = ` +
+ +
+
+ +
+
+
+
`; + html += '
'; + var buttons = scheduler2.config.icons_select; + for (var i = 0; i < buttons.length; i++) { + var ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]); + html += `
+
${scheduler2.locale.labels[buttons[i]]}
`; } - }); - var infoWindowOptions = { content: "" }; - if (scheduler2.config.map_infowindow_max_width) { - infoWindowOptions.maxWidth = scheduler2.config.map_infowindow_max_width; - } - scheduler2.map = { _points: [], _markers: [], _infowindow: new google.maps.InfoWindow(infoWindowOptions), _infowindows_content: [], _initialization_count: -1, _obj: map }; - scheduler2.ext.mapView.geocoder = new google.maps.Geocoder(); - scheduler2.ext.mapView.map = map; - scheduler2.ext.mapView.points = scheduler2.map._points; - scheduler2.ext.mapView.markers = scheduler2.map._markers; - scheduler2.ext.mapView.infoWindow = scheduler2.map._infowindow; - if (scheduler2.config.map_resolve_user_location) { - if (navigator.geolocation) { - if (!scheduler2._isMapPositionSet) { - navigator.geolocation.getCurrentPosition(function(position) { - var _userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); - map.setCenter(_userLocation); - map.setZoom(scheduler2.config.map_zoom_after_resolve || 10); - scheduler2.map._infowindow.setContent(scheduler2.locale.labels.marker_geo_success); - scheduler2.map._infowindow.position = map.getCenter(); - scheduler2.map._infowindow.open(map); - scheduler2._isMapPositionSet = true; - }, function() { - scheduler2.map._infowindow.setContent(scheduler2.locale.labels.marker_geo_fail); - scheduler2.map._infowindow.setPosition(map.getCenter()); - scheduler2.map._infowindow.open(map); - scheduler2._isMapPositionSet = true; - }); - } + html += "
"; + qi.innerHTML = html; + scheduler2.event(qi, "click", function(ev) { + scheduler2._qi_button_click(ev.target || ev.srcElement); + }); + if (scheduler2.config.quick_info_detached) { + scheduler2._detachDomEvent(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); + scheduler2.event(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); } } - google.maps.event.addListener(map, "resize", function(event2) { - gmap.style.zIndex = "5"; - map.setZoom(map.getZoom()); - }); - google.maps.event.addListener(map, "tilesloaded", function(event2) { - gmap.style.zIndex = "5"; - }); - gmap.style.display = "none"; - const old = scheduler2.render_data; - scheduler2.render_data = function(evs, hold) { - if (this._mode == "map") { - fill_map_tab(); - var events = scheduler2.get_visible_events(); - for (var i = 0; i < events.length; i++) { - if (!scheduler2.map._markers[events[i].id]) { - showAddress(events[i], false, false); - } - } - } else - return old.apply(this, arguments); - }; - function set_full_view(mode) { - if (mode) { - var l = scheduler2.locale.labels; - scheduler2._els["dhx_cal_header"][0].innerHTML = "
" + l.date + "
" + l.description + "
"; - scheduler2._table_view = true; - scheduler2.set_sizes(); - } + return this._quick_info_box; + }; + scheduler2._qi_button_click = function(node) { + var box = scheduler2._quick_info_box; + if (!node || node == box) + return; + if (node.closest(".dhx_cal_qi_close_btn")) { + scheduler2.hideQuickInfo(); + return; } - function clear_map_tab() { - scheduler2._selected_event_id = null; - scheduler2.map._infowindow.close(); - var markers = scheduler2.map._markers; - for (var key in markers) { - if (markers.hasOwnProperty(key)) { - markers[key].setMap(null); - delete scheduler2.map._markers[key]; - if (scheduler2.map._infowindows_content[key]) - delete scheduler2.map._infowindows_content[key]; - } - } + var mask = scheduler2._getClassName(node); + if (mask.indexOf("_icon") != -1) { + var id2 = scheduler2._quick_info_box_id; + scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); + } else + scheduler2._qi_button_click(node.parentNode); + }; + function getPositionInsideScheduler(element) { + let left = 0; + let top = 0; + let node = element; + while (node && node != scheduler2._obj) { + left += node.offsetLeft; + top += node.offsetTop - node.scrollTop; + node = node.offsetParent; } - function fill_map_tab() { - var events = scheduler2.get_visible_events(); - events.sort(function(a, b) { - if (a.start_date.valueOf() == b.start_date.valueOf()) - return a.id > b.id ? 1 : -1; - return a.start_date > b.start_date ? 1 : -1; - }); - var ariaAttr = scheduler2._waiAria.mapAttrString(); - var html = "
"; - for (var i = 0; i < events.length; i++) { - var ev = events[i]; - var event_class = ev.id == scheduler2._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line"; - var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : ""; - var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : ""; - var ariaAttr = scheduler2._waiAria.mapRowAttrString(ev); - var ariaButtonAttr = scheduler2._waiAria.mapDetailsBtnString(); - html += "
" + scheduler2.templates.map_time(ev.start_date, ev.end_date, ev) + "
"; - html += `
- -
`; - html += "
" + scheduler2.templates.map_text(ev.start_date, ev.end_date, ev) + "
"; - } - html += "
"; - scheduler2._els["dhx_cal_data"][0].scrollTop = 0; - scheduler2._els["dhx_cal_data"][0].innerHTML = html; - var t = scheduler2._els["dhx_cal_data"][0].firstChild.childNodes; - var dateElement = scheduler2._getNavDateElement(); - if (dateElement) { - dateElement.innerHTML = scheduler2.templates[scheduler2._mode + "_date"](scheduler2._min_date, scheduler2._max_date, scheduler2._mode); - } - scheduler2._rendered = []; - for (var i = 0; i < t.length - 2; i++) { - scheduler2._rendered[i] = t[i]; - } + if (node) { + let dx = left + element.offsetWidth / 2 > scheduler2._x / 2 ? 1 : 0; + let dy = top + element.offsetHeight / 2 > scheduler2._y / 2 ? 1 : 0; + return { left, top, dx, dy, width: element.offsetWidth, height: element.offsetHeight }; } - function _setMapSize(elem_id) { - var map2 = document.getElementById(elem_id); - const nav_height = scheduler2.$container.querySelector(".dhx_cal_navline").offsetHeight; - var height = scheduler2._y - nav_height; - if (height < 0) - height = 0; - var width = scheduler2._x - scheduler2.xy.map_date_width - scheduler2.xy.map_description_width - 1; - if (width < 0) - width = 0; - map2.style.height = height + "px"; - map2.style.width = width + "px"; - map2.style.position = "absolute"; - map2.style.top = nav_height + "px"; - if (scheduler2.config.rtl) { - map2.style.marginRight = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; - } else { - map2.style.marginLeft = scheduler2.xy.map_date_width + scheduler2.xy.map_description_width + 1 + "px"; - } - map2.style.marginTop = scheduler2.xy.nav_height + 2 + "px"; + return 0; + } + scheduler2._get_event_counter_part = function(id2) { + var domEv = scheduler2.getRenderedEvent(id2); + return getPositionInsideScheduler(domEv); + }; + scheduler2._fill_quick_data = function(id2) { + var ev = scheduler2.getEvent(id2); + var qi = scheduler2._quick_info_box; + scheduler2._quick_info_box_id = id2; + var header = { content: scheduler2.templates.quick_info_title(ev.start_date, ev.end_date, ev), date: scheduler2.templates.quick_info_date(ev.start_date, ev.end_date, ev) }; + var titleContent = qi.querySelector(".dhx_cal_qi_tcontent"); + titleContent.innerHTML = `${header.content}`; + var titleDate = qi.querySelector(".dhx_cal_qi_tdate"); + titleDate.innerHTML = header.date; + scheduler2._waiAria.quickInfoHeader(qi, [header.content, header.date].join(" ")); + var main = qi.querySelector(".dhx_cal_qi_content"); + const mainContent = scheduler2.templates.quick_info_content(ev.start_date, ev.end_date, ev); + if (mainContent) { + main.classList.remove("dhx_hidden"); + main.innerHTML = mainContent; + } else { + main.classList.add("dhx_hidden"); } - scheduler2.map_view = function(mode) { - scheduler2.map._initialization_count++; - var gmap2 = scheduler2._els.dhx_gmap[0]; - var temp_center; - scheduler2._min_date = scheduler2.config.map_start || scheduler2._currentDate(); - scheduler2._max_date = scheduler2.config.map_end || scheduler2.date.add(scheduler2._currentDate(), 1, "year"); - scheduler2._table_view = true; - set_full_view(mode); - if (mode) { - clear_map_tab(); - fill_map_tab(); - gmap2.style.display = "block"; - _setMapSize("dhx_gmap"); - temp_center = scheduler2.map._obj.getCenter(); - var events = scheduler2.get_visible_events(); - for (var i = 0; i < events.length; i++) { - if (!scheduler2.map._markers[events[i].id]) { - showAddress(events[i]); - } - } + }; + } + function readonly(scheduler2) { + scheduler2.attachEvent("onTemplatesReady", function() { + var originalRecurringSetValue; + if (scheduler2.form_blocks.recurring) { + originalRecurringSetValue = scheduler2.form_blocks.recurring.set_value; + } + var original_left_buttons = scheduler2.config.buttons_left.slice(); + var original_right_buttons = scheduler2.config.buttons_right.slice(); + scheduler2.attachEvent("onBeforeLightbox", function(id2) { + if (this.config.readonly_form || this.getEvent(id2).readonly) { + this.config.readonly_active = true; } else { - gmap2.style.display = "none"; - } - google.maps.event.trigger(scheduler2.map._obj, "resize"); - if (scheduler2.map._initialization_count === 0 && temp_center) { - scheduler2.map._obj.setCenter(temp_center); - } - if (scheduler2._selected_event_id) { - selectEvent(scheduler2._selected_event_id); - } - }; - var selectEvent = function(event_id) { - scheduler2.map._obj.setCenter(scheduler2.map._points[event_id]); - scheduler2.callEvent("onClick", [event_id]); - }; - var showAddress = function(event2, setCenter, performClick) { - var point = scheduler2.config.map_error_position; - if (event2.lat && event2.lng) { - point = new google.maps.LatLng(event2.lat, event2.lng); - } - var message2 = scheduler2.templates.marker_text(event2.start_date, event2.end_date, event2); - if (!scheduler2._new_event) { - scheduler2.map._infowindows_content[event2.id] = message2; - if (scheduler2.map._markers[event2.id]) - scheduler2.map._markers[event2.id].setMap(null); - scheduler2.map._markers[event2.id] = scheduler2.ext.mapView.createMarker({ position: point, map: scheduler2.map._obj }); - google.maps.event.addListener(scheduler2.map._markers[event2.id], "click", function() { - scheduler2.map._infowindow.setContent(scheduler2.map._infowindows_content[event2.id]); - scheduler2.map._infowindow.open(scheduler2.map._obj, scheduler2.map._markers[event2.id]); - scheduler2._selected_event_id = event2.id; - scheduler2.render_data(); - }); - scheduler2.map._points[event2.id] = point; - if (setCenter) - scheduler2.map._obj.setCenter(scheduler2.map._points[event2.id]); - if (performClick) - scheduler2.callEvent("onClick", [event2.id]); + this.config.readonly_active = false; + scheduler2.config.buttons_left = original_left_buttons.slice(); + scheduler2.config.buttons_right = original_right_buttons.slice(); + if (scheduler2.form_blocks.recurring) { + scheduler2.form_blocks.recurring.set_value = originalRecurringSetValue; + } } - }; - scheduler2.attachEvent("onClick", function(id2, domEvent) { - if (this._mode == "map") { - scheduler2._selected_event_id = id2; - for (var i = 0; i < scheduler2._rendered.length; i++) { - scheduler2._rendered[i].className = "dhx_map_line"; - if (scheduler2._rendered[i].getAttribute(scheduler2.config.event_attribute) == id2) { - scheduler2._rendered[i].className += " highlight"; + var sns = this.config.lightbox.sections; + if (this.config.readonly_active) { + for (var i = 0; i < sns.length; i++) { + if (sns[i].type == "recurring") { + if (this.config.readonly_active && scheduler2.form_blocks.recurring) { + scheduler2.form_blocks.recurring.set_value = function(node, value, ev) { + var wrapper = scheduler2.$domHelpers.closest(node, ".dhx_wrap_section"); + var style = "none"; + wrapper.querySelector(".dhx_cal_lsection").display = style; + wrapper.querySelector(".dhx_form_repeat").display = style; + wrapper.style.display = style; + scheduler2.setLightboxSize(); + }; + } } } - if (scheduler2.map._points[id2] && scheduler2.map._markers[id2]) { - scheduler2.map._obj.setCenter(scheduler2.map._points[id2]); - google.maps.event.trigger(scheduler2.map._markers[id2], "click"); + var forbidden_buttons = ["dhx_delete_btn", "dhx_save_btn"]; + var button_arrays = [scheduler2.config.buttons_left, scheduler2.config.buttons_right]; + for (var i = 0; i < forbidden_buttons.length; i++) { + var forbidden_button = forbidden_buttons[i]; + for (var k = 0; k < button_arrays.length; k++) { + var button_array = button_arrays[k]; + var index = -1; + for (var p = 0; p < button_array.length; p++) { + if (button_array[p] == forbidden_button) { + index = p; + break; + } + } + if (index != -1) { + button_array.splice(index, 1); + } + } } } + this.resetLightbox(); return true; }); - var _displayEventOnMap = function(event2) { - const geocoder = scheduler2.ext.mapView.geocoder; - if (event2.event_location && geocoder) { - geocoder.geocode({ address: event2.event_location, language: scheduler2.uid().toString() }, function(results, status) { - var point = {}; - if (status != google.maps.GeocoderStatus.OK) { - point = scheduler2.callEvent("onLocationError", [event2.id]); - if (!point || point === true) - point = scheduler2.config.map_error_position; - } else { - point = results[0].geometry.location; - } - event2.lat = point.lat(); - event2.lng = point.lng(); - scheduler2._selected_event_id = event2.id; - scheduler2._latLngUpdate = true; - scheduler2.callEvent("onEventChanged", [event2.id, event2]); - showAddress(event2, true, true); - }); - } else { - showAddress(event2, true, true); - } - }; - var _updateEventLocation = function(event2) { - const geocoder = scheduler2.ext.mapView.geocoder; - if (event2.event_location && geocoder) { - geocoder.geocode({ address: event2.event_location, language: scheduler2.uid().toString() }, function(results, status) { - var point = {}; - if (status != google.maps.GeocoderStatus.OK) { - point = scheduler2.callEvent("onLocationError", [event2.id]); - if (!point || point === true) - point = scheduler2.config.map_error_position; - } else { - point = results[0].geometry.location; - } - event2.lat = point.lat(); - event2.lng = point.lng(); - scheduler2._latLngUpdate = true; - scheduler2.callEvent("onEventChanged", [event2.id, event2]); - }); - } - }; - var _delay = function(method, object, params, delay2) { - setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - var ret = method.apply(object, params); - method = object = params = null; - return ret; - }, delay2 || 1); - }; - scheduler2.attachEvent("onEventChanged", function(id2, event2) { - if (!this._latLngUpdate) { - var event2 = scheduler2.getEvent(id2); - if (event2.start_date < scheduler2._min_date && event2.end_date > scheduler2._min_date || event2.start_date < scheduler2._max_date && event2.end_date > scheduler2._max_date || event2.start_date.valueOf() >= scheduler2._min_date && event2.end_date.valueOf() <= scheduler2._max_date) { - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - _displayEventOnMap(event2); + function txt_replace(tag, d, n, text) { + var txts = d.getElementsByTagName(tag); + var txtt = n.getElementsByTagName(tag); + for (var i = txtt.length - 1; i >= 0; i--) { + var n = txtt[i]; + if (!text) { + n.disabled = true; + if (d.checked) + n.checked = true; } else { - scheduler2._selected_event_id = null; - scheduler2.map._infowindow.close(); - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - } - } else - this._latLngUpdate = false; - return true; - }); - scheduler2.attachEvent("onEventIdChange", function(old_event_id, new_event_id) { - var event2 = scheduler2.getEvent(new_event_id); - if (event2.start_date < scheduler2._min_date && event2.end_date > scheduler2._min_date || event2.start_date < scheduler2._max_date && event2.end_date > scheduler2._max_date || event2.start_date.valueOf() >= scheduler2._min_date && event2.end_date.valueOf() <= scheduler2._max_date) { - if (scheduler2.map._markers[old_event_id]) { - scheduler2.map._markers[old_event_id].setMap(null); - delete scheduler2.map._markers[old_event_id]; + var t = document.createElement("span"); + t.className = "dhx_text_disabled"; + t.innerHTML = text(txts[i]); + n.parentNode.insertBefore(t, n); + n.parentNode.removeChild(n); } - if (scheduler2.map._infowindows_content[old_event_id]) - delete scheduler2.map._infowindows_content[old_event_id]; - _displayEventOnMap(event2); } - return true; - }); - scheduler2.attachEvent("onEventAdded", function(id2, event2) { - if (!scheduler2._dataprocessor) { - if (event2.start_date < scheduler2._min_date && event2.end_date > scheduler2._min_date || event2.start_date < scheduler2._max_date && event2.end_date > scheduler2._max_date || event2.start_date.valueOf() >= scheduler2._min_date && event2.end_date.valueOf() <= scheduler2._max_date) { - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - _displayEventOnMap(event2); - } + } + var old = scheduler2._fill_lightbox; + scheduler2._fill_lightbox = function() { + var lb = this.getLightbox(); + if (this.config.readonly_active) { + lb.style.visibility = "hidden"; + lb.style.display = "block"; } - return true; - }); - scheduler2.attachEvent("onBeforeEventDelete", function(id2, event2) { - if (scheduler2.map._markers[id2]) { - scheduler2.map._markers[id2].setMap(null); + var res = old.apply(this, arguments); + if (this.config.readonly_active) { + lb.style.visibility = ""; + lb.style.display = "none"; } - scheduler2._selected_event_id = null; - scheduler2.map._infowindow.close(); - return true; - }); - scheduler2._event_resolve_delay = 1500; - scheduler2.attachEvent("onEventLoading", function(event2) { - if (scheduler2.config.map_resolve_event_location && event2.event_location && !event2.lat && !event2.lng) { - scheduler2._event_resolve_delay += 1500; - _delay(_updateEventLocation, this, [event2], scheduler2._event_resolve_delay); + if (this.config.readonly_active) { + var originalForm = this.getLightbox(); + var readonlyForm = this._lightbox_r = originalForm.cloneNode(true); + readonlyForm.id = scheduler2.uid(); + readonlyForm.className += " dhx_cal_light_readonly"; + txt_replace("textarea", originalForm, readonlyForm, function(a) { + return a.value; + }); + txt_replace("input", originalForm, readonlyForm, false); + txt_replace("select", originalForm, readonlyForm, function(a) { + if (!a.options.length) + return ""; + return a.options[Math.max(a.selectedIndex || 0, 0)].text; + }); + originalForm.parentNode.insertBefore(readonlyForm, originalForm); + this.showCover(readonlyForm); + if (scheduler2._lightbox) + scheduler2._lightbox.parentNode.removeChild(scheduler2._lightbox); + this._lightbox = readonlyForm; + if (scheduler2.config.drag_lightbox) + scheduler2.event(readonlyForm.firstChild, "mousedown", scheduler2._ready_to_dnd); + scheduler2._init_lightbox_events(); + this.setLightboxSize(); } - return true; - }); - scheduler2.attachEvent("onEventCancel", function(id2, is_new) { - if (is_new) { - if (scheduler2.map._markers[id2]) - scheduler2.map._markers[id2].setMap(null); - scheduler2.map._infowindow.close(); + return res; + }; + var hold = scheduler2.hide_lightbox; + scheduler2.hide_lightbox = function() { + if (this._lightbox_r) { + this._lightbox_r.parentNode.removeChild(this._lightbox_r); + this._lightbox_r = this._lightbox = null; } - return true; - }); + return hold.apply(this, arguments); + }; }); } - function minical(scheduler2) { - const minicalDomEvents = scheduler2._createDomEventScope(); - scheduler2.config.minicalendar = { mark_events: true }; - scheduler2._synced_minicalendars = []; - scheduler2.renderCalendar = function(obj, _prev, is_refresh) { - var cal = null; - var date = obj.date || scheduler2._currentDate(); - if (typeof date == "string") - date = this.templates.api_date(date); - if (!_prev) { - var cont = obj.container; - var pos = obj.position; - if (typeof cont == "string") - cont = document.getElementById(cont); - if (typeof pos == "string") - pos = document.getElementById(pos); - if (pos && (typeof pos.left == "undefined" && typeof pos.right == "undefined")) { - var tpos = scheduler2.$domHelpers.getOffset(pos); - pos = { top: tpos.top + pos.offsetHeight, left: tpos.left }; - } - if (!cont) - cont = scheduler2._get_def_cont(pos); - cal = this._render_calendar(cont, date, obj); - if (!cal.$_eventAttached) { - cal.$_eventAttached = true; - minicalDomEvents.attach(cal, "click", (function(e) { - var src = e.target || e.srcElement; - var $dom = scheduler2.$domHelpers; - if ($dom.closest(src, ".dhx_month_head")) { - if (!$dom.closest(src, ".dhx_after") && !$dom.closest(src, ".dhx_before")) { - var cellRoot = $dom.closest(src, "[data-cell-date]"); - var dateAttribute = cellRoot.getAttribute("data-cell-date"); - var newDate = scheduler2.templates.parse_date(dateAttribute); - scheduler2.unmarkCalendar(this); - scheduler2.markCalendar(this, newDate, "dhx_calendar_click"); - this._last_date = newDate; - if (this.conf.handler) - this.conf.handler.call(scheduler2, newDate, this); - } - } - }).bind(cal)); - } - } else { - cal = this._render_calendar(_prev.parentNode, date, obj, _prev); - scheduler2.unmarkCalendar(cal); + var ALL_WEEKDAYS = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"]; + var Weekday = function() { + function Weekday2(weekday, n) { + if (n === 0) + throw new Error("Can't create weekday with n == 0"); + this.weekday = weekday; + this.n = n; + } + Weekday2.fromStr = function(str) { + return new Weekday2(ALL_WEEKDAYS.indexOf(str)); + }; + Weekday2.prototype.nth = function(n) { + return this.n === n ? this : new Weekday2(this.weekday, n); + }; + Weekday2.prototype.equals = function(other) { + return this.weekday === other.weekday && this.n === other.n; + }; + Weekday2.prototype.toString = function() { + var s = ALL_WEEKDAYS[this.weekday]; + if (this.n) + s = (this.n > 0 ? "+" : "") + String(this.n) + s; + return s; + }; + Weekday2.prototype.getJsWeekday = function() { + return this.weekday === 6 ? 0 : this.weekday + 1; + }; + return Weekday2; + }(); + var isPresent = function(value) { + return value !== null && value !== void 0; + }; + var isNumber = function(value) { + return typeof value === "number"; + }; + var isWeekdayStr = function(value) { + return typeof value === "string" && ALL_WEEKDAYS.includes(value); + }; + var isArray = Array.isArray; + var range = function(start, end) { + if (end === void 0) { + end = start; + } + if (arguments.length === 1) { + end = start; + start = 0; + } + var rang = []; + for (var i = start; i < end; i++) + rang.push(i); + return rang; + }; + var repeat = function(value, times) { + var i = 0; + var array = []; + if (isArray(value)) { + for (; i < times; i++) + array[i] = [].concat(value); + } else { + for (; i < times; i++) + array[i] = value; + } + return array; + }; + var toArray = function(item) { + if (isArray(item)) { + return item; + } + return [item]; + }; + function padStart(item, targetLength, padString) { + if (padString === void 0) { + padString = " "; + } + var str = String(item); + targetLength = targetLength >> 0; + if (str.length > targetLength) { + return String(str); + } + targetLength = targetLength - str.length; + if (targetLength > padString.length) { + padString += repeat(padString, targetLength / padString.length); + } + return padString.slice(0, targetLength) + String(str); + } + var split = function(str, sep, num) { + var splits = str.split(sep); + return num ? splits.slice(0, num).concat([splits.slice(num).join(sep)]) : splits; + }; + var pymod = function(a, b) { + var r = a % b; + return r * b < 0 ? r + b : r; + }; + var divmod = function(a, b) { + return { div: Math.floor(a / b), mod: pymod(a, b) }; + }; + var empty = function(obj) { + return !isPresent(obj) || obj.length === 0; + }; + var notEmpty = function(obj) { + return !empty(obj); + }; + var includes = function(arr, val) { + return notEmpty(arr) && arr.indexOf(val) !== -1; + }; + var datetime = function(y, m, d, h, i, s) { + if (h === void 0) { + h = 0; + } + if (i === void 0) { + i = 0; + } + if (s === void 0) { + s = 0; + } + return new Date(Date.UTC(y, m - 1, d, h, i, s)); + }; + var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + var ONE_DAY = 1e3 * 60 * 60 * 24; + var MAXYEAR = 9999; + var ORDINAL_BASE = datetime(1970, 1, 1); + var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5]; + var isLeapYear = function(year) { + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; + }; + var isDate = function(value) { + return value instanceof Date; + }; + var isValidDate = function(value) { + return isDate(value) && !isNaN(value.getTime()); + }; + var daysBetween = function(date1, date2) { + var date1ms = date1.getTime(); + var date2ms = date2.getTime(); + var differencems = date1ms - date2ms; + return Math.round(differencems / ONE_DAY); + }; + var toOrdinal = function(date) { + return daysBetween(date, ORDINAL_BASE); + }; + var fromOrdinal = function(ordinal) { + return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY); + }; + var getMonthDays = function(date) { + var month = date.getUTCMonth(); + return month === 1 && isLeapYear(date.getUTCFullYear()) ? 29 : MONTH_DAYS[month]; + }; + var getWeekday = function(date) { + return PY_WEEKDAYS[date.getUTCDay()]; + }; + var monthRange = function(year, month) { + var date = datetime(year, month + 1, 1); + return [getWeekday(date), getMonthDays(date)]; + }; + var combine = function(date, time) { + time = time || date; + return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds())); + }; + var clone = function(date) { + var dolly = new Date(date.getTime()); + return dolly; + }; + var cloneDates = function(dates) { + var clones = []; + for (var i = 0; i < dates.length; i++) { + clones.push(clone(dates[i])); + } + return clones; + }; + var sort = function(dates) { + dates.sort(function(a, b) { + return a.getTime() - b.getTime(); + }); + }; + var timeToUntilString = function(time, utc) { + if (utc === void 0) { + utc = true; + } + var date = new Date(time); + return [padStart(date.getUTCFullYear().toString(), 4, "0"), padStart(date.getUTCMonth() + 1, 2, "0"), padStart(date.getUTCDate(), 2, "0"), "T", padStart(date.getUTCHours(), 2, "0"), padStart(date.getUTCMinutes(), 2, "0"), padStart(date.getUTCSeconds(), 2, "0"), utc ? "Z" : ""].join(""); + }; + var untilStringToDate = function(until) { + var re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/; + var bits = re.exec(until); + if (!bits) + throw new Error("Invalid UNTIL value: ".concat(until)); + return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0)); + }; + var dateTZtoISO8601 = function(date, timeZone) { + var dateStr = date.toLocaleString("sv-SE", { timeZone }); + return dateStr.replace(" ", "T") + "Z"; + }; + var dateInTimeZone = function(date, timeZone) { + var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; + var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone)); + var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : "UTC")); + var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime(); + return new Date(date.getTime() - tzOffset); + }; + var IterResult = function() { + function IterResult2(method, args) { + this.minDate = null; + this.maxDate = null; + this._result = []; + this.total = 0; + this.method = method; + this.args = args; + if (method === "between") { + this.maxDate = args.inc ? args.before : new Date(args.before.getTime() - 1); + this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1); + } else if (method === "before") { + this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1); + } else if (method === "after") { + this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1); } - if (scheduler2.config.minicalendar.mark_events) { - var start = scheduler2.date.month_start(date); - var end = scheduler2.date.add(start, 1, "month"); - var evs = this.getEvents(start, end); - var filter = this["filter_" + this._mode]; - var markedDates = {}; - for (var i = 0; i < evs.length; i++) { - var ev = evs[i]; - if (filter && !filter(ev.id, ev)) - continue; - var d = ev.start_date; - if (d.valueOf() < start.valueOf()) - d = start; - d = scheduler2.date.date_part(new Date(d.valueOf())); - while (d < ev.end_date) { - if (!markedDates[+d]) { - markedDates[+d] = true; - this.markCalendar(cal, d, "dhx_year_event"); - } - d = this.date.add(d, 1, "day"); - if (d.valueOf() >= end.valueOf()) - break; - } - } + } + IterResult2.prototype.accept = function(date) { + ++this.total; + var tooEarly = this.minDate && date < this.minDate; + var tooLate = this.maxDate && date > this.maxDate; + if (this.method === "between") { + if (tooEarly) + return true; + if (tooLate) + return false; + } else if (this.method === "before") { + if (tooLate) + return false; + } else if (this.method === "after") { + if (tooEarly) + return true; + this.add(date); + return false; + } + return this.add(date); + }; + IterResult2.prototype.add = function(date) { + this._result.push(date); + return true; + }; + IterResult2.prototype.getValue = function() { + var res = this._result; + switch (this.method) { + case "all": + case "between": + return res; + case "before": + case "after": + default: + return res.length ? res[res.length - 1] : null; + } + }; + IterResult2.prototype.clone = function() { + return new IterResult2(this.method, this.args); + }; + return IterResult2; + }(); + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) + if (Object.prototype.hasOwnProperty.call(b2, p)) + d2[p] = b2[p]; + }; + return extendStatics(d, b); + }; + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + var __assign = function() { + __assign = Object.assign || function __assign2(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; } - this._markCalendarCurrentDate(cal); - cal.conf = obj; - if (obj.sync && !is_refresh) - this._synced_minicalendars.push(cal); - if (!cal.conf._on_xle_handler) { - cal.conf._on_xle_handler = scheduler2.attachEvent("onXLE", function refreshOnLoad() { - scheduler2.updateCalendar(cal, cal.conf.date); - }); + return t; + }; + return __assign.apply(this, arguments); + }; + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar2; i < l; i++) { + if (ar2 || !(i in from)) { + if (!ar2) + ar2 = Array.prototype.slice.call(from, 0, i); + ar2[i] = from[i]; + } } - if (this.config.wai_aria_attributes && this.config.wai_aria_application_role) { - cal.setAttribute("role", "application"); + return to.concat(ar2 || Array.prototype.slice.call(from)); + } + typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message2) { + var e = new Error(message2); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + var CallbackIterResult = function(_super) { + __extends(CallbackIterResult2, _super); + function CallbackIterResult2(method, args, iterator) { + var _this = _super.call(this, method, args) || this; + _this.iterator = iterator; + return _this; + } + CallbackIterResult2.prototype.add = function(date) { + if (this.iterator(date, this._result.length)) { + this._result.push(date); + return true; } - return cal; + return false; }; - scheduler2._get_def_cont = function(pos) { - if (!this._def_count) { - this._def_count = document.createElement("div"); - this._def_count.className = "dhx_minical_popup"; - scheduler2.event(this._def_count, "click", function(e) { - e.cancelBubble = true; + return CallbackIterResult2; + }(IterResult); + var ENGLISH = { dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], tokens: { SKIP: /^[ \r\n\t]+|^\.$/, number: /^[1-9][0-9]*/, numberAsText: /^(one|two|three)/i, every: /^every/i, "day(s)": /^days?/i, "weekday(s)": /^weekdays?/i, "week(s)": /^weeks?/i, "hour(s)": /^hours?/i, "minute(s)": /^minutes?/i, "month(s)": /^months?/i, "year(s)": /^years?/i, on: /^(on|in)/i, at: /^(at)/i, the: /^the/i, first: /^first/i, second: /^second/i, third: /^third/i, nth: /^([1-9][0-9]*)(\.|th|nd|rd|st)/i, last: /^last/i, for: /^for/i, "time(s)": /^times?/i, until: /^(un)?til/i, monday: /^mo(n(day)?)?/i, tuesday: /^tu(e(s(day)?)?)?/i, wednesday: /^we(d(n(esday)?)?)?/i, thursday: /^th(u(r(sday)?)?)?/i, friday: /^fr(i(day)?)?/i, saturday: /^sa(t(urday)?)?/i, sunday: /^su(n(day)?)?/i, january: /^jan(uary)?/i, february: /^feb(ruary)?/i, march: /^mar(ch)?/i, april: /^apr(il)?/i, may: /^may/i, june: /^june?/i, july: /^july?/i, august: /^aug(ust)?/i, september: /^sep(t(ember)?)?/i, october: /^oct(ober)?/i, november: /^nov(ember)?/i, december: /^dec(ember)?/i, comma: /^(,\s*|(and|or)\s*)+/i } }; + var contains = function(arr, val) { + return arr.indexOf(val) !== -1; + }; + var defaultGetText = function(id2) { + return id2.toString(); + }; + var defaultDateFormatter = function(year, month, day) { + return "".concat(month, " ").concat(day, ", ").concat(year); + }; + var ToText = function() { + function ToText2(rrule, gettext, language, dateFormatter) { + if (gettext === void 0) { + gettext = defaultGetText; + } + if (language === void 0) { + language = ENGLISH; + } + if (dateFormatter === void 0) { + dateFormatter = defaultDateFormatter; + } + this.text = []; + this.language = language || ENGLISH; + this.gettext = gettext; + this.dateFormatter = dateFormatter; + this.rrule = rrule; + this.options = rrule.options; + this.origOptions = rrule.origOptions; + if (this.origOptions.bymonthday) { + var bymonthday = [].concat(this.options.bymonthday); + var bynmonthday = [].concat(this.options.bynmonthday); + bymonthday.sort(function(a, b) { + return a - b; }); - document.body.appendChild(this._def_count); + bynmonthday.sort(function(a, b) { + return b - a; + }); + this.bymonthday = bymonthday.concat(bynmonthday); + if (!this.bymonthday.length) + this.bymonthday = null; + } + if (isPresent(this.origOptions.byweekday)) { + var byweekday = !isArray(this.origOptions.byweekday) ? [this.origOptions.byweekday] : this.origOptions.byweekday; + var days = String(byweekday); + this.byweekday = { allWeeks: byweekday.filter(function(weekday) { + return !weekday.n; + }), someWeeks: byweekday.filter(function(weekday) { + return Boolean(weekday.n); + }), isWeekdays: days.indexOf("MO") !== -1 && days.indexOf("TU") !== -1 && days.indexOf("WE") !== -1 && days.indexOf("TH") !== -1 && days.indexOf("FR") !== -1 && days.indexOf("SA") === -1 && days.indexOf("SU") === -1, isEveryDay: days.indexOf("MO") !== -1 && days.indexOf("TU") !== -1 && days.indexOf("WE") !== -1 && days.indexOf("TH") !== -1 && days.indexOf("FR") !== -1 && days.indexOf("SA") !== -1 && days.indexOf("SU") !== -1 }; + var sortWeekDays = function(a, b) { + return a.weekday - b.weekday; + }; + this.byweekday.allWeeks.sort(sortWeekDays); + this.byweekday.someWeeks.sort(sortWeekDays); + if (!this.byweekday.allWeeks.length) + this.byweekday.allWeeks = null; + if (!this.byweekday.someWeeks.length) + this.byweekday.someWeeks = null; + } else { + this.byweekday = null; } - if (pos.left) { - this._def_count.style.left = pos.left + "px"; + } + ToText2.isFullyConvertible = function(rrule) { + var canConvert = true; + if (!(rrule.options.freq in ToText2.IMPLEMENTED)) + return false; + if (rrule.origOptions.until && rrule.origOptions.count) + return false; + for (var key in rrule.origOptions) { + if (contains(["dtstart", "tzid", "wkst", "freq"], key)) + return true; + if (!contains(ToText2.IMPLEMENTED[rrule.options.freq], key)) + return false; } - if (pos.right) { - this._def_count.style.right = pos.right + "px"; + return canConvert; + }; + ToText2.prototype.isFullyConvertible = function() { + return ToText2.isFullyConvertible(this.rrule); + }; + ToText2.prototype.toString = function() { + var gettext = this.gettext; + if (!(this.options.freq in ToText2.IMPLEMENTED)) { + return gettext("RRule error: Unable to fully convert this rrule to text"); + } + this.text = [gettext("every")]; + this[RRule.FREQUENCIES[this.options.freq]](); + if (this.options.until) { + this.add(gettext("until")); + var until = this.options.until; + this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate())); + } else if (this.options.count) { + this.add(gettext("for")).add(this.options.count.toString()).add(this.plural(this.options.count) ? gettext("times") : gettext("time")); + } + if (!this.isFullyConvertible()) + this.add(gettext("(~ approximate)")); + return this.text.join(""); + }; + ToText2.prototype.HOURLY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) + this.add(this.options.interval.toString()); + this.add(this.plural(this.options.interval) ? gettext("hours") : gettext("hour")); + }; + ToText2.prototype.MINUTELY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) + this.add(this.options.interval.toString()); + this.add(this.plural(this.options.interval) ? gettext("minutes") : gettext("minute")); + }; + ToText2.prototype.DAILY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) + this.add(this.options.interval.toString()); + if (this.byweekday && this.byweekday.isWeekdays) { + this.add(this.plural(this.options.interval) ? gettext("weekdays") : gettext("weekday")); + } else { + this.add(this.plural(this.options.interval) ? gettext("days") : gettext("day")); } - if (pos.top) { - this._def_count.style.top = pos.top + "px"; + if (this.origOptions.bymonth) { + this.add(gettext("in")); + this._bymonth(); } - if (pos.bottom) { - this._def_count.style.bottom = pos.bottom + "px"; + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday) { + this._byweekday(); + } else if (this.origOptions.byhour) { + this._byhour(); } - this._def_count._created = /* @__PURE__ */ new Date(); - return this._def_count; }; - scheduler2._locateCalendar = function(cal, date) { - if (typeof date == "string") - date = scheduler2.templates.api_date(date); - if (+date > +cal._max_date || +date < +cal._min_date) - return null; - var table = cal.querySelector(".dhx_year_body").childNodes[0]; - var weekNum = 0; - var dat = new Date(cal._min_date); - while (+this.date.add(dat, 1, "week") <= +date) { - dat = this.date.add(dat, 1, "week"); - weekNum++; + ToText2.prototype.WEEKLY = function() { + var gettext = this.gettext; + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext("weeks") : gettext("week")); } - var sm = scheduler2.config.start_on_monday; - var day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0); - const dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`); - if (dayCell) { - return dayCell.firstChild; + if (this.byweekday && this.byweekday.isWeekdays) { + if (this.options.interval === 1) { + this.add(this.plural(this.options.interval) ? gettext("weekdays") : gettext("weekday")); + } else { + this.add(gettext("on")).add(gettext("weekdays")); + } + } else if (this.byweekday && this.byweekday.isEveryDay) { + this.add(this.plural(this.options.interval) ? gettext("days") : gettext("day")); } else { - return null; + if (this.options.interval === 1) + this.add(gettext("week")); + if (this.origOptions.bymonth) { + this.add(gettext("in")); + this._bymonth(); + } + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday) { + this._byweekday(); + } + if (this.origOptions.byhour) { + this._byhour(); + } } }; - scheduler2.markCalendar = function(cal, date, css) { - var div = this._locateCalendar(cal, date); - if (!div) - return; - div.className += " " + css; + ToText2.prototype.MONTHLY = function() { + var gettext = this.gettext; + if (this.origOptions.bymonth) { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()).add(gettext("months")); + if (this.plural(this.options.interval)) + this.add(gettext("in")); + } + this._bymonth(); + } else { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()); + } + this.add(this.plural(this.options.interval) ? gettext("months") : gettext("month")); + } + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday && this.byweekday.isWeekdays) { + this.add(gettext("on")).add(gettext("weekdays")); + } else if (this.byweekday) { + this._byweekday(); + } }; - scheduler2.unmarkCalendar = function(cal, date, css) { - date = date || cal._last_date; - css = css || "dhx_calendar_click"; - if (!date) - return; - var el2 = this._locateCalendar(cal, date); - if (!el2) - return; - el2.className = (el2.className || "").replace(RegExp(css, "g")); + ToText2.prototype.YEARLY = function() { + var gettext = this.gettext; + if (this.origOptions.bymonth) { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()); + this.add(gettext("years")); + } + this._bymonth(); + } else { + if (this.options.interval !== 1) { + this.add(this.options.interval.toString()); + } + this.add(this.plural(this.options.interval) ? gettext("years") : gettext("year")); + } + if (this.bymonthday) { + this._bymonthday(); + } else if (this.byweekday) { + this._byweekday(); + } + if (this.options.byyearday) { + this.add(gettext("on the")).add(this.list(this.options.byyearday, this.nth, gettext("and"))).add(gettext("day")); + } + if (this.options.byweekno) { + this.add(gettext("in")).add(this.plural(this.options.byweekno.length) ? gettext("weeks") : gettext("week")).add(this.list(this.options.byweekno, void 0, gettext("and"))); + } }; - scheduler2._week_template = function(width) { - var summ = width || 250; - var left = 0; - var week_template = document.createElement("div"); - var dummy_date = this.date.week_start(scheduler2._currentDate()); - for (var i = 0; i < 7; i++) { - this._cols[i] = Math.floor(summ / (7 - i)); - this._render_x_header(i, left, dummy_date, week_template); - dummy_date = this.date.add(dummy_date, 1, "day"); - summ -= this._cols[i]; - left += this._cols[i]; + ToText2.prototype._bymonthday = function() { + var gettext = this.gettext; + if (this.byweekday && this.byweekday.allWeeks) { + this.add(gettext("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext("or"))).add(gettext("the")).add(this.list(this.bymonthday, this.nth, gettext("or"))); + } else { + this.add(gettext("on the")).add(this.list(this.bymonthday, this.nth, gettext("and"))); + } + }; + ToText2.prototype._byweekday = function() { + var gettext = this.gettext; + if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) { + this.add(gettext("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext)); + } + if (this.byweekday.someWeeks) { + if (this.byweekday.allWeeks) + this.add(gettext("and")); + this.add(gettext("on the")).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext("and"))); + } + }; + ToText2.prototype._byhour = function() { + var gettext = this.gettext; + this.add(gettext("at")).add(this.list(this.origOptions.byhour, void 0, gettext("and"))); + }; + ToText2.prototype._bymonth = function() { + this.add(this.list(this.options.bymonth, this.monthtext, this.gettext("and"))); + }; + ToText2.prototype.nth = function(n) { + n = parseInt(n.toString(), 10); + var nth; + var gettext = this.gettext; + if (n === -1) + return gettext("last"); + var npos = Math.abs(n); + switch (npos) { + case 1: + case 21: + case 31: + nth = npos + gettext("st"); + break; + case 2: + case 22: + nth = npos + gettext("nd"); + break; + case 3: + case 23: + nth = npos + gettext("rd"); + break; + default: + nth = npos + gettext("th"); } - week_template.lastChild.className += " dhx_scale_bar_last"; - return week_template; + return n < 0 ? nth + " " + gettext("last") : nth; }; - scheduler2.updateCalendar = function(obj, sd) { - obj.conf.date = sd; - this.renderCalendar(obj.conf, obj, true); + ToText2.prototype.monthtext = function(m) { + return this.language.monthNames[m - 1]; }; - scheduler2._mini_cal_arrows = [" ", " "]; - scheduler2._render_calendar = function(obj, sd, conf, previous) { - var ts = scheduler2.templates; - var temp = this._cols; - this._cols = []; - var temp2 = this._mode; - this._mode = "calendar"; - var temp3 = this._colsS; - this._colsS = { height: 0 }; - var temp4 = new Date(this._min_date); - var temp5 = new Date(this._max_date); - var temp6 = new Date(scheduler2._date); - var temp7 = ts.month_day; - var temp8 = this._ignores_detected; - this._ignores_detected = 0; - ts.month_day = ts.calendar_date; - sd = this.date.month_start(sd); - var week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding); - var d; - if (previous) { - d = previous; + ToText2.prototype.weekdaytext = function(wday) { + var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday(); + return (wday.n ? this.nth(wday.n) + " " : "") + this.language.dayNames[weekday]; + }; + ToText2.prototype.plural = function(n) { + return n % 100 !== 1; + }; + ToText2.prototype.add = function(s) { + this.text.push(" "); + this.text.push(s); + return this; + }; + ToText2.prototype.list = function(arr, callback, finalDelim, delim) { + var _this = this; + if (delim === void 0) { + delim = ","; + } + if (!isArray(arr)) { + arr = [arr]; + } + var delimJoin = function(array, delimiter, finalDelimiter) { + var list = ""; + for (var i = 0; i < array.length; i++) { + if (i !== 0) { + if (i === array.length - 1) { + list += " " + finalDelimiter + " "; + } else { + list += delimiter + " "; + } + } + list += array[i]; + } + return list; + }; + callback = callback || function(o) { + return o.toString(); + }; + var realCallback = function(arg) { + return callback && callback.call(_this, arg); + }; + if (finalDelim) { + return delimJoin(arr.map(realCallback), delim, finalDelim); } else { - d = document.createElement("div"); - d.className = "dhx_cal_container dhx_mini_calendar"; + return arr.map(realCallback).join(delim + " "); } - d.setAttribute("date", this._helpers.formatDate(sd)); - d.innerHTML = "
" : "'>") + "
" + (week_template ? week_template.innerHTML : "") + "
"; - var header = d.querySelector(".dhx_year_month"); - var weekHeader = d.querySelector(".dhx_year_week"); - var body = d.querySelector(".dhx_year_body"); - header.innerHTML = this.templates.calendar_month(sd); - if (conf.navigation) { - var move_minicalendar_date = function(calendar, diff) { - var date = scheduler2.date.add(calendar._date, diff, "month"); - scheduler2.updateCalendar(calendar, date); - if (scheduler2._date.getMonth() == calendar._date.getMonth() && scheduler2._date.getFullYear() == calendar._date.getFullYear()) { - scheduler2._markCalendarCurrentDate(calendar); + }; + return ToText2; + }(); + var Parser = function() { + function Parser2(rules) { + this.done = true; + this.rules = rules; + } + Parser2.prototype.start = function(text) { + this.text = text; + this.done = false; + return this.nextSymbol(); + }; + Parser2.prototype.isDone = function() { + return this.done && this.symbol === null; + }; + Parser2.prototype.nextSymbol = function() { + var best; + var bestSymbol; + this.symbol = null; + this.value = null; + do { + if (this.done) + return false; + var rule = void 0; + best = null; + for (var name_1 in this.rules) { + rule = this.rules[name_1]; + var match = rule.exec(this.text); + if (match) { + if (best === null || match[0].length > best[0].length) { + best = match; + bestSymbol = name_1; + } } - }; - var css_classnames = ["dhx_cal_prev_button", "dhx_cal_next_button"]; - var css_texts = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"]; - var diffs = [-1, 1]; - var handler = function(diff) { - return function() { - if (conf.sync) { - var calendars = scheduler2._synced_minicalendars; - for (var k = 0; k < calendars.length; k++) { - move_minicalendar_date(calendars[k], diff); - } - } else { - if (scheduler2.config.rtl) { - diff = -diff; - } - move_minicalendar_date(d, diff); + } + if (best != null) { + this.text = this.text.substr(best[0].length); + if (this.text === "") + this.done = true; + } + if (best == null) { + this.done = true; + this.symbol = null; + this.value = null; + return; + } + } while (bestSymbol === "SKIP"); + this.symbol = bestSymbol; + this.value = best; + return true; + }; + Parser2.prototype.accept = function(name) { + if (this.symbol === name) { + if (this.value) { + var v = this.value; + this.nextSymbol(); + return v; + } + this.nextSymbol(); + return true; + } + return false; + }; + Parser2.prototype.acceptNumber = function() { + return this.accept("number"); + }; + Parser2.prototype.expect = function(name) { + if (this.accept(name)) + return true; + throw new Error("expected " + name + " but found " + this.symbol); + }; + return Parser2; + }(); + function parseText(text, language) { + if (language === void 0) { + language = ENGLISH; + } + var options = {}; + var ttr = new Parser(language.tokens); + if (!ttr.start(text)) + return null; + S(); + return options; + function S() { + ttr.expect("every"); + var n = ttr.acceptNumber(); + if (n) + options.interval = parseInt(n[0], 10); + if (ttr.isDone()) + throw new Error("Unexpected end"); + switch (ttr.symbol) { + case "day(s)": + options.freq = RRule.DAILY; + if (ttr.nextSymbol()) { + AT(); + F(); + } + break; + case "weekday(s)": + options.freq = RRule.WEEKLY; + options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR]; + ttr.nextSymbol(); + AT(); + F(); + break; + case "week(s)": + options.freq = RRule.WEEKLY; + if (ttr.nextSymbol()) { + ON(); + AT(); + F(); + } + break; + case "hour(s)": + options.freq = RRule.HOURLY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "minute(s)": + options.freq = RRule.MINUTELY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "month(s)": + options.freq = RRule.MONTHLY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "year(s)": + options.freq = RRule.YEARLY; + if (ttr.nextSymbol()) { + ON(); + F(); + } + break; + case "monday": + case "tuesday": + case "wednesday": + case "thursday": + case "friday": + case "saturday": + case "sunday": + options.freq = RRule.WEEKLY; + var key = ttr.symbol.substr(0, 2).toUpperCase(); + options.byweekday = [RRule[key]]; + if (!ttr.nextSymbol()) + return; + while (ttr.accept("comma")) { + if (ttr.isDone()) + throw new Error("Unexpected end"); + var wkd = decodeWKD(); + if (!wkd) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected weekday"); } - }; - }; - var labels = [scheduler2.locale.labels.prev, scheduler2.locale.labels.next]; - for (var j = 0; j < 2; j++) { - var arrow = document.createElement("div"); - arrow.className = css_classnames[j]; - scheduler2._waiAria.headerButtonsAttributes(arrow, labels[j]); - arrow.style.cssText = css_texts[j]; - arrow.innerHTML = this._mini_cal_arrows[j]; - header.appendChild(arrow); - minicalDomEvents.attach(arrow, "click", handler(diffs[j])); + options.byweekday.push(RRule[wkd]); + ttr.nextSymbol(); + } + AT(); + MDAYs(); + F(); + break; + case "january": + case "february": + case "march": + case "april": + case "may": + case "june": + case "july": + case "august": + case "september": + case "october": + case "november": + case "december": + options.freq = RRule.YEARLY; + options.bymonth = [decodeM()]; + if (!ttr.nextSymbol()) + return; + while (ttr.accept("comma")) { + if (ttr.isDone()) + throw new Error("Unexpected end"); + var m = decodeM(); + if (!m) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected month"); + } + options.bymonth.push(m); + ttr.nextSymbol(); + } + ON(); + F(); + break; + default: + throw new Error("Unknown symbol"); + } + } + function ON() { + var on = ttr.accept("on"); + var the = ttr.accept("the"); + if (!(on || the)) + return; + do { + var nth = decodeNTH(); + var wkd = decodeWKD(); + var m = decodeM(); + if (nth) { + if (wkd) { + ttr.nextSymbol(); + if (!options.byweekday) + options.byweekday = []; + options.byweekday.push(RRule[wkd].nth(nth)); + } else { + if (!options.bymonthday) + options.bymonthday = []; + options.bymonthday.push(nth); + ttr.accept("day(s)"); + } + } else if (wkd) { + ttr.nextSymbol(); + if (!options.byweekday) + options.byweekday = []; + options.byweekday.push(RRule[wkd]); + } else if (ttr.symbol === "weekday(s)") { + ttr.nextSymbol(); + if (!options.byweekday) { + options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR]; + } + } else if (ttr.symbol === "week(s)") { + ttr.nextSymbol(); + var n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected week number"); + } + options.byweekno = [parseInt(n[0], 10)]; + while (ttr.accept("comma")) { + n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + "; expected monthday"); + } + options.byweekno.push(parseInt(n[0], 10)); + } + } else if (m) { + ttr.nextSymbol(); + if (!options.bymonth) + options.bymonth = []; + options.bymonth.push(m); + } else { + return; + } + } while (ttr.accept("comma") || ttr.accept("the") || ttr.accept("on")); + } + function AT() { + var at = ttr.accept("at"); + if (!at) + return; + do { + var n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + ", expected hour"); + } + options.byhour = [parseInt(n[0], 10)]; + while (ttr.accept("comma")) { + n = ttr.acceptNumber(); + if (!n) { + throw new Error("Unexpected symbol " + ttr.symbol + "; expected hour"); + } + options.byhour.push(parseInt(n[0], 10)); + } + } while (ttr.accept("comma") || ttr.accept("at")); + } + function decodeM() { + switch (ttr.symbol) { + case "january": + return 1; + case "february": + return 2; + case "march": + return 3; + case "april": + return 4; + case "may": + return 5; + case "june": + return 6; + case "july": + return 7; + case "august": + return 8; + case "september": + return 9; + case "october": + return 10; + case "november": + return 11; + case "december": + return 12; + default: + return false; + } + } + function decodeWKD() { + switch (ttr.symbol) { + case "monday": + case "tuesday": + case "wednesday": + case "thursday": + case "friday": + case "saturday": + case "sunday": + return ttr.symbol.substr(0, 2).toUpperCase(); + default: + return false; + } + } + function decodeNTH() { + switch (ttr.symbol) { + case "last": + ttr.nextSymbol(); + return -1; + case "first": + ttr.nextSymbol(); + return 1; + case "second": + ttr.nextSymbol(); + return ttr.accept("last") ? -2 : 2; + case "third": + ttr.nextSymbol(); + return ttr.accept("last") ? -3 : 3; + case "nth": + var v = parseInt(ttr.value[1], 10); + if (v < -366 || v > 366) + throw new Error("Nth out of range: " + v); + ttr.nextSymbol(); + return ttr.accept("last") ? -v : v; + default: + return false; + } + } + function MDAYs() { + ttr.accept("on"); + ttr.accept("the"); + var nth = decodeNTH(); + if (!nth) + return; + options.bymonthday = [nth]; + ttr.nextSymbol(); + while (ttr.accept("comma")) { + nth = decodeNTH(); + if (!nth) { + throw new Error("Unexpected symbol " + ttr.symbol + "; expected monthday"); } + options.bymonthday.push(nth); + ttr.nextSymbol(); } - d._date = new Date(sd); - d.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7; - var dd = d._min_date = this.date.week_start(sd); - d._max_date = this.date.add(d._min_date, 6, "week"); - this._reset_month_scale(body, sd, dd, 6); - if (!previous) - obj.appendChild(d); - weekHeader.style.height = weekHeader.childNodes[0].offsetHeight - 1 + "px"; - var headerId = scheduler2.uid(); - scheduler2._waiAria.minicalHeader(header, headerId); - scheduler2._waiAria.minicalGrid(d.querySelector(".dhx_year_grid"), headerId); - scheduler2._waiAria.minicalRow(weekHeader); - var dayHeaders = weekHeader.querySelectorAll(".dhx_scale_bar"); - for (var i = 0; i < dayHeaders.length; i++) { - scheduler2._waiAria.minicalHeadCell(dayHeaders[i]); + } + function F() { + if (ttr.symbol === "until") { + var date = Date.parse(ttr.text); + if (!date) + throw new Error("Cannot parse until date:" + ttr.text); + options.until = new Date(date); + } else if (ttr.accept("for")) { + options.count = parseInt(ttr.value[0], 10); + ttr.expect("number"); } - var dayCells = body.querySelectorAll(".dhx_cal_month_cell"); - var firstDate = new Date(dd); - for (var i = 0; i < dayCells.length; i++) { - scheduler2._waiAria.minicalDayCell(dayCells[i], new Date(firstDate)); - firstDate = scheduler2.date.add(firstDate, 1, "day"); + } + } + var Frequency; + (function(Frequency2) { + Frequency2[Frequency2["YEARLY"] = 0] = "YEARLY"; + Frequency2[Frequency2["MONTHLY"] = 1] = "MONTHLY"; + Frequency2[Frequency2["WEEKLY"] = 2] = "WEEKLY"; + Frequency2[Frequency2["DAILY"] = 3] = "DAILY"; + Frequency2[Frequency2["HOURLY"] = 4] = "HOURLY"; + Frequency2[Frequency2["MINUTELY"] = 5] = "MINUTELY"; + Frequency2[Frequency2["SECONDLY"] = 6] = "SECONDLY"; + })(Frequency || (Frequency = {})); + function freqIsDailyOrGreater(freq) { + return freq < Frequency.HOURLY; + } + var fromText = function(text, language) { + if (language === void 0) { + language = ENGLISH; + } + return new RRule(parseText(text, language) || void 0); + }; + var common = ["count", "until", "interval", "byweekday", "bymonthday", "bymonth"]; + ToText.IMPLEMENTED = []; + ToText.IMPLEMENTED[Frequency.HOURLY] = common; + ToText.IMPLEMENTED[Frequency.MINUTELY] = common; + ToText.IMPLEMENTED[Frequency.DAILY] = ["byhour"].concat(common); + ToText.IMPLEMENTED[Frequency.WEEKLY] = common; + ToText.IMPLEMENTED[Frequency.MONTHLY] = common; + ToText.IMPLEMENTED[Frequency.YEARLY] = ["byweekno", "byyearday"].concat(common); + var toText = function(rrule, gettext, language, dateFormatter) { + return new ToText(rrule, gettext, language, dateFormatter).toString(); + }; + var isFullyConvertible = ToText.isFullyConvertible; + var Time = function() { + function Time2(hour, minute, second, millisecond) { + this.hour = hour; + this.minute = minute; + this.second = second; + this.millisecond = millisecond || 0; + } + Time2.prototype.getHours = function() { + return this.hour; + }; + Time2.prototype.getMinutes = function() { + return this.minute; + }; + Time2.prototype.getSeconds = function() { + return this.second; + }; + Time2.prototype.getMilliseconds = function() { + return this.millisecond; + }; + Time2.prototype.getTime = function() { + return (this.hour * 60 * 60 + this.minute * 60 + this.second) * 1e3 + this.millisecond; + }; + return Time2; + }(); + var DateTime = function(_super) { + __extends(DateTime2, _super); + function DateTime2(year, month, day, hour, minute, second, millisecond) { + var _this = _super.call(this, hour, minute, second, millisecond) || this; + _this.year = year; + _this.month = month; + _this.day = day; + return _this; + } + DateTime2.fromDate = function(date) { + return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1e3); + }; + DateTime2.prototype.getWeekday = function() { + return getWeekday(new Date(this.getTime())); + }; + DateTime2.prototype.getTime = function() { + return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime(); + }; + DateTime2.prototype.getDay = function() { + return this.day; + }; + DateTime2.prototype.getMonth = function() { + return this.month; + }; + DateTime2.prototype.getYear = function() { + return this.year; + }; + DateTime2.prototype.addYears = function(years) { + this.year += years; + }; + DateTime2.prototype.addMonths = function(months) { + this.month += months; + if (this.month > 12) { + var yearDiv = Math.floor(this.month / 12); + var monthMod = pymod(this.month, 12); + this.month = monthMod; + this.year += yearDiv; + if (this.month === 0) { + this.month = 12; + --this.year; + } } - scheduler2._waiAria.minicalHeader(header, headerId); - this._cols = temp; - this._mode = temp2; - this._colsS = temp3; - this._min_date = temp4; - this._max_date = temp5; - scheduler2._date = temp6; - ts.month_day = temp7; - this._ignores_detected = temp8; - return d; }; - scheduler2.destroyCalendar = function(cal, force) { - if (!cal && this._def_count && this._def_count.firstChild) { - if (force || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) - cal = this._def_count.firstChild; + DateTime2.prototype.addWeekly = function(days, wkst) { + if (wkst > this.getWeekday()) { + this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7; + } else { + this.day += -(this.getWeekday() - wkst) + days * 7; } - if (!cal) - return; - minicalDomEvents.detachAll(); - cal.innerHTML = ""; - if (cal.parentNode) - cal.parentNode.removeChild(cal); - if (this._def_count) - this._def_count.style.top = "-1000px"; - if (cal.conf && cal.conf._on_xle_handler) - scheduler2.detachEvent(cal.conf._on_xle_handler); + this.fixDay(); }; - scheduler2.isCalendarVisible = function() { - if (this._def_count && parseInt(this._def_count.style.top, 10) > 0) - return this._def_count; - return false; + DateTime2.prototype.addDaily = function(days) { + this.day += days; + this.fixDay(); }; - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.event(document.body, "click", function() { - scheduler2.destroyCalendar(); - }); - }, { once: true }); - scheduler2.form_blocks.calendar_time = { render: function(sns) { - var html = ""; - var cfg = scheduler2.config; - var dt = this.date.date_part(scheduler2._currentDate()); - var last = 24 * 60, first = 0; - if (cfg.limit_time_select) { - first = 60 * cfg.first_hour; - last = 60 * cfg.last_hour + 1; + DateTime2.prototype.addHours = function(hours, filtered, byhour) { + if (filtered) { + this.hour += Math.floor((23 - this.hour) / hours) * hours; } - dt.setHours(first / 60); - sns._time_values = []; - html += " "; - return "
" + html + "  –  " + html + "
"; - }, set_value: function(node, value, ev, config) { - var inputs = node.getElementsByTagName("input"); - var selects = node.getElementsByTagName("select"); - var start_date, end_date; - var _init_once = function(inp, date, number) { - scheduler2.event(inp, "click", function() { - scheduler2.destroyCalendar(null, true); - scheduler2.renderCalendar({ position: inp, date: new Date(this._date), navigation: true, handler: function(new_date) { - inp.value = scheduler2.templates.calendar_time(new_date); - inp._date = new Date(new_date); - scheduler2.destroyCalendar(); - if (scheduler2.config.event_duration && scheduler2.config.auto_end_date && number === 0) { - _update_minical_select(); - } - } }); - }); - }; - if (scheduler2.config.full_day) { - if (!node._full_day) { - var html = ""; - if (!scheduler2.config.wide_form) - html = node.previousSibling.innerHTML + html; - node.previousSibling.innerHTML = html; - node._full_day = true; + }; + DateTime2.prototype.addMinutes = function(minutes, filtered, byhour, byminute) { + if (filtered) { + this.minute += Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes; + } + for (; ; ) { + this.minute += minutes; + var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod; + if (hourDiv) { + this.minute = minuteMod; + this.addHours(hourDiv, false, byhour); } - var input = node.previousSibling.getElementsByTagName("input")[0]; - var isFulldayEvent = scheduler2.date.time_part(ev.start_date) === 0 && scheduler2.date.time_part(ev.end_date) === 0; - input.checked = isFulldayEvent; - selects[0].disabled = input.checked; - selects[1].disabled = input.checked; - if (!input.$_eventAttached) { - input.$_eventAttached = true; - scheduler2.event(input, "click", function() { - if (input.checked === true) { - var obj = {}; - scheduler2.form_blocks.calendar_time.get_value(node, obj); - start_date = scheduler2.date.date_part(obj.start_date); - end_date = scheduler2.date.date_part(obj.end_date); - if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)) - end_date = scheduler2.date.add(end_date, 1, "day"); - } - var start = start_date || ev.start_date; - var end = end_date || ev.end_date; - _attach_action(inputs[0], start); - _attach_action(inputs[1], end); - selects[0].value = start.getHours() * 60 + start.getMinutes(); - selects[1].value = end.getHours() * 60 + end.getMinutes(); - selects[0].disabled = input.checked; - selects[1].disabled = input.checked; - }); + if ((empty(byhour) || includes(byhour, this.hour)) && (empty(byminute) || includes(byminute, this.minute))) { + break; } } - if (scheduler2.config.event_duration && scheduler2.config.auto_end_date) { - var _update_minical_select = function() { - if (!(scheduler2.config.auto_end_date && scheduler2.config.event_duration)) { - return; - } - start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); - end_date = new Date(start_date.getTime() + scheduler2.config.event_duration * 60 * 1e3); - inputs[1].value = scheduler2.templates.calendar_time(end_date); - inputs[1]._date = scheduler2.date.date_part(new Date(end_date)); - selects[1].value = end_date.getHours() * 60 + end_date.getMinutes(); - }; - if (!selects[0].$_eventAttached) { - selects[0].addEventListener("change", _update_minical_select); + }; + DateTime2.prototype.addSeconds = function(seconds, filtered, byhour, byminute, bysecond) { + if (filtered) { + this.second += Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / seconds) * seconds; + } + for (; ; ) { + this.second += seconds; + var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod; + if (minuteDiv) { + this.second = secondMod; + this.addMinutes(minuteDiv, false, byhour, byminute); + } + if ((empty(byhour) || includes(byhour, this.hour)) && (empty(byminute) || includes(byminute, this.minute)) && (empty(bysecond) || includes(bysecond, this.second))) { + break; } } - function _attach_action(inp, date, number) { - _init_once(inp, date, number); - inp.value = scheduler2.templates.calendar_time(date); - inp._date = scheduler2.date.date_part(new Date(date)); + }; + DateTime2.prototype.fixDay = function() { + if (this.day <= 28) { + return; } - _attach_action(inputs[0], ev.start_date, 0); - _attach_action(inputs[1], ev.end_date, 1); - _init_once = function() { - }; - function _round_minutes(date) { - var time_values = config._time_values; - var direct_value = date.getHours() * 60 + date.getMinutes(); - var fixed_value = direct_value; - var value_found = false; - for (var k = 0; k < time_values.length; k++) { - var t_v = time_values[k]; - if (t_v === direct_value) { - value_found = true; - break; + var daysinmonth = monthRange(this.year, this.month - 1)[1]; + if (this.day <= daysinmonth) { + return; + } + while (this.day > daysinmonth) { + this.day -= daysinmonth; + ++this.month; + if (this.month === 13) { + this.month = 1; + ++this.year; + if (this.year > MAXYEAR) { + return; } - if (t_v < direct_value) - fixed_value = t_v; } - if (!(value_found || fixed_value)) - return -1; - return value_found ? direct_value : fixed_value; + daysinmonth = monthRange(this.year, this.month - 1)[1]; + } + }; + DateTime2.prototype.add = function(options, filtered) { + var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; + switch (freq) { + case Frequency.YEARLY: + return this.addYears(interval); + case Frequency.MONTHLY: + return this.addMonths(interval); + case Frequency.WEEKLY: + return this.addWeekly(interval, wkst); + case Frequency.DAILY: + return this.addDaily(interval); + case Frequency.HOURLY: + return this.addHours(interval, filtered, byhour); + case Frequency.MINUTELY: + return this.addMinutes(interval, filtered, byhour, byminute); + case Frequency.SECONDLY: + return this.addSeconds(interval, filtered, byhour, byminute, bysecond); + } + }; + return DateTime2; + }(Time); + function initializeOptions$1(options) { + var invalid = []; + var keys = Object.keys(options); + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + if (!includes(defaultKeys, key)) + invalid.push(key); + if (isDate(options[key]) && !isValidDate(options[key])) { + invalid.push(key); } - selects[0].value = _round_minutes(ev.start_date); - selects[1].value = _round_minutes(ev.end_date); - }, get_value: function(node, ev) { - var inputs = node.getElementsByTagName("input"); - var selects = node.getElementsByTagName("select"); - ev.start_date = scheduler2.date.add(inputs[0]._date, selects[0].value, "minute"); - ev.end_date = scheduler2.date.add(inputs[1]._date, selects[1].value, "minute"); - if (ev.end_date <= ev.start_date) - ev.end_date = scheduler2.date.add(ev.start_date, scheduler2.config.time_step, "minute"); - return { start_date: new Date(ev.start_date), end_date: new Date(ev.end_date) }; - }, focus: function(node) { - } }; - scheduler2.linkCalendar = function(calendar, datediff) { - var action = function() { - var date = scheduler2._date; - var dateNew = new Date(date.valueOf()); - if (datediff) - dateNew = datediff(dateNew); - dateNew.setDate(1); - scheduler2.updateCalendar(calendar, dateNew); - return true; - }; - scheduler2.attachEvent("onViewChange", action); - scheduler2.attachEvent("onXLE", action); - scheduler2.attachEvent("onEventAdded", action); - scheduler2.attachEvent("onEventChanged", action); - scheduler2.attachEvent("onEventDeleted", action); - action(); - }; - scheduler2._markCalendarCurrentDate = function(calendar) { - var state = scheduler2.getState(); - var from = state.min_date; - var to = state.max_date; - var mode = state.mode; - var month_start = scheduler2.date.month_start(new Date(calendar._date)); - var month_end = scheduler2.date.add(month_start, 1, "month"); - var noHighlight = { month: true, year: true, agenda: true, grid: true }; - if (noHighlight[mode] || from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf()) { - return; + } + if (invalid.length) { + throw new Error("Invalid options: " + invalid.join(", ")); + } + return __assign({}, options); + } + function parseOptions(options) { + var opts = __assign(__assign({}, DEFAULT_OPTIONS$1), initializeOptions$1(options)); + if (isPresent(opts.byeaster)) + opts.freq = RRule.YEARLY; + if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) { + throw new Error("Invalid frequency: ".concat(opts.freq, " ").concat(options.freq)); + } + if (!opts.dtstart) + opts.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0)); + if (!isPresent(opts.wkst)) { + opts.wkst = RRule.MO.weekday; + } else if (isNumber(opts.wkst)) + ; + else { + opts.wkst = opts.wkst.weekday; + } + if (isPresent(opts.bysetpos)) { + if (isNumber(opts.bysetpos)) + opts.bysetpos = [opts.bysetpos]; + for (var i = 0; i < opts.bysetpos.length; i++) { + var v = opts.bysetpos[i]; + if (v === 0 || !(v >= -366 && v <= 366)) { + throw new Error("bysetpos must be between 1 and 366, or between -366 and -1"); + } + } + } + if (!(Boolean(opts.byweekno) || notEmpty(opts.byweekno) || notEmpty(opts.byyearday) || Boolean(opts.bymonthday) || notEmpty(opts.bymonthday) || isPresent(opts.byweekday) || isPresent(opts.byeaster))) { + switch (opts.freq) { + case RRule.YEARLY: + if (!opts.bymonth) + opts.bymonth = opts.dtstart.getUTCMonth() + 1; + opts.bymonthday = opts.dtstart.getUTCDate(); + break; + case RRule.MONTHLY: + opts.bymonthday = opts.dtstart.getUTCDate(); + break; + case RRule.WEEKLY: + opts.byweekday = [getWeekday(opts.dtstart)]; + break; + } + } + if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) { + opts.bymonth = [opts.bymonth]; + } + if (isPresent(opts.byyearday) && !isArray(opts.byyearday) && isNumber(opts.byyearday)) { + opts.byyearday = [opts.byyearday]; + } + if (!isPresent(opts.bymonthday)) { + opts.bymonthday = []; + opts.bynmonthday = []; + } else if (isArray(opts.bymonthday)) { + var bymonthday = []; + var bynmonthday = []; + for (var i = 0; i < opts.bymonthday.length; i++) { + var v = opts.bymonthday[i]; + if (v > 0) { + bymonthday.push(v); + } else if (v < 0) { + bynmonthday.push(v); + } + } + opts.bymonthday = bymonthday; + opts.bynmonthday = bynmonthday; + } else if (opts.bymonthday < 0) { + opts.bynmonthday = [opts.bymonthday]; + opts.bymonthday = []; + } else { + opts.bynmonthday = []; + opts.bymonthday = [opts.bymonthday]; + } + if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) { + opts.byweekno = [opts.byweekno]; + } + if (!isPresent(opts.byweekday)) { + opts.bynweekday = null; + } else if (isNumber(opts.byweekday)) { + opts.byweekday = [opts.byweekday]; + opts.bynweekday = null; + } else if (isWeekdayStr(opts.byweekday)) { + opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday]; + opts.bynweekday = null; + } else if (opts.byweekday instanceof Weekday) { + if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) { + opts.byweekday = [opts.byweekday.weekday]; + opts.bynweekday = null; + } else { + opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]]; + opts.byweekday = null; } - var current = from; - while (current.valueOf() < to.valueOf()) { - if (month_start.valueOf() <= current.valueOf() && month_end > current) { - scheduler2.markCalendar(calendar, current, "dhx_calendar_click"); + } else { + var byweekday = []; + var bynweekday = []; + for (var i = 0; i < opts.byweekday.length; i++) { + var wday = opts.byweekday[i]; + if (isNumber(wday)) { + byweekday.push(wday); + continue; + } else if (isWeekdayStr(wday)) { + byweekday.push(Weekday.fromStr(wday).weekday); + continue; + } + if (!wday.n || opts.freq > RRule.MONTHLY) { + byweekday.push(wday.weekday); + } else { + bynweekday.push([wday.weekday, wday.n]); } - current = scheduler2.date.add(current, 1, "day"); } - }; - scheduler2.attachEvent("onEventCancel", function() { - scheduler2.destroyCalendar(null, true); - }); - scheduler2.attachEvent("onDestroy", function() { - scheduler2.destroyCalendar(); + opts.byweekday = notEmpty(byweekday) ? byweekday : null; + opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null; + } + if (!isPresent(opts.byhour)) { + opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null; + } else if (isNumber(opts.byhour)) { + opts.byhour = [opts.byhour]; + } + if (!isPresent(opts.byminute)) { + opts.byminute = opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null; + } else if (isNumber(opts.byminute)) { + opts.byminute = [opts.byminute]; + } + if (!isPresent(opts.bysecond)) { + opts.bysecond = opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null; + } else if (isNumber(opts.bysecond)) { + opts.bysecond = [opts.bysecond]; + } + return { parsedOptions: opts }; + } + function buildTimeset(opts) { + var millisecondModulo = opts.dtstart.getTime() % 1e3; + if (!freqIsDailyOrGreater(opts.freq)) { + return []; + } + var timeset = []; + opts.byhour.forEach(function(hour) { + opts.byminute.forEach(function(minute) { + opts.bysecond.forEach(function(second) { + timeset.push(new Time(hour, minute, second, millisecondModulo)); + }); + }); }); + return timeset; } - function monthheight(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.xy.scroll_width = 0; - var old = scheduler2.render_view_data; - scheduler2.render_view_data = function() { - var data = this._els["dhx_cal_data"][0]; - data.firstChild._h_fix = true; - old.apply(scheduler2, arguments); - var height = parseInt(data.style.height); - data.style.height = "1px"; - data.style.height = data.scrollHeight + "px"; - this._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + "px"; - }; - var old_s = scheduler2._reset_month_scale; - scheduler2._reset_month_scale = function(a, b, c, d) { - var dummy = { clientHeight: 100 }; - old_s.apply(scheduler2, [dummy, b, c, d]); - a.innerHTML = dummy.innerHTML; - }; + function parseString(rfcString) { + var options = rfcString.split("\n").map(parseLine).filter(function(x) { + return x !== null; }); + return __assign(__assign({}, options[0]), options[1]); } - function multisection_restricted(scheduler2) { - notImplemented.alert("Multisection", scheduler2.assert); + function parseDtstart(line) { + var options = {}; + var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(line); + if (!dtstartWithZone) { + return options; + } + var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2]; + if (tzid) { + options.tzid = tzid; + } + options.dtstart = untilStringToDate(dtstart); + return options; } - function multiselect(scheduler2) { - function parseXMLOptions(loader, config) { - var items = scheduler2.ajax.xpath("//data/item", loader.xmlDoc); - var ids = {}; - for (var i = 0; i < items.length; i++) { - ids[items[i].getAttribute(config.map_to)] = true; - } - return ids; + function parseLine(rfcString) { + rfcString = rfcString.replace(/^\s+|\s+$/, ""); + if (!rfcString.length) + return null; + var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase()); + if (!header) { + return parseRrule(rfcString); } - function parseJSONOptions(loader, config) { - try { - var items = JSON.parse(loader.xmlDoc.responseText); - var ids = {}; - for (var i = 0; i < items.length; i++) { - var option = items[i]; - ids[option.value || option.key || option.id] = true; - } - return ids; - } catch (e) { - return null; - } + var key = header[1]; + switch (key.toUpperCase()) { + case "RRULE": + case "EXRULE": + return parseRrule(rfcString); + case "DTSTART": + return parseDtstart(rfcString); + default: + throw new Error("Unsupported RFC prop ".concat(key, " in ").concat(rfcString)); } - scheduler2.form_blocks["multiselect"] = { render: function(sns) { - var css = "dhx_multi_select_control dhx_multi_select_" + sns.name; - if (!!sns.vertical) { - css += " dhx_multi_select_control_vertical"; - } - var _result = "
"; - for (var i = 0; i < sns.options.length; i++) { - _result += ""; - } - _result += "
"; - return _result; - }, set_value: function(node, value, ev, config) { - var _children = node.getElementsByTagName("input"); - for (var i = 0; i < _children.length; i++) { - _children[i].checked = false; + } + function parseRrule(line) { + var strippedLine = line.replace(/^RRULE:/i, ""); + var options = parseDtstart(strippedLine); + var attrs = line.replace(/^(?:RRULE|EXRULE):/i, "").split(";"); + attrs.forEach(function(attr) { + var _a = attr.split("="), key = _a[0], value = _a[1]; + switch (key.toUpperCase()) { + case "FREQ": + options.freq = Frequency[value.toUpperCase()]; + break; + case "WKST": + options.wkst = Days[value.toUpperCase()]; + break; + case "COUNT": + case "INTERVAL": + case "BYSETPOS": + case "BYMONTH": + case "BYMONTHDAY": + case "BYYEARDAY": + case "BYWEEKNO": + case "BYHOUR": + case "BYMINUTE": + case "BYSECOND": + var num = parseNumber(value); + var optionKey = key.toLowerCase(); + options[optionKey] = num; + break; + case "BYWEEKDAY": + case "BYDAY": + options.byweekday = parseWeekday(value); + break; + case "DTSTART": + case "TZID": + var dtstart = parseDtstart(line); + options.tzid = dtstart.tzid; + options.dtstart = dtstart.dtstart; + break; + case "UNTIL": + options.until = untilStringToDate(value); + break; + case "BYEASTER": + options.byeaster = Number(value); + break; + default: + throw new Error("Unknown RRULE property '" + key + "'"); } - function _mark_inputs(ids) { - var _children2 = node.getElementsByTagName("input"); - for (var i2 = 0; i2 < _children2.length; i2++) { - _children2[i2].checked = !!ids[_children2[i2].value]; - } + }); + return options; + } + function parseNumber(value) { + if (value.indexOf(",") !== -1) { + var values = value.split(","); + return values.map(parseIndividualNumber); + } + return parseIndividualNumber(value); + } + function parseIndividualNumber(value) { + if (/^[+-]?\d+$/.test(value)) { + return Number(value); + } + return value; + } + function parseWeekday(value) { + var days = value.split(","); + return days.map(function(day) { + if (day.length === 2) { + return Days[day]; + } + var parts = day.match(/^([+-]?\d{1,2})([A-Z]{2})$/); + if (!parts || parts.length < 3) { + throw new SyntaxError("Invalid weekday string: ".concat(day)); + } + var n = Number(parts[1]); + var wdaypart = parts[2]; + var wday = Days[wdaypart].weekday; + return new Weekday(wday, n); + }); + } + var DateWithZone = function() { + function DateWithZone2(date, tzid) { + if (isNaN(date.getTime())) { + throw new RangeError("Invalid date passed to DateWithZone"); } - var _ids = {}; - if (ev[config.map_to]) { - var results = (ev[config.map_to] + "").split(config.delimiter || scheduler2.config.section_delimiter || ","); - for (var i = 0; i < results.length; i++) { - _ids[results[i]] = true; - } - _mark_inputs(_ids); - } else { - if (scheduler2._new_event || !config.script_url) - return; - var divLoading = document.createElement("div"); - divLoading.className = "dhx_loading"; - divLoading.style.cssText = "position: absolute; top: 40%; left: 40%;"; - node.appendChild(divLoading); - var url2 = [config.script_url, config.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + config.map_to + "=" + ev.id + "&uid=" + scheduler2.uid()].join(""); - scheduler2.ajax.get(url2, function(loader) { - var options = parseJSONOptions(loader); - if (!options) { - options = parseXMLOptions(loader, config); + this.date = date; + this.tzid = tzid; + } + Object.defineProperty(DateWithZone2.prototype, "isUTC", { get: function() { + return !this.tzid || this.tzid.toUpperCase() === "UTC"; + }, enumerable: false, configurable: true }); + DateWithZone2.prototype.toString = function() { + var datestr = timeToUntilString(this.date.getTime(), this.isUTC); + if (!this.isUTC) { + return ";TZID=".concat(this.tzid, ":").concat(datestr); + } + return ":".concat(datestr); + }; + DateWithZone2.prototype.getTime = function() { + return this.date.getTime(); + }; + DateWithZone2.prototype.rezonedDate = function() { + if (this.isUTC) { + return this.date; + } + return dateInTimeZone(this.date, this.tzid); + }; + return DateWithZone2; + }(); + function optionsToString(options) { + var rrule = []; + var dtstart = ""; + var keys = Object.keys(options); + var defaultKeys2 = Object.keys(DEFAULT_OPTIONS$1); + for (var i = 0; i < keys.length; i++) { + if (keys[i] === "tzid") + continue; + if (!includes(defaultKeys2, keys[i])) + continue; + var key = keys[i].toUpperCase(); + var value = options[keys[i]]; + var outValue = ""; + if (!isPresent(value) || isArray(value) && !value.length) + continue; + switch (key) { + case "FREQ": + outValue = RRule.FREQUENCIES[options.freq]; + break; + case "WKST": + if (isNumber(value)) { + outValue = new Weekday(value).toString(); + } else { + outValue = value.toString(); + } + break; + case "BYWEEKDAY": + key = "BYDAY"; + outValue = toArray(value).map(function(wday) { + if (wday instanceof Weekday) { + return wday; + } + if (isArray(wday)) { + return new Weekday(wday[0], wday[1]); + } + return new Weekday(wday); + }).toString(); + break; + case "DTSTART": + dtstart = buildDtstart(value, options.tzid); + break; + case "UNTIL": + outValue = timeToUntilString(value, !options.tzid); + break; + default: + if (isArray(value)) { + var strValues = []; + for (var j = 0; j < value.length; j++) { + strValues[j] = String(value[j]); + } + outValue = strValues.toString(); + } else { + outValue = String(value); } - _mark_inputs(options); - node.removeChild(divLoading); - }); } - }, get_value: function(node, ev, config) { - var _result = []; - var _children = node.getElementsByTagName("input"); - for (var i = 0; i < _children.length; i++) { - if (_children[i].checked) - _result.push(_children[i].value); + if (outValue) { + rrule.push([key, outValue]); } - return _result.join(config.delimiter || scheduler2.config.section_delimiter || ","); - }, focus: function(node) { - } }; + } + var rules = rrule.map(function(_a) { + var key2 = _a[0], value2 = _a[1]; + return "".concat(key2, "=").concat(value2.toString()); + }).join(";"); + var ruleString = ""; + if (rules !== "") { + ruleString = "RRULE:".concat(rules); + } + return [dtstart, ruleString].filter(function(x) { + return !!x; + }).join("\n"); } - function multisource(scheduler2) { - function backup(obj) { - var t = function() { - }; - t.prototype = obj; - return t; + function buildDtstart(dtstart, tzid) { + if (!dtstart) { + return ""; } - var old = scheduler2._load; - scheduler2._load = function(url2, from) { - url2 = url2 || this._load_url; - if (typeof url2 == "object") { - var t = backup(this._loaded); - for (var i = 0; i < url2.length; i++) { - this._loaded = new t(); - old.call(this, url2[i], from); - } - } else - old.apply(this, arguments); - }; + return "DTSTART" + new DateWithZone(new Date(dtstart), tzid).toString(); } - function mvc(scheduler2) { - var cfg = { use_id: false }; - function sanitize(ev) { - var obj = {}; - for (var key in ev) - if (key.indexOf("_") !== 0) - obj[key] = ev[key]; - if (!cfg.use_id) - delete obj.id; - return obj; + function argsMatch(left, right) { + if (Array.isArray(left)) { + if (!Array.isArray(right)) + return false; + if (left.length !== right.length) + return false; + return left.every(function(date, i) { + return date.getTime() === right[i].getTime(); + }); } - var update_timer; - function update_view() { - clearTimeout(update_timer); - update_timer = setTimeout(function() { - if (scheduler2.$destroyed) { - return true; - } - scheduler2.updateView(); - }, 1); + if (left instanceof Date) { + return right instanceof Date && left.getTime() === right.getTime(); } - function _start_ext_load(cal) { - cal._loading = true; - cal._not_render = true; - cal.callEvent("onXLS", []); + return left === right; + } + var Cache = function() { + function Cache2() { + this.all = false; + this.before = []; + this.after = []; + this.between = []; } - function _finish_ext_load(cal) { - cal._not_render = false; - if (cal._render_wait) - cal.render_view_data(); - cal._loading = false; - cal.callEvent("onXLE", []); + Cache2.prototype._cacheAdd = function(what, value, args) { + if (value) { + value = value instanceof Date ? clone(value) : cloneDates(value); + } + if (what === "all") { + this.all = value; + } else { + args._value = value; + this[what].push(args); + } + }; + Cache2.prototype._cacheGet = function(what, args) { + var cached = false; + var argsKeys = args ? Object.keys(args) : []; + var findCacheDiff = function(item2) { + for (var i2 = 0; i2 < argsKeys.length; i2++) { + var key = argsKeys[i2]; + if (!argsMatch(args[key], item2[key])) { + return true; + } + } + return false; + }; + var cachedObject = this[what]; + if (what === "all") { + cached = this.all; + } else if (isArray(cachedObject)) { + for (var i = 0; i < cachedObject.length; i++) { + var item = cachedObject[i]; + if (argsKeys.length && findCacheDiff(item)) + continue; + cached = item._value; + break; + } + } + if (!cached && this.all) { + var iterResult = new IterResult(what, args); + for (var i = 0; i < this.all.length; i++) { + if (!iterResult.accept(this.all[i])) + break; + } + cached = iterResult.getValue(); + this._cacheAdd(what, cached, args); + } + return isArray(cached) ? cloneDates(cached) : cached instanceof Date ? clone(cached) : cached; + }; + return Cache2; + }(); + var M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true); + var M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true); + var M28 = range(1, 29); + var M29 = range(1, 30); + var M30 = range(1, 31); + var M31 = range(1, 32); + var MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true); + var MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true); + var NM28 = range(-28, 0); + var NM29 = range(-29, 0); + var NM30 = range(-30, 0); + var NM31 = range(-31, 0); + var NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true); + var NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true); + var M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + var M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + var WDAYMASK = function() { + var wdaymask = []; + for (var i = 0; i < 55; i++) + wdaymask = wdaymask.concat(range(7)); + return wdaymask; + }(); + function rebuildYear(year, options) { + var firstyday = datetime(year, 1, 1); + var yearlen = isLeapYear(year) ? 366 : 365; + var nextyearlen = isLeapYear(year + 1) ? 366 : 365; + var yearordinal = toOrdinal(firstyday); + var yearweekday = getWeekday(firstyday); + var result = __assign(__assign({ yearlen, nextyearlen, yearordinal, yearweekday }, baseYearMasks(year)), { wnomask: null }); + if (empty(options.byweekno)) { + return result; } - function _get_id(model) { - return cfg.use_id ? model.id : model.cid; + result.wnomask = repeat(0, yearlen + 7); + var firstwkst; + var wyearlen; + var no1wkst = firstwkst = pymod(7 - yearweekday + options.wkst, 7); + if (no1wkst >= 4) { + no1wkst = 0; + wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7); + } else { + wyearlen = yearlen - no1wkst; } - scheduler2.backbone = function(events, config) { - if (config) - cfg = config; - events.bind("change", function(model, info) { - var cid = _get_id(model); - var ev = scheduler2._events[cid] = model.toJSON(); - ev.id = cid; - scheduler2._init_event(ev); - update_view(); - }); - events.bind("remove", function(model, changes) { - var cid = _get_id(model); - if (scheduler2._events[cid]) - scheduler2.deleteEvent(cid); - }); - var queue = []; - function add_from_queue() { - if (scheduler2.$destroyed) { - return true; + var div = Math.floor(wyearlen / 7); + var mod = pymod(wyearlen, 7); + var numweeks = Math.floor(div + mod / 4); + for (var j = 0; j < options.byweekno.length; j++) { + var n = options.byweekno[j]; + if (n < 0) { + n += numweeks + 1; + } + if (!(n > 0 && n <= numweeks)) { + continue; + } + var i = void 0; + if (n > 1) { + i = no1wkst + (n - 1) * 7; + if (no1wkst !== firstwkst) { + i -= 7 - firstwkst; } - if (queue.length) { - scheduler2.parse(queue, "json"); - queue = []; + } else { + i = no1wkst; + } + for (var k = 0; k < 7; k++) { + result.wnomask[i] = 1; + i++; + if (result.wdaymask[i] === options.wkst) + break; + } + } + if (includes(options.byweekno, 1)) { + var i = no1wkst + numweeks * 7; + if (no1wkst !== firstwkst) + i -= 7 - firstwkst; + if (i < yearlen) { + for (var j = 0; j < 7; j++) { + result.wnomask[i] = 1; + i += 1; + if (result.wdaymask[i] === options.wkst) + break; } } - events.bind("add", function(model, changes) { - var cid = _get_id(model); - if (!scheduler2._events[cid]) { - var ev = model.toJSON(); - ev.id = cid; - scheduler2._init_event(ev); - queue.push(ev); - if (queue.length == 1) - setTimeout(add_from_queue, 1); + } + if (no1wkst) { + var lnumweeks = void 0; + if (!includes(options.byweekno, -1)) { + var lyearweekday = getWeekday(datetime(year - 1, 1, 1)); + var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7); + var lyearlen = isLeapYear(year - 1) ? 366 : 365; + var weekst = void 0; + if (lno1wkst >= 4) { + lno1wkst = 0; + weekst = lyearlen + pymod(lyearweekday - options.wkst, 7); + } else { + weekst = yearlen - no1wkst; } - }); - events.bind("request", function(obj) { - if (obj instanceof Backbone.Collection) - _start_ext_load(scheduler2); - }); - events.bind("sync", function(obj) { - if (obj instanceof Backbone.Collection) - _finish_ext_load(scheduler2); - }); - events.bind("error", function(obj) { - if (obj instanceof Backbone.Collection) - _finish_ext_load(scheduler2); - }); - scheduler2.attachEvent("onEventCreated", function(id2) { - var ev = new events.model(scheduler2.getEvent(id2)); - scheduler2._events[id2] = ev.toJSON(); - scheduler2._events[id2].id = id2; - return true; - }); - scheduler2.attachEvent("onEventAdded", function(id2) { - if (!events.get(id2)) { - var data = sanitize(scheduler2.getEvent(id2)); - var model = new events.model(data); - var cid = _get_id(model); - if (cid != id2) - this.changeEventId(id2, cid); - events.add(model); - events.trigger("scheduler:add", model); + lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4); + } else { + lnumweeks = -1; + } + if (includes(options.byweekno, lnumweeks)) { + for (var i = 0; i < no1wkst; i++) + result.wnomask[i] = 1; + } + } + return result; + } + function baseYearMasks(year) { + var yearlen = isLeapYear(year) ? 366 : 365; + var firstyday = datetime(year, 1, 1); + var wday = getWeekday(firstyday); + if (yearlen === 365) { + return { mmask: M365MASK, mdaymask: MDAY365MASK, nmdaymask: NMDAY365MASK, wdaymask: WDAYMASK.slice(wday), mrange: M365RANGE }; + } + return { mmask: M366MASK, mdaymask: MDAY366MASK, nmdaymask: NMDAY366MASK, wdaymask: WDAYMASK.slice(wday), mrange: M366RANGE }; + } + function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) { + var result = { lastyear: year, lastmonth: month, nwdaymask: [] }; + var ranges = []; + if (options.freq === RRule.YEARLY) { + if (empty(options.bymonth)) { + ranges = [[0, yearlen]]; + } else { + for (var j = 0; j < options.bymonth.length; j++) { + month = options.bymonth[j]; + ranges.push(mrange.slice(month - 1, month + 1)); } - return true; - }); - scheduler2.attachEvent("onEventChanged", function(id2) { - var ev = events.get(id2); - var upd = sanitize(scheduler2.getEvent(id2)); - ev.set(upd); - events.trigger("scheduler:change", ev); - return true; - }); - scheduler2.attachEvent("onEventDeleted", function(id2) { - var model = events.get(id2); - if (model) { - events.trigger("scheduler:remove", model); - events.remove(id2); + } + } else if (options.freq === RRule.MONTHLY) { + ranges = [mrange.slice(month - 1, month + 1)]; + } + if (empty(ranges)) { + return result; + } + result.nwdaymask = repeat(0, yearlen); + for (var j = 0; j < ranges.length; j++) { + var rang = ranges[j]; + var first = rang[0]; + var last = rang[1] - 1; + for (var k = 0; k < options.bynweekday.length; k++) { + var i = void 0; + var _a = options.bynweekday[k], wday = _a[0], n = _a[1]; + if (n < 0) { + i = last + (n + 1) * 7; + i -= pymod(wdaymask[i] - wday, 7); + } else { + i = first + (n - 1) * 7; + i += pymod(7 - wdaymask[i] + wday, 7); } - return true; + if (first <= i && i <= last) + result.nwdaymask[i] = 1; + } + } + return result; + } + function easter(y, offset) { + if (offset === void 0) { + offset = 0; + } + var a = y % 19; + var b = Math.floor(y / 100); + var c = y % 100; + var d = Math.floor(b / 4); + var e = b % 4; + var f = Math.floor((b + 8) / 25); + var g = Math.floor((b - f + 1) / 3); + var h = Math.floor(19 * a + b - d - g + 15) % 30; + var i = Math.floor(c / 4); + var k = c % 4; + var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7; + var m = Math.floor((a + 11 * h + 22 * l) / 451); + var month = Math.floor((h + l - 7 * m + 114) / 31); + var day = (h + l - 7 * m + 114) % 31 + 1; + var date = Date.UTC(y, month - 1, day + offset); + var yearStart = Date.UTC(y, 0, 1); + return [Math.ceil((date - yearStart) / (1e3 * 60 * 60 * 24))]; + } + var Iterinfo = function() { + function Iterinfo2(options) { + this.options = options; + } + Iterinfo2.prototype.rebuild = function(year, month) { + var options = this.options; + if (year !== this.lastyear) { + this.yearinfo = rebuildYear(year, options); + } + if (notEmpty(options.bynweekday) && (month !== this.lastmonth || year !== this.lastyear)) { + var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask; + this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options); + } + if (isPresent(options.byeaster)) { + this.eastermask = easter(year, options.byeaster); + } + }; + Object.defineProperty(Iterinfo2.prototype, "lastyear", { get: function() { + return this.monthinfo ? this.monthinfo.lastyear : null; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "lastmonth", { get: function() { + return this.monthinfo ? this.monthinfo.lastmonth : null; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "yearlen", { get: function() { + return this.yearinfo.yearlen; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "yearordinal", { get: function() { + return this.yearinfo.yearordinal; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "mrange", { get: function() { + return this.yearinfo.mrange; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "wdaymask", { get: function() { + return this.yearinfo.wdaymask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "mmask", { get: function() { + return this.yearinfo.mmask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "wnomask", { get: function() { + return this.yearinfo.wnomask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "nwdaymask", { get: function() { + return this.monthinfo ? this.monthinfo.nwdaymask : []; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "nextyearlen", { get: function() { + return this.yearinfo.nextyearlen; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "mdaymask", { get: function() { + return this.yearinfo.mdaymask; + }, enumerable: false, configurable: true }); + Object.defineProperty(Iterinfo2.prototype, "nmdaymask", { get: function() { + return this.yearinfo.nmdaymask; + }, enumerable: false, configurable: true }); + Iterinfo2.prototype.ydayset = function() { + return [range(this.yearlen), 0, this.yearlen]; + }; + Iterinfo2.prototype.mdayset = function(_, month) { + var start = this.mrange[month - 1]; + var end = this.mrange[month]; + var set = repeat(null, this.yearlen); + for (var i = start; i < end; i++) + set[i] = i; + return [set, start, end]; + }; + Iterinfo2.prototype.wdayset = function(year, month, day) { + var set = repeat(null, this.yearlen + 7); + var i = toOrdinal(datetime(year, month, day)) - this.yearordinal; + var start = i; + for (var j = 0; j < 7; j++) { + set[i] = i; + ++i; + if (this.wdaymask[i] === this.options.wkst) + break; + } + return [set, start, i]; + }; + Iterinfo2.prototype.ddayset = function(year, month, day) { + var set = repeat(null, this.yearlen); + var i = toOrdinal(datetime(year, month, day)) - this.yearordinal; + set[i] = i; + return [set, i, i + 1]; + }; + Iterinfo2.prototype.htimeset = function(hour, _, second, millisecond) { + var _this = this; + var set = []; + this.options.byminute.forEach(function(minute) { + set = set.concat(_this.mtimeset(hour, minute, second, millisecond)); }); + sort(set); + return set; }; + Iterinfo2.prototype.mtimeset = function(hour, minute, _, millisecond) { + var set = this.options.bysecond.map(function(second) { + return new Time(hour, minute, second, millisecond); + }); + sort(set); + return set; + }; + Iterinfo2.prototype.stimeset = function(hour, minute, second, millisecond) { + return [new Time(hour, minute, second, millisecond)]; + }; + Iterinfo2.prototype.getdayset = function(freq) { + switch (freq) { + case Frequency.YEARLY: + return this.ydayset.bind(this); + case Frequency.MONTHLY: + return this.mdayset.bind(this); + case Frequency.WEEKLY: + return this.wdayset.bind(this); + case Frequency.DAILY: + return this.ddayset.bind(this); + default: + return this.ddayset.bind(this); + } + }; + Iterinfo2.prototype.gettimeset = function(freq) { + switch (freq) { + case Frequency.HOURLY: + return this.htimeset.bind(this); + case Frequency.MINUTELY: + return this.mtimeset.bind(this); + case Frequency.SECONDLY: + return this.stimeset.bind(this); + } + }; + return Iterinfo2; + }(); + function buildPoslist(bysetpos, timeset, start, end, ii, dayset) { + var poslist = []; + for (var j = 0; j < bysetpos.length; j++) { + var daypos = void 0; + var timepos = void 0; + var pos = bysetpos[j]; + if (pos < 0) { + daypos = Math.floor(pos / timeset.length); + timepos = pymod(pos, timeset.length); + } else { + daypos = Math.floor((pos - 1) / timeset.length); + timepos = pymod(pos - 1, timeset.length); + } + var tmp = []; + for (var k = start; k < end; k++) { + var val = dayset[k]; + if (!isPresent(val)) + continue; + tmp.push(val); + } + var i = void 0; + if (daypos < 0) { + i = tmp.slice(daypos)[0]; + } else { + i = tmp[daypos]; + } + var time = timeset[timepos]; + var date = fromOrdinal(ii.yearordinal + i); + var res = combine(date, time); + if (!includes(poslist, res)) + poslist.push(res); + } + sort(poslist); + return poslist; } - function outerdrag(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - var dragger = new dhtmlDragAndDropObject(); - var old = dragger.stopDrag; - var last_event; - dragger.stopDrag = function(e) { - last_event = e; - return old.apply(this, arguments); - }; - function on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { - if (scheduler2.checkEvent("onBeforeExternalDragIn") && !scheduler2.callEvent("onBeforeExternalDragIn", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event])) - return; - var temp = scheduler2.attachEvent("onEventCreated", function(id2) { - if (!scheduler2.callEvent("onExternalDragIn", [id2, sourceHtmlObject, last_event])) { - this._drag_mode = this._drag_id = null; - this.deleteEvent(id2); + function iter(iterResult, options) { + var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos; + var count = options.count; + if (count === 0 || interval === 0) { + return emitResult(iterResult); + } + var counterDate = DateTime.fromDate(dtstart); + var ii = new Iterinfo(options); + ii.rebuild(counterDate.year, counterDate.month); + var timeset = makeTimeset(ii, counterDate, options); + for (; ; ) { + var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2]; + var filtered = removeFilteredDays(dayset, start, end, ii, options); + if (notEmpty(bysetpos)) { + var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset); + for (var j = 0; j < poslist.length; j++) { + var res = poslist[j]; + if (until && res > until) { + return emitResult(iterResult); + } + if (res >= dtstart) { + var rezonedDate = rezoneIfNeeded(res, options); + if (!iterResult.accept(rezonedDate)) { + return emitResult(iterResult); + } + if (count) { + --count; + if (!count) { + return emitResult(iterResult); + } + } } - }); - var action_data = scheduler2.getActionData(last_event); - var event_data = { start_date: new Date(action_data.date) }; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - var view_options = scheduler2.matrix[scheduler2._mode]; - event_data[view_options.y_property] = action_data.section; - var pos = scheduler2._locate_cell_timeline(last_event); - event_data.start_date = view_options._trace_x[pos.x]; - event_data.end_date = scheduler2.date.add(event_data.start_date, view_options.x_step, view_options.x_unit); } - if (scheduler2._props && scheduler2._props[scheduler2._mode]) { - event_data[scheduler2._props[scheduler2._mode].map_to] = action_data.section; + } else { + for (var j = start; j < end; j++) { + var currentDay = dayset[j]; + if (!isPresent(currentDay)) { + continue; + } + var date = fromOrdinal(ii.yearordinal + currentDay); + for (var k = 0; k < timeset.length; k++) { + var time = timeset[k]; + var res = combine(date, time); + if (until && res > until) { + return emitResult(iterResult); + } + if (res >= dtstart) { + var rezonedDate = rezoneIfNeeded(res, options); + if (!iterResult.accept(rezonedDate)) { + return emitResult(iterResult); + } + if (count) { + --count; + if (!count) { + return emitResult(iterResult); + } + } + } + } } - scheduler2.addEventNow(event_data); - scheduler2.detachEvent(temp); } - dragger.addDragLanding(scheduler2._els["dhx_cal_data"][0], { _drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) { - on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml); - }, _dragIn: function(htmlObject, shtmlObject) { - return htmlObject; - }, _dragOut: function(htmlObject) { - return this; - } }); - if (dhtmlx.DragControl) { - dhtmlx.DragControl.addDrop(scheduler2._els["dhx_cal_data"][0], { onDrop: function(source, target, d, e) { - var sourceDhtmlx = dhtmlx.DragControl.getMaster(source); - last_event = e; - on_drop(source, sourceDhtmlx, target, e.target || e.srcElement); - }, onDragIn: function(source, target, e) { - return target; - } }, true); + if (options.interval === 0) { + return emitResult(iterResult); } - }); + counterDate.add(options, filtered); + if (counterDate.year > MAXYEAR) { + return emitResult(iterResult); + } + if (!freqIsDailyOrGreater(freq)) { + timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0); + } + ii.rebuild(counterDate.year, counterDate.month); + } } - function pdf(scheduler2) { - var dx, dy, html_regexp = new RegExp("<[^>]*>", "g"), newline_regexp = new RegExp("]*>", "g"); - function clean_html(val) { - return val.replace(newline_regexp, "\n").replace(html_regexp, ""); + function isFiltered(ii, currentDay, options) { + var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday; + return notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay]) || notEmpty(byweekno) && !ii.wnomask[currentDay] || notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay]) || notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay] || byeaster !== null && !includes(ii.eastermask, currentDay) || (notEmpty(bymonthday) || notEmpty(bynmonthday)) && !includes(bymonthday, ii.mdaymask[currentDay]) && !includes(bynmonthday, ii.nmdaymask[currentDay]) || notEmpty(byyearday) && (currentDay < ii.yearlen && !includes(byyearday, currentDay + 1) && !includes(byyearday, -ii.yearlen + currentDay) || currentDay >= ii.yearlen && !includes(byyearday, currentDay + 1 - ii.yearlen) && !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)); + } + function rezoneIfNeeded(date, options) { + return new DateWithZone(date, options.tzid).rezonedDate(); + } + function emitResult(iterResult) { + return iterResult.getValue(); + } + function removeFilteredDays(dayset, start, end, ii, options) { + var filtered = false; + for (var dayCounter = start; dayCounter < end; dayCounter++) { + var currentDay = dayset[dayCounter]; + filtered = isFiltered(ii, currentDay, options); + if (filtered) + dayset[currentDay] = null; } - function x_norm(x, offset) { - x = parseFloat(x); - offset = parseFloat(offset); - if (!isNaN(offset)) - x -= offset; - var w = colsWidth(x); - x = x - w.width + w.cols * dx; - return isNaN(x) ? "auto" : 100 * x / dx; + return filtered; + } + function makeTimeset(ii, counterDate, options) { + var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; + if (freqIsDailyOrGreater(freq)) { + return buildTimeset(options); } - function x_norm_event(x, offset, is_left) { - x = parseFloat(x); - offset = parseFloat(offset); - if (!isNaN(offset) && is_left) - x -= offset; - var w = colsWidth(x); - x = x - w.width + w.cols * dx; - return isNaN(x) ? "auto" : 100 * x / (dx - (!isNaN(offset) ? offset : 0)); + if (freq >= RRule.HOURLY && notEmpty(byhour) && !includes(byhour, counterDate.hour) || freq >= RRule.MINUTELY && notEmpty(byminute) && !includes(byminute, counterDate.minute) || freq >= RRule.SECONDLY && notEmpty(bysecond) && !includes(bysecond, counterDate.second)) { + return []; } - function colsWidth(width) { - var r = 0; - var header = scheduler2._els.dhx_cal_header[0].childNodes; - var els = header[1] ? header[1].childNodes : header[0].childNodes; - for (var i = 0; i < els.length; i++) { - var el2 = els[i].style ? els[i] : els[i].parentNode; - var w = parseFloat(el2.style.width); - if (width > w) { - width -= w + 1; - r += w + 1; - } else - break; + return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond); + } + var Days = { MO: new Weekday(0), TU: new Weekday(1), WE: new Weekday(2), TH: new Weekday(3), FR: new Weekday(4), SA: new Weekday(5), SU: new Weekday(6) }; + var DEFAULT_OPTIONS$1 = { freq: Frequency.YEARLY, dtstart: null, interval: 1, wkst: Days.MO, count: null, until: null, tzid: null, bysetpos: null, bymonth: null, bymonthday: null, bynmonthday: null, byyearday: null, byweekno: null, byweekday: null, bynweekday: null, byhour: null, byminute: null, bysecond: null, byeaster: null }; + var defaultKeys = Object.keys(DEFAULT_OPTIONS$1); + var RRule = function() { + function RRule2(options, noCache) { + if (options === void 0) { + options = {}; + } + if (noCache === void 0) { + noCache = false; + } + this._cache = noCache ? null : new Cache(); + this.origOptions = initializeOptions$1(options); + var parsedOptions = parseOptions(options).parsedOptions; + this.options = parsedOptions; + } + RRule2.parseText = function(text, language) { + return parseText(text, language); + }; + RRule2.fromText = function(text, language) { + return fromText(text, language); + }; + RRule2.fromString = function(str) { + return new RRule2(RRule2.parseString(str) || void 0); + }; + RRule2.prototype._iter = function(iterResult) { + return iter(iterResult, this.options); + }; + RRule2.prototype._cacheGet = function(what, args) { + if (!this._cache) + return false; + return this._cache._cacheGet(what, args); + }; + RRule2.prototype._cacheAdd = function(what, value, args) { + if (!this._cache) + return; + return this._cache._cacheAdd(what, value, args); + }; + RRule2.prototype.all = function(iterator) { + if (iterator) { + return this._iter(new CallbackIterResult("all", {}, iterator)); } - return { width: r, cols: i }; + var result = this._cacheGet("all"); + if (result === false) { + result = this._iter(new IterResult("all", {})); + this._cacheAdd("all", result); + } + return result; + }; + RRule2.prototype.between = function(after, before, inc, iterator) { + if (inc === void 0) { + inc = false; + } + if (!isValidDate(after) || !isValidDate(before)) { + throw new Error("Invalid date passed in to RRule.between"); + } + var args = { before, after, inc }; + if (iterator) { + return this._iter(new CallbackIterResult("between", args, iterator)); + } + var result = this._cacheGet("between", args); + if (result === false) { + result = this._iter(new IterResult("between", args)); + this._cacheAdd("between", result, args); + } + return result; + }; + RRule2.prototype.before = function(dt, inc) { + if (inc === void 0) { + inc = false; + } + if (!isValidDate(dt)) { + throw new Error("Invalid date passed in to RRule.before"); + } + var args = { dt, inc }; + var result = this._cacheGet("before", args); + if (result === false) { + result = this._iter(new IterResult("before", args)); + this._cacheAdd("before", result, args); + } + return result; + }; + RRule2.prototype.after = function(dt, inc) { + if (inc === void 0) { + inc = false; + } + if (!isValidDate(dt)) { + throw new Error("Invalid date passed in to RRule.after"); + } + var args = { dt, inc }; + var result = this._cacheGet("after", args); + if (result === false) { + result = this._iter(new IterResult("after", args)); + this._cacheAdd("after", result, args); + } + return result; + }; + RRule2.prototype.count = function() { + return this.all().length; + }; + RRule2.prototype.toString = function() { + return optionsToString(this.origOptions); + }; + RRule2.prototype.toText = function(gettext, language, dateFormatter) { + return toText(this, gettext, language, dateFormatter); + }; + RRule2.prototype.isFullyConvertibleToText = function() { + return isFullyConvertible(this); + }; + RRule2.prototype.clone = function() { + return new RRule2(this.origOptions); + }; + RRule2.FREQUENCIES = ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"]; + RRule2.YEARLY = Frequency.YEARLY; + RRule2.MONTHLY = Frequency.MONTHLY; + RRule2.WEEKLY = Frequency.WEEKLY; + RRule2.DAILY = Frequency.DAILY; + RRule2.HOURLY = Frequency.HOURLY; + RRule2.MINUTELY = Frequency.MINUTELY; + RRule2.SECONDLY = Frequency.SECONDLY; + RRule2.MO = Days.MO; + RRule2.TU = Days.TU; + RRule2.WE = Days.WE; + RRule2.TH = Days.TH; + RRule2.FR = Days.FR; + RRule2.SA = Days.SA; + RRule2.SU = Days.SU; + RRule2.parseString = parseString; + RRule2.optionsToString = optionsToString; + return RRule2; + }(); + function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) { + var _exdateHash = {}; + var _accept = iterResult.accept; + function evalExdate(after, before) { + _exrule.forEach(function(rrule) { + rrule.between(after, before, true).forEach(function(date) { + _exdateHash[Number(date)] = true; + }); + }); } - function y_norm(y) { - y = parseFloat(y); - if (isNaN(y)) - return "auto"; - return 100 * y / dy; + _exdate.forEach(function(date) { + var zonedDate2 = new DateWithZone(date, tzid).rezonedDate(); + _exdateHash[Number(zonedDate2)] = true; + }); + iterResult.accept = function(date) { + var dt = Number(date); + if (isNaN(dt)) + return _accept.call(this, date); + if (!_exdateHash[dt]) { + evalExdate(new Date(dt - 1), new Date(dt + 1)); + if (!_exdateHash[dt]) { + _exdateHash[dt] = true; + return _accept.call(this, date); + } + } + return true; + }; + if (iterResult.method === "between") { + evalExdate(iterResult.args.after, iterResult.args.before); + iterResult.accept = function(date) { + var dt = Number(date); + if (!_exdateHash[dt]) { + _exdateHash[dt] = true; + return _accept.call(this, date); + } + return true; + }; } - function get_style(node, style) { - return (window.getComputedStyle ? window.getComputedStyle(node, null)[style] : node.currentStyle ? node.currentStyle[style] : null) || ""; + for (var i = 0; i < _rdate.length; i++) { + var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate(); + if (!iterResult.accept(new Date(zonedDate.getTime()))) + break; } - function de_day(node, n) { - var x = parseInt(node.style.left, 10); - for (var dx2 = 0; dx2 < scheduler2._cols.length; dx2++) { - x -= scheduler2._cols[dx2]; - if (x < 0) - return dx2; + _rrule.forEach(function(rrule) { + iter(iterResult, rrule.options); + }); + var res = iterResult._result; + sort(res); + switch (iterResult.method) { + case "all": + case "between": + return res; + case "before": + return res.length && res[res.length - 1] || null; + case "after": + default: + return res.length && res[0] || null; + } + } + var DEFAULT_OPTIONS = { dtstart: null, cache: false, unfold: false, forceset: false, compatible: false, tzid: null }; + function parseInput(s, options) { + var rrulevals = []; + var rdatevals = []; + var exrulevals = []; + var exdatevals = []; + var parsedDtstart = parseDtstart(s); + var dtstart = parsedDtstart.dtstart; + var tzid = parsedDtstart.tzid; + var lines = splitIntoLines(s, options.unfold); + lines.forEach(function(line) { + var _a; + if (!line) + return; + var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value; + switch (name.toUpperCase()) { + case "RRULE": + if (parms.length) { + throw new Error("unsupported RRULE parm: ".concat(parms.join(","))); + } + rrulevals.push(parseString(line)); + break; + case "RDATE": + var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1]; + if (rdateTzid && !tzid) { + tzid = rdateTzid; + } + rdatevals = rdatevals.concat(parseRDate(value, parms)); + break; + case "EXRULE": + if (parms.length) { + throw new Error("unsupported EXRULE parm: ".concat(parms.join(","))); + } + exrulevals.push(parseString(value)); + break; + case "EXDATE": + exdatevals = exdatevals.concat(parseRDate(value, parms)); + break; + case "DTSTART": + break; + default: + throw new Error("unsupported property: " + name); } - return n; + }); + return { dtstart, tzid, rrulevals, rdatevals, exrulevals, exdatevals }; + } + function buildRule(s, options) { + var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid; + var noCache = options.cache === false; + if (options.compatible) { + options.forceset = true; + options.unfold = true; } - function de_week(node, n) { - var y = parseInt(node.style.top, 10); - for (var dy2 = 0; dy2 < scheduler2._colsS.heights.length; dy2++) - if (scheduler2._colsS.heights[dy2] > y) - return dy2; - return n; + if (options.forceset || rrulevals.length > 1 || rdatevals.length || exrulevals.length || exdatevals.length) { + var rset_1 = new RRuleSet(noCache); + rset_1.dtstart(dtstart); + rset_1.tzid(tzid || void 0); + rrulevals.forEach(function(val2) { + rset_1.rrule(new RRule(groomRruleOptions(val2, dtstart, tzid), noCache)); + }); + rdatevals.forEach(function(date) { + rset_1.rdate(date); + }); + exrulevals.forEach(function(val2) { + rset_1.exrule(new RRule(groomRruleOptions(val2, dtstart, tzid), noCache)); + }); + exdatevals.forEach(function(date) { + rset_1.exdate(date); + }); + if (options.compatible && options.dtstart) + rset_1.rdate(dtstart); + return rset_1; } - function xml_start(tag) { - return tag ? "<" + tag + ">" : ""; + var val = rrulevals[0] || {}; + return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache); + } + function rrulestr(s, options) { + if (options === void 0) { + options = {}; } - function xml_end(tag) { - return tag ? "" : ""; + return buildRule(s, initializeOptions(options)); + } + function groomRruleOptions(val, dtstart, tzid) { + return __assign(__assign({}, val), { dtstart, tzid }); + } + function initializeOptions(options) { + var invalid = []; + var keys = Object.keys(options); + var defaultKeys2 = Object.keys(DEFAULT_OPTIONS); + keys.forEach(function(key) { + if (!includes(defaultKeys2, key)) + invalid.push(key); + }); + if (invalid.length) { + throw new Error("Invalid options: " + invalid.join(", ")); } - function xml_top(tag, profile, header, footer) { - var xml = "<" + tag + " profile='" + profile + "'"; - if (header) - xml += " header='" + header + "'"; - if (footer) - xml += " footer='" + footer + "'"; - xml += ">"; - return xml; + return __assign(__assign({}, DEFAULT_OPTIONS), options); + } + function extractName(line) { + if (line.indexOf(":") === -1) { + return { name: "RRULE", value: line }; } - function xml_body_header() { - var xml = ""; - var mode = scheduler2._mode; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) - mode = scheduler2.matrix[scheduler2._mode].render == "cell" ? "matrix" : "timeline"; - xml += ""; - if (scheduler2._mode == "week_agenda") { - var xh = scheduler2._els.dhx_cal_data[0].getElementsByTagName("DIV"); - for (var i = 0; i < xh.length; i++) - if (xh[i].className == "dhx_wa_scale_bar") - xml += "" + clean_html(xh[i].innerHTML) + ""; - } else if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { - var xh = scheduler2._els.dhx_cal_header[0].childNodes[0].childNodes; - xml += "" + clean_html(xh[0].innerHTML) + "" + clean_html(xh[1].innerHTML) + ""; - } else if (scheduler2._mode == "year") { - var xh = scheduler2._els.dhx_cal_data[0].childNodes; - for (var i = 0; i < xh.length; i++) { - xml += ""; - xml += xml_month_scale(xh[i].querySelector(".dhx_year_week").childNodes); - xml += xml_month(xh[i].querySelector(".dhx_year_body")); - xml += ""; - } + var _a = split(line, ":", 1), name = _a[0], value = _a[1]; + return { name, value }; + } + function breakDownLine(line) { + var _a = extractName(line), name = _a.name, value = _a.value; + var parms = name.split(";"); + if (!parms) + throw new Error("empty property name"); + return { name: parms[0].toUpperCase(), parms: parms.slice(1), value }; + } + function splitIntoLines(s, unfold) { + if (unfold === void 0) { + unfold = false; + } + s = s && s.trim(); + if (!s) + throw new Error("Invalid empty string"); + if (!unfold) { + return s.split(/\s/); + } + var lines = s.split("\n"); + var i = 0; + while (i < lines.length) { + var line = lines[i] = lines[i].replace(/\s+$/g, ""); + if (!line) { + lines.splice(i, 1); + } else if (i > 0 && line[0] === " ") { + lines[i - 1] += line.slice(1); + lines.splice(i, 1); } else { - xml += ""; - var xh = scheduler2._els.dhx_cal_header[0].childNodes; - xml += xml_month_scale(xh); - xml += ""; - var yh = scheduler2._els.dhx_cal_data[0]; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - xml += ""; - for (var i = 0; i < yh.firstChild.rows.length; i++) { - var el2 = yh.firstChild.rows[i]; - xml += ""; - } - xml += ""; - dy = yh.firstChild.rows[0].cells[0].offsetHeight; - } else if (yh.firstChild.tagName == "TABLE") { - xml += xml_month(yh); - } else { - yh = yh.childNodes[yh.childNodes.length - 1]; - while (yh.className.indexOf("dhx_scale_holder") == -1) - yh = yh.previousSibling; - yh = yh.childNodes; - xml += ""; - for (var i = 0; i < yh.length; i++) - xml += "\n"; - xml += ""; - dy = yh[0].offsetHeight; - } + i += 1; } - xml += ""; - return xml; } - function xml_month(yh) { - var xml = ""; - var r = yh.querySelectorAll("tr"); - for (var i = 0; i < r.length; i++) { - var days = []; - var cells = r[i].querySelectorAll("td"); - for (var j = 0; j < cells.length; j++) - days.push(cells[j].querySelector(".dhx_month_head").innerHTML); - xml += "\n"; - dy = cells[0].offsetHeight; + return lines; + } + function validateDateParm(parms) { + parms.forEach(function(parm) { + if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) { + throw new Error("unsupported RDATE/EXDATE parm: " + parm); } - return xml; - } - function xml_month_scale(xh) { - var xhs, xml = ""; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - if (scheduler2.matrix[scheduler2._mode].second_scale) - xhs = xh[1].childNodes; - xh = xh[0].childNodes; + }); + } + function parseRDate(rdateval, parms) { + validateDateParm(parms); + return rdateval.split(",").map(function(datestr) { + return untilStringToDate(datestr); + }); + } + function createGetterSetter(fieldName) { + var _this = this; + return function(field) { + if (field !== void 0) { + _this["_".concat(fieldName)] = field; } - for (var i = 0; i < xh.length; i++) - xml += "\n"; - dx = xh[0].offsetWidth; - if (xhs) { - var width = 0; - var top_width = xh[0].offsetWidth; - var top_col = 1; - for (var i = 0; i < xhs.length; i++) { - xml += "\n"; - width += xhs[i].offsetWidth; - if (width >= top_width) { - top_width += xh[top_col] ? xh[top_col].offsetWidth : 0; - top_col++; - } - dx = xhs[0].offsetWidth; + if (_this["_".concat(fieldName)] !== void 0) { + return _this["_".concat(fieldName)]; + } + for (var i = 0; i < _this._rrule.length; i++) { + var field_1 = _this._rrule[i].origOptions[fieldName]; + if (field_1) { + return field_1; } } - return xml; + }; + } + var RRuleSet = function(_super) { + __extends(RRuleSet2, _super); + function RRuleSet2(noCache) { + if (noCache === void 0) { + noCache = false; + } + var _this = _super.call(this, {}, noCache) || this; + _this.dtstart = createGetterSetter.apply(_this, ["dtstart"]); + _this.tzid = createGetterSetter.apply(_this, ["tzid"]); + _this._rrule = []; + _this._rdate = []; + _this._exrule = []; + _this._exdate = []; + return _this; } - function xml_body(colors) { - var xml = ""; - var evs = scheduler2._rendered; - var matrix = scheduler2.matrix && scheduler2.matrix[scheduler2._mode]; - if (scheduler2._mode == "agenda" || scheduler2._mode == "map") { - for (var i = 0; i < evs.length; i++) - xml += ""; - } else if (scheduler2._mode == "week_agenda") { - for (var i = 0; i < evs.length; i++) - xml += "" + clean_html(evs[i].innerHTML) + ""; - } else if (scheduler2._mode == "year") { - var evs = scheduler2.get_visible_events(); - for (var i = 0; i < evs.length; i++) { - var d = evs[i].start_date; - if (d.valueOf() < scheduler2._min_date.valueOf()) - d = scheduler2._min_date; - while (d < evs[i].end_date) { - var m = d.getMonth() + 12 * (d.getFullYear() - scheduler2._min_date.getFullYear()) - scheduler2.week_starts._month; - var day = scheduler2.week_starts[m] + d.getDate() - 1; - var text_color = colors ? get_style(scheduler2._get_year_cell(d), "color") : ""; - var bg_color = colors ? get_style(scheduler2._get_year_cell(d), "backgroundColor") : ""; - xml += ""; - d = scheduler2.date.add(d, 1, "day"); - if (d.valueOf() >= scheduler2._max_date.valueOf()) - break; - } - } - } else if (matrix && matrix.render == "cell") { - var evs = scheduler2._els.dhx_cal_data[0].getElementsByTagName("TD"); - for (var i = 0; i < evs.length; i++) { - var text_color = colors ? get_style(evs[i], "color") : ""; - var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; - xml += "\n"; - } - } else { - for (var i = 0; i < evs.length; i++) { - var zx, zdx; - if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - zx = x_norm(evs[i].style.left); - zdx = x_norm(evs[i].offsetWidth) - 1; - } else { - var left_norm = scheduler2.config.use_select_menu_space ? 0 : 26; - zx = x_norm_event(evs[i].style.left, left_norm, true); - zdx = x_norm_event(evs[i].style.width, left_norm) - 1; - } - if (isNaN(zdx * 1)) - continue; - var zy = y_norm(evs[i].style.top); - var zdy = y_norm(evs[i].style.height); - var e_type = evs[i].className.split(" ")[0].replace("dhx_cal_", ""); - if (e_type === "dhx_tooltip_line") - continue; - var dets = scheduler2.getEvent(evs[i].getAttribute(scheduler2.config.event_attribute)); - if (!dets) - continue; - var day = dets._sday; - var week = dets._sweek; - var length = dets._length || 0; - if (scheduler2._mode == "month") { - zdy = parseInt(evs[i].offsetHeight, 10); - zy = parseInt(evs[i].style.top, 10) - scheduler2.xy.month_head_height; - day = de_day(evs[i], day); - week = de_week(evs[i], week); - } else if (scheduler2.matrix && scheduler2.matrix[scheduler2._mode]) { - day = 0; - var el2 = evs[i].parentNode.parentNode.parentNode; - week = el2.rowIndex; - var dy_copy = dy; - dy = evs[i].parentNode.offsetHeight; - zy = y_norm(evs[i].style.top); - zy -= zy * 0.2; - dy = dy_copy; - } else { - if (evs[i].parentNode == scheduler2._els.dhx_cal_data[0]) - continue; - var parent = scheduler2._els["dhx_cal_data"][0].childNodes[0]; - var offset = parseFloat(parent.className.indexOf("dhx_scale_holder") != -1 ? parent.style.left : 0); - zx += x_norm(evs[i].parentNode.style.left, offset); + RRuleSet2.prototype._iter = function(iterResult) { + return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid()); + }; + RRuleSet2.prototype.rrule = function(rrule) { + _addRule(rrule, this._rrule); + }; + RRuleSet2.prototype.exrule = function(rrule) { + _addRule(rrule, this._exrule); + }; + RRuleSet2.prototype.rdate = function(date) { + _addDate(date, this._rdate); + }; + RRuleSet2.prototype.exdate = function(date) { + _addDate(date, this._exdate); + }; + RRuleSet2.prototype.rrules = function() { + return this._rrule.map(function(e) { + return rrulestr(e.toString()); + }); + }; + RRuleSet2.prototype.exrules = function() { + return this._exrule.map(function(e) { + return rrulestr(e.toString()); + }); + }; + RRuleSet2.prototype.rdates = function() { + return this._rdate.map(function(e) { + return new Date(e.getTime()); + }); + }; + RRuleSet2.prototype.exdates = function() { + return this._exdate.map(function(e) { + return new Date(e.getTime()); + }); + }; + RRuleSet2.prototype.valueOf = function() { + var result = []; + if (!this._rrule.length && this._dtstart) { + result = result.concat(optionsToString({ dtstart: this._dtstart })); + } + this._rrule.forEach(function(rrule) { + result = result.concat(rrule.toString().split("\n")); + }); + this._exrule.forEach(function(exrule) { + result = result.concat(exrule.toString().split("\n").map(function(line) { + return line.replace(/^RRULE:/, "EXRULE:"); + }).filter(function(line) { + return !/^DTSTART/.test(line); + })); + }); + if (this._rdate.length) { + result.push(rdatesToString("RDATE", this._rdate, this.tzid())); + } + if (this._exdate.length) { + result.push(rdatesToString("EXDATE", this._exdate, this.tzid())); + } + return result; + }; + RRuleSet2.prototype.toString = function() { + return this.valueOf().join("\n"); + }; + RRuleSet2.prototype.clone = function() { + var rrs = new RRuleSet2(!!this._cache); + this._rrule.forEach(function(rule) { + return rrs.rrule(rule.clone()); + }); + this._exrule.forEach(function(rule) { + return rrs.exrule(rule.clone()); + }); + this._rdate.forEach(function(date) { + return rrs.rdate(new Date(date.getTime())); + }); + this._exdate.forEach(function(date) { + return rrs.exdate(new Date(date.getTime())); + }); + return rrs; + }; + return RRuleSet2; + }(RRule); + function _addRule(rrule, collection) { + if (!(rrule instanceof RRule)) { + throw new TypeError(String(rrule) + " is not RRule instance"); + } + if (!includes(collection.map(String), String(rrule))) { + collection.push(rrule); + } + } + function _addDate(date, collection) { + if (!(date instanceof Date)) { + throw new TypeError(String(date) + " is not Date instance"); + } + if (!includes(collection.map(Number), Number(date))) { + collection.push(date); + sort(collection); + } + } + function rdatesToString(param, rdates, tzid) { + var isUTC = !tzid || tzid.toUpperCase() === "UTC"; + var header = isUTC ? "".concat(param, ":") : "".concat(param, ";TZID=").concat(tzid, ":"); + var dateString = rdates.map(function(rdate) { + return timeToUntilString(rdate.valueOf(), isUTC); + }).join(","); + return "".concat(header).concat(dateString); + } + function recurring(scheduler2) { + function clearMilliseconds(date) { + return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0); + } + function isDeletedOccurrence(event2) { + return !!event2.deleted; + } + function isSeries(event2) { + return !!event2.rrule && !event2.recurring_event_id; + } + function clearRecurringProperties(event2) { + event2.rrule = ""; + event2.original_start = null; + event2.recurring_event_id = null; + event2.duration = null; + event2.deleted = null; + } + function createException(ev) { + let id2 = ev.id.split("#"); + let nid = scheduler2.uid(); + scheduler2._not_render = true; + let nev = scheduler2._copy_event(ev); + nev.id = nid; + nev.recurring_event_id = id2[0]; + let timestamp = id2[1]; + nev.original_start = new Date(Number(timestamp)); + scheduler2._add_rec_marker(nev, timestamp); + scheduler2.addEvent(nev); + scheduler2._not_render = false; + } + scheduler2._rec_temp = []; + scheduler2._rec_markers_pull = {}; + scheduler2._rec_markers = {}; + scheduler2._add_rec_marker = function(ev, time) { + ev._pid_time = time; + this._rec_markers[ev.id] = ev; + if (!this._rec_markers_pull[ev.event_pid]) + this._rec_markers_pull[ev.event_pid] = {}; + this._rec_markers_pull[ev.event_pid][time] = ev; + }; + scheduler2._get_rec_marker = function(time, id2) { + let ch = this._rec_markers_pull[id2]; + if (ch) + return ch[time]; + return null; + }; + scheduler2._get_rec_markers = function(id2) { + return this._rec_markers_pull[id2] || []; + }; + (function() { + var old_add_event = scheduler2.addEvent; + scheduler2.addEvent = function(start_date, end_date, text, id2, extra_data) { + var ev_id = old_add_event.apply(this, arguments); + if (ev_id && scheduler2.getEvent(ev_id)) { + var ev = scheduler2.getEvent(ev_id); + if (ev.start_date) { + ev.start_date = clearMilliseconds(ev.start_date); } - xml += "\n"; - if (e_type == "event") { - xml += "
"; - var text_color = colors ? get_style(evs[i].childNodes[2], "color") : ""; - var bg_color = colors ? get_style(evs[i].childNodes[2], "backgroundColor") : ""; - xml += ""; - } else { - var text_color = colors ? get_style(evs[i], "color") : ""; - var bg_color = colors ? get_style(evs[i], "backgroundColor") : ""; - xml += ""; + if (ev.end_date) { + ev.end_date = clearMilliseconds(ev.end_date); } - xml += "
"; } + return ev_id; + }; + })(); + scheduler2.attachEvent("onEventLoading", function(event2) { + if (event2.original_start) { + event2.original_start = scheduler2.templates.parse_date(event2.original_start); } - return xml; - } - function toXML(start, end, view, mode, header, footer) { - var colors = false; - if (mode == "fullcolor") { - colors = true; - mode = "color"; + return true; + }); + scheduler2.attachEvent("onEventIdChange", function(id2, new_id) { + if (this._ignore_call) + return; + this._ignore_call = true; + if (scheduler2._rec_markers[id2]) { + scheduler2._rec_markers[new_id] = scheduler2._rec_markers[id2]; + delete scheduler2._rec_markers[id2]; } - mode = mode || "color"; - var xml = ""; - if (start) { - var original_date = scheduler2._date; - var original_mode = scheduler2._mode; - end = scheduler2.date[view + "_start"](end); - end = scheduler2.date["get_" + view + "_end"] ? scheduler2.date["get_" + view + "_end"](end) : scheduler2.date.add(end, 1, view); - xml = xml_top("pages", mode, header, footer); - for (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) { - this.setCurrentView(temp_date, view); - xml += xml_start("page") + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("page"); + if (scheduler2._rec_markers_pull[id2]) { + scheduler2._rec_markers_pull[new_id] = scheduler2._rec_markers_pull[id2]; + delete scheduler2._rec_markers_pull[id2]; + } + for (var i = 0; i < this._rec_temp.length; i++) { + var tev = this._rec_temp[i]; + if (tev.recurring_event_id == id2) { + tev.recurring_event_id = new_id; + this.changeEventId(tev.id, new_id + "#" + tev.id.split("#")[1]); } - xml += xml_end("pages"); - this.setCurrentView(original_date, original_mode); - } else { - xml = xml_top("data", mode, header, footer) + xml_body_header().replace("–", "-") + xml_body(colors) + xml_end("data"); } - return xml; - } - scheduler2.getPDFData = toXML; - function send_xml(xml, url2) { - var uid2 = scheduler2.uid(); - var d = document.createElement("div"); - d.style.display = "none"; - document.body.appendChild(d); - d.innerHTML = '
'; - document.getElementById(uid2).firstChild.value = encodeURIComponent(xml); - document.getElementById(uid2).submit(); - d.parentNode.removeChild(d); + for (var i in this._rec_markers) { + var tev = this._rec_markers[i]; + if (tev.recurring_event_id == id2) { + tev.recurring_event_id = new_id; + tev._pid_changed = true; + } + } + var el2 = scheduler2._rec_markers[new_id]; + if (el2 && el2._pid_changed) { + delete el2._pid_changed; + setTimeout(function() { + if (scheduler2.$destroyed) { + return true; + } + scheduler2.callEvent("onEventChanged", [new_id, scheduler2.getEvent(new_id)]); + }, 1); + } + delete this._ignore_call; + }); + function deleteEventFromSeries(idTimestamp, ev) { + let id2 = idTimestamp; + idTimestamp = id2.split("#"); + let nid = scheduler2.uid(); + let tid = idTimestamp[1] ? idTimestamp[1] : ev._pid_time; + let nev = scheduler2._copy_event(ev); + nev.id = nid; + nev.recurring_event_id = ev.recurring_event_id || idTimestamp[0]; + nev.original_start = new Date(Number(tid)); + nev.deleted = true; + scheduler2.addEvent(nev); } - function to_pdf(start, end, view, url2, mode, header, footer) { - var xml = ""; - if (typeof mode == "object") { - xml = schedulersToPdf(mode); + scheduler2.attachEvent("onConfirmedBeforeEventDelete", function(id2) { + var ev = this.getEvent(id2); + if (this._is_virtual_event(id2) || this._is_modified_occurence(ev) && !isDeletedOccurrence(ev)) { + deleteEventFromSeries(id2, ev); } else { - xml = toXML.apply(this, [start, end, view, mode, header, footer]); + if (isSeries(ev) && this._lightbox_id) + this._roll_back_dates(ev); + var sub = this._get_rec_markers(id2); + for (var i in sub) { + if (sub.hasOwnProperty(i)) { + id2 = sub[i].id; + if (this.getEvent(id2)) + this.deleteEvent(id2, true); + } + } } - send_xml(xml, url2); - } - function schedulersToPdf(objects) { - var xml = ""; - for (var i = 0; i < objects.length; i++) { - xml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer); + return true; + }); + scheduler2.attachEvent("onEventDeleted", function(id2, ev) { + if (!this._is_virtual_event(id2) && this._is_modified_occurence(ev)) { + if (!scheduler2._events[id2]) { + ev.deleted = true; + this.setEvent(id2, ev); + } } - xml += ""; - return xml; - } - scheduler2.toPDF = function(url2, mode, header, footer) { - return to_pdf.apply(this, [null, null, null, url2, mode, header, footer]); - }; - scheduler2.toPDFRange = function(start, end, view, url2, mode, header, footer) { - if (typeof start == "string") { - start = scheduler2.templates.api_date(start); - end = scheduler2.templates.api_date(end); + }); + scheduler2.attachEvent("onEventChanged", function(id2, event2) { + if (this._loading) + return true; + var ev = this.getEvent(id2); + if (this._is_virtual_event(id2)) { + createException(ev); + } else { + if (ev.start_date) { + ev.start_date = clearMilliseconds(ev.start_date); + } + if (ev.end_date) { + ev.end_date = clearMilliseconds(ev.end_date); + } + if (isSeries(ev) && this._lightbox_id) { + this._roll_back_dates(ev); + } + var sub = this._get_rec_markers(id2); + for (var i in sub) { + if (sub.hasOwnProperty(i)) { + delete this._rec_markers[sub[i].id]; + this.deleteEvent(sub[i].id, true); + } + } + delete this._rec_markers_pull[id2]; + var isEventFound = false; + for (var k = 0; k < this._rendered.length; k++) { + if (this._rendered[k].getAttribute(this.config.event_attribute) == id2) + isEventFound = true; + } + if (!isEventFound) + this._select_id = null; } - return to_pdf.apply(this, arguments); - }; - } - function quick_info(scheduler2) { - scheduler2.config.icons_select = ["icon_form", "icon_delete"]; - scheduler2.config.details_on_create = true; - scheduler2.config.show_quick_info = true; - scheduler2.xy.menu_width = 0; - scheduler2.attachEvent("onClick", function(id2) { - if (!scheduler2.config.show_quick_info) { - return; + return true; + }); + scheduler2.attachEvent("onEventAdded", function(id2) { + if (!this._loading) { + var ev = this.getEvent(id2); + if (isSeries(ev)) { + this._roll_back_dates(ev); + } } - scheduler2.showQuickInfo(id2); return true; }); - (function() { - var events = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeEventDelete", "onBeforeDrag"]; - var hiding_function = function() { - scheduler2.hideQuickInfo(true); - return true; - }; - for (var i = 0; i < events.length; i++) { - scheduler2.attachEvent(events[i], hiding_function); + scheduler2.attachEvent("onEventSave", function(id2, data, is_new_event) { + var ev = this.getEvent(id2); + if (isSeries(ev)) + this._select_id = null; + return true; + }); + scheduler2.attachEvent("onEventCreated", function(id2) { + var ev = this.getEvent(id2); + if (!isSeries(ev)) { + clearRecurringProperties(ev); + } + return true; + }); + scheduler2.attachEvent("onEventCancel", function(id2) { + var ev = this.getEvent(id2); + if (isSeries(ev)) { + this._roll_back_dates(ev); + this.render_view_data(); + } + }); + scheduler2._roll_back_dates = function(ev) { + if (ev.start_date) { + ev.start_date = clearMilliseconds(ev.start_date); + } + if (ev.end_date) { + ev.end_date = clearMilliseconds(ev.end_date); + } + ev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1e3); + ev.end_date = ev._end_date; + if (ev._start_date) { + ev.start_date.setMonth(0); + ev.start_date.setDate(ev._start_date.getDate()); + ev.start_date.setMonth(ev._start_date.getMonth()); + ev.start_date.setFullYear(ev._start_date.getFullYear()); } - })(); - scheduler2.templates.quick_info_title = function(start, end, ev) { - return ev.text.substr(0, 50); }; - scheduler2.templates.quick_info_content = function(start, end, ev) { - return ev.details || ""; + scheduler2._is_virtual_event = function(id2) { + return id2.toString().indexOf("#") != -1; }; - scheduler2.templates.quick_info_date = function(start, end, ev) { - if (scheduler2.isOneDayEvent(ev) && scheduler2.config.rtl) { - return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(end, start, ev); - } else if (scheduler2.isOneDayEvent(ev)) { - return scheduler2.templates.day_date(start, end, ev) + " " + scheduler2.templates.event_header(start, end, ev); - } else if (scheduler2.config.rtl) { - return scheduler2.templates.week_date(end, start, ev); - } else { - return scheduler2.templates.week_date(start, end, ev); + scheduler2._is_modified_occurence = function(ev) { + return ev.recurring_event_id && ev.recurring_event_id != "0"; + }; + scheduler2.showLightbox_rec = scheduler2.showLightbox; + scheduler2.showLightbox = function(id2) { + var locale = this.locale; + var c = scheduler2.config.lightbox_recurring; + var ev = this.getEvent(id2); + var pid = ev.recurring_event_id; + var isVirtual = this._is_virtual_event(id2); + if (isVirtual) + pid = id2.split("#")[0]; + var showSeries = function(id3) { + var event2 = scheduler2.getEvent(id3); + event2._end_date = event2.end_date; + event2.end_date = new Date(event2.start_date.valueOf() + event2.duration * 1e3); + return scheduler2.showLightbox_rec(id3); + }; + if ((pid || pid * 1 === 0) && isSeries(ev)) { + return showSeries(id2); } - }; - scheduler2.showQuickInfo = function(id2) { - if (id2 == this._quick_info_box_id) - return; - this.hideQuickInfo(true); - if (this.callEvent("onBeforeQuickInfo", [id2]) === false) { - return; + if (!pid || pid === "0" || (!locale.labels.confirm_recurring || c == "instance" || c == "series" && !isVirtual)) { + return this.showLightbox_rec(id2); } - var pos = this._get_event_counter_part(id2); - if (pos) { - this._quick_info_box = this._init_quick_info(pos); - this._fill_quick_data(id2); - this._show_quick_info(pos); - this.callEvent("onQuickInfo", [id2]); + if (c == "ask") { + var that = this; + scheduler2.modalbox({ text: locale.labels.confirm_recurring, title: locale.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel], callback: function(index) { + switch (+index) { + case 0: + return showSeries(pid); + case 1: + return that.showLightbox_rec(id2); + case 2: + return; + } + } }); + } else { + showSeries(pid); } }; - (function() { - function cssTimeToMs(time) { - time = time || ""; - var num = parseFloat(time), unit = time.match(/m?s/), milliseconds; - if (unit) { - unit = unit[0]; + function groupExceptions() { + const exceptions = {}; + for (const i in scheduler2._events) { + const ev = scheduler2._events[i]; + if (ev.recurring_event_id) { + if (!exceptions[ev.recurring_event_id]) { + exceptions[ev.recurring_event_id] = {}; + } + exceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev; } - switch (unit) { - case "s": - milliseconds = num * 1e3; - break; - case "ms": - milliseconds = num; - break; - default: - milliseconds = 0; - break; + } + return exceptions; + } + scheduler2.get_visible_events_rec = scheduler2.get_visible_events; + scheduler2.get_visible_events = function(only_timed) { + for (var i = 0; i < this._rec_temp.length; i++) + delete this._events[this._rec_temp[i].id]; + this._rec_temp = []; + const exceptions = groupExceptions(); + var stack = this.get_visible_events_rec(only_timed); + var out = []; + for (var i = 0; i < stack.length; i++) { + if (stack[i].deleted || stack[i].recurring_event_id) { + continue; + } + if (isSeries(stack[i])) { + this.repeat_date(stack[i], out, void 0, void 0, void 0, void 0, exceptions); + } else { + out.push(stack[i]); } - return milliseconds; } - scheduler2.hideQuickInfo = function(forced) { - var qi = this._quick_info_box; - var eventId = this._quick_info_box_id; - this._quick_info_box_id = 0; - if (qi && qi.parentNode) { - var width = qi.offsetWidth; - if (scheduler2.config.quick_info_detached) { - this.callEvent("onAfterQuickInfo", [eventId]); - return qi.parentNode.removeChild(qi); - } - if (qi.style.right == "auto") - qi.style.left = -width + "px"; - else - qi.style.right = -width + "px"; - if (forced) { - qi.parentNode.removeChild(qi); - } else { - var style; - if (window.getComputedStyle) { - style = window.getComputedStyle(qi, null); - } else if (qi.currentStyle) { - style = qi.currentStyle; - } - var delay2 = cssTimeToMs(style["transition-delay"]) + cssTimeToMs(style["transition-duration"]); - setTimeout(function() { - if (qi.parentNode) { - qi.parentNode.removeChild(qi); - } - }, delay2); - } - this.callEvent("onAfterQuickInfo", [eventId]); + return out; + }; + (function() { + var old = scheduler2.isOneDayEvent; + scheduler2.isOneDayEvent = function(ev) { + if (isSeries(ev)) + return true; + return old.call(this, ev); + }; + var old_update_event = scheduler2.updateEvent; + scheduler2.updateEvent = function(id2) { + var ev = scheduler2.getEvent(id2); + if (ev && isSeries(ev) && !this._is_virtual_event(id2)) { + scheduler2.update_view(); + } else { + old_update_event.call(this, id2); } }; })(); - scheduler2.event(window, "keydown", function(e) { - if (e.keyCode == 27) - scheduler2.hideQuickInfo(); - }); - scheduler2._show_quick_info = function(pos) { - var qi = scheduler2._quick_info_box; - scheduler2._obj.appendChild(qi); - var width = qi.offsetWidth; - var height = qi.offsetHeight; - if (scheduler2.config.quick_info_detached) { - var left = pos.left - pos.dx * (width - pos.width); - if (scheduler2.getView() && scheduler2.getView()._x_scroll) { - if (scheduler2.config.rtl) { - left += scheduler2.getView()._x_scroll; + const toIcalString = scheduler2.date.date_to_str("%Y%m%dT%H%i%s"); + scheduler2.repeat_date = function(ev, stack, non_render, from, to, maxCount, exceptions) { + if (!ev.rrule) { + return; + } + let seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id]; + if (!seriesExceptions) { + seriesExceptions = {}; + } + if (!from) { + from = scheduler2._min_date; + } + if (!to) { + to = scheduler2._max_date; + } + const utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds())); + const parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart }); + const repeatedDates = parsedRRule.between(from, to).map((date) => { + const adjustedDate = new Date(date); + adjustedDate.setHours(ev.start_date.getHours()); + adjustedDate.setMinutes(ev.start_date.getMinutes()); + adjustedDate.setSeconds(ev.start_date.getSeconds()); + return adjustedDate; + }); + let visibleCount = 0; + const eventDuration = ev.duration; + for (let i = 0; i < repeatedDates.length; i++) { + if (maxCount && visibleCount >= maxCount) { + break; + } + const date = repeatedDates[i]; + let exception = seriesExceptions[date.valueOf()]; + if (exception) { + if (exception.deleted) { + continue; } else { - left -= scheduler2.getView()._x_scroll; + visibleCount++; + stack.push(exception); } + } else { + const copy = scheduler2._copy_event(ev); + copy.text = ev.text; + copy.start_date = date; + copy.id = ev.id + "#" + Math.ceil(date.valueOf()); + copy.end_date = new Date(date.valueOf() + eventDuration * 1e3); + copy.end_date = scheduler2._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date); + copy._timed = scheduler2.isOneDayEvent(copy); + if (!copy._timed && !scheduler2._table_view && !scheduler2.config.multi_day) + continue; + stack.push(copy); + if (!non_render) { + scheduler2._events[copy.id] = copy; + scheduler2._rec_temp.push(copy); + } + visibleCount++; } - var right = left + width; - if (right > window.innerWidth) { - left = window.innerWidth - width; - } - left = Math.max(0, left); - qi.style.left = left + "px"; - qi.style.top = pos.top - (pos.dy ? height : -pos.height) + "px"; - } else { - const dataPos = scheduler2.$container.querySelector(".dhx_cal_data").offsetTop; - qi.style.top = dataPos + 20 + "px"; - if (pos.dx == 1) { - qi.style.right = "auto"; - qi.style.left = -width + "px"; - setTimeout(function() { - qi.style.left = "-10px"; - }, 1); + } + }; + scheduler2._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) { + var shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset(); + if (shift) { + if (shift > 0) { + return new Date(counter.valueOf() + ev.duration * 1e3 - shift * 60 * 1e3); } else { - qi.style.left = "auto"; - qi.style.right = -width + "px"; - setTimeout(function() { - qi.style.right = "-10px"; - }, 1); + return new Date(end_date.valueOf() - shift * 60 * 1e3); } - qi.className = qi.className.replace(" dhx_qi_left", "").replace(" dhx_qi_right", "") + " dhx_qi_" + (pos.dx == 1 ? "left" : "right"); } + return new Date(default_date.valueOf()); }; - scheduler2.attachEvent("onTemplatesReady", function() { - scheduler2.hideQuickInfo(); - if (this._quick_info_box) { - var box = this._quick_info_box; - if (box.parentNode) { - box.parentNode.removeChild(box); + scheduler2.getRecDates = function(id2, max) { + var ev = typeof id2 == "object" ? id2 : scheduler2.getEvent(id2); + var recurrings = []; + max = max || 100; + if (!isSeries(ev)) { + return [{ start_date: ev.start_date, end_date: ev.end_date }]; + } + if (ev.deleted) { + return []; + } + scheduler2.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max); + var result = []; + for (var i = 0; i < recurrings.length; i++) { + if (!recurrings[i].deleted) { + result.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date }); } - this._quick_info_box = null; } - }); - scheduler2._quick_info_onscroll_handler = function(e) { - scheduler2.hideQuickInfo(); + return result; }; - scheduler2._init_quick_info = function() { - if (!this._quick_info_box) { - var qi = this._quick_info_box = document.createElement("div"); - this._waiAria.quickInfoAttr(qi); - qi.className = "dhx_cal_quick_info"; - if (scheduler2.$testmode) - qi.className += " dhx_no_animate"; - if (scheduler2.config.rtl) - qi.className += " dhx_quick_info_rtl"; - var ariaAttr = this._waiAria.quickInfoHeaderAttrString(); - var html = ` -
- -
-
- -
-
-
-
`; - html += '
'; - var buttons = scheduler2.config.icons_select; - for (var i = 0; i < buttons.length; i++) { - var ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]); - html += `
-
${scheduler2.locale.labels[buttons[i]]}
`; + scheduler2.getEvents = function(from, to) { + var result = []; + const exceptions = groupExceptions(); + for (var a in this._events) { + var ev = this._events[a]; + if (ev.recurring_event_id) { + continue; } - html += "
"; - qi.innerHTML = html; - scheduler2.event(qi, "click", function(ev) { - scheduler2._qi_button_click(ev.target || ev.srcElement); - }); - if (scheduler2.config.quick_info_detached) { - scheduler2._detachDomEvent(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); - scheduler2.event(scheduler2._els["dhx_cal_data"][0], "scroll", scheduler2._quick_info_onscroll_handler); + if (isSeries(ev)) { + if (from && to && ev.start_date < to && ev.end_date > from) { + var sev = []; + this.repeat_date(ev, sev, true, from, to, void 0, exceptions); + sev.forEach(function(occurence) { + if (occurence.start_date < to && occurence.end_date > from) { + result.push(occurence); + } + }); + } else if (!from && !to) { + result.push(ev); + } + } else if (!this._is_virtual_event(ev.id)) { + result.push(ev); } } - return this._quick_info_box; - }; - scheduler2._qi_button_click = function(node) { - var box = scheduler2._quick_info_box; - if (!node || node == box) - return; - if (node.closest(".dhx_cal_qi_close_btn")) { - scheduler2.hideQuickInfo(); - return; + return result; + }; + scheduler2._copy_dummy = function(ev) { + var start_date = new Date(this.start_date); + var end_date = new Date(this.end_date); + this.start_date = start_date; + this.end_date = end_date; + this.duration = this.rrule = null; + }; + scheduler2.config.include_end_by = false; + scheduler2.config.lightbox_recurring = "ask"; + scheduler2.config.recurring_workdays = [RRule.MO.weekday, RRule.TU.weekday, RRule.WE.weekday, RRule.TH.weekday, RRule.FR.weekday]; + scheduler2.config.repeat_date = "%m.%d.%Y"; + scheduler2.config.lightbox.sections = [{ name: "description", map_to: "text", type: "textarea", focus: true }, { name: "recurring", type: "recurring", map_to: "rec_type" }, { name: "time", height: 72, type: "time", map_to: "auto" }]; + scheduler2.attachEvent("onClearAll", function() { + scheduler2._rec_markers = {}; + scheduler2._rec_markers_pull = {}; + scheduler2._rec_temp = []; + }); + function getTopLevelOption(rruleObj, untilDate) { + const options = rruleObj.options; + const until = options.until || untilDate; + const hasEndCondition = options.count || until && until.getFullYear() !== 9999; + if (hasEndCondition) { + return "CUSTOM"; + } + if (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) { + return "DAILY"; + } else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) { + return "WEEKLY"; + } else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) { + return "MONTHLY"; + } else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) { + return "YEARLY"; + } else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler2.config.recurring_workdays.length && options.byweekday.includes(RRule.MO) && options.byweekday.includes(RRule.TU) && options.byweekday.includes(RRule.WE) && options.byweekday.includes(RRule.TH) && options.byweekday.includes(RRule.FR)) { + return "WORKDAYS"; + } else { + return "CUSTOM"; + } + } + function getWeekdayOfMonth(date) { + const dayOfWeek = date.getDay(); + const dayOfMonth = date.getDate(); + const dayNumber = Math.ceil(dayOfMonth / 7); + return { dayOfWeek, dayNumber }; + } + const jsDaysToRRULEDays = { 0: "SU", 1: "MO", 2: "TU", 3: "WE", 4: "TH", 5: "FR", 6: "SA" }; + const RruleDayNumsToJs = { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0 }; + function fillCustomDaily(node, rule) { + node.querySelector("[name='repeat_interval_value']").value = (rule ? rule.interval : 1) || 1; + } + function fillCustomWeekly(node, rule, event2) { + node.querySelector("[name='repeat_interval_value']").value = (rule ? rule.interval : 1) || 1; + const dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`); + dayCheckboxes.forEach((ch) => ch.checked = false); + if (rule && rule.byweekday) { + rule.byweekday.forEach((day) => { + const dayNum = RruleDayNumsToJs[day.weekday]; + const dayLabel = jsDaysToRRULEDays[dayNum]; + node.querySelector(`.dhx_form_repeat_custom_week input[value="${dayLabel}"]`).checked = true; + }); + } else { + const dayLabel = jsDaysToRRULEDays[event2.start_date.getDay()]; + node.querySelector(`.dhx_form_repeat_custom_week input[value="${dayLabel}"]`).checked = true; } - var mask = scheduler2._getClassName(node); - if (mask.indexOf("_icon") != -1) { - var id2 = scheduler2._quick_info_box_id; - scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2); - } else - scheduler2._qi_button_click(node.parentNode); - }; - scheduler2._get_event_counter_part = function(id2) { - var domEv = scheduler2.getRenderedEvent(id2); - var left = 0; - var top = 0; - var node = domEv; - while (node && node != scheduler2._obj) { - left += node.offsetLeft; - top += node.offsetTop - node.scrollTop; - node = node.offsetParent; + } + function fillCustomMonthly(node, rule, event2) { + node.querySelector("[name='repeat_interval_value']").value = (rule ? rule.interval : 1) || 1; + const dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value="month_date"]`); + const nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value="month_nth_weekday"]`); + dateOfMonth.innerText = scheduler2.templates.repeat_monthly_date(event2.start_date, event2); + nthWeekDayOfMonth.innerText = scheduler2.templates.repeat_monthly_weekday(event2.start_date, event2); + if (!rule || rule.bysetpos && !(rule.byweekday && rule.byweekday.length)) { + node.querySelector(`[name="dhx_custom_month_option"]`).value = "month_date"; + } else { + node.querySelector(`[name="dhx_custom_month_option"]`).value = "month_nth_weekday"; } - if (node) { - var dx = left + domEv.offsetWidth / 2 > scheduler2._x / 2 ? 1 : 0; - var dy = top + domEv.offsetHeight / 2 > scheduler2._y / 2 ? 1 : 0; - return { left, top, dx, dy, width: domEv.offsetWidth, height: domEv.offsetHeight }; + } + function formatDayNumber(date) { + switch (date) { + case 1: + case 31: + return `${date}st`; + case 2: + return `${date}nd`; + case 3: + return `${date}rd`; + default: + return `${date}th`; } - return 0; - }; - scheduler2._fill_quick_data = function(id2) { - var ev = scheduler2.getEvent(id2); - var qi = scheduler2._quick_info_box; - scheduler2._quick_info_box_id = id2; - var header = { content: scheduler2.templates.quick_info_title(ev.start_date, ev.end_date, ev), date: scheduler2.templates.quick_info_date(ev.start_date, ev.end_date, ev) }; - var titleContent = qi.querySelector(".dhx_cal_qi_tcontent"); - titleContent.innerHTML = `${header.content}`; - var titleDate = qi.querySelector(".dhx_cal_qi_tdate"); - titleDate.innerHTML = header.date; - scheduler2._waiAria.quickInfoHeader(qi, [header.content, header.date].join(" ")); - var main = qi.querySelector(".dhx_cal_qi_content"); - const mainContent = scheduler2.templates.quick_info_content(ev.start_date, ev.end_date, ev); - if (mainContent) { - main.classList.remove("dhx_hidden"); - main.innerHTML = mainContent; + } + scheduler2.templates.repeat_monthly_date = function(startDate, event2) { + const date = startDate.getDate(); + return `Every ${formatDayNumber(date)}`; + }; + scheduler2.templates.repeat_monthly_weekday = function(startDate, event2) { + const nthDayOfMonth = getWeekdayOfMonth(startDate); + return `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler2.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`; + }; + scheduler2.templates.repeat_yearly_month_date = function(startDate, event2) { + const date = startDate.getDate(); + const monthLabel = scheduler2.locale.date.month_full[startDate.getMonth()]; + return `Every ${formatDayNumber(date)} day of ${monthLabel}`; + }; + scheduler2.templates.repeat_yearly_month_weekday = function(startDate, event2) { + const nthDayOfMonth = getWeekdayOfMonth(startDate); + const monthLabel = scheduler2.locale.date.month_full[startDate.getMonth()]; + return `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler2.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`; + }; + function fillCustomYearly(node, rule, event2) { + const dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value="month_date"]`); + const nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value="month_nth_weekday"]`); + dateOfYear.innerText = scheduler2.templates.repeat_yearly_month_date(event2.start_date, event2); + nthWeekDayOfYear.innerText = scheduler2.templates.repeat_yearly_month_weekday(event2.start_date, event2); + if (!rule || rule.bysetpos && !(rule.byweekday && rule.byweekday.length)) { + node.querySelector(`[name="dhx_custom_year_option"]`).value = "month_date"; } else { - main.classList.add("dhx_hidden"); + node.querySelector(`[name="dhx_custom_year_option"]`).value = "month_nth_weekday"; } - }; - } - function readonly(scheduler2) { - scheduler2.attachEvent("onTemplatesReady", function() { - var originalRecurringSetValue; - if (scheduler2.form_blocks.recurring) { - originalRecurringSetValue = scheduler2.form_blocks.recurring.set_value; + } + function fillEndRule(node, rule, event2) { + const countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_after"]`); + const ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_ondate"]`); + const endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`); + countInput.value = 1; + let formatter = scheduler2.date.date_to_str("%Y-%m-%d"); + if (!scheduler2.config.repeat_date_of_end) { + scheduler2.config.repeat_date_of_end = formatter(scheduler2.date.add(scheduler2._currentDate(), 30, "day")); } - var original_left_buttons = scheduler2.config.buttons_left.slice(); - var original_right_buttons = scheduler2.config.buttons_right.slice(); - scheduler2.attachEvent("onBeforeLightbox", function(id2) { - if (this.config.readonly_form || this.getEvent(id2).readonly) { - this.config.readonly_active = true; - } else { - this.config.readonly_active = false; - scheduler2.config.buttons_left = original_left_buttons.slice(); - scheduler2.config.buttons_right = original_right_buttons.slice(); - if (scheduler2.form_blocks.recurring) { - scheduler2.form_blocks.recurring.set_value = originalRecurringSetValue; - } - } - var sns = this.config.lightbox.sections; - if (this.config.readonly_active) { - for (var i = 0; i < sns.length; i++) { - if (sns[i].type == "recurring") { - if (this.config.readonly_active && scheduler2.form_blocks.recurring) { - scheduler2.form_blocks.recurring.set_value = function(node, value, ev) { - var wrapper = scheduler2.$domHelpers.closest(node, ".dhx_wrap_section"); - var style = "none"; - wrapper.querySelector(".dhx_cal_lsection").display = style; - wrapper.querySelector(".dhx_form_repeat").display = style; - wrapper.style.display = style; - scheduler2.setLightboxSize(); - }; - } + ondateInput.value = scheduler2.config.repeat_date_of_end; + if (rule && rule.count) { + endOptionSelect.value = "AFTER"; + countInput.value = rule.count; + } else if (event2._end_date && event2._end_date.getFullYear() !== 9999) { + endOptionSelect.value = "ON"; + ondateInput.value = formatter(event2._end_date); + } else { + endOptionSelect.value = "NEVER"; + } + endOptionSelect.dispatchEvent(new Event("change")); + } + const getRecValue = { MONTHLY: function(dates) { + const rrule = { freq: RRule.MONTHLY, interval: 1, bymonthday: dates.start.getDate() }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, WEEKLY: function(dates) { + let day = dates.start.getDay() - 1; + if (day == -1) + day = 6; + const rrule = { freq: RRule.WEEKLY, interval: 1, byweekday: [day] }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, DAILY: function(dates) { + const rrule = { freq: RRule.DAILY, interval: 1 }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, YEARLY: function(dates) { + const rrule = { freq: RRule.YEARLY, bymonth: dates.start.getMonth() + 1, interval: 1, bymonthday: dates.start.getDate() }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, WORKDAYS: function(dates) { + const rrule = { freq: RRule.WEEKLY, interval: 1, byweekday: scheduler2.config.recurring_workdays }; + const until = new Date(9999, 1, 1); + return { rrule, until }; + }, CUSTOM: function(dates, node) { + const rrule = {}; + const freq = node.querySelector(`[name="repeat_interval_unit"]`).value; + const interval = Math.max(1, node.querySelector(`[name="repeat_interval_value"]`).value); + const monthRepeat = node.querySelector(`[name="dhx_custom_month_option"]`).value; + const yearRepeat = node.querySelector(`[name="dhx_custom_year_option"]`).value; + rrule.interval = interval; + let days; + let day; + switch (freq) { + case "DAILY": + rrule.freq = RRule.DAILY; + break; + case "WEEKLY": + rrule.freq = RRule.WEEKLY; + days = []; + node.querySelectorAll(`.dhx_form_repeat_custom_week [name="week_day"]`).forEach((ch) => { + if (ch.checked) { + days.push(ch.value); } - } - var forbidden_buttons = ["dhx_delete_btn", "dhx_save_btn"]; - var button_arrays = [scheduler2.config.buttons_left, scheduler2.config.buttons_right]; - for (var i = 0; i < forbidden_buttons.length; i++) { - var forbidden_button = forbidden_buttons[i]; - for (var k = 0; k < button_arrays.length; k++) { - var button_array = button_arrays[k]; - var index = -1; - for (var p = 0; p < button_array.length; p++) { - if (button_array[p] == forbidden_button) { - index = p; - break; - } - } - if (index != -1) { - button_array.splice(index, 1); - } + }); + rrule.byweekday = days.map((day2) => { + switch (day2) { + case "MO": + return RRule.MO.weekday; + case "TU": + return RRule.TU.weekday; + case "WE": + return RRule.WE.weekday; + case "TH": + return RRule.TH.weekday; + case "FR": + return RRule.FR.weekday; + case "SA": + return RRule.SA.weekday; + case "SU": + return RRule.SU.weekday; } + }); + break; + case "MONTHLY": + rrule.freq = RRule.MONTHLY; + if (monthRepeat === "month_date") { + rrule.bymonthday = dates.start.getDate(); + } else { + day = dates.start.getDay() - 1; + if (day == -1) + day = 6; + rrule.byweekday = [day]; + rrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber; } - } - this.resetLightbox(); - return true; - }); - function txt_replace(tag, d, n, text) { - var txts = d.getElementsByTagName(tag); - var txtt = n.getElementsByTagName(tag); - for (var i = txtt.length - 1; i >= 0; i--) { - var n = txtt[i]; - if (!text) { - n.disabled = true; - if (d.checked) - n.checked = true; + break; + case "YEARLY": + rrule.freq = RRule.YEARLY; + rrule.bymonth = dates.start.getMonth() + 1; + if (yearRepeat == "month_date") { + rrule.bymonthday = dates.start.getDate(); } else { - var t = document.createElement("span"); - t.className = "dhx_text_disabled"; - t.innerHTML = text(txts[i]); - n.parentNode.insertBefore(t, n); - n.parentNode.removeChild(n); + day = dates.start.getDay() - 1; + if (day == -1) + day = 6; + rrule.byweekday = [day]; + rrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber; } + break; + } + let until = new Date(9999, 1, 1); + const endRule = node.querySelector(`[name="dhx_custom_repeat_ends"]`); + if (endRule === "ON") { + until = node.querySelector(`[name="dhx_form_repeat_ends_ondate"]`).value; + } else if (endRule === "AFTER") { + rrule.count = Math.max(1, node.querySelector(`[name="dhx_form_repeat_ends_after"]`).value); + } + return { rrule, until }; + }, NEVER: function() { + } }; + function fillInDefaults(node, rule, event2) { + fillCustomDaily(node, rule); + fillCustomWeekly(node, rule, event2); + fillCustomMonthly(node, rule, event2); + fillCustomYearly(node, rule, event2); + fillEndRule(node, rule, event2); + } + scheduler2.form_blocks["recurring"] = { render: function(sns) { + if (sns.form) { + let rec = scheduler2.form_blocks["recurring"]; + let form = rec._get_node(sns.form); + let html = rec._outer_html(form); + form.style.display = "none"; + return html; + } + let loc = scheduler2.locale.labels; + return `
+
+ +
+
+
+ + +
+ +
+
+ + + + + + + +
+ +
+ +
+ +
+ +
+
+ +
+
${loc.repeat_ends}
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
`; + }, _init_set_value: function(node, value, event2) { + scheduler2.form_blocks["recurring"]._ds = { start: event2.start_date, end: event2.end_date }; + function hide(node2) { + node2.classList.add("dhx_hidden"); + } + function show(node2) { + node2.classList.remove("dhx_hidden"); + } + function onRepeatOptionChange(value2) { + const repeat2 = node.querySelector(".dhx_form_repeat_custom"); + if (value2 === "CUSTOM") { + show(repeat2); + } else { + hide(repeat2); } } - var old = scheduler2._fill_lightbox; - scheduler2._fill_lightbox = function() { - var lb = this.getLightbox(); - if (this.config.readonly_active) { - lb.style.visibility = "hidden"; - lb.style.display = "block"; + function onCustomRepeatIntervalChange(value2) { + const nodes = { weekly: node.querySelector(".dhx_form_repeat_custom_week"), monthly: node.querySelector(".dhx_form_repeat_custom_month"), yearly: node.querySelector(".dhx_form_repeat_custom_year") }; + switch (value2) { + case "DAILY": + hide(nodes.weekly); + hide(nodes.monthly); + hide(nodes.yearly); + break; + case "WEEKLY": + show(nodes.weekly); + hide(nodes.monthly); + hide(nodes.yearly); + break; + case "MONTHLY": + hide(nodes.weekly); + show(nodes.monthly); + hide(nodes.yearly); + break; + case "YEARLY": + hide(nodes.weekly); + hide(nodes.monthly); + show(nodes.yearly); + break; } - var res = old.apply(this, arguments); - if (this.config.readonly_active) { - lb.style.visibility = ""; - lb.style.display = "none"; + } + function onCustomRepeatEndRule(value2) { + const nodes = { after: node.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after"), on: node.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on") }; + switch (value2) { + case "NEVER": + hide(nodes.after); + hide(nodes.on); + break; + case "AFTER": + show(nodes.after); + hide(nodes.on); + break; + case "ON": + hide(nodes.after); + show(nodes.on); + break; } - if (this.config.readonly_active) { - var originalForm = this.getLightbox(); - var readonlyForm = this._lightbox_r = originalForm.cloneNode(true); - readonlyForm.id = scheduler2.uid(); - readonlyForm.className += " dhx_cal_light_readonly"; - txt_replace("textarea", originalForm, readonlyForm, function(a) { - return a.value; - }); - txt_replace("input", originalForm, readonlyForm, false); - txt_replace("select", originalForm, readonlyForm, function(a) { - if (!a.options.length) - return ""; - return a.options[Math.max(a.selectedIndex || 0, 0)].text; - }); - originalForm.parentNode.insertBefore(readonlyForm, originalForm); - this.showCover(readonlyForm); - if (scheduler2._lightbox) - scheduler2._lightbox.parentNode.removeChild(scheduler2._lightbox); - this._lightbox = readonlyForm; - if (scheduler2.config.drag_lightbox) - scheduler2.event(readonlyForm.firstChild, "mousedown", scheduler2._ready_to_dnd); - scheduler2._init_lightbox_events(); - this.setLightboxSize(); + } + node.querySelector(".dhx_form_repeat_pattern select").addEventListener("change", function() { + onRepeatOptionChange(this.value); + }); + node.querySelector(".dhx_form_repeat_custom_interval [name='repeat_interval_unit']").addEventListener("change", function() { + onCustomRepeatIntervalChange(this.value); + }); + node.querySelector(".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']").addEventListener("change", function() { + onCustomRepeatEndRule(this.value); + }); + scheduler2._lightbox._rec_init_done = true; + }, button_click: function() { + }, set_value: function(node, value, ev) { + let rf = scheduler2.form_blocks["recurring"]; + if (!scheduler2._lightbox._rec_init_done) + rf._init_set_value(node, value, ev); + node.open = !ev.rrule; + node.blocked = this._is_modified_occurence(ev); + let ds = rf._ds; + ds.start = ev.start_date; + ds.end = ev._end_date; + if (ev.rrule) { + const rruleset = rrulestr(ev.rrule); + fillInDefaults(node, rruleset.origOptions, ev); + const topOption = getTopLevelOption(rruleset, ev._end_date); + node.querySelector(".dhx_form_repeat_pattern select").value = topOption; + if (topOption === "CUSTOM") { + let customFreq; + switch (rruleset.origOptions.freq) { + case RRule.DAILY: + customFreq = "DAILY"; + break; + case RRule.WEEKLY: + customFreq = "WEEKLY"; + break; + case RRule.MONTHLY: + customFreq = "MONTHLY"; + break; + case RRule.YEARLY: + customFreq = "YEARLY"; + break; + } + if (customFreq) { + node.querySelector(`[name="repeat_interval_unit"]`).value = customFreq; + node.querySelector(`[name="repeat_interval_unit"]`).dispatchEvent(new Event("change")); + } } - return res; - }; - var hold = scheduler2.hide_lightbox; - scheduler2.hide_lightbox = function() { - if (this._lightbox_r) { - this._lightbox_r.parentNode.removeChild(this._lightbox_r); - this._lightbox_r = this._lightbox = null; + } else { + fillInDefaults(node, null, ev); + node.querySelector(".dhx_form_repeat_pattern select").value = "NEVER"; + } + node.querySelector(".dhx_form_repeat_pattern select").dispatchEvent(new Event("change")); + }, get_value: function(node, ev) { + if (!node.blocked && node.querySelector(".dhx_form_repeat_pattern select").value !== "NEVER") { + let ds = scheduler2.form_blocks["recurring"]._ds; + let actual_dates = {}; + let timeControl = getTimeSection(); + timeControl.getValue(actual_dates); + ds.start = actual_dates.start_date; + const pattern = node.querySelector(".dhx_form_repeat_pattern select").value; + const recurrence = getRecValue[pattern](ds, node); + ev.rrule = new RRule(recurrence.rrule).toString().replace("RRULE:", ""); + ds.end = recurrence.until; + ev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1e3); + if (ds._start) { + ev.start_date = new Date(ds.start); + ev._start_date = new Date(ds.start); + ds._start = false; + } else + ev._start_date = null; + ev._end_date = ds.end; + } else { + ev.rrule = ev.rrule = ""; + ev._end_date = ev.end_date; + } + return ev.rrule; + }, focus: function(node) { + } }; + function getTimeSection() { + let timeControl = scheduler2.formSection("time"); + if (!timeControl) { + timeControl = getFirstSectionOfType("time"); + } + if (!timeControl) { + timeControl = getFirstSectionOfType("calendar_time"); + } + if (!timeControl) { + throw new Error(["Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.", "You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. ", 'In the latter case, make sure the control is named "time":', "", "scheduler.config.lightbox.sections = [", '{name:"time", height:72, type:"YOU CONTROL", map_to:"auto" }];'].join("\n")); + } + return timeControl; + } + function getFirstSectionOfType(type) { + for (let i = 0; i < scheduler2.config.lightbox.sections.length; i++) { + let section = scheduler2.config.lightbox.sections[i]; + if (section.type === type) { + return scheduler2.formSection(section.name); } - return hold.apply(this, arguments); - }; - }); + } + return null; + } } - function recurring(scheduler2) { + function recurring_legacy(scheduler2) { scheduler2.config.occurrence_timestamp_in_utc = false; scheduler2.config.recurring_workdays = [1, 2, 3, 4, 5]; scheduler2.form_blocks["recurring"] = { _get_node: function(node) { @@ -14556,20 +18674,20 @@ get_rcode[code[0]](code, dates); while (code.length < 5) code.push(""); - var repeat = ""; + var repeat2 = ""; var end = get_end_rule(els); if (end == "no") { dates.end = new Date(9999, 1, 1); - repeat = "no"; + repeat2 = "no"; } else if (end == "date_of_end") { dates.end = str_date(get_value(els, "date_of_end")); } else { scheduler2.transpose_type(code.join("_")); - repeat = Math.max(1, get_value(els, "occurences_count")); + repeat2 = Math.max(1, get_value(els, "occurences_count")); var transp = 0; - dates.end = scheduler2.date["add_" + code.join("_")](new Date(dates.start), repeat + transp, { start_date: dates.start }) || dates.start; + dates.end = scheduler2.date["add_" + code.join("_")](new Date(dates.start), repeat2 + transp, { start_date: dates.start }) || dates.start; } - return code.join("_") + "#" + repeat; + return code.join("_") + "#" + repeat2; } function get_end_rule(els2) { var end = els2["end"]; @@ -15635,11 +19753,11 @@ } tooltipFor(config) { const cloneDomEvent = (event2) => { - let clone = event2; + let clone2 = event2; if (document["createEventObject"] && !document.createEvent) { - clone = document["createEventObject"](event2); + clone2 = document["createEventObject"](event2); } - return clone; + return clone2; }; this._initDelayedFunctions(); this.attach({ selector: config.selector, global: config.global, onmouseenter: (event2, node) => { @@ -15830,7 +19948,7 @@ return null; return scheduler2.templates.parse_date(day.getAttribute("data-cell-date")); }; - scheduler2.dblclick_dhx_month_head = function(e) { + scheduler2.dblclick_dhx_year_grid = function(e) { if (isYearMode()) { const target = e.target; if (scheduler2.$domHelpers.closest(target, ".dhx_before") || scheduler2.$domHelpers.closest(target, ".dhx_after")) { @@ -16314,7 +20432,7 @@ add_export_methods(scheduler2); })(); } - const gplExtensions = { active_links, agenda_legacy, agenda_view, all_timed, collision, container_autoresize, cookie, daytimeline: daytimeline_restricted, drag_between: drag_between_restricted, editors, expand, export_api, grid_view, html_templates, key_nav, layer, limit, map_view, minical, monthheight, multisection: multisection_restricted, multiselect, multisource, mvc, outerdrag, pdf, quick_info, readonly, recurring, serialize, timeline: timeline_restricted, tooltip, treetimeline: treetimeline_restricted, units: units_restricted, url, week_agenda: week_agenda_restricted, wp, year_view }; + const gplExtensions = { active_links, agenda_legacy, agenda_view, all_timed, collision, container_autoresize, cookie, daytimeline: daytimeline_restricted, drag_between: drag_between_restricted, editors, expand, export_api, grid_view, html_templates, key_nav, layer, limit, map_view, minical, monthheight, multisection: multisection_restricted, multiselect, multisource, mvc, outerdrag, pdf, quick_info, readonly, recurring, recurring_legacy, serialize, timeline: timeline_restricted, tooltip, treetimeline: treetimeline_restricted, units: units_restricted, url, week_agenda: week_agenda_restricted, wp, year_view }; const factory = new SchedulerFactory(gplExtensions); const scheduler = factory.getSchedulerInstance(); const Scheduler$1 = { plugin: scheduler.bind(factory.plugin, factory) }; diff --git a/codebase/sources/dhtmlxscheduler.js.map b/codebase/sources/dhtmlxscheduler.js.map index e5b8140..fc5bf86 100644 --- a/codebase/sources/dhtmlxscheduler.js.map +++ b/codebase/sources/dhtmlxscheduler.js.map @@ -1 +1 @@ -{"version":3,"file":"dhtmlxscheduler.js","sources":["../../sources/dhtmlx_hook.js","../../sources/global.js","../../sources/core/common/assert.js","../../sources/core/common_errors.js","../../sources/core/connector.js","../../sources/core/nav_bar.js","../../sources/core/scheduler_resize_listener.js","../../sources/utils/eventable.js","../../sources/core/scheduler.js","../../sources/core/utils/event.js","../../sources/core/utils/scoped_event.js","../../sources/core/common.js","../../sources/core/wai_aria.js","../../sources/core/utils/utils.js","../../sources/core/utils/dom_helpers.js","../../sources/utils/env.js","../../sources/core/destructor.js","../../sources/core/common/url_serialize.js","../../sources/core/utils/ajax.js","../../sources/core/base.js","../../sources/core/config.js","../../sources/core/event.js","../../sources/core/event_highlight.js","../../sources/core/loaders/xml.js","../../sources/core/loaders/json.js","../../sources/core/loaders/ical.js","../../sources/core/common/get_serializable_events.js","../../sources/core/load.js","../../sources/core/lightbox.js","../../sources/core/touch.js","../../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../../sources/core/skins.js","../../sources/core/jquery.js","../../sources/core/delay_render.js","../../sources/core/dataprocessor/dataprocessor_hooks.js","../../sources/core/dataprocessor/dataprocessor.js","../../sources/core/message.js","../../sources/locale/locale_ar.js","../../sources/locale/locale_be.js","../../sources/locale/locale_ca.js","../../sources/locale/locale_cn.js","../../sources/locale/locale_cs.js","../../sources/locale/locale_da.js","../../sources/locale/locale_de.js","../../sources/locale/locale_el.js","../../sources/locale/locale_en.js","../../sources/locale/locale_es.js","../../sources/locale/locale_fi.js","../../sources/locale/locale_fr.js","../../sources/locale/locale_he.js","../../sources/locale/locale_hu.js","../../sources/locale/locale_id.js","../../sources/locale/locale_it.js","../../sources/locale/locale_jp.js","../../sources/locale/locale_manager.js","../../sources/locale/locale_nb.js","../../sources/locale/locale_nl.js","../../sources/locale/locale_no.js","../../sources/locale/locale_pl.js","../../sources/locale/locale_pt.js","../../sources/locale/locale_ro.js","../../sources/locale/locale_ru.js","../../sources/locale/locale_si.js","../../sources/locale/locale_sk.js","../../sources/locale/locale_sv.js","../../sources/locale/locale_tr.js","../../sources/locale/locale_ua.js","../../sources/locale/index.js","../../sources/core/datepicker.js","../../sources/scheduler_factory_method.js","../../sources/ext/extension_manager.js","../../sources/scheduler_factory.js","../../sources/ext/active_links.js","../../sources/ext/agenda_legacy_view.js","../../sources/ext/agenda.js","../../sources/ext/all_timed.js","../../sources/ext/collision.js","../../sources/ext/container_autoresize.js","../../sources/ext/cookie.js","../../sources/ext/restricted_extensions/not_implemented_extension.js","../../sources/ext/restricted_extensions/daytimeline.js","../../sources/ext/restricted_extensions/drag_between.js","../../sources/ext/editors.js","../../sources/ext/expand.js","../../sources/ext/restricted_extensions/grid_view.js","../../sources/ext/html_templates.js","../../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../../sources/ext/keyboard_navigation/common/eventhandler.js","../../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../../sources/ext/keyboard_navigation/marker.js","../../sources/ext/keyboard_navigation/elements/scheduler_node.js","../../sources/ext/keyboard_navigation/elements/nav_node.js","../../sources/ext/keyboard_navigation/elements/header_cell.js","../../sources/ext/keyboard_navigation/elements/event.js","../../sources/ext/keyboard_navigation/elements/time_slot.js","../../sources/ext/keyboard_navigation/elements/minical_button.js","../../sources/ext/keyboard_navigation/elements/minical_cell.js","../../sources/ext/keyboard_navigation/elements/data_area.js","../../sources/ext/keyboard_navigation/modals.js","../../sources/ext/keyboard_navigation/core.js","../../sources/ext/keyboard_navigation/key_nav_legacy.js","../../sources/ext/keyboard_navigation/scheduler_handlers.js","../../sources/ext/keyboard_navigation/minical_handlers.js","../../sources/ext/key_nav.js","../../sources/ext/layer.js","../../sources/ext/limit.js","../../sources/ext/map_view.js","../../sources/ext/minical.js","../../sources/ext/monthheight.js","../../sources/ext/restricted_extensions/multisection.js","../../sources/ext/multiselect.js","../../sources/ext/multisource.js","../../sources/ext/mvc.js","../../sources/ext/outerdrag.js","../../sources/ext/pdf.js","../../sources/ext/quick_info.js","../../sources/ext/readonly.js","../../sources/ext/recurring.js","../../sources/ext/serialize.js","../../sources/ext/restricted_extensions/timeline.js","../../sources/ext/tooltip/tooltip.ts","../../sources/ext/tooltip/tooltipManager.ts","../../sources/ext/tooltip/index.ts","../../sources/ext/restricted_extensions/treetimeline.js","../../sources/ext/restricted_extensions/units.js","../../sources/ext/url.js","../../sources/ext/restricted_extensions/week_agenda.js","../../sources/ext/wp.js","../../sources/ext/year_view.js","../../sources/ext/export_api/index.js","../../sources/ext/extensions_gpl.js","../../sources/dhtmlxscheduler.gpl.js"],"sourcesContent":["\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.getState=function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n};\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX + d.scrollLeft - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY + d.scrollTop - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\t\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\r\n\tvar html = '
';\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"\";\r\n\t\thtml+=\"\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function () {\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\"\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\n\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\nscheduler.config.mark_now = true;\r\nscheduler.config.display_marked_timespans = true;\r\nscheduler.config.overwrite_marked_timespans = true;\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tvar blocker = scheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif (event.rec_type) {\r\n\t\t\tvar dates = scheduler.getRecDates(event);\r\n\t\t\tfor(var i=0; i < dates.length; i++){\r\n\t\t\t\tvar ev = scheduler._copy_event(event);\r\n\t\t\t\tscheduler._lame_copy(ev, dates[i]);\r\n\t\t\t\tevs.push(ev);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!blocker(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn blocker(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn blocker(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\tscheduler._mark_now = function(hide) {\r\n\t\t// day, week, units views\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tif (!this._els[dhx_now_time]) {\r\n\t\t\tthis._els[dhx_now_time] = [];\r\n\t\t}\r\n\t\tvar now = scheduler._currentDate();\r\n\t\tvar cfg = this.config;\r\n\t\tscheduler._remove_mark_now(); // delete previous marks if they exist\r\n\t\tif (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i\" + ev.text + \"

\" + (ev.event_location || '') + \"

\" + scheduler.templates.marker_date(start) + \" - \" + scheduler.templates.marker_date(end) + \"
\";\r\n};\r\nscheduler.dblclick_dhx_map_area = function() {\r\n\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler._date,\r\n\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t});\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\n\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\n\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\n\r\nscheduler._latLngUpdate = false; // flag for not displaying event second time in case of coordinates update\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\tscheduler._isMapPositionSet = false; // if user actual (geolocation) position was set on the map\r\n\r\n\tconst gmap = document.createElement('div');\r\n\tgmap.className = 'dhx_map';\r\n\tgmap.id = 'dhx_gmap';\r\n\tgmap.style.display = \"none\";\r\n\r\n\tscheduler._obj.appendChild(gmap);\r\n\r\n\tscheduler._els.dhx_gmap = [];\r\n\tscheduler._els.dhx_gmap.push(gmap);\r\n\r\n\t_setMapSize('dhx_gmap');\r\n\r\n\tconst mapOptions = {\r\n\t\tzoom: scheduler.config.map_initial_zoom || 10,\r\n\t\tcenter: scheduler.config.map_initial_position,\r\n\t\tmapTypeId: scheduler.config.map_type || google.maps.MapTypeId.ROADMAP\r\n\t};\r\n\tconst map = new google.maps.Map(document.getElementById('dhx_gmap'), mapOptions);\r\n\tmap.disableDefaultUI = false;\r\n\tmap.disableDoubleClickZoom = !scheduler.config.readonly;\r\n\r\n\tgoogle.maps.event.addListener(map, \"dblclick\", function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\r\n\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\tvar point = event.latLng;\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'latLng': point },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\tstart_date: scheduler._date,\r\n\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n\r\n\tvar infoWindowOptions = {\r\n\t\tcontent: ''\r\n\t};\r\n\r\n\tif (scheduler.config.map_infowindow_max_width) {\r\n\t\tinfoWindowOptions.maxWidth = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\r\n\tscheduler.map = {\r\n\t\t_points: [],\r\n\t\t_markers: [],\r\n\t\t_infowindow: new google.maps.InfoWindow(infoWindowOptions),\r\n\t\t_infowindows_content: [],\r\n\t\t_initialization_count: -1,\r\n\t\t_obj: map\r\n\t};\r\n\r\n\tscheduler.ext.mapView.geocoder = new google.maps.Geocoder();\r\n\tscheduler.ext.mapView.map = map;\r\n\tscheduler.ext.mapView.points = scheduler.map._points;\r\n\tscheduler.ext.mapView.markers = scheduler.map._markers;\r\n\tscheduler.ext.mapView.infoWindow = scheduler.map._infowindow;\r\n\r\n\tif (scheduler.config.map_resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tif (!scheduler._isMapPositionSet) {\r\n\t\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\t\tvar _userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\r\n\t\t\t\t\tmap.setCenter(_userLocation);\r\n\t\t\t\t\tmap.setZoom(scheduler.config.map_zoom_after_resolve || 10);\r\n\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);\r\n\t\t\t\t\tscheduler.map._infowindow.position = map.getCenter();\r\n\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\r\n\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t},\r\n\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.setPosition(map.getCenter());\r\n\t\t\t\t\t\t\tscheduler.map._infowindow.open(map);\r\n\t\t\t\t\t\t\tscheduler._isMapPositionSet = true;\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tgoogle.maps.event.addListener(map, \"resize\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t\tmap.setZoom(map.getZoom());\r\n\r\n\t});\r\n\tgoogle.maps.event.addListener(map, \"tilesloaded\", function(event) {\r\n\t\tgmap.style.zIndex = '5';\r\n\t});\r\n\r\n\tgmap.style.display = 'none'; // property was changed after attaching map\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i], false, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clear_map_tab() {\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\tvar markers = scheduler.map._markers;\r\n\t\tfor (var key in markers) {\r\n\t\t\tif (markers.hasOwnProperty(key)) {\r\n\t\t\t\tmarkers[key].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[key];\r\n\t\t\t\tif (scheduler.map._infowindows_content[key])\r\n\t\t\t\t\tdelete scheduler.map._infowindows_content[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tvar ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tvar html = \"
\";\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar ev = events[i];\r\n\t\t\tvar event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tvar ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tvar ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tvar t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (var i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tvar map = document.getElementById(elem_id);\r\n\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\tvar height = scheduler._y - nav_height;\r\n\t\tif (height < 0)\r\n\t\t\theight = 0;\r\n\t\tvar width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\tif (width < 0)\r\n\t\t\twidth = 0;\r\n\t\tmap.style.height = height + 'px';\r\n\t\tmap.style.width = width + 'px';\r\n\t\tmap.style.position = \"absolute\";\r\n\t\tmap.style.top = nav_height + \"px\";\r\n\t\tif (scheduler.config.rtl) {\r\n\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t} else {\r\n\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t}\r\n\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t}\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler.map._initialization_count++;\r\n\t\tvar gmap = scheduler._els.dhx_gmap[0];\r\n\t\tvar temp_center;\r\n\t\t//scheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\r\n\t\tif (mode) { //map tab activated\r\n\t\t\tclear_map_tab();\r\n\t\t\tfill_map_tab();\r\n\t\t\tgmap.style.display = 'block';\r\n\r\n\t\t\t// need to resize block every time window is resized\r\n\t\t\t_setMapSize('dhx_gmap');\r\n\t\t\ttemp_center = scheduler.map._obj.getCenter();\r\n\r\n\t\t\tvar events = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\t\tif (!scheduler.map._markers[events[i].id]) {\r\n\t\t\t\t\tshowAddress(events[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else { //map tab de-activated\r\n\t\t\tgmap.style.display = 'none';\r\n\t\t}\r\n\t\tgoogle.maps.event.trigger(scheduler.map._obj, 'resize');\r\n\r\n\t\tif (scheduler.map._initialization_count === 0 && temp_center) { // if tab is activated for the first time need to fix position\r\n\t\t\tscheduler.map._obj.setCenter(temp_center);\r\n\t\t}\r\n\r\n\t\tif (scheduler._selected_event_id) {\r\n\t\t\tselectEvent(scheduler._selected_event_id);\r\n\t\t}\r\n\t};\r\n\r\n\tvar selectEvent = function(event_id) {\r\n\t\tscheduler.map._obj.setCenter(scheduler.map._points[event_id]);\r\n\t\tscheduler.callEvent(\"onClick\", [event_id]);\r\n\t};\r\n\r\n\tvar showAddress = function(event, setCenter, performClick) { // what if event have incorrect position from the start?\r\n\t\tvar point = scheduler.config.map_error_position;\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tpoint = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t}\r\n\t\tvar message = scheduler.templates.marker_text(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._new_event) {\r\n\r\n\t\t\tscheduler.map._infowindows_content[event.id] = message;\r\n\r\n\t\t\tif (scheduler.map._markers[event.id])\r\n\t\t\t\tscheduler.map._markers[event.id].setMap(null);\r\n\r\n\t\t\tscheduler.map._markers[event.id] = scheduler.ext.mapView.createMarker({\r\n\t\t\t\tposition: point,\r\n\t\t\t\tmap: scheduler.map._obj\r\n\t\t\t});\r\n\r\n\t\t\tgoogle.maps.event.addListener(scheduler.map._markers[event.id], 'click', function() {\r\n\t\t\t\tscheduler.map._infowindow.setContent(scheduler.map._infowindows_content[event.id]);\r\n\t\t\t\tscheduler.map._infowindow.open(scheduler.map._obj, scheduler.map._markers[event.id]);\r\n\t\t\t\tscheduler._selected_event_id = event.id;\r\n\t\t\t\tscheduler.render_data();\r\n\t\t\t});\r\n\t\t\tscheduler.map._points[event.id] = point;\r\n\r\n\t\t\tif (setCenter) scheduler.map._obj.setCenter(scheduler.map._points[event.id]);\r\n\t\t\tif (performClick) scheduler.callEvent(\"onClick\", [event.id]);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onClick\", function(id, domEvent) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tscheduler._selected_event_id = id;\r\n\t\t\tfor (var i = 0; i < scheduler._rendered.length; i++) {\r\n\t\t\t\tscheduler._rendered[i].className = 'dhx_map_line';\r\n\t\t\t\tif (scheduler._rendered[i].getAttribute(scheduler.config.event_attribute) == id) {\r\n\t\t\t\t\tscheduler._rendered[i].className += \" highlight\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._points[id] && scheduler.map._markers[id]) {\r\n\t\t\t\tscheduler.map._obj.setCenter(scheduler.map._points[id]); // was panTo\r\n\t\t\t\tgoogle.maps.event.trigger(scheduler.map._markers[id], 'click');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tvar _displayEventOnMap = function(event) {\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\r\n\t\t\t\t\tscheduler._selected_event_id = event.id;\r\n\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t\tshowAddress(event, true, true);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tshowAddress(event, true, true);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _updateEventLocation = function(event) { // update lat and lng in database\r\n\t\tconst geocoder = scheduler.ext.mapView.geocoder;\r\n\t\tif (event.event_location && geocoder) {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{\r\n\t\t\t\t\t'address': event.event_location,\r\n\t\t\t\t\t'language': scheduler.uid().toString()\r\n\t\t\t\t},\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tvar point = {};\r\n\t\t\t\t\tif (status != google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tpoint = scheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\t\t\tif (!point || point === true)\r\n\t\t\t\t\t\t\tpoint = scheduler.config.map_error_position;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tevent.lat = point.lat();\r\n\t\t\t\t\tevent.lng = point.lng();\r\n\t\t\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\tvar _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tvar ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\t\tif (!this._latLngUpdate) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t} else { // event no longer should be displayed on the map view\r\n\t\t\t\tscheduler._selected_event_id = null;\r\n\t\t\t\tscheduler.map._infowindow.close();\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis._latLngUpdate = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_event_id, new_event_id) {\r\n\t\tvar event = scheduler.getEvent(new_event_id);\r\n\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\tif (scheduler.map._markers[old_event_id]) {\r\n\t\t\t\tscheduler.map._markers[old_event_id].setMap(null);\r\n\t\t\t\tdelete scheduler.map._markers[old_event_id];\r\n\t\t\t}\r\n\t\t\tif (scheduler.map._infowindows_content[old_event_id])\r\n\t\t\t\tdelete scheduler.map._infowindows_content[old_event_id];\r\n\t\t\t_displayEventOnMap(event);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id, event) {\r\n\t\tif (!scheduler._dataprocessor) {\r\n\t\t\tif ((event.start_date < scheduler._min_date && event.end_date > scheduler._min_date) || (event.start_date < scheduler._max_date && event.end_date > scheduler._max_date) || (event.start_date.valueOf() >= scheduler._min_date && event.end_date.valueOf() <= scheduler._max_date)) {\r\n\t\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\t\t_displayEventOnMap(event);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\t/* Test/example\r\n\t scheduler.attachEvent(\"onLocationError\", function(event_id,event_object){\r\n\t return new google.maps.LatLng(8, 8);\r\n\t });\r\n\t */\r\n\r\n\tscheduler.attachEvent(\"onBeforeEventDelete\", function(id, event) {\r\n\t\tif (scheduler.map._markers[id]) {\r\n\t\t\tscheduler.map._markers[id].setMap(null); // if new event is deleted tab != map then it doesn't have marker yet\r\n\t\t}\r\n\t\tscheduler._selected_event_id = null;\r\n\t\tscheduler.map._infowindow.close();\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (scheduler.config.map_resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventCancel\", function(id, is_new) {\r\n\t\tif (is_new) {\r\n\t\t\tif (scheduler.map._markers[id])\r\n\t\t\t\tscheduler.map._markers[id].setMap(null);\r\n\t\t\tscheduler.map._infowindow.close();\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\r\n\tvar node = domEv;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tvar dx = (left + domEv.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tvar dy = (top + domEv.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:domEv.offsetWidth, height:domEv.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\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r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\tloc.select_year_day2+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t''+loc.repeat_text_occurences_count+'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_month_head = function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };"],"names":["dhtmlxHook","dhtmlx","attaches","attachScheduler","day","mode","tabs","scheduler","obj","document","createElement","id","this","_genStr","innerHTML","body","appendChild","firstChild","attachObject","vs","av","sched","schedId","setSizes","updateView","destructor","init","_viewRestore","globalScope","window","global","global$1","assert","check","message","config","show_errors","callEvent","type","text","expire","console","log","extend","commonViews","agenda","grid","map","unit","timeline","week_agenda","year","anythingElse","requiredExtensions","limit","_commonErrorMessages","unknownView","view","relatedDoc","relatedExtension","collapsedContainer","div","createTimelineView","Error","createUnitsView","createGridView","addMarkedTimespan","renderCalendar","exportToPNG","join","exportToPDF","attachEvent","dhtmlxError","catchError","a","b","c","responseText","ajax_error","alert","className","element","classes","split","forEach","cssClass","classList","add","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","date","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","event","isCalendarVisible","destroyCalendar","position","getState","navigation","handler","calendar","setCurrentView","html_element","findRenderer","renderer","rows","cols","renderElement","css","width","value","style","height","html","align","justifyContent","prepareConfig","renderLayout","fragment","createDocumentFragment","items","Array","isArray","i","length","next","_init_nav_bar","navBar","$container","querySelector","_update_nav_bar","previousHeight","container","heightChanged","configChanged","newHeight","xy","nav_height","unset_actions","_els","get_elements","set_actions","display","isAttachedNode","root","parentNode","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","equals","listenWindowResize","oldSize","resizeDelay","clearTimeout","setTimeout","$destroyed","newSize","triggerSchedulerResize","$root","watchNodeResize","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","addResizeListener","containerStyles","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","salesforce_environment","contentWindow","removeChild","EventHost","_silent_mode","listeners","_silentStart","createEventStorage","handlers","index","eventStorage","combinedResult","handlerResult","apply","arguments","addEvent","settings","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","innerId","attachAll","callback","name","eventArguments","handlerName","concat","checkEvent","detachEvent","list","eventId","detachAllEvents","extend$l","_detachDomEvent","el","removeEventListener","_init_once","scheduler_resize_listener","layout","navbar","render","header","dataArea","hasSchedulerMarkup","createDefaultHeader","views","nav","matrix","push","_props","_grid","names","optionalViews","viewName","_currentDate","_obj","getElementById","error","wai_aria_application_role","JSON","stringify","rtl","_skin_init","_scroll","init_templates","_init_touch_events","set_sizes","$initialized","min_event_height","bar_height","scale_width","scroll_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","keys","edit_save","edit_cancel","functor","object","_x","scale_x","_table_view","materialScalePlaceholder","_is_material_skin","insertBefore","set_xy","offsetTop","_lightbox","_setLbPosition","_data_width","left","right","node","x","y","prepareValue","val","prepared","isNaN","Number","Math","max","direction","undefined","top","els","getElementsByTagName","class_name","_getClassName","attr_value","getAttribute","label","locale","labels","_waiAria","labelAttr","domEventsScope","_createDomEventScope","detachAll","_click","attach","e","preventDefault","_temp_touch_block","_on_mouse_move","_ignore_next_click","_on_mouse_down","_on_mouse_up","_on_dbl_click","returnValue","_locate_event","target","select","_select_id","_close_not_saved","editStop","unselect","updateEvent","previousSelection","getEvent","_mode","Date","_date","min_date","_min_date","max_date","_max_date","editor_id","_edit_id","lightbox_id","_lightbox_id","new_event","_new_event","select_id","expanded","drag_id","_drag_id","drag_mode","_drag_mode","dhx_cal_data","cancelBubble","getActionData","readonly","icon","closest","mask","indexOf","buttons","replace","valueOf","dhx_cal_prev_button","dhx_cal_next_button","dummy","step","def_step","dhx_cal_today_button","dhx_cal_tab","deprecated_name","substring","search","delete","confirm_deleting","_dhtmlx_confirm","title","title_confirm_deleting","deleteEvent","ok","icon_delete","edit","save","details","showLightbox","form","cancel","opts","result","confirm","addEventNow","start","end","base","_isObject","_isDate","duration","event_duration","time_step","start_date","round","start_hour","first_hour","getHours","setHours","end_date","setTime","uid","_loading","_drag_event","src","dblclick_create","details_on_dblclick","_timed","viewHandler","call","_get_column_index","x_pos","column","_cols","_ignores","floor","_week_indexes_from_pos","pos","min","ceil","hour_size_px","_mouse_coords","ev","$env","isIE","pageX","pageY","clientX","scrollLeft","clientLeft","clientY","scrollTop","clientTop","_colsS","$domHelpers","getAbsoluteLeft","getAbsoluteTop","dy","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","confirm_closing","title_confirm_closing","positive_closing","_drag_pos","_correct_shift","back","getTimezoneOffset","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","acc","abs","delay","d_pos","has_moved","_correct_drag_start_date","len","_start_correction","_end_correction","last_hour","getMinutes","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","res","fields","timeStep","custom","time_part","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","date_part","resize_from_start","end_day_start","end_day_date","firstHour","lastHour","maxY","precisePos","minDate","maxDate","preciseDate","cursor","shift","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","getView","getDate","_allow_dnd","update_render","sx","update_view","for_rendered","r","srcElement","classname","drag_event_body","fullClass","_lame_clone","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","_mobile","moved","_dhx_changed","is_new","_lame_copy","edit_on_create","details_on_create","isOneDayEvent","render_view_data","_trigger_dyn_loading","_load_mode","_load","_render_wait","_reset_ignores","_reset_scale","isViewExists","templates","_set_aria_buttons_attrs","buttonGroups","group","j","prev","headerButtonsAttributes","icon_form","icon_edit","oldClass","newClass","dhx_multi_day","prev_scroll","preserve_scroll","multidayScroll","_dy_shift","tab","headerToggleState","remove","_render_x_header","offset_top","head","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","from","to","count","count_n","_get_timeunit_start","_get_view_end","dd","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","parseInt","d","scales","cls","firstHalf","slotDate","getFullYear","getMonth","format_date","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","day_start","_getNavDateElement","str","drag_resize","drag_move","_scales","week_start","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","visibility","totalWidth","col_length","offset","hiddenWidth","c2","cloneNode","cc","content","hour_scale","hourScaleAttr","scroll_hour","now_date","n","preserve","ignore","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","month_day","cellBody","bf1","cells","querySelectorAll","parse_date","getLabel","property","key","sections","lightbox","map_to","options","updateCollection","list_name","collection","serverList","splice","resetLightbox","hideCover","cache","t","Object","create","String","Boolean","prototype","hasOwnProperty","source","n_ev","section","_focus","focus","getDaysDifference","startDate","endDate","differenceInTime","getTime","differenceInDays","eventLength","startColumnIndex","endColumnIndex","_get_date_index","last_column","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","days","fd","start_slot","end_slot","_get_section_property","y_property","_is_initialized","state","_is_lightbox_open","defaultDomEvents","addEventListener","eventRemove","createEventScope","domEvents","eventScope","capture","detach","staticArray","slice","_eventRemoveAll","_trim","func","trim","htmlTags","RegExp","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","attr","attributes","setAttributes","values","day_date","role","isActive","getHeaderCellAttr","dateString","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","attrs","agendaDetailsBtnString","icon_details","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","month","hour","minute","messageButtonAttrString","buttonLabel","messageInfoAttr","messageModalAttr","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","isDisabled","payload","uidSeed","now","pop","isStringObject","Function","toString","constructor","isNumberObject","isBooleanObject","isDate","defined","timeout","timer","$cancelTimeout","$pending","args","$execute","utils","mixin","force","f","copy","varType","elementPosition","elem","bottom","getBoundingClientRect","box","docElem","pageYOffset","pageXOffset","offsetLeft","offsetParent","getRelativeEventPosition","getNodePosition","getClassName","baseVal","getTargetNode","trg","tagName","shadowRoot","composedPath","locateCss","strict","ind","charAt","isVisible","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","hasHref","canHaveHref","area","nodeName","loLowerCase","isEnabled","canDisable","input","textarea","hasAttribute","getFocusableNodes","nodes","nodesArray","$position","sort","isValid","isShadowDomSupported","createShadowRoot","attachShadow","getActiveElement","activeElement","getSelection","focusNode","getRootNode","ShadowRoot","host","hasShadowParent","dom_helpers","htmlObject","getOffset","getOffsetSum","getOffsetRect","test","navigator","userAgent","dummyBox","selector","insertAfter","newNode","referenceNode","nextSibling","isChildOf","child","parent","contains","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isOpera","isChrome","isKHTML","isFF","isIPad","isEdge","isNode","clearAll","_dp","serialize$1","data","serialized","encodeURIComponent","Promise","createConfig","method","url","async","headers","serialize","ajax","serializeRequestParams","parse","DOMParser","parseFromString","ActiveXObject","loadXML","xmltop","tagname","xhr","status","xml","responseXML","xpath","xpathExp","docObj","selectNodes","first","col","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","query","_call","get","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","match","readyState","xmlDoc","filePath","open","setRequestHeader","toUpperCase","send","urlSeparator","$ajax","generateStringToDate","format","utc","splt","code","csp_date_to_str","to_fixed","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","getDay","day_full","month_short","month_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","csp_str_to_date","set","temp","month_short_hash","month_full_hash","UTC","cspEnabled","checkIfCSPEnabled","useCsp","csp","s","old","setMinutes","setSeconds","setMilliseconds","start_on_monday","month_start","setDate","year_start","setMonth","_add_days","inc","ndate","datesDiff","rest","hours","setYear","num","date_to_str","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","isYMDDate","datestr","isMDYDate","isDMYDate","isISO8601","parseYMD","parseMDY","parseDMY","parse_exact_format","nday","first_thursday","year_number","ordinal_date","week_number","convert_to_utc","default_date","month_date","load_date","week_date","hour_date","date_format","api_date","displayed_event_color","displayed_event_text_color","wide_form","day_column_padding","use_select_menu_space","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_display","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","server_utc","touch","touch_tip","touch_drag","touch_swipe_dates","quick_info_detached","drag_highlight","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","delay_render","timeline_swap_resize","event_attribute","$initial","_helpers","parseDate","xml_date","formatDate","xml_format","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","load_format","event_header","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","_events","_loaded","clear_view","extra_data","event_updated","silent","setEvent","hash","_rendered","changeEventId","new_id","create_getter","create_setter","_changed","is_visible_events","clear_event","in_visible_range","evFirstHour","evLastHour","end_dates_visible","hidden_duration","checkEndDate","get_visible_events","only_timed","stack","filter_event","filter","_is_main_area_event","evs","hold","full","_not_render","_recalculate_timed","tvs","tvd","_rendered_location","render_data","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","getEvents","_get_event_bar_pos","widt","x2","_pre_render_events","containers","render_event_bar","max_evs","max_month_events","_sorder","locate_holder","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_line","_pre_render_events_table","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","t_end_date","slot_index","sorderSet","_is_sorder","k","_max_sorder","max_count","_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","cellIndex","locate_holder_day","weekCellIndex","out","weeks","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","parentPosition","zIndex","color","setProperty","tplClass","cssText","_editor","shiftKey","keyCode","icons","icons_str","ariaAttr","currentIcon","textColor","highlightEventPosition","contentA","contentB","cs","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","childNodes","past","_get_dnd_order","order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","restoreOriginalColors","section_delimiter","getSectionTop","posFromDate","dx","_smartRenderingEnabled","scrollTo","_append_drag_marker","m","zone","scale","lastChild","previousSibling","_update_marker_position","size","_parsers","canParse","topElement","loader","csrfToken","security_key","arr","itms","itm","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","err","events","dhx_security","collections","collections_loaded","option","option_key","ical","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","dh","dm","utcMark","dn","getSerializator","_load_url","prevent_cache","ajaxCallback","response","on_load","lf","cache_line","temp_to","extend$a","extend$9","extend$8","foundParser","parser","_process","_process_loading","_after_call","_tagvalue","_init_date","getSerializableData","createSerializator","dataset","allEvents","exportedEvent","exportValue","rawValue","load","setLoadMode","array","show_loading","_y","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","time","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","cfg","dt","last","limit_time_select","p","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","full_day","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","getLightboxRoot","cspEnvironment","salesforceEnvironment","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","block","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","action","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","labelBlock","inputBlock","fallback","inputId","old_id","mobile","MSStream","platform","maxTouchPoints","touchEventsSupported","createEvent","_touch_events","touches","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","accessor","tracker","scroll_mode","action_mode","dblclicktime","attachTouchEvent","passive","check_direction_swipe","s_ev","e_ev","max_dy","scrollable","doMouseMove","dnd","original_render","_update_global_tip","drag_cancel","_pointerDragId","pointerId","fake_event","_block_next_stop","actTask","fakeTask","sourceTask","_show_global_tip","_hide_global_tip","toptip","_global_tip","drag_to_create","drag_to_move","getRootView","tag","hooks","didInsert","cmp","_addThemeClass","skin","_skin_settings","_skin_xy","lightbox_additional_height","checkIfMaterialSkin","themeNameFromFile","links","href","_build_skin_info","monitorThemeChange","styles","themeVar","isCssVarTheme","themeName","cssValues","oldMaterialTheme","_theme_info","theme","cssVarTheme","themeVariables","calculatedMaterial","probe","cachedBorderBoxValue","checkIfBorderBoxStyling","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","newStyling","_configure","setSkin","flatSkinHourScale","monitorIntervalId","clearInterval","setInterval","csstheme","_old_month_day","old_month_day","reorderTabs","specialTabs","tabName","find","firstTab","reverse","jQuery","$","counter","methods","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","self","oldDate","oldMode","updateFlags","lazy_updateView","ars","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","_add_rec_marker","extendScheduler","_is_virtual_event","getUserData","_set_event_text_style","rec_type","rec_pattern","_dp_change_event_id","_dp_hook_delete","setDp","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","updateMode","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","setTransactionMode","total","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","_columns","getSyncState","enableDataNames","enablePartialDataSend","setUpdateMode","master","rowId","findRow","existing","set_invalid","is_invalid","markRow","sendData","_methods","getActionByState","checkBeforeUpdate","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","pref","_applyPayload","dataToSend","_onResolvedCreateUpdate","resultState","sid","tid","afterUpdateCallback","routerMode","actionPromise","update","then","catch","queryParams","ids","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","preprocessedData","_cleanupItemBeforeSend","valid","_forEachUpdatedRow","_getAllData","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","processedData","updatedItem","output","_prepareDataItem","item","processedItem","dataItem","createDataProcessor","tMode","batchUpdate","boxAttribute","_dhx_msg_cfg","usercall","modalBox","hide","modal_key","which","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","buttonCss","info","timers","pull","getFirstDefined","_boxStructure","contentId","inner","message_ok","message_cancel","btn","_createBox","hidden","alertPopup","confirmPopup","boxPopup","box_params","params","alertBox","confirmBox","focusable","subtype","seed","hideAll","popups","modalbox","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","section_description","section_time","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","be","agenda_tab","description","year_tab","week_agenda_tab","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","month_for_recurring","day_for_recurring","ca","cn","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","i18nFactory","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","labelFormat","dayElement","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","dayStart","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","currDate","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","common_errors","common","schedulerCore","wai_aria","dom","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","event_highlight","dhtmlx_suite_hooks","skins","jquery","dataProcessorExtend","connector","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","ext","activePlugins","plugins","extensionList","getExtensionList","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","ExtensionsManager","_extensions","SchedulerFactory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","calendars","addCalendar","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","_agendaScrollTop","set_full_view","l","rowAttr","dateHeader","descriptionHeader","tableAttr","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","agenda_area","v_border","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","eventStart","renderEmptyView","renderDay","calendarEvent","renderOneEvent","dates","selectedId","bg","all_timed_month","is_event_short","_safe_copy","proto","event_pid","isPrototypeOf","event_length","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","before","collision_limit","_setTempSection","event_id","checked_mode","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","second","evs_dates","getRecDates","tevs","concurrent","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","rows_length","year_y","week_agenda_scale_height","cur_height","eventsContainer","g","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","setCookie","cookie_param","getCookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","old_load","notImplemented","daytimeline_restricted","drag_between_restricted","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","all_options","single_option","addOption","getIndexByValue","selectOption","selected_id","disable","setComboValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","grid_view","html_templates","all","keyboard_shortcuts","$keyboardNavigation","shortcuts","createCommand","modifiers","alt","ctrl","meta","shortcut","commands","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","ctrlKey","metaKey","printableKey","fromCharCode","getHashFromEvent","getHash","parts","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","eventhandler","EventHandler","_handlers","findHandler","doAction","unbind","bindAll","initKeys","trap_modal_focus","trapFocus","currentFocus","currentIndex","nextIndex","nextItem","divs","renderMultiple","currentStart","currentEnd","TimeSlot","_modes","_getMode","units","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","areas","round_position","blocks","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","_timeline_getX","tempStart","tempEnd","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","inner_index","all_hours_height","hour_ms","lineHeight","scheduler_node","SchedulerNode","_compose","getDefaultNode","getMode","blur","enable","removeAttribute","_compareEvents","_pickEvent","startId","eventElement","Event","getNode","nextEventHandler","activeNode","dispatcher","nextEvent","currEvent","visibleDates","nextEv","setActiveNode","prevEventHandler","HeaderCell","getNodes","_key_nav_copy_paste","nav_node","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","header_cell","defaultCell","_getSection","_getNodes","eventNode","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","keepScrollPosition","_moveToSlot","slot","nextSlot","time_slot","movingDate","getDefaultDate","key_nav_step","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","clone","timeslot","_getMultisectionView","_getNextSection","sectionId","isInRange","defaultSlot","DataArea","smart_rendering","_pasteDate","_pasteSection","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","minutes","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","minical_button","MinicalButton","globalNode","MinicalCell","minical_cell","_getGrid","_getNode","enabled","newRow","newCol","modals","modalsStack","isModal","afterPopup","startModal","endModal","isTopModal","currentTarget","traceLightbox","_keyNavMessagePopup","focusElement","backupFocus","core","getActiveNode","setDefaultNode","focusGlobalNode","blurNode","editor","keyDownHandler","defaultPrevented","schedulerNode","_timeout","key_nav_legacy","_temp_key_scope","key_nav","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","clear_event_after","copyEvent","_make_pasted_event","multisection","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","getSelectedEvent","_buffer_event","new_ev","scheduler_handlers","attachSchedulerHandlers","focusHandler","waitCall","reFocusActiveNode","mousedownHandler","dataAreaClick","listOfScales","arrOfScales","some","focusEvent","evNode","prevState","lastStart","lastEnd","lastSection","minical_handlers","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","td","renderMinical","cal","added","destroyMinical","_def_count","addShortcut","scope","scopeObject","getScope","getShortcutHandler","removeShortcut","disp","scopes","minicalButton","minicalDate","timeSlot","searchMap","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_start","limit_end","limit_view","check_limits","mark_now","display_marked_timespans","overwrite_marked_timespans","_temp_limit_scope","dhx_time_block","default_timespan_type","fix_options","zones","get_resulting_options","blockTime","unblockTime","deleteMarkedTimespan","om","od","nm","nd","isBlocked","date_end","resetDate","checkInMarkedTimespan","timespan_type","on_overlap","temp_start_date","temp_end_date","timespans","_marked_timespans","day_value","day_index","getZones","_get_zone_minutes","eventEnd","markerStart","markerEnd","blocker","checkLimitViolation","complete_res","allow","_get_blocked_zones","timeline_zones","blocked_timeline_zones","_get_relevant_blocked_zones","_add_timespan_zones","resultZones","view_config","linker","is_new_event","data_copy","native_object","_mark_now","_mark_now_timer","dhx_now_time","_remove_mark_now","_append_mark_now","zone_start","start_index","end_index","units_l","r_divs","t_day","t_div","_render_marked_timespan","_prepare_timespan_options","r_configs","temp_configs","t_days","cloned_config","invert_zones","invertZones","view_key","t_config","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","start_day","delta","t_date","_get_css_classes_by_config","css_classes","_get_block_by_config","date_to_display","min_day","sday","block_proto","_mark_timespans","_on_scale_add_marker","markTimespan","configuration","rebuild_els","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","unmarkTimespan","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","_subtract_timespan_zones","is_modified","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","types","typedConfig","_get_types_to_render","specific","types_to_render","_get_configs_to_render","_get_unit_index","day_ind","unitsPerDay","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","map_view","mapView","geocoder","points","markers","infoWindow","createMarker","google","maps","Marker","map_date_width","map_icon_width","map_description_width","map_resolve_event_location","map_resolve_user_location","map_initial_position","LatLng","map_error_position","map_infowindow_max_width","map_type","MapTypeId","ROADMAP","map_zoom_after_resolve","marker_geo_success","marker_geo_fail","marker_date","marker_text","event_location","dblclick_dhx_map_area","map_time","map_text","map_start","add_map","map_date","_latLngUpdate","_isMapPositionSet","gmap","dhx_gmap","_setMapSize","mapOptions","zoom","map_initial_zoom","center","mapTypeId","Map","disableDefaultUI","disableDoubleClickZoom","addListener","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","lat","lng","formatted_address","infoWindowOptions","maxWidth","_points","_markers","_infowindow","InfoWindow","_infowindows_content","_initialization_count","Geocoder","geolocation","getCurrentPosition","_userLocation","coords","latitude","longitude","setCenter","setZoom","setContent","getCenter","setPosition","getZoom","fill_map_tab","showAddress","clear_map_tab","_selected_event_id","close","setMap","ariaButtonAttr","elem_id","marginRight","marginLeft","marginTop","temp_center","map_end","trigger","selectEvent","performClick","_displayEventOnMap","address","language","_updateEventLocation","_delay","ret","old_event_id","new_event_id","_event_resolve_delay","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","cont","tpos","_get_def_cont","_render_calendar","$dom","cellRoot","dateAttribute","unmarkCalendar","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","refreshOnLoad","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","arrow","dayHeaders","dayCells","inputs","selects","inp","number","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","noHighlight","monthheight","old_s","multisection_restricted","multiselect","parseXMLOptions","parseJSONOptions","_result","_children","_mark_inputs","_ids","delimiter","script_url","divLoading","multisource","backup","mvc","use_id","sanitize","update_timer","_start_ext_load","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","dragger","dhtmlDragAndDropObject","stopDrag","last_event","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","parseFloat","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_start","xml_end","xml_top","profile","footer","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","getPDFData","send_xml","submit","to_pdf","schedulersToPdf","objects","toPDF","toPDFRange","quick_info","show_quick_info","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","_quick_info_onscroll_handler","$testmode","_qi_button_click","domEv","titleContent","titleDate","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","txt_replace","txts","txtt","originalForm","readonlyForm","_lightbox_r","occurrence_timestamp_in_utc","recurring_workdays","_get_node","_outer_html","outerHTML","getOuterHTML","rec","loc","repeat_date_of_end","_ds","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","_init_set_value","_end_date","str_date_format","repeat_date","str_date","include_end_by","date_str","register_els","inps","formatter","change_current_view","get_repeat_code","get_rcode","repeat","get_end_rule","transpose_type","transp","set_end_rule","has_values","_get_repeat_code","get_numeric_value","repeat_precise","_start","start_exists","transpose_day_week","set_rcode","set_repeat_code","dispatchEvent","MouseEvent","_set_repeat_code","elements","_rec_init_done","rf","blocked","_is_modified_occurence","_toggle_block","actual_dates","timeControl","getTimeSection","_start_date","_get_button","getRecurringSection","_get_form","backgroundPosition","getFirstSectionOfType","_rec_markers","_rec_markers_pull","_pid_time","_get_rec_marker","ch","_get_rec_markers","clearMilliseconds","_rec_temp","old_add_event","ev_id","_ignore_call","tev","_pid_changed","nid","nev","sub","isEventFound","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","old_update_event","transponse_size","day_week","originalMonth","cday","newMonth","cor","cor2","transposeRecurring","recurringParts","dayDurationMs","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","maxCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","getMilliseconds","non_render","startHour","visibleCount","_fix_daylight_saving_date","ted","recurrings","sev","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","timeline_restricted","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","_getViewPort","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","delayShow","utils.default","show","tooltip_timeout","tooltip_hide_timeout","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","hideTooltip","treetimeline_restricted","units_restricted","s2d","d2s","select_event","week_agenda_restricted","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_month_head","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","yearStart","datepicker","locateEvent","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","add_export_methods","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","fail","_plain_export_copy","$text","_create_hidden_form","_hidden_export_form","_get_export_size","A5","A4","A3","A2","A1","A0","dataX","dataY","headY","multY","cSize","getTimeline","getInitialSizes","smartRendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","setExportSizes","initialSizes","setInitialSizes","gplExtensions","drag_between","factory","$dhx"],"mappings":";;;;AACe,WAAAA,aAAAA;AAEf,QAAWC,OAAAA,UAAU,eAAeA,OAAOC,UAAU;AACpDD,aAAOC,SAASC,kBAAkB,SAAUC,KAAKC,MAAMC,MAAMC,YAC5D;AAAA,YAAID,OAAOA,QAAQ;AACnB,YAAIE,MAAMC,SAASC,cAAc,KACjCF;AAAAA,YAAIG,KAAK,iBAAiBC,KAAKC,QAAQ,EACvCL;AAAAA,YAAIM,YAAY,cAAcN,IAAIG,KAAK,qPAAqPL,OAAO;AACnSG,iBAASM,KAAKC,YAAYR,IAAIS,UAE9BL;AAAAA,aAAKM,aAAaV,IAAIG,IAAI,OAAO;AAEjCC,aAAKO,GAAGP,KAAKQ,EAAAA,EAAIC,QAAQd;AACzBK,aAAKO,GAAGP,KAAKQ,EAAIE,EAAAA,UAAUd,IAAIG;AAC/BJ,QAAAA,WAAUgB,WAAWhB,WAAUiB;AAC/BjB,QAAAA,WAAUkB,aAAa,WAAA;AAAA;AACvBlB,QAAAA,WAAUmB,KAAKlB,IAAIG,IAAIP,KAAKC;AAE5B,eAAOO,KAAKO,GAAGP,KAAKe,aAAgBN,CAAAA,EAAAA;AAAAA,MACtC;AAAA,IACA;AAAA,EAEA;;ACrBA,MAAIO;AACJ,MAAA,OAAUC,WAAW,aAAY;AAChCD,kBAAcC;AAAAA,EACf,OAAK;AACJD,kBAAcE;AAAAA,EACf;AAGA,QAAAC,WAAeH;ACVA,WAAQI,OAACzB,YAAAA;AACvB,WAAO,SAASyB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AAA;AAAAA,UACV;AAED,iBAAOY;AAAAA,QACT;AAAA,MAEA;AAEA6+F,yBAAmBlmG,UAAAA;AAAAA,IAGlB,GA9RD;AAAA,EAgSA;AC5Pe,QAAAwoG,gBAAA,EACdrtC,cACAQ,eACA4B,aACA39C,WACAkgD,WACAiB,sBACAoC,QACA1J,aAAasK,wBACb0kC,cAAczkC,yBACdC,SACAkC,QACAy/B,YACA7+B,WACAC,gBACAkQ,SACA+D,OACAl4E,OACAuiF,UACAyG,SACAiE,aACArY,cAAcuY,yBACdC,aACAU,aACAE,KACAr3B,WACA65B,KACAuD,YACA1gF,UACAkmC,WACAliB,WACA13B,UAAUo+F,qBACVW,SACAjoC,cAAcoqC,yBACd/3B,OAAOg4B,kBACP5pE,KACAt3B,aAAashG,wBACbC,IACAC,UAAAA;AC1ED,QAAMuE,UAAU,IAAInuC,iBAAiBiuC,aAEhC;AAAA,QAACxoG,YAAY0oG,QAAQplD;AACrB,QAACD,cAAY,EACjBuW,QAAQ55D,UAAU+M,KAAK27F,QAAQ9uC,QAAQ8uC;AAGxCpnG,SAAOtB,YAAYA;AACnBsB,SAAO+hD,YAAYA;AAEnB,MAAI/hD,CAAAA,OAAOqnG,MAAM;AAChBrnG,WAAOqnG,OAAO;EACf;AAEArnG,SAAOqnG,KAAK3oG,YAAYA;AACxBsB,SAAOqnG,KAAKtlD,YAAYA;;;;;;"} \ No newline at end of file +{"version":3,"file":"dhtmlxscheduler.js","sources":["../../sources/dhtmlx_hook.js","../../sources/global.js","../../sources/plugins/drag_highlight_pos.js","../../sources/plugins/undo_delete.js","../../sources/plugins/limit.js","../../sources/plugins/batch_update.js","../../sources/plugins/index.js","../../sources/core/utils/utils.js","../../sources/core/state.js","../../sources/core/common/assert.js","../../sources/core/common_errors.js","../../sources/core/connector.js","../../sources/core/nav_bar.js","../../sources/core/scheduler_resize_listener.js","../../sources/utils/eventable.js","../../sources/core/scheduler.js","../../sources/core/utils/event.js","../../sources/core/utils/scoped_event.js","../../sources/core/common.js","../../sources/core/wai_aria.js","../../sources/core/utils/dom_helpers.js","../../sources/utils/env.js","../../sources/core/destructor.js","../../sources/core/common/url_serialize.js","../../sources/core/utils/ajax.js","../../sources/core/base.js","../../sources/core/config.js","../../sources/core/event.js","../../sources/core/event_highlight.js","../../sources/core/loaders/xml.js","../../sources/core/loaders/json.js","../../sources/core/loaders/ical.js","../../sources/core/common/get_serializable_events.js","../../sources/core/load.js","../../sources/core/lightbox.js","../../sources/core/touch.js","../../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../../sources/core/skins.js","../../sources/core/jquery.js","../../sources/core/delay_render.js","../../sources/core/dataprocessor/dataprocessor_hooks.js","../../sources/core/dataprocessor/dataprocessor.js","../../sources/core/message.js","../../sources/locale/locale_ar.js","../../sources/locale/locale_be.js","../../sources/locale/locale_ca.js","../../sources/locale/locale_cn.js","../../sources/locale/locale_cs.js","../../sources/locale/locale_da.js","../../sources/locale/locale_de.js","../../sources/locale/locale_el.js","../../sources/locale/locale_en.js","../../sources/locale/locale_es.js","../../sources/locale/locale_fi.js","../../sources/locale/locale_fr.js","../../sources/locale/locale_he.js","../../sources/locale/locale_hu.js","../../sources/locale/locale_id.js","../../sources/locale/locale_it.js","../../sources/locale/locale_jp.js","../../sources/locale/locale_manager.js","../../sources/locale/locale_nb.js","../../sources/locale/locale_nl.js","../../sources/locale/locale_no.js","../../sources/locale/locale_pl.js","../../sources/locale/locale_pt.js","../../sources/locale/locale_ro.js","../../sources/locale/locale_ru.js","../../sources/locale/locale_si.js","../../sources/locale/locale_sk.js","../../sources/locale/locale_sv.js","../../sources/locale/locale_tr.js","../../sources/locale/locale_ua.js","../../sources/locale/index.js","../../sources/core/datepicker.js","../../sources/scheduler_factory_method.js","../../sources/ext/extension_manager.js","../../sources/scheduler_factory.js","../../sources/ext/active_links.js","../../sources/ext/agenda_legacy_view.js","../../sources/ext/agenda.js","../../sources/ext/all_timed.js","../../sources/ext/collision.js","../../sources/ext/container_autoresize.js","../../sources/ext/cookie.js","../../sources/ext/restricted_extensions/not_implemented_extension.js","../../sources/ext/restricted_extensions/daytimeline.js","../../sources/ext/restricted_extensions/drag_between.js","../../sources/ext/editors.js","../../sources/ext/expand.js","../../sources/ext/restricted_extensions/grid_view.js","../../sources/ext/html_templates.js","../../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../../sources/ext/keyboard_navigation/common/eventhandler.js","../../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../../sources/ext/keyboard_navigation/marker.js","../../sources/ext/keyboard_navigation/elements/scheduler_node.js","../../sources/ext/keyboard_navigation/elements/nav_node.js","../../sources/ext/keyboard_navigation/elements/header_cell.js","../../sources/ext/keyboard_navigation/elements/event.js","../../sources/ext/keyboard_navigation/elements/time_slot.js","../../sources/ext/keyboard_navigation/elements/minical_button.js","../../sources/ext/keyboard_navigation/elements/minical_cell.js","../../sources/ext/keyboard_navigation/elements/data_area.js","../../sources/ext/keyboard_navigation/modals.js","../../sources/ext/keyboard_navigation/core.js","../../sources/ext/keyboard_navigation/key_nav_legacy.js","../../sources/ext/keyboard_navigation/scheduler_handlers.js","../../sources/ext/keyboard_navigation/minical_handlers.js","../../sources/ext/key_nav.js","../../sources/ext/layer.js","../../sources/ext/limit.js","../../sources/ext/map_view/gMapAdapter.ts","../../sources/ext/map_view/osmMapAdapter.ts","../../sources/ext/map_view/mapboxAdapter.ts","../../sources/ext/map_view/index.ts","../../sources/ext/minical.js","../../sources/ext/monthheight.js","../../sources/ext/restricted_extensions/multisection.js","../../sources/ext/multiselect.js","../../sources/ext/multisource.js","../../sources/ext/mvc.js","../../sources/ext/outerdrag.js","../../sources/ext/pdf.js","../../sources/ext/quick_info.js","../../sources/ext/readonly.js","../../node_modules/rrule/dist/esm/weekday.js","../../node_modules/rrule/dist/esm/helpers.js","../../node_modules/rrule/dist/esm/dateutil.js","../../node_modules/rrule/dist/esm/iterresult.js","../../node_modules/rrule/node_modules/tslib/tslib.es6.mjs","../../node_modules/rrule/dist/esm/callbackiterresult.js","../../node_modules/rrule/dist/esm/nlp/i18n.js","../../node_modules/rrule/dist/esm/nlp/totext.js","../../node_modules/rrule/dist/esm/nlp/parsetext.js","../../node_modules/rrule/dist/esm/types.js","../../node_modules/rrule/dist/esm/nlp/index.js","../../node_modules/rrule/dist/esm/datetime.js","../../node_modules/rrule/dist/esm/parseoptions.js","../../node_modules/rrule/dist/esm/parsestring.js","../../node_modules/rrule/dist/esm/datewithzone.js","../../node_modules/rrule/dist/esm/optionstostring.js","../../node_modules/rrule/dist/esm/cache.js","../../node_modules/rrule/dist/esm/masks.js","../../node_modules/rrule/dist/esm/iterinfo/yearinfo.js","../../node_modules/rrule/dist/esm/iterinfo/monthinfo.js","../../node_modules/rrule/dist/esm/iterinfo/easter.js","../../node_modules/rrule/dist/esm/iterinfo/index.js","../../node_modules/rrule/dist/esm/iter/poslist.js","../../node_modules/rrule/dist/esm/iter/index.js","../../node_modules/rrule/dist/esm/rrule.js","../../node_modules/rrule/dist/esm/iterset.js","../../node_modules/rrule/dist/esm/rrulestr.js","../../node_modules/rrule/dist/esm/rruleset.js","../../sources/ext/recurring.js","../../sources/ext/recurring_legacy.js","../../sources/ext/serialize.js","../../sources/ext/restricted_extensions/timeline.js","../../sources/ext/tooltip/tooltip.ts","../../sources/ext/tooltip/tooltipManager.ts","../../sources/ext/tooltip/index.ts","../../sources/ext/restricted_extensions/treetimeline.js","../../sources/ext/restricted_extensions/units.js","../../sources/ext/url.js","../../sources/ext/restricted_extensions/week_agenda.js","../../sources/ext/wp.js","../../sources/ext/year_view.js","../../sources/ext/export_api/index.js","../../sources/ext/extensions_gpl.js","../../sources/dhtmlxscheduler.gpl.js"],"sourcesContent":["\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
' + tabs + '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function dragHighlightPos(scheduler){\r\n let dndMarkers = [];\r\n let dragStarted = false;\r\n let eventNode = null;\r\n let event = null;\r\n\r\n function isEnabled() { \r\n return scheduler.config.drag_highlight && scheduler.markTimespan;\r\n }\r\n\r\n function checkViewName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj){\r\n return viewObj.layout;\r\n }\r\n return viewName;\r\n }\r\n\r\n function checkSectionPropertyName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj.y_property){\r\n return viewObj.y_property;\r\n }\r\n if(viewObj.map_to){\r\n return viewObj.map_to;\r\n }\r\n }\r\n\r\n function setRequiredStylesToMarker(eventNode, layout){\r\n switch (layout) {\r\n case \"month\":\r\n eventNode.style.top = \"\";\r\n eventNode.style.left = \"\";\r\n break;\r\n case \"timeline\":\r\n eventNode.style.left = \"\";\r\n eventNode.style.marginLeft = \"1px\";\r\n break;\r\n default:\r\n eventNode.style.top = \"\";\r\n break;\r\n }\r\n }\r\n \r\n function createMarkerConfig(configSettings){\r\n const { event, layout, viewName, sectionId, eventNode } = configSettings;\r\n setRequiredStylesToMarker(eventNode, layout);\r\n const sections = {};\r\n let markerObject = {\r\n start_date: event.start_date,\r\n end_date: event.end_date,\r\n css: \"dhx_scheduler_dnd_marker\",\r\n html: eventNode\r\n };\r\n if (layout == \"timeline\" || layout == \"month\" ){\r\n // we need to set end date less than 24 hours of the views to avoid receiving multiple marktimespans\r\n markerObject = {...markerObject, end_date: scheduler.date.add(event.start_date, 1, 'minute')};\r\n }\r\n if (sectionId){\r\n sections[viewName] = sectionId;\r\n markerObject.sections = sections;\r\n }\r\n return markerObject;\r\n }\r\n\r\n function createViewMarker(settings){\r\n const { layout } = settings;\r\n let markerConfigs;\r\n switch (layout) {\r\n case \"month\": \r\n markerConfigs = getMonthViewMarkers(settings);\r\n break;\r\n case 'timeline':\r\n case 'units':\r\n markerConfigs = getTimelineAndUnitsViewMarkers(settings);\r\n break;\r\n default: \r\n markerConfigs = getColumnViewMarkers(settings);\r\n break;\r\n }\r\n markerConfigs.forEach((cfg) => {\r\n dndMarkers.push(scheduler.markTimespan(cfg));\r\n });\r\n }\r\n\r\n function getColumnViewMarkers(settings){\r\n const {event, layout, viewName, sectionId} = settings;\r\n let columnViewMarkersArray = [];\r\n let eventNodes = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);\r\n if(eventNodes){\r\n for (let i = 0; i < eventNodes.length; i++) {\r\n let eventNodeClone = eventNodes[i].cloneNode(true);\r\n let startDate = new Date(+eventNodeClone.getAttribute(\"data-bar-start\"));\r\n let endDate = new Date(+eventNodeClone.getAttribute(\"data-bar-end\"));\r\n let dates = {start_date: startDate, end_date: endDate};\r\n const configSettings = {\r\n event: dates, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode:eventNodeClone\r\n };\r\n columnViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\t\r\n }\r\n return columnViewMarkersArray;\r\n }\r\n\r\n function getMonthViewMarkers(settings){\r\n let monthViewMarkersArray = [];\r\n const {event, layout, viewName, sectionId} = settings;\r\n const weekDates = [];\r\n let currDate = new Date(event.start_date);\r\n while(currDate.valueOf() < event.end_date.valueOf()){\r\n let obj = {start_date: currDate};\r\n weekDates.push(obj);\r\n currDate = scheduler.date.week_start(scheduler.date.add(currDate, 1, \"week\"));\r\n }\r\n let cells = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']`);\r\n for (let i = 0; i < cells.length; i++) {\r\n const configSettings = {\r\n event: weekDates[i], \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode: cells[i].cloneNode(true)\r\n };\r\n monthViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n return monthViewMarkersArray;\r\n }\r\n\r\n function getTimelineAndUnitsViewMarkers(settings){\r\n let unitMarkersArray = [];\r\n const {event, layout, viewName, eventNode} = settings;\r\n let sectionPropertyName = checkSectionPropertyName(viewName);\r\n if (scheduler.config.multisection && sectionPropertyName){\r\n const sections = String(event[sectionPropertyName]).split(scheduler.config.section_delimiter);\r\n const formatedSections = sections.map(element => String(element));\r\n const elems = [];\r\n for (let i = 0; i < formatedSections.length; i++) {\r\n elems[i] = eventNode.cloneNode(true);\r\n const configSettings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId: formatedSections[i],\r\n eventNode: elems[i]\r\n };\r\n unitMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n }\r\n return unitMarkersArray;\r\n }\r\n \r\n scheduler.attachEvent(\"onBeforeDrag\", function (id, mode, e){\r\n if (isEnabled()) {\r\n dragStarted = true;\r\n event = scheduler.getEvent(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n // to avoid incorrect eventNode and marker creation when scheduler.config.cascade_event_display included\r\n if (layout == \"units\" && scheduler.config.cascade_event_display ) {\r\n scheduler.unselect(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n scheduler.attachEvent(\"onEventDrag\", function (id, mode, e){\r\n if(dragStarted && isEnabled()){\r\n dragStarted = false;// insert element only once after dnd start\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n const sectionId = scheduler.getActionData(e).section;\r\n if (event) {\r\n const settings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode\r\n };\r\n createViewMarker(settings);\r\n }\r\n }\r\n });\r\n\r\n scheduler.attachEvent(\"onDragEnd\", function(id, mode, e){\r\n for (let i = 0; i < dndMarkers.length; i++) {\r\n scheduler.unmarkTimespan(dndMarkers[i]);\r\n }\r\n dndMarkers = [];\r\n eventNode = null;\r\n event = null;\r\n });\r\n}","export default function undoDelete(scheduler) {\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tlet deletedEvent = scheduler.copy(ev);\r\n\t\tif (scheduler.config.undo_deleted && !scheduler.getState().new_event) {\r\n\t\t\tscheduler.message({\r\n\t\t\t\ttext: `
\r\n Event deleted\r\n \r\n
`,\r\n\t\t\t\texpire: 10000,\r\n\t\t\t\ttype: \"popup_after_delete\",\r\n\t\t\t\tcallback: function (e) {\r\n\t\t\t\t\tlet undoBtn = e.target.closest(\r\n\t\t\t\t\t\t`[data-deleted-event-id=\"${ev.id}\"]`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (undoBtn) {\r\n\t\t\t\t\t\tscheduler.addEvent(deletedEvent);\r\n\t\t\t\t\t\tscheduler.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n","export default function limitPlugin(scheduler){\r\n\r\n\r\n\tscheduler.config.mark_now = true;\r\n\tscheduler.config.display_marked_timespans = true;\r\n\tscheduler.config.overwrite_marked_timespans = true;\r\n\r\n\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStarteventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tscheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif ((event.rec_type && event._end_date) || (event.rrule)) {\r\n\t\t\tconst seriesEnd = event._end_date || event.end_date;\r\n\t\t\t// GS-2482 need to take into account that a part of recurring events might be outside the limits\r\n\t\t\tif ((c.limit_start && c.limit_end)) {\r\n\t\t\t\tvar recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event.start_date.valueOf() <= c.limit_end.valueOf();\r\n\t\t\t\treturn recEventInLimits;\r\n\t\t\t} else return true;\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i {\r\n\t\t\tif(date){\r\n\t\t\t\tcalls.setModeDate.date = date;\r\n\t\t\t}\r\n\t\t\tif(mode){\r\n\t\t\t\tcalls.setModeDate.mode = mode;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar methods = {\r\n\t\t\trender:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tsetCurrentView:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tupdateView:(date, mode) => {calls.needUpdateView = true; rememberModeDate(date, mode);},\r\n\t\t\trender_data:() => calls.needRender = true,\r\n\t\t\trender_view_data:(evs) => { \r\n\t\t\t\tif(evs && evs.length){\r\n\t\t\t\t\tevs.forEach((e) => calls.repaintEvents[e.id] = true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcalls.needRender = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\tisActive = false;\r\n\t\tif(!noRedraw){\r\n\t\t\tif(calls.needRender){\r\n\t\t\t\tscheduler.render(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else if(calls.needUpdateView){\r\n\t\t\t\tscheduler.updateView(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else{\r\n\t\t\t\tfor(const i in calls.repaintEvents){\r\n\t\t\t\t\tscheduler.updateEvent(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default function(scheduler){\r\n\tscheduler.batchUpdate = createMethod(scheduler);\r\n}","import dragHighlightPos from \"./drag_highlight_pos\";\r\nimport undoDelete from \"./undo_delete\";\r\nimport limit from \"./limit\";\r\nimport batchUpdate from \"./batch_update\";\r\n\r\nexport default function initPlugins(scheduler){\r\n undoDelete(scheduler);\r\n dragHighlightPos(scheduler);\r\n limit(scheduler);\r\n batchUpdate(scheduler);\r\n}","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","import utils from \"./utils/utils\";\r\n\r\nconst StateService = (function(){\r\n\tconst stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tconst provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tconst res = {};\r\n\t\t\tfor(const i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.$stateProvider.registerProvider(\"global\", (function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n}).bind(scheduler));\r\n\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\tundo_deleted: true,\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events)\";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"
Start date: \" + scheduler.templates.tooltip_date_format(start) + \"
End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += `
`;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"
\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\tvar html = `
\r\n\t\t\t\t
`;\r\n\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
 
';\r\n\t\tinner_html += '
' + contentA + '
';\r\n\t\tinner_html += '
' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"
\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)}`;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += '
';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i -1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"
\"+html+\"  –  \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \"\";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"
\" + scheduler.locale.labels[buttons[i]] + \"
\";\r\n\t\t}\r\n\t\thtml += \"\";\r\n\t\thtml+=\"\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\"+this.locale.labels[\"button_\"+sns[i].button]+\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
 \r\n
\r\n
\r\n\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"
\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"\"+ date.getHours() +\"\"+\r\n\t\t\" \"+ min +\"\";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
 
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_prepareDataItem: function(item) {\r\n\t\tvar processedItem = {};\r\n\t\tvar scheduler = this.$scheduler;\r\n\t\tvar copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (copy[i]) {\r\n\t\t\t\tif(copy[i].getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(copy[i]);\r\n\t\t\t\t} else if(typeof copy[i] == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareDataItem(copy[i]);\r\n\t\t\t\t} else if(copy[i] === null) {\r\n\t\t\t\t\tprocessedItem[i] = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = copy[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn `
${text}
`;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function (e) {\r\n if(text.callback) {\r\n text.callback.call(this, e);\r\n }\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, scheduler.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, scheduler.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"scheduler_\" + btn.label.toLowerCase() + \"_button dhtmlx_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tinner += '
';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id, callback) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id, callback: callback};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"يومي\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"أسبوعي\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"شهري\",\r\n\t\trepeat_radio_year: \"سنوي\",\r\n\t\trepeat_radio_day_type: \"كل\",\r\n\t\trepeat_text_day_count: \"يوم\",\r\n\t\trepeat_radio_day_type2: \"كل يوم عمل\",\r\n\t\trepeat_week: \" تكرار كل\",\r\n\t\trepeat_text_week_count: \"أسبوع في الأيام التالية:\",\r\n\t\trepeat_radio_month_type: \"تكرار\",\r\n\t\trepeat_radio_month_start: \"في\",\r\n\t\trepeat_text_month_day: \"يوم كل\",\r\n\t\trepeat_text_month_count: \"شهر\",\r\n\t\trepeat_text_month_count2_before: \"كل\",\r\n\t\trepeat_text_month_count2_after: \"شهر\",\r\n\t\trepeat_year_label: \"في\",\r\n\t\tselect_year_day2: \"من\",\r\n\t\trepeat_text_year_day: \"يوم\",\r\n\t\tselect_year_month: \"شهر\",\r\n\t\trepeat_radio_end: \"بدون تاريخ انتهاء\",\r\n\t\trepeat_text_occurences_count: \"تكرارات\",\r\n\t\trepeat_radio_end2: \"بعد\",\r\n\t\trepeat_radio_end3: \"ينتهي في\",\r\n\r\n\t\trepeat_never: \"أبداً\",\r\n\t\trepeat_daily: \"كل يوم\",\r\n\t\trepeat_workdays: \"كل يوم عمل\",\r\n\t\trepeat_weekly: \"كل أسبوع\",\r\n\t\trepeat_monthly: \"كل شهر\",\r\n\t\trepeat_yearly: \"كل سنة\",\r\n\t\trepeat_custom: \"تخصيص\",\r\n\t\trepeat_freq_day: \"يوم\",\r\n\t\trepeat_freq_week: \"أسبوع\",\r\n\t\trepeat_freq_month: \"شهر\",\r\n\t\trepeat_freq_year: \"سنة\",\r\n\t\trepeat_on_date: \"في التاريخ\",\r\n\t\trepeat_ends: \"ينتهي\",\r\n\r\n\t\tmonth_for_recurring: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_for_recurring: [\"الأحد\", \"الإثنين\", \"الثلاثاء\", \"الأربعاء\", \"الخميس\", \"الجمعة\", \"السبت\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\r\n\t\trepeat_never: \"Ніколі\",\r\n\t\trepeat_daily: \"Кожны дзень\",\r\n\t\trepeat_workdays: \"Кожны працоўны дзень\",\r\n\t\trepeat_weekly: \"Кожны тыдзень\",\r\n\t\trepeat_monthly: \"Кожны месяц\",\r\n\t\trepeat_yearly: \"Кожны год\",\r\n\t\trepeat_custom: \"Наладжвальны\",\r\n\t\trepeat_freq_day: \"Дзень\",\r\n\t\trepeat_freq_week: \"Тыдзень\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Заканчваецца\",\r\n\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diari\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Setmanal\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mensual\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada dia laborable\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"setmana els dies següents:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada\",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"de\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sense data de finalització\",\r\n\t\trepeat_text_occurences_count: \"ocurrències\",\r\n\t\trepeat_radio_end2: \"Després\",\r\n\t\trepeat_radio_end3: \"Finalitzar el\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Cada dia\",\r\n\t\trepeat_workdays: \"Cada dia laborable\",\r\n\t\trepeat_weekly: \"Cada setmana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada any\",\r\n\t\trepeat_custom: \"Personalitzat\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Setmana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Any\",\r\n\t\trepeat_on_date: \"En la data\",\r\n\t\trepeat_ends: \"Finalitza\",\r\n\r\n\t\tmonth_for_recurring: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tday_for_recurring: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"]\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\t\r\n\t\trepeat_never: \"从不\",\r\n\t\trepeat_daily: \"每天\",\r\n\t\trepeat_workdays: \"每个工作日\",\r\n\t\trepeat_weekly: \"每周\",\r\n\t\trepeat_monthly: \"每月\",\r\n\t\trepeat_yearly: \"每年\",\r\n\t\trepeat_custom: \"自定义\",\r\n\t\trepeat_freq_day: \"天\",\r\n\t\trepeat_freq_week: \"周\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"在日期\",\r\n\t\trepeat_ends: \"结束\",\r\n\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý den\",\r\n\t\trepeat_workdays: \"Každý pracovní den\",\r\n\t\trepeat_weekly: \"Každý týden\",\r\n\t\trepeat_monthly: \"Každý měsíc\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastní\",\r\n\t\trepeat_freq_day: \"Den\",\r\n\t\trepeat_freq_week: \"Týden\",\r\n\t\trepeat_freq_month: \"Měsíc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Končí\",\r\n\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver hverdag\",\r\n\t\trepeat_weekly: \"Hver uge\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Brugerdefineret\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uge\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\r\n\t\trepeat_never: \"Nie\",\r\n\t\trepeat_daily: \"Jeden Tag\",\r\n\t\trepeat_workdays: \"Jeden Werktag\",\r\n\t\trepeat_weekly: \"Jede Woche\",\r\n\t\trepeat_monthly: \"Jeden Monat\",\r\n\t\trepeat_yearly: \"Jedes Jahr\",\r\n\t\trepeat_custom: \"Benutzerdefiniert\",\r\n\t\trepeat_freq_day: \"Tag\",\r\n\t\trepeat_freq_week: \"Woche\",\r\n\t\trepeat_freq_month: \"Monat\",\r\n\t\trepeat_freq_year: \"Jahr\",\r\n\t\trepeat_on_date: \"Am Datum\",\r\n\t\trepeat_ends: \"Endet\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\r\n\t\trepeat_never: \"Ποτέ\",\r\n\t\trepeat_daily: \"Κάθε μέρα\",\r\n\t\trepeat_workdays: \"Κάθε εργάσιμη μέρα\",\r\n\t\trepeat_weekly: \"Κάθε εβδομάδα\",\r\n\t\trepeat_monthly: \"Κάθε μήνα\",\r\n\t\trepeat_yearly: \"Κάθε χρόνο\",\r\n\t\trepeat_custom: \"Προσαρμοσμένο\",\r\n\t\trepeat_freq_day: \"Ημέρα\",\r\n\t\trepeat_freq_week: \"Εβδομάδα\",\r\n\t\trepeat_freq_month: \"Μήνας\",\r\n\t\trepeat_freq_year: \"Χρόνος\",\r\n\t\trepeat_on_date: \"Σε ημερομηνία\",\r\n\t\trepeat_ends: \"Λήγει\",\r\n\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\r\n\t\trepeat_never: \"Never\",\r\n\t\trepeat_daily: \"Every day\",\r\n\t\trepeat_workdays: \"Every weekday\",\r\n\t\trepeat_weekly: \"Every week\",\r\n\t\trepeat_monthly: \"Every month\",\r\n\t\trepeat_yearly: \"Every year\",\r\n\t\trepeat_custom: \"Custom\",\r\n\t\trepeat_freq_day: \"Day\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Month\",\r\n\t\trepeat_freq_year: \"Year\",\r\n\t\trepeat_on_date: \"On date\",\r\n\t\trepeat_ends: \"Ends\",\r\n\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Cada día\",\r\n\t\trepeat_workdays: \"Cada día laborable\",\r\n\t\trepeat_weekly: \"Cada semana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada año\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Día\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Año\",\r\n\t\trepeat_on_date: \"En la fecha\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ei koskaan\",\r\n\t\trepeat_daily: \"Joka päivä\",\r\n\t\trepeat_workdays: \"Joka arkipäivä\",\r\n\t\trepeat_weekly: \"Joka viikko\",\r\n\t\trepeat_monthly: \"Joka kuukausi\",\r\n\t\trepeat_yearly: \"Joka vuosi\",\r\n\t\trepeat_custom: \"Mukautettu\",\r\n\t\trepeat_freq_day: \"Päivä\",\r\n\t\trepeat_freq_week: \"Viikko\",\r\n\t\trepeat_freq_month: \"Kuukausi\",\r\n\t\trepeat_freq_year: \"Vuosi\",\r\n\t\trepeat_on_date: \"Tiettynä päivänä\",\r\n\t\trepeat_ends: \"Päättyy\",\r\n\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\r\n\t\trepeat_never: \"Jamais\",\r\n\t\trepeat_daily: \"Chaque jour\",\r\n\t\trepeat_workdays: \"Chaque jour ouvrable\",\r\n\t\trepeat_weekly: \"Chaque semaine\",\r\n\t\trepeat_monthly: \"Chaque mois\",\r\n\t\trepeat_yearly: \"Chaque année\",\r\n\t\trepeat_custom: \"Personnalisé\",\r\n\t\trepeat_freq_day: \"Jour\",\r\n\t\trepeat_freq_week: \"Semaine\",\r\n\t\trepeat_freq_month: \"Mois\",\r\n\t\trepeat_freq_year: \"Année\",\r\n\t\trepeat_on_date: \"À la date\",\r\n\t\trepeat_ends: \"Se termine\",\r\n\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\r\n\t\trepeat_never: \"אף פעם\",\r\n\t\trepeat_daily: \"כל יום\",\r\n\t\trepeat_workdays: \"כל יום עבודה\",\r\n\t\trepeat_weekly: \"כל שבוע\",\r\n\t\trepeat_monthly: \"כל חודש\",\r\n\t\trepeat_yearly: \"כל שנה\",\r\n\t\trepeat_custom: \"מותאם אישית\",\r\n\t\trepeat_freq_day: \"יום\",\r\n\t\trepeat_freq_week: \"שבוע\",\r\n\t\trepeat_freq_month: \"חודש\",\r\n\t\trepeat_freq_year: \"שנה\",\r\n\t\trepeat_on_date: \"בתאריך\",\r\n\t\trepeat_ends: \"מסתיים\",\r\n\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Napi\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Heti\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Havi\",\r\n\t\trepeat_radio_year: \"Éves\",\r\n\t\trepeat_radio_day_type: \"Minden\",\r\n\t\trepeat_text_day_count: \"nap\",\r\n\t\trepeat_radio_day_type2: \"Minden munkanap\",\r\n\t\trepeat_week: \" Ismételje meg minden\",\r\n\t\trepeat_text_week_count: \"héten a következő napokon:\",\r\n\t\trepeat_radio_month_type: \"Ismétlés\",\r\n\t\trepeat_radio_month_start: \"Ekkor\",\r\n\t\trepeat_text_month_day: \"nap minden\",\r\n\t\trepeat_text_month_count: \"hónapban\",\r\n\t\trepeat_text_month_count2_before: \"minden\",\r\n\t\trepeat_text_month_count2_after: \"hónapban\",\r\n\t\trepeat_year_label: \"Ekkor\",\r\n\t\tselect_year_day2: \"-án/-én\",\r\n\t\trepeat_text_year_day: \"nap\",\r\n\t\tselect_year_month: \"hónap\",\r\n\t\trepeat_radio_end: \"Nincs befejezési dátum\",\r\n\t\trepeat_text_occurences_count: \"esemény\",\r\n\t\trepeat_radio_end2: \"Után\",\r\n\t\trepeat_radio_end3: \"Befejező dátum\",\r\n\r\n\t\trepeat_never: \"Soha\",\r\n\t\trepeat_daily: \"Minden nap\",\r\n\t\trepeat_workdays: \"Minden munkanap\",\r\n\t\trepeat_weekly: \"Minden héten\",\r\n\t\trepeat_monthly: \"Minden hónapban\",\r\n\t\trepeat_yearly: \"Minden évben\",\r\n\t\trepeat_custom: \"Egyedi\",\r\n\t\trepeat_freq_day: \"Nap\",\r\n\t\trepeat_freq_week: \"Hét\",\r\n\t\trepeat_freq_month: \"Hónap\",\r\n\t\trepeat_freq_year: \"Év\",\r\n\t\trepeat_on_date: \"Dátum szerint\",\r\n\t\trepeat_ends: \"Befejeződik\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Harian\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Mingguan\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Bulanan\",\r\n\t\trepeat_radio_year: \"Tahunan\",\r\n\t\trepeat_radio_day_type: \"Setiap\",\r\n\t\trepeat_text_day_count: \"hari\",\r\n\t\trepeat_radio_day_type2: \"Setiap hari kerja\",\r\n\t\trepeat_week: \" Ulangi setiap\",\r\n\t\trepeat_text_week_count: \"minggu pada hari berikut:\",\r\n\t\trepeat_radio_month_type: \"Ulangi\",\r\n\t\trepeat_radio_month_start: \"Pada\",\r\n\t\trepeat_text_month_day: \"hari setiap\",\r\n\t\trepeat_text_month_count: \"bulan\",\r\n\t\trepeat_text_month_count2_before: \"setiap\",\r\n\t\trepeat_text_month_count2_after: \"bulan\",\r\n\t\trepeat_year_label: \"Pada\",\r\n\t\tselect_year_day2: \"dari\",\r\n\t\trepeat_text_year_day: \"hari\",\r\n\t\tselect_year_month: \"bulan\",\r\n\t\trepeat_radio_end: \"Tanpa tanggal akhir\",\r\n\t\trepeat_text_occurences_count: \"kejadian\",\r\n\t\trepeat_radio_end2: \"Setelah\",\r\n\t\trepeat_radio_end3: \"Berakhir pada\",\r\n\r\n\t\trepeat_never: \"Tidak pernah\",\r\n\t\trepeat_daily: \"Setiap hari\",\r\n\t\trepeat_workdays: \"Setiap hari kerja\",\r\n\t\trepeat_weekly: \"Setiap minggu\",\r\n\t\trepeat_monthly: \"Setiap bulan\",\r\n\t\trepeat_yearly: \"Setiap tahun\",\r\n\t\trepeat_custom: \"Kustom\",\r\n\t\trepeat_freq_day: \"Hari\",\r\n\t\trepeat_freq_week: \"Minggu\",\r\n\t\trepeat_freq_month: \"Bulan\",\r\n\t\trepeat_freq_year: \"Tahun\",\r\n\t\trepeat_on_date: \"Pada tanggal\",\r\n\t\trepeat_ends: \"Berakhir\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Ogni giorno\",\r\n\t\trepeat_workdays: \"Ogni giorno feriale\",\r\n\t\trepeat_weekly: \"Ogni settimana\",\r\n\t\trepeat_monthly: \"Ogni mese\",\r\n\t\trepeat_yearly: \"Ogni anno\",\r\n\t\trepeat_custom: \"Personalizzato\",\r\n\t\trepeat_freq_day: \"Giorno\",\r\n\t\trepeat_freq_week: \"Settimana\",\r\n\t\trepeat_freq_month: \"Mese\",\r\n\t\trepeat_freq_year: \"Anno\",\r\n\t\trepeat_on_date: \"Alla data\",\r\n\t\trepeat_ends: \"Finisce\",\r\n\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"毎日\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"毎週\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"毎月\",\r\n\t\trepeat_radio_year: \"毎年\",\r\n\t\trepeat_radio_day_type: \"毎\",\r\n\t\trepeat_text_day_count: \"日\",\r\n\t\trepeat_radio_day_type2: \"毎営業日\",\r\n\t\trepeat_week: \" 繰り返し毎\",\r\n\t\trepeat_text_week_count: \"週 次の日:\",\r\n\t\trepeat_radio_month_type: \"繰り返し\",\r\n\t\trepeat_radio_month_start: \"オン\",\r\n\t\trepeat_text_month_day: \"日毎\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"毎\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"オン\",\r\n\t\tselect_year_day2: \"の\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"終了日なし\",\r\n\t\trepeat_text_occurences_count: \"回数\",\r\n\t\trepeat_radio_end2: \"後\",\r\n\t\trepeat_radio_end3: \"終了日まで\",\r\n\r\n\t\trepeat_never: \"決して\",\r\n\t\trepeat_daily: \"毎日\",\r\n\t\trepeat_workdays: \"毎営業日\",\r\n\t\trepeat_weekly: \"毎週\",\r\n\t\trepeat_monthly: \"毎月\",\r\n\t\trepeat_yearly: \"毎年\",\r\n\t\trepeat_custom: \"カスタム\",\r\n\t\trepeat_freq_day: \"日\",\r\n\t\trepeat_freq_week: \"週\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"日にち\",\r\n\t\trepeat_ends: \"終了\",\r\n\r\n\t\tmonth_for_recurring: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_for_recurring: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\r\n\t\trepeat_never: \"Nooit\",\r\n\t\trepeat_daily: \"Elke dag\",\r\n\t\trepeat_workdays: \"Elke werkdag\",\r\n\t\trepeat_weekly: \"Elke week\",\r\n\t\trepeat_monthly: \"Elke maand\",\r\n\t\trepeat_yearly: \"Elk jaar\",\r\n\t\trepeat_custom: \"Aangepast\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Maand\",\r\n\t\trepeat_freq_year: \"Jaar\",\r\n\t\trepeat_on_date: \"Op datum\",\r\n\t\trepeat_ends: \"Eindigt\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Ukentlig\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Hver arbeidsdag\",\r\n\t\trepeat_week: \" Gjenta hver\",\r\n\t\trepeat_text_week_count: \"uke neste dager:\",\r\n\t\trepeat_radio_month_type: \"Gjenta\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"På\",\r\n\t\tselect_year_day2: \"av\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"måned\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomster\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\trepeat_radio_end3: \"Slutt innen\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nigdy\",\r\n\t\trepeat_daily: \"Codziennie\",\r\n\t\trepeat_workdays: \"Każdy dzień roboczy\",\r\n\t\trepeat_weekly: \"Co tydzień\",\r\n\t\trepeat_monthly: \"Co miesiąc\",\r\n\t\trepeat_yearly: \"Co rok\",\r\n\t\trepeat_custom: \"Niestandardowy\",\r\n\t\trepeat_freq_day: \"Dzień\",\r\n\t\trepeat_freq_week: \"Tydzień\",\r\n\t\trepeat_freq_month: \"Miesiąc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"W dniu\",\r\n\t\trepeat_ends: \"Kończy się\",\r\n\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Todos os dias\",\r\n\t\trepeat_workdays: \"Todos os dias úteis\",\r\n\t\trepeat_weekly: \"Toda semana\",\r\n\t\trepeat_monthly: \"Todo mês\",\r\n\t\trepeat_yearly: \"Todo ano\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mês\",\r\n\t\trepeat_freq_year: \"Ano\",\r\n\t\trepeat_on_date: \"Na data\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\r\n\t\trepeat_never: \"Niciodată\",\r\n\t\trepeat_daily: \"În fiecare zi\",\r\n\t\trepeat_workdays: \"În fiecare zi lucrătoare\",\r\n\t\trepeat_weekly: \"În fiecare săptămână\",\r\n\t\trepeat_monthly: \"În fiecare lună\",\r\n\t\trepeat_yearly: \"În fiecare an\",\r\n\t\trepeat_custom: \"Personalizat\",\r\n\t\trepeat_freq_day: \"Zi\",\r\n\t\trepeat_freq_week: \"Săptămână\",\r\n\t\trepeat_freq_month: \"Lună\",\r\n\t\trepeat_freq_year: \"An\",\r\n\t\trepeat_on_date: \"La data\",\r\n\t\trepeat_ends: \"Se termină\",\r\n\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Никогда\",\r\n\t\trepeat_daily: \"Каждый день\",\r\n\t\trepeat_workdays: \"Каждый будний день\",\r\n\t\trepeat_weekly: \"Каждую неделю\",\r\n\t\trepeat_monthly: \"Каждый месяц\",\r\n\t\trepeat_yearly: \"Каждый год\",\r\n\t\trepeat_custom: \"Настроить\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Неделя\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"В дату\",\r\n\t\trepeat_ends: \"Заканчивается\",\r\n\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dnevno\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Tedensko\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mesečno\",\r\n\t\trepeat_radio_year: \"Letno\",\r\n\t\trepeat_radio_day_type: \"Vsak\",\r\n\t\trepeat_text_day_count: \"dan\",\r\n\t\trepeat_radio_day_type2: \"Vsak delovni dan\",\r\n\t\trepeat_week: \" Ponavljaj vsak\",\r\n\t\trepeat_text_week_count: \"teden na naslednje dni:\",\r\n\t\trepeat_radio_month_type: \"Ponavljaj\",\r\n\t\trepeat_radio_month_start: \"Na\",\r\n\t\trepeat_text_month_day: \"dan vsak\",\r\n\t\trepeat_text_month_count: \"mesec\",\r\n\t\trepeat_text_month_count2_before: \"vsak\",\r\n\t\trepeat_text_month_count2_after: \"mesec\",\r\n\t\trepeat_year_label: \"Na\",\r\n\t\tselect_year_day2: \"od\",\r\n\t\trepeat_text_year_day: \"dan\",\r\n\t\tselect_year_month: \"mesec\",\r\n\t\trepeat_radio_end: \"Brez končnega datuma\",\r\n\t\trepeat_text_occurences_count: \"pojavitve\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\trepeat_radio_end3: \"Končaj do\",\r\n\r\n\t\trepeat_never: \"Nikoli\",\r\n\t\trepeat_daily: \"Vsak dan\",\r\n\t\trepeat_workdays: \"Vsak delovni dan\",\r\n\t\trepeat_weekly: \"Vsak teden\",\r\n\t\trepeat_monthly: \"Vsak mesec\",\r\n\t\trepeat_yearly: \"Vsako leto\",\r\n\t\trepeat_custom: \"Po meri\",\r\n\t\trepeat_freq_day: \"Dan\",\r\n\t\trepeat_freq_week: \"Teden\",\r\n\t\trepeat_freq_month: \"Mesec\",\r\n\t\trepeat_freq_year: \"Leto\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Konča se\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý deň\",\r\n\t\trepeat_workdays: \"Každý pracovný deň\",\r\n\t\trepeat_weekly: \"Každý týždeň\",\r\n\t\trepeat_monthly: \"Každý mesiac\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastné\",\r\n\t\trepeat_freq_day: \"Deň\",\r\n\t\trepeat_freq_week: \"Týždeň\",\r\n\t\trepeat_freq_month: \"Mesiac\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na dátum\",\r\n\t\trepeat_ends: \"Koniec\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Varje dag\",\r\n\t\trepeat_workdays: \"Varje vardag\",\r\n\t\trepeat_weekly: \"Varje vecka\",\r\n\t\trepeat_monthly: \"Varje månad\",\r\n\t\trepeat_yearly: \"Varje år\",\r\n\t\trepeat_custom: \"Anpassad\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Vecka\",\r\n\t\trepeat_freq_month: \"Månad\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På datum\",\r\n\t\trepeat_ends: \"Slutar\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Günlük\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Haftalık\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Aylık\",\r\n\t\trepeat_radio_year: \"Yıllık\",\r\n\t\trepeat_radio_day_type: \"Her\",\r\n\t\trepeat_text_day_count: \"gün\",\r\n\t\trepeat_radio_day_type2: \"Her iş günü\",\r\n\t\trepeat_week: \" Tekrar her\",\r\n\t\trepeat_text_week_count: \"hafta şu günlerde:\",\r\n\t\trepeat_radio_month_type: \"Tekrar et\",\r\n\t\trepeat_radio_month_start: \"Tarihinde\",\r\n\t\trepeat_text_month_day: \"gün her\",\r\n\t\trepeat_text_month_count: \"ay\",\r\n\t\trepeat_text_month_count2_before: \"her\",\r\n\t\trepeat_text_month_count2_after: \"ay\",\r\n\t\trepeat_year_label: \"Tarihinde\",\r\n\t\tselect_year_day2: \"ayın\",\r\n\t\trepeat_text_year_day: \"günü\",\r\n\t\tselect_year_month: \"ay\",\r\n\t\trepeat_radio_end: \"Bitiş tarihi yok\",\r\n\t\trepeat_text_occurences_count: \"olay\",\r\n\t\trepeat_radio_end2: \"Sonra\",\r\n\t\trepeat_radio_end3: \"Tarihinde bitir\",\r\n\r\n\t\trepeat_never: \"Asla\",\r\n\t\trepeat_daily: \"Her gün\",\r\n\t\trepeat_workdays: \"Her iş günü\",\r\n\t\trepeat_weekly: \"Her hafta\",\r\n\t\trepeat_monthly: \"Her ay\",\r\n\t\trepeat_yearly: \"Her yıl\",\r\n\t\trepeat_custom: \"Özel\",\r\n\t\trepeat_freq_day: \"Gün\",\r\n\t\trepeat_freq_week: \"Hafta\",\r\n\t\trepeat_freq_month: \"Ay\",\r\n\t\trepeat_freq_year: \"Yıl\",\r\n\t\trepeat_on_date: \"Tarihinde\",\r\n\t\trepeat_ends: \"Biter\",\r\n\r\n\t\tmonth_for_recurring: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tday_for_recurring: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ніколи\",\r\n\t\trepeat_daily: \"Щодня\",\r\n\t\trepeat_workdays: \"Щодня в робочі дні\",\r\n\t\trepeat_weekly: \"Щотижня\",\r\n\t\trepeat_monthly: \"Щомісяця\",\r\n\t\trepeat_yearly: \"Щороку\",\r\n\t\trepeat_custom: \"Налаштоване\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Тиждень\",\r\n\t\trepeat_freq_month: \"Місяць\",\r\n\t\trepeat_freq_year: \"Рік\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Закінчується\",\r\n\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\nimport addPlugins from \"./plugins\";\r\nimport stateProvider from \"./core/state\";\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tscheduler.$stateProvider = stateProvider();\r\n\r\n\tscheduler.getState = scheduler.$stateProvider.getState;\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\taddPlugins(scheduler);\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \"\";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"
\" +\r\n\t\t\t\t\"
\"+l.date+\"
\" +\r\n\t\t\t\t\"\"+l.description+\"\" +\r\n\t\t\t\t\"
\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"
\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=`
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\"
\";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t
${scheduler.templates.agenda_day(day)}
\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif(edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tif(last.style.visibility == \"hidden\"){\r\n\t\t\t\t\t\t\tlast.style.display = \"none\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlast.style.display = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a Professional version of the component.
\r\n\t\tContact us at https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += `
`;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i
';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \"\";\r\n\t\tvar label_html = \"\";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\r\n\t\t\tif(scheduler.config.multisection)\r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('
';\r\n\t\thtml+='
 
';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='
';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"
\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\n\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onMouseDown\", function(classname) {\r\n\t\treturn !(classname == dhx_time_block);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t\tif (!id) return true;\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(id));\r\n\t});\r\n\tscheduler.attachEvent(\"onClick\", function (event_id, native_event_object){\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(event_id));\r\n });\r\n\tscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tbefore = [ev.start_date, ev.end_date];\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\r\n\t\t//lightbox may not have 'time' section\r\n\t\tif(!(data.start_date && data.end_date)){\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tdata.start_date = new Date(ev.start_date);\r\n\t\t\tdata.end_date = new Date(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif(data.rec_type){\r\n\t\t\t//_roll_back_dates modifies start_date of recurring event, need to check limits after modification\r\n\t\t\t// use a copy to keep original event unchanged\r\n\t\t\tvar data_copy = scheduler._lame_clone(data);\r\n\t\t\tscheduler._roll_back_dates(data_copy);\r\n\t\t\treturn scheduler.checkLimitViolation(data_copy);\r\n\t\t}\r\n\t\treturn scheduler.checkLimitViolation(data);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {\r\n\t\t\t//if newly created event is outside of limited time - crop it, leaving only allowed time\r\n\t\t\tif (ev.start_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.start_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn scheduler.checkLimitViolation(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\r\n};\r\nscheduler._temp_limit_scope();\r\n\r\n\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\ndeclare let google: any;\r\n\r\nexport class GoogleMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tprivate infoWindow: any;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tlet zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom;\r\n\t\t\t\t\tif (event.lat && event.lng){\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: event.lat, \r\n\t\t\t\t\t\t\tlng: event.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: this.settings.error_position.lat, \r\n\t\t\t\t\t\t\tlng: this.settings.error_position.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoogle.maps.event.trigger(this._markers[i].marker, 'click');\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tthis.settings = options;\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapOptions = {\r\n\t\t\tcenter: { lat: options.initial_position.lat, lng: options.initial_position.lng },\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tmapId: container.id,\r\n\t\t\tscrollwheel: true,\r\n\t\t\tmapTypeId: options.type\r\n\t\t}\r\n\t\t// we need to reuse the google map to avoid leak memory\r\n\t\tif (this.map === null) {\r\n\t\t\tthis.map = new google.maps.Map(container, mapOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet map = this.map;\r\n\t\t\tcontainer.appendChild(this.map.__gm.messageOverlay);\r\n\t\t\tcontainer.appendChild(this.map.__gm.outerContainer);\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tmap.setOptions({container: container.id});\r\n\t\t\t}, 500);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(this.map, \"dblclick\", function(event) {\r\n\t\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\r\n\t\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\t\tlet point = event.latLng;\r\n\t\t\t\tgeocoder.geocode(\r\n\t\t\t\t\t{ 'latLng': point },\r\n\t\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tgoogle.maps.event.clearInstanceListeners(window);\r\n\t\tgoogle.maps.event.clearInstanceListeners(document);\r\n\t\tgoogle.maps.event.clearInstanceListeners(container);\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\tasync addEventMarker(event: ICalendarEvent): Promise {\r\n\t\tlet config = {\r\n\t\t\ttitle: event.text,\r\n\t\t\tposition: {},\r\n\t\t\tmap: {}\r\n\t\t}\r\n\t\t\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tconfig.position = { lat: event.lat, lng: event.lng };\r\n\t\t} else {\r\n\t\t\tconfig.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }\r\n\t\t}\r\n\t\tconst { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\t\tlet marker;\r\n\t\tif (this.scheduler.ext.mapView.createMarker) {\r\n\t\t\tconfig.map = this.map;\r\n\t\t\tmarker = this.scheduler.ext.mapView.createMarker(config);\r\n\t\t} else {\r\n\t\t\tmarker = new AdvancedMarkerElement(config);\r\n\t\t\tmarker.map = this.map;\r\n\t\t}\r\n\t\tmarker.setMap(this.map);\r\n\t\t//case for markeks which were deleted with DataProcessor\r\n\t\tif (event[\"!nativeeditor_status\"] == \"true_deleted\"){\r\n\t\t\tmarker.setMap(null);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(marker, \"click\", () => {\r\n\t\t\tif (this.infoWindow) {\r\n\t\t\t\tthis.infoWindow.close();\r\n\t\t\t}\r\n\t\t\tthis.infoWindow = new google.maps.InfoWindow({maxWidth: this.settings.info_window_max_width});\r\n\t\t\tthis.infoWindow.setContent(this.scheduler.templates.map_info_content(event));\r\n\t\t\tthis.infoWindow.open({\r\n\t\t\t\tanchor: marker,\r\n\t\t\t\tmap: this.map,\r\n\t\t\t});\r\n\t\t});\r\n\t\tlet markerInfo = {event, ...config, marker};\r\n\t\tthis._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.setVisible(false);\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t\tthis._markers[i].marker.setPosition(null);\r\n\t\t\t\tthis._markers[i].marker = null;\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tthis._markers[i].position.lat = event.lat;\r\n\t\t\t\tthis._markers[i].position.lng = event.lng;\r\n\t\t\t\tthis._markers[i].text = event.text;\r\n\t\t\t\tlet latlng = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t\t\tthis._markers[i].marker.setPosition(latlng);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif (this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setCenter({\r\n\t\t\tlat: latitude, \r\n\t\t\tlng: longitude,\r\n\t\t});\r\n\t\tthis.map.setZoom(zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\tlet position: any = await new Promise((resolve) => {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'address': string },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tresolve({\r\n\t\t\t\t\t\t lat: results[0].geometry.location.lat(),\r\n\t\t\t\t\t\t lng: results[0].geometry.location.lng()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\tresolve({});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\t\treturn position;\r\n\t}\r\n\t\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let L: any\r\n\r\nexport class OpenStreetMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate _markers: any[];\r\n\tprivate settings: IMapSettings;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.openPopup();\r\n\t\t\t\t\tthis._markers[i].marker.closeTooltip();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapWrapper = document.createElement('div');\r\n\t\tmapWrapper.className = 'mapWrapper';\r\n\t\tmapWrapper.id = 'mapWrapper';\r\n\t\tmapWrapper.style.width = container.style.width;\r\n\t\tmapWrapper.style.height = container.style.height;\r\n\t\tcontainer.appendChild(mapWrapper);\r\n\r\n\t\tlet map = L.map(mapWrapper, {\r\n\t\t\tcenter: L.latLng(options.initial_position.lat, options.initial_position.lng),\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tkeyboard: false // need to set false, due to bug with moving window\r\n\t\t});\r\n\t\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);\r\n\t\tmap.on(\"dblclick\", async function(e){\r\n\t\t\tconst settings = {\r\n\t\t\t\t\"method\": \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then(response => response.json());\r\n\t\t\tif (response.address) {\r\n\t\t\t\tlet address = response.address.country;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.latlng.lat,\r\n\t\t\t\t\tlng: e.latlng.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\", response.error);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.map = map;\r\n\t\tthis.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n\t\tconst myIcon = L.icon({\r\n\t\t\ticonUrl: 'https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png',\r\n\t\t\ticonSize: [25, 41],\r\n\t\t\tshadowSize: [30, 65],\r\n\t\t\ticonAnchor: [12, 41],\r\n\t\t\tshadowAnchor: [7, 65]\r\n\t\t});\r\n\t\tlet popupConfig = {\r\n\t\t\tminWidth: 180,\r\n\t\t\tmaxWidth: this.settings.info_window_max_width,\r\n\t\t}\r\n\t\tconst markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event));\r\n\t\tconst tooltip = L.tooltip().setContent(event.text);\r\n\r\n\t\tlet markerConfig = [\r\n\t\t\tevent.lat,\r\n\t\t\tevent.lng\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tmarkerConfig = [this.settings.error_position.lat, this.settings.error_position.lng];\r\n\t\t}\r\n\t\tconst marker = L.marker(markerConfig, {\r\n\t\t\ticon: myIcon\r\n\t\t}).bindPopup(markerPopup).bindTooltip(tooltip).addTo(this.map);\r\n\t\tconst markerInfo = {event, marker};\r\n\t\tthis._markers.push(markerInfo);\t\t\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker);\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([event.lat, event.lng]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif(this._markers) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker); \r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setView([latitude, longitude], zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst settings = {\r\n\t\t\t\"method\": \"GET\",\r\n\t\t\theaders: {\r\n\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t},\r\n\t\t};\r\n\t\tlet position:any = {};\r\n\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then(response => response.json());\r\n\t\tif (response && response.length) {\r\n\t\t\tposition.lat = +response[0].lat;\r\n\t\t\tposition.lng = +response[0].lon;\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let mapboxgl: any;\r\ndeclare let MapboxGeocoder: any;\r\n\r\nexport class MapboxAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n const popup = this._markers[i].marker.getPopup();\r\n if (popup.isOpen()){\r\n popup.remove();\r\n }\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.togglePopup();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n let scheduler = this.scheduler;\r\n\r\n\t\tmapboxgl.accessToken = options.accessToken;\r\n const map = new mapboxgl.Map({\r\n container: container, \r\n center: [options.initial_position.lng, options.initial_position.lat], \r\n zoom: options.initial_zoom + 1, // problems with coordinates if zoom = 1\r\n });\r\n map.on(\"dblclick\",async function(e){\r\n\t\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${ e.lngLat.lat}.json?access_token=${options.accessToken}`).then(response => response.json());\r\n\t\t\tif (response.features){\r\n\t\t\t\tlet address = response.features[0].place_name;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.lngLat.lat,\r\n\t\t\t\t\tlng: e.lngLat.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\");\r\n\t\t\t}\r\n\t\t});\r\n this.map = map;\r\n this.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n while (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n container.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n let config = [\r\n\t\t\tevent.lng,\r\n\t\t\tevent.lat\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tconfig = [this.settings.error_position.lng, this.settings.error_position.lat];\r\n\t\t} \r\n\r\n\t\tconst popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false})\r\n .setMaxWidth(`${this.settings.info_window_max_width}px`) \r\n .setHTML(this.scheduler.templates.map_info_content(event));\r\n const marker = new mapboxgl.Marker()\r\n .setLngLat(config)\r\n .setPopup(popup)\r\n .addTo(this.map);\r\n const markerInfo = {event, marker}; \r\n this._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.remove();\r\n this._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([event.lng, event.lat]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tfor (let i = 0; i {\r\n\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then(response => response.json());\r\n\t\tlet position:any = {};\r\n\t\tif (response && response.features.length) {\r\n\t\t\tposition.lng = response.features[0].center[0];\r\n\t\t\tposition.lat = response.features[0].center[1];\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { GoogleMapAdapter } from \"./gMapAdapter\";\r\nimport { OpenStreetMapAdapter } from \"./osmMapAdapter\";\r\nimport { MapboxAdapter } from \"./mapboxAdapter\";\r\nimport { IMapAdapter, ICalendarEvent, IMapSettings } from \"./types\";\r\n\r\ndeclare let google: any;\r\n\r\nexport default function(scheduler: any){\r\n\t\r\nlet mapAdapter: IMapAdapter | null = null;\r\nlet eventHandlerIds: number[] = [];\r\nconst adapters: { [name:string]: IMapAdapter } = {\r\n\tgoogleMap: new GoogleMapAdapter(scheduler),\r\n\topenStreetMaps: new OpenStreetMapAdapter(scheduler),\r\n\tmapbox: new MapboxAdapter(scheduler)\r\n}\r\n\r\nif(!scheduler.ext){\r\n\tscheduler.ext = {};\r\n}\r\nscheduler.ext.mapView = {\r\n\tcreateAdapter: function():IMapAdapter{\r\n\t\treturn adapters[scheduler.config.map_view_provider];\r\n\t},\r\n\tcreateMarker: function(config){\r\n\t\treturn new google.maps.Marker(config);\r\n\t},\r\n\tcurrentAdapter: null,\r\n\tadapters\r\n};\r\nscheduler._latLngUpdate = false; // flag for updating events which don't have event.lat and event.lng\r\nscheduler._eventLocationChanged = false; // flag for checking if the location of the event is changed\r\nscheduler.config.map_view_provider = \"googleMap\";\r\nscheduler.config.map_settings = {\r\n\tinitial_position: {\r\n\t lat: 48.724,\r\n\t lng: 8.215\r\n\t},\r\n\terror_position: {\r\n\t lat: 15,\r\n\t lng: 15\r\n\t},\r\n\tinitial_zoom: 1,\r\n\tzoom_after_resolve: 15,\r\n\tinfo_window_max_width: 300,\r\n\tresolve_user_location: true,\r\n\tresolve_event_location: true,\r\n\tview_provider: \"googleMap\"\r\n}\r\nif (scheduler.config.map_initial_position) {\r\n\tscheduler.config.map_settings.initial_position = {\r\n\t\tlat: scheduler.config.map_initial_position.lat(),\r\n\t\tlng: scheduler.config.map_initial_position.lng(), \r\n\t};\r\n}\r\n\r\nif (scheduler.config.map_error_position) {\r\n\tscheduler.config.map_settings.error_position = {\r\n\t\tlat: scheduler.config.map_error_position.lat(),\r\n\t\tlng: scheduler.config.map_error_position.lng(), \r\n\t};\r\n}\r\n\r\nscheduler.xy.map_date_width = 188; // date column width\r\nscheduler.xy.map_icon_width = 25; // event details icon width\r\nscheduler.xy.map_description_width = 400; // description column width\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\nscheduler.templates.map_info_content = function(event){\r\n return `
Event's text: ${event.text}\r\n\t\t\t\t
Location: ${event.event_location}
\r\n\t\t\t\t
Starts: ${scheduler.templates.tooltip_date_format(event.start_date)}
\r\n\t\t\t\t
Ends: ${scheduler.templates.tooltip_date_format(event.end_date)}
\r\n\t\t\t
`;\r\n};\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\n\r\nfunction setupMapView(scheduler) {\r\n\t// Initialization logic, possibly including creation of a new mapAdapter\r\n\tmapAdapter = scheduler.ext.mapView.createAdapter();\r\n\tattachSchedulerEvents();\r\n}\r\nasync function addEventWithLocation(event: ICalendarEvent, mapAdapter: IMapAdapter){\r\n\tlet coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\tevent.lat = coordinates.lat;\r\n\tevent.lng = coordinates.lng;\r\n\tmapAdapter.removeEventMarker(String(event.id));\r\n\tmapAdapter.addEventMarker(event);\r\n\treturn event;\r\n}\r\nfunction setUserLocation(options: IMapSettings, adapter: IMapAdapter): void{\r\n\tif (options.resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\tadapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tadapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom);\r\n\t}\r\n}\r\nscheduler.dblclick_dhx_map_area = function(e) {\r\n\tlet eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\tif (eventNode){\r\n\t\tlet eventId = eventNode.getAttribute(`${scheduler.config.event_attribute}`);\r\n\t\tscheduler.showLightbox(eventId);\r\n\t}\r\n\tif (!this.config.readonly && this.config.dblclick_create && !eventNode) {\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler.config.map_start,\r\n\t\t\tend_date: scheduler.date.add( scheduler.config.map_start, scheduler.config.time_step, \"minute\"),\r\n\t\t});\r\n\t}\t\r\n};\r\n\r\nfunction attachSchedulerEvents() { \r\n eventHandlerIds.push(\r\n\tscheduler.attachEvent(\"onEventSave\",function(id,ev,is_new){\r\n\t\tlet unmodifiedEvent = scheduler.getEvent(id);\r\n\t\tif (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) {\r\n\t\t\tscheduler._eventLocationChanged = true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}),\r\n scheduler.attachEvent(\"onEventChanged\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !scheduler._latLngUpdate ) {\r\n\t\t\t\t \taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.updateEventMarker(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._latLngUpdate = false;\r\n\t\treturn true;\r\n }),\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_id,new_id){\r\n\t\tlet newIdEvent = scheduler.getEvent(new_id);\r\n\t\tmapAdapter?.removeEventMarker(old_id);\r\n\t\tmapAdapter?.addEventMarker(newIdEvent);\r\n\t}),\r\n scheduler.attachEvent(\"onEventAdded\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n \t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && scheduler._eventLocationChanged) {\r\n\t\t\t\t\taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t\tscheduler._eventLocationChanged = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.addEventMarker(event);\r\n\t\t\t\t\tmapAdapter.onEventClick(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }),\r\n scheduler.attachEvent(\"onClick\", function (id, e){\r\n\t\tconst event = scheduler.getEvent(id);\r\n\t\tif (mapAdapter && event) mapAdapter.onEventClick(event);\r\n\t\treturn false;\r\n }),\r\n scheduler.attachEvent(\"onBeforeEventDelete\", (id, event) => {\r\n\t\tif (mapAdapter) {\r\n\t\t\tmapAdapter.removeEventMarker(id);\r\n\t\t}\r\n\t\treturn true;\r\n })\r\n );\r\n}\r\nfunction detachSchedulerEvents() {\r\n\teventHandlerIds.forEach(id => scheduler.detachEvent(id));\r\n\teventHandlerIds = [];\r\n}\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\r\n\tif(scheduler.config.map_initial_zoom !== undefined){\r\n\t\tscheduler.config.map_settings.initial_zoom = scheduler.config.map_initial_zoom;\r\n\t}\r\n\tif(scheduler.config.map_zoom_after_resolve !== undefined){\r\n\t\tscheduler.config.map_settings.zoom_after_resolve = scheduler.config.map_zoom_after_resolve;\r\n\t}\r\n\tif(scheduler.config.map_infowindow_max_width !== undefined){\r\n\t\tscheduler.config.map_settings.info_window_max_width = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\tif(scheduler.config.map_resolve_user_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_user_location = scheduler.config.map_resolve_user_location;\r\n\t}\r\n\tif(scheduler.config.map_view_provider !== undefined){\r\n\t\tscheduler.config.map_settings.view_provider = scheduler.config.map_view_provider;\r\n\t}\r\n\tif(scheduler.config.map_type !== undefined){\r\n\t\tscheduler.config.map_settings.type = scheduler.config.map_type;\r\n\t}\r\n\tif(scheduler.config.map_resolve_event_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_event_location = scheduler.config.map_resolve_event_location;\r\n\t}\r\n\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\r\n\tlet map = document.createElement('div');\r\n\tmap.className = 'mapContainer';\r\n\tmap.id = 'mapContainer';\r\n\tmap.style.display = \"none\";\r\n\tmap.style.zIndex = \"1\";\r\n\tscheduler._obj.appendChild(map);\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tlet events = scheduler.get_visible_events();\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tmapAdapter.clearEventMarkers();\r\n\t\t\t\tevents.forEach((event) => mapAdapter?.addEventMarker(event));\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\t\tlet mapContainer = document.getElementById('mapContainer');\r\n\t\t_setMapSize('mapContainer');\r\n\r\n\t\t// creating the new logic\r\n\t\tif (mode && mapContainer) {\r\n\t\t\tmap.style.display = 'block';\r\n\t\t\tfill_map_tab();\r\n\t\t\t// case to display several maps and has the opportunity to switch between them\r\n\t\t\tif (scheduler.config.map_view_provider == scheduler.ext.mapView.currentAdapter) {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t} else {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t \tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t\t}\r\n\t\t\tif(mapAdapter) {\r\n\t\t\t\tsetUserLocation(scheduler.config.map_settings, mapAdapter);\r\n\t\t\t}\t\r\n\t\t} else {\r\n\t\t\tmap.style.display = 'none';\r\n\t\t\tscheduler._els.dhx_cal_data[0].style.width = \"100%\";\r\n\t\t \tif (mapAdapter && mapContainer ) {\r\n\t\t\t\tmapAdapter.destroy(mapContainer);\r\n\t\t\t\tmapAdapter = null;\r\n\t\t\t\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t }\r\n\t\t \tdetachSchedulerEvents();\r\n\t\t}\r\n\t};\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tlet map = document.getElementById(elem_id);\r\n\t\tif (map) {\r\n\t\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\t\tlet height = scheduler.$container.querySelector(\".dhx_cal_data\").offsetHeight + scheduler.$container.querySelector(\".dhx_cal_header\").offsetHeight;\r\n\t\t\tif (height < 0)\r\n\t\t\t\theight = 0;\r\n\t\t\tlet width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\t\tif (width < 0)\r\n\t\t\t\twidth = 0;\r\n\t\t\tmap.style.height = height + 'px';\r\n\t\t\tmap.style.width = width + 'px';\r\n\t\t\tmap.style.position = \"absolute\";\r\n\t\t\tmap.style.top = nav_height + \"px\";\r\n\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t} else {\r\n\t\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t}\r\n\t\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t\t}\r\n\t}\t\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tlet events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tlet ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tlet html = \"
\";\r\n\t\tfor (let i = 0; i < events.length; i++) {\r\n\t\t\tlet ev = events[i];\r\n\t\t\tlet event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tlet bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tlet color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tlet ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tlet ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
\r\n\t\t\t\r\n\t\t\t
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tlet dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (let i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tconst l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\t\r\n\tscheduler.attachEvent(\"onLocationError\", function (id){\r\n\t\talert(\"Location can't be found\");\r\n\t\treturn google.maps.LatLng(51.477840, -0.001492); \r\n\t\t//the coordinates of the Greenwich Royal Observatory\r\n\t})\r\n\tlet _updateEventLocation = async function(event) {\r\n\t\tif (mapAdapter){\r\n\t\t\tconst coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\t\t\tif (coordinates.lat && coordinates.lng) {\r\n\t\t\t\tevent.lat = +coordinates.lat;\r\n\t\t\t\tevent.lng = +coordinates.lng;\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\tevent.lng = scheduler.config.map_settings.error_position.lng;\r\n\t\t\t\tevent.lat = scheduler.config.map_settings.error_position.lat;\r\n\t\t\t}\r\n\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t}\r\n\t};\r\n\tlet _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tevent.lat = +event.lat;\r\n\t\t\tevent.lng = +event.lng;\r\n\t\t}\r\n\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n})\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \"  –  \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"\";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i\"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \"\" + clean_html(xh[1].innerHTML) + \"\";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \"\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \"\";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n\";\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"\" + clean_html(evs[i].innerHTML) + \"\";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \"
\";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \"\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\n\r\n\r\nlet clickedElementPosition = null;\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tconst container = scheduler.$container;\r\n\tif(container._$quickInfoHandler){\r\n\t\treturn;\r\n\t}else{\r\n\t\tcontainer._$quickInfoHandler = true;\r\n\t\t// store coordinates of clicked segment of an event\r\n\t\t// in case multi section events or multi-line month events\r\n\t\tscheduler.event(container, \"mousedown\", function(e){\r\n\t\t\tconst eventElement = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\t\t\tif (eventElement) {\r\n\t\t\t\tclickedElementPosition = {\r\n\t\t\t\t\tid: eventElement.getAttribute(scheduler.config.event_attribute),\r\n\t\t\t\t\tposition: getPositionInsideScheduler(eventElement)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.attachEvent(\"onDestroy\", () => {\r\n\t\t\tdelete container._$quickInfoHandler;\r\n\t\t});\r\n\t}\r\n});\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n\r\n\tqi.ontransitionend = () => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t\tqi.ontransitionend = null;\r\n\t};\r\n\tsetTimeout(() => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t}, 1);\r\n};\r\n\r\nfunction fitQIInsideWindow(quickInfoPopup){\r\n\tconst popupRect = quickInfoPopup.getBoundingClientRect();\r\n\tconst containerRect = scheduler.$container.getBoundingClientRect();\r\n\r\n\t// calculate the bottom offset of the Quick Info relative to the scheduler container\r\n\tconst offsetBottom = containerRect.bottom - popupRect.bottom;\r\n\r\n\t// If the popup extends outside the scheduler container, adjust its top position\r\n\tif (offsetBottom < 0) {\r\n\t\tquickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`;\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"
\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\n\r\nfunction getPositionInsideScheduler(element){\r\n\tlet left = 0;\r\n\tlet top = 0;\r\n\r\n\tlet node = element;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tlet dx = (left + element.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tlet dy = (top + element.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:element.offsetWidth, height:element.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\treturn getPositionInsideScheduler(domEv);\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content}`;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","// =============================================================================\n// Weekday\n// =============================================================================\nexport var ALL_WEEKDAYS = [\n 'MO',\n 'TU',\n 'WE',\n 'TH',\n 'FR',\n 'SA',\n 'SU',\n];\nvar Weekday = /** @class */ (function () {\n function Weekday(weekday, n) {\n if (n === 0)\n throw new Error(\"Can't create weekday with n == 0\");\n this.weekday = weekday;\n this.n = n;\n }\n Weekday.fromStr = function (str) {\n return new Weekday(ALL_WEEKDAYS.indexOf(str));\n };\n // __call__ - Cannot call the object directly, do it through\n // e.g. RRule.TH.nth(-1) instead,\n Weekday.prototype.nth = function (n) {\n return this.n === n ? this : new Weekday(this.weekday, n);\n };\n // __eq__\n Weekday.prototype.equals = function (other) {\n return this.weekday === other.weekday && this.n === other.n;\n };\n // __repr__\n Weekday.prototype.toString = function () {\n var s = ALL_WEEKDAYS[this.weekday];\n if (this.n)\n s = (this.n > 0 ? '+' : '') + String(this.n) + s;\n return s;\n };\n Weekday.prototype.getJsWeekday = function () {\n return this.weekday === 6 ? 0 : this.weekday + 1;\n };\n return Weekday;\n}());\nexport { Weekday };\n//# sourceMappingURL=weekday.js.map","// =============================================================================\n// Helper functions\n// =============================================================================\nimport { ALL_WEEKDAYS } from './weekday';\nexport var isPresent = function (value) {\n return value !== null && value !== undefined;\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isWeekdayStr = function (value) {\n return typeof value === 'string' && ALL_WEEKDAYS.includes(value);\n};\nexport var isArray = Array.isArray;\n/**\n * Simplified version of python's range()\n */\nexport var range = function (start, end) {\n if (end === void 0) { end = start; }\n if (arguments.length === 1) {\n end = start;\n start = 0;\n }\n var rang = [];\n for (var i = start; i < end; i++)\n rang.push(i);\n return rang;\n};\nexport var clone = function (array) {\n return [].concat(array);\n};\nexport var repeat = function (value, times) {\n var i = 0;\n var array = [];\n if (isArray(value)) {\n for (; i < times; i++)\n array[i] = [].concat(value);\n }\n else {\n for (; i < times; i++)\n array[i] = value;\n }\n return array;\n};\nexport var toArray = function (item) {\n if (isArray(item)) {\n return item;\n }\n return [item];\n};\nexport function padStart(item, targetLength, padString) {\n if (padString === void 0) { padString = ' '; }\n var str = String(item);\n targetLength = targetLength >> 0;\n if (str.length > targetLength) {\n return String(str);\n }\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += repeat(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(str);\n}\n/**\n * Python like split\n */\nexport var split = function (str, sep, num) {\n var splits = str.split(sep);\n return num\n ? splits.slice(0, num).concat([splits.slice(num).join(sep)])\n : splits;\n};\n/**\n * closure/goog/math/math.js:modulo\n * Copyright 2006 The Closure Library Authors.\n * The % operator in JavaScript returns the remainder of a / b, but differs from\n * some other languages in that the result will have the same sign as the\n * dividend. For example, -1 % 8 == -1, whereas in some other languages\n * (such as Python) the result would be 7. This function emulates the more\n * correct modulo behavior, which is useful for certain applications such as\n * calculating an offset index in a circular list.\n *\n * @param {number} a The dividend.\n * @param {number} b The divisor.\n * @return {number} a % b where the result is between 0 and b (either 0 <= x < b\n * or b < x <= 0, depending on the sign of b).\n */\nexport var pymod = function (a, b) {\n var r = a % b;\n // If r and b differ in sign, add b to wrap the result to the correct sign.\n return r * b < 0 ? r + b : r;\n};\n/**\n * @see: \n */\nexport var divmod = function (a, b) {\n return { div: Math.floor(a / b), mod: pymod(a, b) };\n};\nexport var empty = function (obj) {\n return !isPresent(obj) || obj.length === 0;\n};\n/**\n * Python-like boolean\n *\n * @return {Boolean} value of an object/primitive, taking into account\n * the fact that in Python an empty list's/tuple's\n * boolean value is False, whereas in JS it's true\n */\nexport var notEmpty = function (obj) {\n return !empty(obj);\n};\n/**\n * Return true if a value is in an array\n */\nexport var includes = function (arr, val) {\n return notEmpty(arr) && arr.indexOf(val) !== -1;\n};\n//# sourceMappingURL=helpers.js.map","import { padStart } from './helpers';\nexport var datetime = function (y, m, d, h, i, s) {\n if (h === void 0) { h = 0; }\n if (i === void 0) { i = 0; }\n if (s === void 0) { s = 0; }\n return new Date(Date.UTC(y, m - 1, d, h, i, s));\n};\n/**\n * General date-related utilities.\n * Also handles several incompatibilities between JavaScript and Python\n *\n */\nexport var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/**\n * Number of milliseconds of one day\n */\nexport var ONE_DAY = 1000 * 60 * 60 * 24;\n/**\n * @see: \n */\nexport var MAXYEAR = 9999;\n/**\n * Python uses 1-Jan-1 as the base for calculating ordinals but we don't\n * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,\n * therefore we use 1-Jan-1970 instead\n */\nexport var ORDINAL_BASE = datetime(1970, 1, 1);\n/**\n * Python: MO-SU: 0 - 6\n * JS: SU-SAT 0 - 6\n */\nexport var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];\n/**\n * py_date.timetuple()[7]\n */\nexport var getYearDay = function (date) {\n var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /\n ONE_DAY) + 1);\n};\nexport var isLeapYear = function (year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n};\nexport var isDate = function (value) {\n return value instanceof Date;\n};\nexport var isValidDate = function (value) {\n return isDate(value) && !isNaN(value.getTime());\n};\n/**\n * @return {Number} the date's timezone offset in ms\n */\nexport var tzOffset = function (date) {\n return date.getTimezoneOffset() * 60 * 1000;\n};\n/**\n * @see: \n */\nexport var daysBetween = function (date1, date2) {\n // The number of milliseconds in one day\n // Convert both dates to milliseconds\n var date1ms = date1.getTime();\n var date2ms = date2.getTime();\n // Calculate the difference in milliseconds\n var differencems = date1ms - date2ms;\n // Convert back to days and return\n return Math.round(differencems / ONE_DAY);\n};\n/**\n * @see: \n */\nexport var toOrdinal = function (date) {\n return daysBetween(date, ORDINAL_BASE);\n};\n/**\n * @see - \n */\nexport var fromOrdinal = function (ordinal) {\n return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);\n};\nexport var getMonthDays = function (date) {\n var month = date.getUTCMonth();\n return month === 1 && isLeapYear(date.getUTCFullYear())\n ? 29\n : MONTH_DAYS[month];\n};\n/**\n * @return {Number} python-like weekday\n */\nexport var getWeekday = function (date) {\n return PY_WEEKDAYS[date.getUTCDay()];\n};\n/**\n * @see: \n */\nexport var monthRange = function (year, month) {\n var date = datetime(year, month + 1, 1);\n return [getWeekday(date), getMonthDays(date)];\n};\n/**\n * @see: \n */\nexport var combine = function (date, time) {\n time = time || date;\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));\n};\nexport var clone = function (date) {\n var dolly = new Date(date.getTime());\n return dolly;\n};\nexport var cloneDates = function (dates) {\n var clones = [];\n for (var i = 0; i < dates.length; i++) {\n clones.push(clone(dates[i]));\n }\n return clones;\n};\n/**\n * Sorts an array of Date or Time objects\n */\nexport var sort = function (dates) {\n dates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n};\nexport var timeToUntilString = function (time, utc) {\n if (utc === void 0) { utc = true; }\n var date = new Date(time);\n return [\n padStart(date.getUTCFullYear().toString(), 4, '0'),\n padStart(date.getUTCMonth() + 1, 2, '0'),\n padStart(date.getUTCDate(), 2, '0'),\n 'T',\n padStart(date.getUTCHours(), 2, '0'),\n padStart(date.getUTCMinutes(), 2, '0'),\n padStart(date.getUTCSeconds(), 2, '0'),\n utc ? 'Z' : '',\n ].join('');\n};\nexport var untilStringToDate = function (until) {\n var re = /^(\\d{4})(\\d{2})(\\d{2})(T(\\d{2})(\\d{2})(\\d{2})Z?)?$/;\n var bits = re.exec(until);\n if (!bits)\n throw new Error(\"Invalid UNTIL value: \".concat(until));\n return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));\n};\nvar dateTZtoISO8601 = function (date, timeZone) {\n // date format for sv-SE is almost ISO8601\n var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });\n // '2023-02-07 10:41:36'\n return dateStr.replace(' ', 'T') + 'Z';\n};\nexport var dateInTimeZone = function (date, timeZone) {\n var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // Date constructor can only reliably parse dates in ISO8601 format\n var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));\n var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));\n var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();\n return new Date(date.getTime() - tzOffset);\n};\n//# sourceMappingURL=dateutil.js.map","/**\n * This class helps us to emulate python's generators, sorta.\n */\nvar IterResult = /** @class */ (function () {\n function IterResult(method, args) {\n this.minDate = null;\n this.maxDate = null;\n this._result = [];\n this.total = 0;\n this.method = method;\n this.args = args;\n if (method === 'between') {\n this.maxDate = args.inc\n ? args.before\n : new Date(args.before.getTime() - 1);\n this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1);\n }\n else if (method === 'before') {\n this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1);\n }\n else if (method === 'after') {\n this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1);\n }\n }\n /**\n * Possibly adds a date into the result.\n *\n * @param {Date} date - the date isn't necessarly added to the result\n * list (if it is too late/too early)\n * @return {Boolean} true if it makes sense to continue the iteration\n * false if we're done.\n */\n IterResult.prototype.accept = function (date) {\n ++this.total;\n var tooEarly = this.minDate && date < this.minDate;\n var tooLate = this.maxDate && date > this.maxDate;\n if (this.method === 'between') {\n if (tooEarly)\n return true;\n if (tooLate)\n return false;\n }\n else if (this.method === 'before') {\n if (tooLate)\n return false;\n }\n else if (this.method === 'after') {\n if (tooEarly)\n return true;\n this.add(date);\n return false;\n }\n return this.add(date);\n };\n /**\n *\n * @param {Date} date that is part of the result.\n * @return {Boolean} whether we are interested in more values.\n */\n IterResult.prototype.add = function (date) {\n this._result.push(date);\n return true;\n };\n /**\n * 'before' and 'after' return only one date, whereas 'all'\n * and 'between' an array.\n *\n * @return {Date,Array?}\n */\n IterResult.prototype.getValue = function () {\n var res = this._result;\n switch (this.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n case 'after':\n default:\n return (res.length ? res[res.length - 1] : null);\n }\n };\n IterResult.prototype.clone = function () {\n return new IterResult(this.method, this.args);\n };\n return IterResult;\n}());\nexport default IterResult;\n//# sourceMappingURL=iterresult.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nimport IterResult from './iterresult';\n/**\n * IterResult subclass that calls a callback function on each add,\n * and stops iterating when the callback returns false.\n */\nvar CallbackIterResult = /** @class */ (function (_super) {\n __extends(CallbackIterResult, _super);\n function CallbackIterResult(method, args, iterator) {\n var _this = _super.call(this, method, args) || this;\n _this.iterator = iterator;\n return _this;\n }\n CallbackIterResult.prototype.add = function (date) {\n if (this.iterator(date, this._result.length)) {\n this._result.push(date);\n return true;\n }\n return false;\n };\n return CallbackIterResult;\n}(IterResult));\nexport default CallbackIterResult;\n//# sourceMappingURL=callbackiterresult.js.map","// =============================================================================\n// i18n\n// =============================================================================\nvar ENGLISH = {\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ],\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n tokens: {\n SKIP: /^[ \\r\\n\\t]+|^\\.$/,\n number: /^[1-9][0-9]*/,\n numberAsText: /^(one|two|three)/i,\n every: /^every/i,\n 'day(s)': /^days?/i,\n 'weekday(s)': /^weekdays?/i,\n 'week(s)': /^weeks?/i,\n 'hour(s)': /^hours?/i,\n 'minute(s)': /^minutes?/i,\n 'month(s)': /^months?/i,\n 'year(s)': /^years?/i,\n on: /^(on|in)/i,\n at: /^(at)/i,\n the: /^the/i,\n first: /^first/i,\n second: /^second/i,\n third: /^third/i,\n nth: /^([1-9][0-9]*)(\\.|th|nd|rd|st)/i,\n last: /^last/i,\n for: /^for/i,\n 'time(s)': /^times?/i,\n until: /^(un)?til/i,\n monday: /^mo(n(day)?)?/i,\n tuesday: /^tu(e(s(day)?)?)?/i,\n wednesday: /^we(d(n(esday)?)?)?/i,\n thursday: /^th(u(r(sday)?)?)?/i,\n friday: /^fr(i(day)?)?/i,\n saturday: /^sa(t(urday)?)?/i,\n sunday: /^su(n(day)?)?/i,\n january: /^jan(uary)?/i,\n february: /^feb(ruary)?/i,\n march: /^mar(ch)?/i,\n april: /^apr(il)?/i,\n may: /^may/i,\n june: /^june?/i,\n july: /^july?/i,\n august: /^aug(ust)?/i,\n september: /^sep(t(ember)?)?/i,\n october: /^oct(ober)?/i,\n november: /^nov(ember)?/i,\n december: /^dec(ember)?/i,\n comma: /^(,\\s*|(and|or)\\s*)+/i,\n },\n};\nexport default ENGLISH;\n//# sourceMappingURL=i18n.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\nimport { isArray, isNumber, isPresent } from '../helpers';\n// =============================================================================\n// Helper functions\n// =============================================================================\n/**\n * Return true if a value is in an array\n */\nvar contains = function (arr, val) {\n return arr.indexOf(val) !== -1;\n};\nvar defaultGetText = function (id) { return id.toString(); };\nvar defaultDateFormatter = function (year, month, day) { return \"\".concat(month, \" \").concat(day, \", \").concat(year); };\n/**\n *\n * @param {RRule} rrule\n * Optional:\n * @param {Function} gettext function\n * @param {Object} language definition\n * @constructor\n */\nvar ToText = /** @class */ (function () {\n function ToText(rrule, gettext, language, dateFormatter) {\n if (gettext === void 0) { gettext = defaultGetText; }\n if (language === void 0) { language = ENGLISH; }\n if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; }\n this.text = [];\n this.language = language || ENGLISH;\n this.gettext = gettext;\n this.dateFormatter = dateFormatter;\n this.rrule = rrule;\n this.options = rrule.options;\n this.origOptions = rrule.origOptions;\n if (this.origOptions.bymonthday) {\n var bymonthday = [].concat(this.options.bymonthday);\n var bynmonthday = [].concat(this.options.bynmonthday);\n bymonthday.sort(function (a, b) { return a - b; });\n bynmonthday.sort(function (a, b) { return b - a; });\n // 1, 2, 3, .., -5, -4, -3, ..\n this.bymonthday = bymonthday.concat(bynmonthday);\n if (!this.bymonthday.length)\n this.bymonthday = null;\n }\n if (isPresent(this.origOptions.byweekday)) {\n var byweekday = !isArray(this.origOptions.byweekday)\n ? [this.origOptions.byweekday]\n : this.origOptions.byweekday;\n var days = String(byweekday);\n this.byweekday = {\n allWeeks: byweekday.filter(function (weekday) {\n return !weekday.n;\n }),\n someWeeks: byweekday.filter(function (weekday) {\n return Boolean(weekday.n);\n }),\n isWeekdays: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') === -1 &&\n days.indexOf('SU') === -1,\n isEveryDay: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') !== -1 &&\n days.indexOf('SU') !== -1,\n };\n var sortWeekDays = function (a, b) {\n return a.weekday - b.weekday;\n };\n this.byweekday.allWeeks.sort(sortWeekDays);\n this.byweekday.someWeeks.sort(sortWeekDays);\n if (!this.byweekday.allWeeks.length)\n this.byweekday.allWeeks = null;\n if (!this.byweekday.someWeeks.length)\n this.byweekday.someWeeks = null;\n }\n else {\n this.byweekday = null;\n }\n }\n /**\n * Test whether the rrule can be fully converted to text.\n *\n * @param {RRule} rrule\n * @return {Boolean}\n */\n ToText.isFullyConvertible = function (rrule) {\n var canConvert = true;\n if (!(rrule.options.freq in ToText.IMPLEMENTED))\n return false;\n if (rrule.origOptions.until && rrule.origOptions.count)\n return false;\n for (var key in rrule.origOptions) {\n if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))\n return true;\n if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))\n return false;\n }\n return canConvert;\n };\n ToText.prototype.isFullyConvertible = function () {\n return ToText.isFullyConvertible(this.rrule);\n };\n /**\n * Perform the conversion. Only some of the frequencies are supported.\n * If some of the rrule's options aren't supported, they'll\n * be omitted from the output an \"(~ approximate)\" will be appended.\n *\n * @return {*}\n */\n ToText.prototype.toString = function () {\n var gettext = this.gettext;\n if (!(this.options.freq in ToText.IMPLEMENTED)) {\n return gettext('RRule error: Unable to fully convert this rrule to text');\n }\n this.text = [gettext('every')];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[RRule.FREQUENCIES[this.options.freq]]();\n if (this.options.until) {\n this.add(gettext('until'));\n var until = this.options.until;\n this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate()));\n }\n else if (this.options.count) {\n this.add(gettext('for'))\n .add(this.options.count.toString())\n .add(this.plural(this.options.count) ? gettext('times') : gettext('time'));\n }\n if (!this.isFullyConvertible())\n this.add(gettext('(~ approximate)'));\n return this.text.join('');\n };\n ToText.prototype.HOURLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour'));\n };\n ToText.prototype.MINUTELY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval)\n ? gettext('minutes')\n : gettext('minute'));\n };\n ToText.prototype.DAILY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n else if (this.origOptions.byhour) {\n this._byhour();\n }\n };\n ToText.prototype.WEEKLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week'));\n }\n if (this.byweekday && this.byweekday.isWeekdays) {\n if (this.options.interval === 1) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n }\n else if (this.byweekday && this.byweekday.isEveryDay) {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n else {\n if (this.options.interval === 1)\n this.add(gettext('week'));\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.origOptions.byhour) {\n this._byhour();\n }\n }\n };\n ToText.prototype.MONTHLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(gettext('months'));\n if (this.plural(this.options.interval))\n this.add(gettext('in'));\n }\n else {\n // this.add(gettext('MONTH'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval)\n ? gettext('months')\n : gettext('month'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n };\n ToText.prototype.YEARLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n this.add(gettext('years'));\n }\n else {\n // this.add(gettext('YEAR'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.options.byyearday) {\n this.add(gettext('on the'))\n .add(this.list(this.options.byyearday, this.nth, gettext('and')))\n .add(gettext('day'));\n }\n if (this.options.byweekno) {\n this.add(gettext('in'))\n .add(this.plural(this.options.byweekno.length)\n ? gettext('weeks')\n : gettext('week'))\n .add(this.list(this.options.byweekno, undefined, gettext('and')));\n }\n };\n ToText.prototype._bymonthday = function () {\n var gettext = this.gettext;\n if (this.byweekday && this.byweekday.allWeeks) {\n this.add(gettext('on'))\n .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')))\n .add(gettext('the'))\n .add(this.list(this.bymonthday, this.nth, gettext('or')));\n }\n else {\n this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and')));\n }\n // this.add(gettext('DAY'))\n };\n ToText.prototype._byweekday = function () {\n var gettext = this.gettext;\n if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext));\n }\n if (this.byweekday.someWeeks) {\n if (this.byweekday.allWeeks)\n this.add(gettext('and'));\n this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and')));\n }\n };\n ToText.prototype._byhour = function () {\n var gettext = this.gettext;\n this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and')));\n };\n ToText.prototype._bymonth = function () {\n this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and')));\n };\n ToText.prototype.nth = function (n) {\n n = parseInt(n.toString(), 10);\n var nth;\n var gettext = this.gettext;\n if (n === -1)\n return gettext('last');\n var npos = Math.abs(n);\n switch (npos) {\n case 1:\n case 21:\n case 31:\n nth = npos + gettext('st');\n break;\n case 2:\n case 22:\n nth = npos + gettext('nd');\n break;\n case 3:\n case 23:\n nth = npos + gettext('rd');\n break;\n default:\n nth = npos + gettext('th');\n }\n return n < 0 ? nth + ' ' + gettext('last') : nth;\n };\n ToText.prototype.monthtext = function (m) {\n return this.language.monthNames[m - 1];\n };\n ToText.prototype.weekdaytext = function (wday) {\n var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday();\n return ((wday.n ? this.nth(wday.n) + ' ' : '') +\n this.language.dayNames[weekday]);\n };\n ToText.prototype.plural = function (n) {\n return n % 100 !== 1;\n };\n ToText.prototype.add = function (s) {\n this.text.push(' ');\n this.text.push(s);\n return this;\n };\n ToText.prototype.list = function (arr, callback, finalDelim, delim) {\n var _this = this;\n if (delim === void 0) { delim = ','; }\n if (!isArray(arr)) {\n arr = [arr];\n }\n var delimJoin = function (array, delimiter, finalDelimiter) {\n var list = '';\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n if (i === array.length - 1) {\n list += ' ' + finalDelimiter + ' ';\n }\n else {\n list += delimiter + ' ';\n }\n }\n list += array[i];\n }\n return list;\n };\n callback =\n callback ||\n function (o) {\n return o.toString();\n };\n var realCallback = function (arg) {\n return callback && callback.call(_this, arg);\n };\n if (finalDelim) {\n return delimJoin(arr.map(realCallback), delim, finalDelim);\n }\n else {\n return arr.map(realCallback).join(delim + ' ');\n }\n };\n return ToText;\n}());\nexport default ToText;\n//# sourceMappingURL=totext.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\n// =============================================================================\n// Parser\n// =============================================================================\nvar Parser = /** @class */ (function () {\n function Parser(rules) {\n this.done = true;\n this.rules = rules;\n }\n Parser.prototype.start = function (text) {\n this.text = text;\n this.done = false;\n return this.nextSymbol();\n };\n Parser.prototype.isDone = function () {\n return this.done && this.symbol === null;\n };\n Parser.prototype.nextSymbol = function () {\n var best;\n var bestSymbol;\n this.symbol = null;\n this.value = null;\n do {\n if (this.done)\n return false;\n var rule = void 0;\n best = null;\n for (var name_1 in this.rules) {\n rule = this.rules[name_1];\n var match = rule.exec(this.text);\n if (match) {\n if (best === null || match[0].length > best[0].length) {\n best = match;\n bestSymbol = name_1;\n }\n }\n }\n if (best != null) {\n this.text = this.text.substr(best[0].length);\n if (this.text === '')\n this.done = true;\n }\n if (best == null) {\n this.done = true;\n this.symbol = null;\n this.value = null;\n return;\n }\n } while (bestSymbol === 'SKIP');\n this.symbol = bestSymbol;\n this.value = best;\n return true;\n };\n Parser.prototype.accept = function (name) {\n if (this.symbol === name) {\n if (this.value) {\n var v = this.value;\n this.nextSymbol();\n return v;\n }\n this.nextSymbol();\n return true;\n }\n return false;\n };\n Parser.prototype.acceptNumber = function () {\n return this.accept('number');\n };\n Parser.prototype.expect = function (name) {\n if (this.accept(name))\n return true;\n throw new Error('expected ' + name + ' but found ' + this.symbol);\n };\n return Parser;\n}());\nexport default function parseText(text, language) {\n if (language === void 0) { language = ENGLISH; }\n var options = {};\n var ttr = new Parser(language.tokens);\n if (!ttr.start(text))\n return null;\n S();\n return options;\n function S() {\n // every [n]\n ttr.expect('every');\n var n = ttr.acceptNumber();\n if (n)\n options.interval = parseInt(n[0], 10);\n if (ttr.isDone())\n throw new Error('Unexpected end');\n switch (ttr.symbol) {\n case 'day(s)':\n options.freq = RRule.DAILY;\n if (ttr.nextSymbol()) {\n AT();\n F();\n }\n break;\n // FIXME Note: every 2 weekdays != every two weeks on weekdays.\n // DAILY on weekdays is not a valid rule\n case 'weekday(s)':\n options.freq = RRule.WEEKLY;\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n ttr.nextSymbol();\n AT();\n F();\n break;\n case 'week(s)':\n options.freq = RRule.WEEKLY;\n if (ttr.nextSymbol()) {\n ON();\n AT();\n F();\n }\n break;\n case 'hour(s)':\n options.freq = RRule.HOURLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'minute(s)':\n options.freq = RRule.MINUTELY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'month(s)':\n options.freq = RRule.MONTHLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'year(s)':\n options.freq = RRule.YEARLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n options.freq = RRule.WEEKLY;\n var key = ttr.symbol\n .substr(0, 2)\n .toUpperCase();\n options.byweekday = [RRule[key]];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var wkd = decodeWKD();\n if (!wkd) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday');\n }\n options.byweekday.push(RRule[wkd]);\n ttr.nextSymbol();\n }\n AT();\n MDAYs();\n F();\n break;\n case 'january':\n case 'february':\n case 'march':\n case 'april':\n case 'may':\n case 'june':\n case 'july':\n case 'august':\n case 'september':\n case 'october':\n case 'november':\n case 'december':\n options.freq = RRule.YEARLY;\n options.bymonth = [decodeM()];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var m = decodeM();\n if (!m) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month');\n }\n options.bymonth.push(m);\n ttr.nextSymbol();\n }\n ON();\n F();\n break;\n default:\n throw new Error('Unknown symbol');\n }\n }\n function ON() {\n var on = ttr.accept('on');\n var the = ttr.accept('the');\n if (!(on || the))\n return;\n do {\n var nth = decodeNTH();\n var wkd = decodeWKD();\n var m = decodeM();\n // nth | \n if (nth) {\n // ttr.nextSymbol()\n if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd].nth(nth));\n }\n else {\n if (!options.bymonthday)\n options.bymonthday = [];\n options.bymonthday.push(nth);\n ttr.accept('day(s)');\n }\n // \n }\n else if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd]);\n }\n else if (ttr.symbol === 'weekday(s)') {\n ttr.nextSymbol();\n if (!options.byweekday) {\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n }\n }\n else if (ttr.symbol === 'week(s)') {\n ttr.nextSymbol();\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number');\n }\n options.byweekno = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.byweekno.push(parseInt(n[0], 10));\n }\n }\n else if (m) {\n ttr.nextSymbol();\n if (!options.bymonth)\n options.bymonth = [];\n options.bymonth.push(m);\n }\n else {\n return;\n }\n } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on'));\n }\n function AT() {\n var at = ttr.accept('at');\n if (!at)\n return;\n do {\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour');\n }\n options.byhour = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour');\n }\n options.byhour.push(parseInt(n[0], 10));\n }\n } while (ttr.accept('comma') || ttr.accept('at'));\n }\n function decodeM() {\n switch (ttr.symbol) {\n case 'january':\n return 1;\n case 'february':\n return 2;\n case 'march':\n return 3;\n case 'april':\n return 4;\n case 'may':\n return 5;\n case 'june':\n return 6;\n case 'july':\n return 7;\n case 'august':\n return 8;\n case 'september':\n return 9;\n case 'october':\n return 10;\n case 'november':\n return 11;\n case 'december':\n return 12;\n default:\n return false;\n }\n }\n function decodeWKD() {\n switch (ttr.symbol) {\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n return ttr.symbol.substr(0, 2).toUpperCase();\n default:\n return false;\n }\n }\n function decodeNTH() {\n switch (ttr.symbol) {\n case 'last':\n ttr.nextSymbol();\n return -1;\n case 'first':\n ttr.nextSymbol();\n return 1;\n case 'second':\n ttr.nextSymbol();\n return ttr.accept('last') ? -2 : 2;\n case 'third':\n ttr.nextSymbol();\n return ttr.accept('last') ? -3 : 3;\n case 'nth':\n var v = parseInt(ttr.value[1], 10);\n if (v < -366 || v > 366)\n throw new Error('Nth out of range: ' + v);\n ttr.nextSymbol();\n return ttr.accept('last') ? -v : v;\n default:\n return false;\n }\n }\n function MDAYs() {\n ttr.accept('on');\n ttr.accept('the');\n var nth = decodeNTH();\n if (!nth)\n return;\n options.bymonthday = [nth];\n ttr.nextSymbol();\n while (ttr.accept('comma')) {\n nth = decodeNTH();\n if (!nth) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.bymonthday.push(nth);\n ttr.nextSymbol();\n }\n }\n function F() {\n if (ttr.symbol === 'until') {\n var date = Date.parse(ttr.text);\n if (!date)\n throw new Error('Cannot parse until date:' + ttr.text);\n options.until = new Date(date);\n }\n else if (ttr.accept('for')) {\n options.count = parseInt(ttr.value[0], 10);\n ttr.expect('number');\n // ttr.expect('times')\n }\n }\n}\n//# sourceMappingURL=parsetext.js.map","export var Frequency;\n(function (Frequency) {\n Frequency[Frequency[\"YEARLY\"] = 0] = \"YEARLY\";\n Frequency[Frequency[\"MONTHLY\"] = 1] = \"MONTHLY\";\n Frequency[Frequency[\"WEEKLY\"] = 2] = \"WEEKLY\";\n Frequency[Frequency[\"DAILY\"] = 3] = \"DAILY\";\n Frequency[Frequency[\"HOURLY\"] = 4] = \"HOURLY\";\n Frequency[Frequency[\"MINUTELY\"] = 5] = \"MINUTELY\";\n Frequency[Frequency[\"SECONDLY\"] = 6] = \"SECONDLY\";\n})(Frequency || (Frequency = {}));\nexport function freqIsDailyOrGreater(freq) {\n return freq < Frequency.HOURLY;\n}\n//# sourceMappingURL=types.js.map","import ToText from './totext';\nimport parseText from './parsetext';\nimport { RRule } from '../rrule';\nimport { Frequency } from '../types';\nimport ENGLISH from './i18n';\n/* !\n * rrule.js - Library for working with recurrence rules for calendar dates.\n * https://github.com/jakubroztocil/rrule\n *\n * Copyright 2010, Jakub Roztocil and Lars Schoning\n * Licenced under the BSD licence.\n * https://github.com/jakubroztocil/rrule/blob/master/LICENCE\n *\n */\n/**\n *\n * Implementation of RRule.fromText() and RRule::toText().\n *\n *\n * On the client side, this file needs to be included\n * when those functions are used.\n *\n */\n// =============================================================================\n// fromText\n// =============================================================================\n/**\n * Will be able to convert some of the below described rules from\n * text format to a rule object.\n *\n *\n * RULES\n *\n * Every ([n])\n * day(s)\n * | [weekday], ..., (and) [weekday]\n * | weekday(s)\n * | week(s)\n * | month(s)\n * | [month], ..., (and) [month]\n * | year(s)\n *\n *\n * Plus 0, 1, or multiple of these:\n *\n * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday]\n *\n * on [weekday], ..., (and) [weekday]\n *\n * on the [monthday], [monthday], ... (and) [monthday] (day of the month)\n *\n * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year)\n *\n *\n * Plus 0 or 1 of these:\n *\n * for [n] time(s)\n *\n * until [date]\n *\n * Plus (.)\n *\n *\n * Definitely no supported for parsing:\n *\n * (for year):\n * in week(s) [n], ..., (and) [n]\n *\n * on the [yearday], ..., (and) [n] day of the year\n * on day [yearday], ..., (and) [n]\n *\n *\n * NON-TERMINALS\n *\n * [n]: 1, 2 ..., one, two, three ..\n * [month]: January, February, March, April, May, ... December\n * [weekday]: Monday, ... Sunday\n * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ...\n * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, ..\n * [date]:\n * - [month] (0-31(,) ([year])),\n * - (the) 0-31.(1-12.([year])),\n * - (the) 0-31/(1-12/([year])),\n * - [weekday]\n *\n * [year]: 0000, 0001, ... 01, 02, ..\n *\n * Definitely not supported for parsing:\n *\n * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, ..\n *\n * @param {String} text\n * @return {Object, Boolean} the rule, or null.\n */\nvar fromText = function (text, language) {\n if (language === void 0) { language = ENGLISH; }\n return new RRule(parseText(text, language) || undefined);\n};\nvar common = [\n 'count',\n 'until',\n 'interval',\n 'byweekday',\n 'bymonthday',\n 'bymonth',\n];\nToText.IMPLEMENTED = [];\nToText.IMPLEMENTED[Frequency.HOURLY] = common;\nToText.IMPLEMENTED[Frequency.MINUTELY] = common;\nToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common);\nToText.IMPLEMENTED[Frequency.WEEKLY] = common;\nToText.IMPLEMENTED[Frequency.MONTHLY] = common;\nToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common);\n// =============================================================================\n// Export\n// =============================================================================\nvar toText = function (rrule, gettext, language, dateFormatter) {\n return new ToText(rrule, gettext, language, dateFormatter).toString();\n};\nvar isFullyConvertible = ToText.isFullyConvertible;\nexport { fromText, parseText, isFullyConvertible, toText };\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { Frequency } from './types';\nimport { pymod, divmod, empty, includes } from './helpers';\nimport { getWeekday, MAXYEAR, monthRange } from './dateutil';\nvar Time = /** @class */ (function () {\n function Time(hour, minute, second, millisecond) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond || 0;\n }\n Time.prototype.getHours = function () {\n return this.hour;\n };\n Time.prototype.getMinutes = function () {\n return this.minute;\n };\n Time.prototype.getSeconds = function () {\n return this.second;\n };\n Time.prototype.getMilliseconds = function () {\n return this.millisecond;\n };\n Time.prototype.getTime = function () {\n return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 +\n this.millisecond);\n };\n return Time;\n}());\nexport { Time };\nvar DateTime = /** @class */ (function (_super) {\n __extends(DateTime, _super);\n function DateTime(year, month, day, hour, minute, second, millisecond) {\n var _this = _super.call(this, hour, minute, second, millisecond) || this;\n _this.year = year;\n _this.month = month;\n _this.day = day;\n return _this;\n }\n DateTime.fromDate = function (date) {\n return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000);\n };\n DateTime.prototype.getWeekday = function () {\n return getWeekday(new Date(this.getTime()));\n };\n DateTime.prototype.getTime = function () {\n return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();\n };\n DateTime.prototype.getDay = function () {\n return this.day;\n };\n DateTime.prototype.getMonth = function () {\n return this.month;\n };\n DateTime.prototype.getYear = function () {\n return this.year;\n };\n DateTime.prototype.addYears = function (years) {\n this.year += years;\n };\n DateTime.prototype.addMonths = function (months) {\n this.month += months;\n if (this.month > 12) {\n var yearDiv = Math.floor(this.month / 12);\n var monthMod = pymod(this.month, 12);\n this.month = monthMod;\n this.year += yearDiv;\n if (this.month === 0) {\n this.month = 12;\n --this.year;\n }\n }\n };\n DateTime.prototype.addWeekly = function (days, wkst) {\n if (wkst > this.getWeekday()) {\n this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7;\n }\n else {\n this.day += -(this.getWeekday() - wkst) + days * 7;\n }\n this.fixDay();\n };\n DateTime.prototype.addDaily = function (days) {\n this.day += days;\n this.fixDay();\n };\n DateTime.prototype.addHours = function (hours, filtered, byhour) {\n if (filtered) {\n // Jump to one iteration before next day\n this.hour += Math.floor((23 - this.hour) / hours) * hours;\n }\n for (;;) {\n this.hour += hours;\n var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod;\n if (dayDiv) {\n this.hour = hourMod;\n this.addDaily(dayDiv);\n }\n if (empty(byhour) || includes(byhour, this.hour))\n break;\n }\n };\n DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) {\n if (filtered) {\n // Jump to one iteration before next day\n this.minute +=\n Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes;\n }\n for (;;) {\n this.minute += minutes;\n var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod;\n if (hourDiv) {\n this.minute = minuteMod;\n this.addHours(hourDiv, false, byhour);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute))) {\n break;\n }\n }\n };\n DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) {\n if (filtered) {\n // Jump to one iteration before next day\n this.second +=\n Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) /\n seconds) * seconds;\n }\n for (;;) {\n this.second += seconds;\n var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod;\n if (minuteDiv) {\n this.second = secondMod;\n this.addMinutes(minuteDiv, false, byhour, byminute);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute)) &&\n (empty(bysecond) || includes(bysecond, this.second))) {\n break;\n }\n }\n };\n DateTime.prototype.fixDay = function () {\n if (this.day <= 28) {\n return;\n }\n var daysinmonth = monthRange(this.year, this.month - 1)[1];\n if (this.day <= daysinmonth) {\n return;\n }\n while (this.day > daysinmonth) {\n this.day -= daysinmonth;\n ++this.month;\n if (this.month === 13) {\n this.month = 1;\n ++this.year;\n if (this.year > MAXYEAR) {\n return;\n }\n }\n daysinmonth = monthRange(this.year, this.month - 1)[1];\n }\n };\n DateTime.prototype.add = function (options, filtered) {\n var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n switch (freq) {\n case Frequency.YEARLY:\n return this.addYears(interval);\n case Frequency.MONTHLY:\n return this.addMonths(interval);\n case Frequency.WEEKLY:\n return this.addWeekly(interval, wkst);\n case Frequency.DAILY:\n return this.addDaily(interval);\n case Frequency.HOURLY:\n return this.addHours(interval, filtered, byhour);\n case Frequency.MINUTELY:\n return this.addMinutes(interval, filtered, byhour, byminute);\n case Frequency.SECONDLY:\n return this.addSeconds(interval, filtered, byhour, byminute, bysecond);\n }\n };\n return DateTime;\n}(Time));\nexport { DateTime };\n//# sourceMappingURL=datetime.js.map","import { __assign } from \"tslib\";\nimport { freqIsDailyOrGreater } from './types';\nimport { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr, } from './helpers';\nimport { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';\nimport { getWeekday, isDate, isValidDate } from './dateutil';\nimport { Weekday } from './weekday';\nimport { Time } from './datetime';\nexport function initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n // Shallow copy for options and origOptions and check for invalid\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!includes(defaultKeys, key))\n invalid.push(key);\n if (isDate(options[key]) && !isValidDate(options[key])) {\n invalid.push(key);\n }\n }\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign({}, options);\n}\nexport function parseOptions(options) {\n var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options));\n if (isPresent(opts.byeaster))\n opts.freq = RRule.YEARLY;\n if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) {\n throw new Error(\"Invalid frequency: \".concat(opts.freq, \" \").concat(options.freq));\n }\n if (!opts.dtstart)\n opts.dtstart = new Date(new Date().setMilliseconds(0));\n if (!isPresent(opts.wkst)) {\n opts.wkst = RRule.MO.weekday;\n }\n else if (isNumber(opts.wkst)) {\n // cool, just keep it like that\n }\n else {\n opts.wkst = opts.wkst.weekday;\n }\n if (isPresent(opts.bysetpos)) {\n if (isNumber(opts.bysetpos))\n opts.bysetpos = [opts.bysetpos];\n for (var i = 0; i < opts.bysetpos.length; i++) {\n var v = opts.bysetpos[i];\n if (v === 0 || !(v >= -366 && v <= 366)) {\n throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1');\n }\n }\n }\n if (!(Boolean(opts.byweekno) ||\n notEmpty(opts.byweekno) ||\n notEmpty(opts.byyearday) ||\n Boolean(opts.bymonthday) ||\n notEmpty(opts.bymonthday) ||\n isPresent(opts.byweekday) ||\n isPresent(opts.byeaster))) {\n switch (opts.freq) {\n case RRule.YEARLY:\n if (!opts.bymonth)\n opts.bymonth = opts.dtstart.getUTCMonth() + 1;\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.MONTHLY:\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.WEEKLY:\n opts.byweekday = [getWeekday(opts.dtstart)];\n break;\n }\n }\n // bymonth\n if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) {\n opts.bymonth = [opts.bymonth];\n }\n // byyearday\n if (isPresent(opts.byyearday) &&\n !isArray(opts.byyearday) &&\n isNumber(opts.byyearday)) {\n opts.byyearday = [opts.byyearday];\n }\n // bymonthday\n if (!isPresent(opts.bymonthday)) {\n opts.bymonthday = [];\n opts.bynmonthday = [];\n }\n else if (isArray(opts.bymonthday)) {\n var bymonthday = [];\n var bynmonthday = [];\n for (var i = 0; i < opts.bymonthday.length; i++) {\n var v = opts.bymonthday[i];\n if (v > 0) {\n bymonthday.push(v);\n }\n else if (v < 0) {\n bynmonthday.push(v);\n }\n }\n opts.bymonthday = bymonthday;\n opts.bynmonthday = bynmonthday;\n }\n else if (opts.bymonthday < 0) {\n opts.bynmonthday = [opts.bymonthday];\n opts.bymonthday = [];\n }\n else {\n opts.bynmonthday = [];\n opts.bymonthday = [opts.bymonthday];\n }\n // byweekno\n if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) {\n opts.byweekno = [opts.byweekno];\n }\n // byweekday / bynweekday\n if (!isPresent(opts.byweekday)) {\n opts.bynweekday = null;\n }\n else if (isNumber(opts.byweekday)) {\n opts.byweekday = [opts.byweekday];\n opts.bynweekday = null;\n }\n else if (isWeekdayStr(opts.byweekday)) {\n opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday];\n opts.bynweekday = null;\n }\n else if (opts.byweekday instanceof Weekday) {\n if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) {\n opts.byweekday = [opts.byweekday.weekday];\n opts.bynweekday = null;\n }\n else {\n opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]];\n opts.byweekday = null;\n }\n }\n else {\n var byweekday = [];\n var bynweekday = [];\n for (var i = 0; i < opts.byweekday.length; i++) {\n var wday = opts.byweekday[i];\n if (isNumber(wday)) {\n byweekday.push(wday);\n continue;\n }\n else if (isWeekdayStr(wday)) {\n byweekday.push(Weekday.fromStr(wday).weekday);\n continue;\n }\n if (!wday.n || opts.freq > RRule.MONTHLY) {\n byweekday.push(wday.weekday);\n }\n else {\n bynweekday.push([wday.weekday, wday.n]);\n }\n }\n opts.byweekday = notEmpty(byweekday) ? byweekday : null;\n opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null;\n }\n // byhour\n if (!isPresent(opts.byhour)) {\n opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null;\n }\n else if (isNumber(opts.byhour)) {\n opts.byhour = [opts.byhour];\n }\n // byminute\n if (!isPresent(opts.byminute)) {\n opts.byminute =\n opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null;\n }\n else if (isNumber(opts.byminute)) {\n opts.byminute = [opts.byminute];\n }\n // bysecond\n if (!isPresent(opts.bysecond)) {\n opts.bysecond =\n opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null;\n }\n else if (isNumber(opts.bysecond)) {\n opts.bysecond = [opts.bysecond];\n }\n return { parsedOptions: opts };\n}\nexport function buildTimeset(opts) {\n var millisecondModulo = opts.dtstart.getTime() % 1000;\n if (!freqIsDailyOrGreater(opts.freq)) {\n return [];\n }\n var timeset = [];\n opts.byhour.forEach(function (hour) {\n opts.byminute.forEach(function (minute) {\n opts.bysecond.forEach(function (second) {\n timeset.push(new Time(hour, minute, second, millisecondModulo));\n });\n });\n });\n return timeset;\n}\n//# sourceMappingURL=parseoptions.js.map","import { __assign } from \"tslib\";\nimport { Frequency } from './types';\nimport { Weekday } from './weekday';\nimport { untilStringToDate } from './dateutil';\nimport { Days } from './rrule';\nexport function parseString(rfcString) {\n var options = rfcString\n .split('\\n')\n .map(parseLine)\n .filter(function (x) { return x !== null; });\n return __assign(__assign({}, options[0]), options[1]);\n}\nexport function parseDtstart(line) {\n var options = {};\n var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\\s]+)/i.exec(line);\n if (!dtstartWithZone) {\n return options;\n }\n var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2];\n if (tzid) {\n options.tzid = tzid;\n }\n options.dtstart = untilStringToDate(dtstart);\n return options;\n}\nfunction parseLine(rfcString) {\n rfcString = rfcString.replace(/^\\s+|\\s+$/, '');\n if (!rfcString.length)\n return null;\n var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());\n if (!header) {\n return parseRrule(rfcString);\n }\n var key = header[1];\n switch (key.toUpperCase()) {\n case 'RRULE':\n case 'EXRULE':\n return parseRrule(rfcString);\n case 'DTSTART':\n return parseDtstart(rfcString);\n default:\n throw new Error(\"Unsupported RFC prop \".concat(key, \" in \").concat(rfcString));\n }\n}\nfunction parseRrule(line) {\n var strippedLine = line.replace(/^RRULE:/i, '');\n var options = parseDtstart(strippedLine);\n var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';');\n attrs.forEach(function (attr) {\n var _a = attr.split('='), key = _a[0], value = _a[1];\n switch (key.toUpperCase()) {\n case 'FREQ':\n options.freq = Frequency[value.toUpperCase()];\n break;\n case 'WKST':\n options.wkst = Days[value.toUpperCase()];\n break;\n case 'COUNT':\n case 'INTERVAL':\n case 'BYSETPOS':\n case 'BYMONTH':\n case 'BYMONTHDAY':\n case 'BYYEARDAY':\n case 'BYWEEKNO':\n case 'BYHOUR':\n case 'BYMINUTE':\n case 'BYSECOND':\n var num = parseNumber(value);\n var optionKey = key.toLowerCase();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n options[optionKey] = num;\n break;\n case 'BYWEEKDAY':\n case 'BYDAY':\n options.byweekday = parseWeekday(value);\n break;\n case 'DTSTART':\n case 'TZID':\n // for backwards compatibility\n var dtstart = parseDtstart(line);\n options.tzid = dtstart.tzid;\n options.dtstart = dtstart.dtstart;\n break;\n case 'UNTIL':\n options.until = untilStringToDate(value);\n break;\n case 'BYEASTER':\n options.byeaster = Number(value);\n break;\n default:\n throw new Error(\"Unknown RRULE property '\" + key + \"'\");\n }\n });\n return options;\n}\nfunction parseNumber(value) {\n if (value.indexOf(',') !== -1) {\n var values = value.split(',');\n return values.map(parseIndividualNumber);\n }\n return parseIndividualNumber(value);\n}\nfunction parseIndividualNumber(value) {\n if (/^[+-]?\\d+$/.test(value)) {\n return Number(value);\n }\n return value;\n}\nfunction parseWeekday(value) {\n var days = value.split(',');\n return days.map(function (day) {\n if (day.length === 2) {\n // MO, TU, ...\n return Days[day]; // wday instanceof Weekday\n }\n // -1MO, +3FR, 1SO, 13TU ...\n var parts = day.match(/^([+-]?\\d{1,2})([A-Z]{2})$/);\n if (!parts || parts.length < 3) {\n throw new SyntaxError(\"Invalid weekday string: \".concat(day));\n }\n var n = Number(parts[1]);\n var wdaypart = parts[2];\n var wday = Days[wdaypart].weekday;\n return new Weekday(wday, n);\n });\n}\n//# sourceMappingURL=parsestring.js.map","import { dateInTimeZone, timeToUntilString } from './dateutil';\nvar DateWithZone = /** @class */ (function () {\n function DateWithZone(date, tzid) {\n if (isNaN(date.getTime())) {\n throw new RangeError('Invalid date passed to DateWithZone');\n }\n this.date = date;\n this.tzid = tzid;\n }\n Object.defineProperty(DateWithZone.prototype, \"isUTC\", {\n get: function () {\n return !this.tzid || this.tzid.toUpperCase() === 'UTC';\n },\n enumerable: false,\n configurable: true\n });\n DateWithZone.prototype.toString = function () {\n var datestr = timeToUntilString(this.date.getTime(), this.isUTC);\n if (!this.isUTC) {\n return \";TZID=\".concat(this.tzid, \":\").concat(datestr);\n }\n return \":\".concat(datestr);\n };\n DateWithZone.prototype.getTime = function () {\n return this.date.getTime();\n };\n DateWithZone.prototype.rezonedDate = function () {\n if (this.isUTC) {\n return this.date;\n }\n return dateInTimeZone(this.date, this.tzid);\n };\n return DateWithZone;\n}());\nexport { DateWithZone };\n//# sourceMappingURL=datewithzone.js.map","import { RRule, DEFAULT_OPTIONS } from './rrule';\nimport { includes, isPresent, isArray, isNumber, toArray } from './helpers';\nimport { Weekday } from './weekday';\nimport { timeToUntilString } from './dateutil';\nimport { DateWithZone } from './datewithzone';\nexport function optionsToString(options) {\n var rrule = [];\n var dtstart = '';\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === 'tzid')\n continue;\n if (!includes(defaultKeys, keys[i]))\n continue;\n var key = keys[i].toUpperCase();\n var value = options[keys[i]];\n var outValue = '';\n if (!isPresent(value) || (isArray(value) && !value.length))\n continue;\n switch (key) {\n case 'FREQ':\n outValue = RRule.FREQUENCIES[options.freq];\n break;\n case 'WKST':\n if (isNumber(value)) {\n outValue = new Weekday(value).toString();\n }\n else {\n outValue = value.toString();\n }\n break;\n case 'BYWEEKDAY':\n /*\n NOTE: BYWEEKDAY is a special case.\n RRule() deconstructs the rule.options.byweekday array\n into an array of Weekday arguments.\n On the other hand, rule.origOptions is an array of Weekdays.\n We need to handle both cases here.\n It might be worth change RRule to keep the Weekdays.\n \n Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC)\n \n */\n key = 'BYDAY';\n outValue = toArray(value)\n .map(function (wday) {\n if (wday instanceof Weekday) {\n return wday;\n }\n if (isArray(wday)) {\n return new Weekday(wday[0], wday[1]);\n }\n return new Weekday(wday);\n })\n .toString();\n break;\n case 'DTSTART':\n dtstart = buildDtstart(value, options.tzid);\n break;\n case 'UNTIL':\n outValue = timeToUntilString(value, !options.tzid);\n break;\n default:\n if (isArray(value)) {\n var strValues = [];\n for (var j = 0; j < value.length; j++) {\n strValues[j] = String(value[j]);\n }\n outValue = strValues.toString();\n }\n else {\n outValue = String(value);\n }\n }\n if (outValue) {\n rrule.push([key, outValue]);\n }\n }\n var rules = rrule\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value.toString());\n })\n .join(';');\n var ruleString = '';\n if (rules !== '') {\n ruleString = \"RRULE:\".concat(rules);\n }\n return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\\n');\n}\nfunction buildDtstart(dtstart, tzid) {\n if (!dtstart) {\n return '';\n }\n return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString();\n}\n//# sourceMappingURL=optionstostring.js.map","import IterResult from './iterresult';\nimport { clone, cloneDates } from './dateutil';\nimport { isArray } from './helpers';\nfunction argsMatch(left, right) {\n if (Array.isArray(left)) {\n if (!Array.isArray(right))\n return false;\n if (left.length !== right.length)\n return false;\n return left.every(function (date, i) { return date.getTime() === right[i].getTime(); });\n }\n if (left instanceof Date) {\n return right instanceof Date && left.getTime() === right.getTime();\n }\n return left === right;\n}\nvar Cache = /** @class */ (function () {\n function Cache() {\n this.all = false;\n this.before = [];\n this.after = [];\n this.between = [];\n }\n /**\n * @param {String} what - all/before/after/between\n * @param {Array,Date} value - an array of dates, one date, or null\n * @param {Object?} args - _iter arguments\n */\n Cache.prototype._cacheAdd = function (what, value, args) {\n if (value) {\n value = value instanceof Date ? clone(value) : cloneDates(value);\n }\n if (what === 'all') {\n this.all = value;\n }\n else {\n args._value = value;\n this[what].push(args);\n }\n };\n /**\n * @return false - not in the cache\n * @return null - cached, but zero occurrences (before/after)\n * @return Date - cached (before/after)\n * @return [] - cached, but zero occurrences (all/between)\n * @return [Date1, DateN] - cached (all/between)\n */\n Cache.prototype._cacheGet = function (what, args) {\n var cached = false;\n var argsKeys = args ? Object.keys(args) : [];\n var findCacheDiff = function (item) {\n for (var i = 0; i < argsKeys.length; i++) {\n var key = argsKeys[i];\n if (!argsMatch(args[key], item[key])) {\n return true;\n }\n }\n return false;\n };\n var cachedObject = this[what];\n if (what === 'all') {\n cached = this.all;\n }\n else if (isArray(cachedObject)) {\n // Let's see whether we've already called the\n // 'what' method with the same 'args'\n for (var i = 0; i < cachedObject.length; i++) {\n var item = cachedObject[i];\n if (argsKeys.length && findCacheDiff(item))\n continue;\n cached = item._value;\n break;\n }\n }\n if (!cached && this.all) {\n // Not in the cache, but we already know all the occurrences,\n // so we can find the correct dates from the cached ones.\n var iterResult = new IterResult(what, args);\n for (var i = 0; i < this.all.length; i++) {\n if (!iterResult.accept(this.all[i]))\n break;\n }\n cached = iterResult.getValue();\n this._cacheAdd(what, cached, args);\n }\n return isArray(cached)\n ? cloneDates(cached)\n : cached instanceof Date\n ? clone(cached)\n : cached;\n };\n return Cache;\n}());\nexport { Cache };\n//# sourceMappingURL=cache.js.map","import { __spreadArray } from \"tslib\";\nimport { range, repeat } from './helpers';\n// =============================================================================\n// Date masks\n// =============================================================================\n// Every mask is 7 days longer to handle cross-year weekly periods.\nvar M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M28 = range(1, 29);\nvar M29 = range(1, 30);\nvar M30 = range(1, 31);\nvar M31 = range(1, 32);\nvar MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar NM28 = range(-28, 0);\nvar NM29 = range(-29, 0);\nvar NM30 = range(-30, 0);\nvar NM31 = range(-31, 0);\nvar NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];\nvar M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];\nvar WDAYMASK = (function () {\n var wdaymask = [];\n for (var i = 0; i < 55; i++)\n wdaymask = wdaymask.concat(range(7));\n return wdaymask;\n})();\nexport { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK, };\n//# sourceMappingURL=masks.js.map","import { __assign } from \"tslib\";\nimport { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';\nimport { empty, repeat, pymod, includes } from '../helpers';\nimport { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';\nexport function rebuildYear(year, options) {\n var firstyday = datetime(year, 1, 1);\n var yearlen = isLeapYear(year) ? 366 : 365;\n var nextyearlen = isLeapYear(year + 1) ? 366 : 365;\n var yearordinal = toOrdinal(firstyday);\n var yearweekday = getWeekday(firstyday);\n var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });\n if (empty(options.byweekno)) {\n return result;\n }\n result.wnomask = repeat(0, yearlen + 7);\n var firstwkst;\n var wyearlen;\n var no1wkst = (firstwkst = pymod(7 - yearweekday + options.wkst, 7));\n if (no1wkst >= 4) {\n no1wkst = 0;\n // Number of days in the year, plus the days we got\n // from last year.\n wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7);\n }\n else {\n // Number of days in the year, minus the days we\n // left in last year.\n wyearlen = yearlen - no1wkst;\n }\n var div = Math.floor(wyearlen / 7);\n var mod = pymod(wyearlen, 7);\n var numweeks = Math.floor(div + mod / 4);\n for (var j = 0; j < options.byweekno.length; j++) {\n var n = options.byweekno[j];\n if (n < 0) {\n n += numweeks + 1;\n }\n if (!(n > 0 && n <= numweeks)) {\n continue;\n }\n var i = void 0;\n if (n > 1) {\n i = no1wkst + (n - 1) * 7;\n if (no1wkst !== firstwkst) {\n i -= 7 - firstwkst;\n }\n }\n else {\n i = no1wkst;\n }\n for (var k = 0; k < 7; k++) {\n result.wnomask[i] = 1;\n i++;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n if (includes(options.byweekno, 1)) {\n // Check week number 1 of next year as well\n // orig-TODO : Check -numweeks for next year.\n var i = no1wkst + numweeks * 7;\n if (no1wkst !== firstwkst)\n i -= 7 - firstwkst;\n if (i < yearlen) {\n // If week starts in next year, we\n // don't care about it.\n for (var j = 0; j < 7; j++) {\n result.wnomask[i] = 1;\n i += 1;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n }\n if (no1wkst) {\n // Check last week number of last year as\n // well. If no1wkst is 0, either the year\n // started on week start, or week number 1\n // got days from last year, so there are no\n // days from last year's last week number in\n // this year.\n var lnumweeks = void 0;\n if (!includes(options.byweekno, -1)) {\n var lyearweekday = getWeekday(datetime(year - 1, 1, 1));\n var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);\n var lyearlen = isLeapYear(year - 1) ? 366 : 365;\n var weekst = void 0;\n if (lno1wkst >= 4) {\n lno1wkst = 0;\n weekst = lyearlen + pymod(lyearweekday - options.wkst, 7);\n }\n else {\n weekst = yearlen - no1wkst;\n }\n lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4);\n }\n else {\n lnumweeks = -1;\n }\n if (includes(options.byweekno, lnumweeks)) {\n for (var i = 0; i < no1wkst; i++)\n result.wnomask[i] = 1;\n }\n }\n return result;\n}\nfunction baseYearMasks(year) {\n var yearlen = isLeapYear(year) ? 366 : 365;\n var firstyday = datetime(year, 1, 1);\n var wday = getWeekday(firstyday);\n if (yearlen === 365) {\n return {\n mmask: M365MASK,\n mdaymask: MDAY365MASK,\n nmdaymask: NMDAY365MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M365RANGE,\n };\n }\n return {\n mmask: M366MASK,\n mdaymask: MDAY366MASK,\n nmdaymask: NMDAY366MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M366RANGE,\n };\n}\n//# sourceMappingURL=yearinfo.js.map","import { RRule } from '../rrule';\nimport { empty, repeat, pymod } from '../helpers';\nexport function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) {\n var result = {\n lastyear: year,\n lastmonth: month,\n nwdaymask: [],\n };\n var ranges = [];\n if (options.freq === RRule.YEARLY) {\n if (empty(options.bymonth)) {\n ranges = [[0, yearlen]];\n }\n else {\n for (var j = 0; j < options.bymonth.length; j++) {\n month = options.bymonth[j];\n ranges.push(mrange.slice(month - 1, month + 1));\n }\n }\n }\n else if (options.freq === RRule.MONTHLY) {\n ranges = [mrange.slice(month - 1, month + 1)];\n }\n if (empty(ranges)) {\n return result;\n }\n // Weekly frequency won't get here, so we may not\n // care about cross-year weekly periods.\n result.nwdaymask = repeat(0, yearlen);\n for (var j = 0; j < ranges.length; j++) {\n var rang = ranges[j];\n var first = rang[0];\n var last = rang[1] - 1;\n for (var k = 0; k < options.bynweekday.length; k++) {\n var i = void 0;\n var _a = options.bynweekday[k], wday = _a[0], n = _a[1];\n if (n < 0) {\n i = last + (n + 1) * 7;\n i -= pymod(wdaymask[i] - wday, 7);\n }\n else {\n i = first + (n - 1) * 7;\n i += pymod(7 - wdaymask[i] + wday, 7);\n }\n if (first <= i && i <= last)\n result.nwdaymask[i] = 1;\n }\n }\n return result;\n}\n//# sourceMappingURL=monthinfo.js.map","export function easter(y, offset) {\n if (offset === void 0) { offset = 0; }\n var a = y % 19;\n var b = Math.floor(y / 100);\n var c = y % 100;\n var d = Math.floor(b / 4);\n var e = b % 4;\n var f = Math.floor((b + 8) / 25);\n var g = Math.floor((b - f + 1) / 3);\n var h = Math.floor(19 * a + b - d - g + 15) % 30;\n var i = Math.floor(c / 4);\n var k = c % 4;\n var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;\n var m = Math.floor((a + 11 * h + 22 * l) / 451);\n var month = Math.floor((h + l - 7 * m + 114) / 31);\n var day = ((h + l - 7 * m + 114) % 31) + 1;\n var date = Date.UTC(y, month - 1, day + offset);\n var yearStart = Date.UTC(y, 0, 1);\n return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];\n}\n//# sourceMappingURL=easter.js.map","import { notEmpty, repeat, range, isPresent } from '../helpers';\nimport { Frequency } from '../types';\nimport { rebuildYear } from './yearinfo';\nimport { rebuildMonth } from './monthinfo';\nimport { easter } from './easter';\nimport { Time } from '../datetime';\nimport { datetime, sort, toOrdinal } from '../dateutil';\n// =============================================================================\n// Iterinfo\n// =============================================================================\nvar Iterinfo = /** @class */ (function () {\n // eslint-disable-next-line no-empty-function\n function Iterinfo(options) {\n this.options = options;\n }\n Iterinfo.prototype.rebuild = function (year, month) {\n var options = this.options;\n if (year !== this.lastyear) {\n this.yearinfo = rebuildYear(year, options);\n }\n if (notEmpty(options.bynweekday) &&\n (month !== this.lastmonth || year !== this.lastyear)) {\n var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask;\n this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options);\n }\n if (isPresent(options.byeaster)) {\n this.eastermask = easter(year, options.byeaster);\n }\n };\n Object.defineProperty(Iterinfo.prototype, \"lastyear\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastyear : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"lastmonth\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastmonth : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearlen\", {\n get: function () {\n return this.yearinfo.yearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearordinal\", {\n get: function () {\n return this.yearinfo.yearordinal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mrange\", {\n get: function () {\n return this.yearinfo.mrange;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wdaymask\", {\n get: function () {\n return this.yearinfo.wdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mmask\", {\n get: function () {\n return this.yearinfo.mmask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wnomask\", {\n get: function () {\n return this.yearinfo.wnomask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nwdaymask\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.nwdaymask : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nextyearlen\", {\n get: function () {\n return this.yearinfo.nextyearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mdaymask\", {\n get: function () {\n return this.yearinfo.mdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nmdaymask\", {\n get: function () {\n return this.yearinfo.nmdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Iterinfo.prototype.ydayset = function () {\n return [range(this.yearlen), 0, this.yearlen];\n };\n Iterinfo.prototype.mdayset = function (_, month) {\n var start = this.mrange[month - 1];\n var end = this.mrange[month];\n var set = repeat(null, this.yearlen);\n for (var i = start; i < end; i++)\n set[i] = i;\n return [set, start, end];\n };\n Iterinfo.prototype.wdayset = function (year, month, day) {\n // We need to handle cross-year weeks here.\n var set = repeat(null, this.yearlen + 7);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n var start = i;\n for (var j = 0; j < 7; j++) {\n set[i] = i;\n ++i;\n if (this.wdaymask[i] === this.options.wkst)\n break;\n }\n return [set, start, i];\n };\n Iterinfo.prototype.ddayset = function (year, month, day) {\n var set = repeat(null, this.yearlen);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n set[i] = i;\n return [set, i, i + 1];\n };\n Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) {\n var _this = this;\n var set = [];\n this.options.byminute.forEach(function (minute) {\n set = set.concat(_this.mtimeset(hour, minute, second, millisecond));\n });\n sort(set);\n return set;\n };\n Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) {\n var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });\n sort(set);\n return set;\n };\n Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) {\n return [new Time(hour, minute, second, millisecond)];\n };\n Iterinfo.prototype.getdayset = function (freq) {\n switch (freq) {\n case Frequency.YEARLY:\n return this.ydayset.bind(this);\n case Frequency.MONTHLY:\n return this.mdayset.bind(this);\n case Frequency.WEEKLY:\n return this.wdayset.bind(this);\n case Frequency.DAILY:\n return this.ddayset.bind(this);\n default:\n return this.ddayset.bind(this);\n }\n };\n Iterinfo.prototype.gettimeset = function (freq) {\n switch (freq) {\n case Frequency.HOURLY:\n return this.htimeset.bind(this);\n case Frequency.MINUTELY:\n return this.mtimeset.bind(this);\n case Frequency.SECONDLY:\n return this.stimeset.bind(this);\n }\n };\n return Iterinfo;\n}());\nexport default Iterinfo;\n//# sourceMappingURL=index.js.map","import { combine, fromOrdinal, sort } from '../dateutil';\nimport { pymod, isPresent, includes } from '../helpers';\nexport function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {\n var poslist = [];\n for (var j = 0; j < bysetpos.length; j++) {\n var daypos = void 0;\n var timepos = void 0;\n var pos = bysetpos[j];\n if (pos < 0) {\n daypos = Math.floor(pos / timeset.length);\n timepos = pymod(pos, timeset.length);\n }\n else {\n daypos = Math.floor((pos - 1) / timeset.length);\n timepos = pymod(pos - 1, timeset.length);\n }\n var tmp = [];\n for (var k = start; k < end; k++) {\n var val = dayset[k];\n if (!isPresent(val))\n continue;\n tmp.push(val);\n }\n var i = void 0;\n if (daypos < 0) {\n i = tmp.slice(daypos)[0];\n }\n else {\n i = tmp[daypos];\n }\n var time = timeset[timepos];\n var date = fromOrdinal(ii.yearordinal + i);\n var res = combine(date, time);\n // XXX: can this ever be in the array?\n // - compare the actual date instead?\n if (!includes(poslist, res))\n poslist.push(res);\n }\n sort(poslist);\n return poslist;\n}\n//# sourceMappingURL=poslist.js.map","import { freqIsDailyOrGreater } from '../types';\nimport { combine, fromOrdinal, MAXYEAR } from '../dateutil';\nimport Iterinfo from '../iterinfo/index';\nimport { RRule } from '../rrule';\nimport { buildTimeset } from '../parseoptions';\nimport { notEmpty, includes, isPresent } from '../helpers';\nimport { DateWithZone } from '../datewithzone';\nimport { buildPoslist } from './poslist';\nimport { DateTime } from '../datetime';\nexport function iter(iterResult, options) {\n var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;\n var count = options.count;\n if (count === 0 || interval === 0) {\n return emitResult(iterResult);\n }\n var counterDate = DateTime.fromDate(dtstart);\n var ii = new Iterinfo(options);\n ii.rebuild(counterDate.year, counterDate.month);\n var timeset = makeTimeset(ii, counterDate, options);\n for (;;) {\n var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2];\n var filtered = removeFilteredDays(dayset, start, end, ii, options);\n if (notEmpty(bysetpos)) {\n var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset);\n for (var j = 0; j < poslist.length; j++) {\n var res = poslist[j];\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n else {\n for (var j = start; j < end; j++) {\n var currentDay = dayset[j];\n if (!isPresent(currentDay)) {\n continue;\n }\n var date = fromOrdinal(ii.yearordinal + currentDay);\n for (var k = 0; k < timeset.length; k++) {\n var time = timeset[k];\n var res = combine(date, time);\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n }\n if (options.interval === 0) {\n return emitResult(iterResult);\n }\n // Handle frequency and interval\n counterDate.add(options, filtered);\n if (counterDate.year > MAXYEAR) {\n return emitResult(iterResult);\n }\n if (!freqIsDailyOrGreater(freq)) {\n timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0);\n }\n ii.rebuild(counterDate.year, counterDate.month);\n }\n}\nfunction isFiltered(ii, currentDay, options) {\n var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday;\n return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) ||\n (notEmpty(byweekno) && !ii.wnomask[currentDay]) ||\n (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) ||\n (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) ||\n (byeaster !== null && !includes(ii.eastermask, currentDay)) ||\n ((notEmpty(bymonthday) || notEmpty(bynmonthday)) &&\n !includes(bymonthday, ii.mdaymask[currentDay]) &&\n !includes(bynmonthday, ii.nmdaymask[currentDay])) ||\n (notEmpty(byyearday) &&\n ((currentDay < ii.yearlen &&\n !includes(byyearday, currentDay + 1) &&\n !includes(byyearday, -ii.yearlen + currentDay)) ||\n (currentDay >= ii.yearlen &&\n !includes(byyearday, currentDay + 1 - ii.yearlen) &&\n !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))));\n}\nfunction rezoneIfNeeded(date, options) {\n return new DateWithZone(date, options.tzid).rezonedDate();\n}\nfunction emitResult(iterResult) {\n return iterResult.getValue();\n}\nfunction removeFilteredDays(dayset, start, end, ii, options) {\n var filtered = false;\n for (var dayCounter = start; dayCounter < end; dayCounter++) {\n var currentDay = dayset[dayCounter];\n filtered = isFiltered(ii, currentDay, options);\n if (filtered)\n dayset[currentDay] = null;\n }\n return filtered;\n}\nfunction makeTimeset(ii, counterDate, options) {\n var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n if (freqIsDailyOrGreater(freq)) {\n return buildTimeset(options);\n }\n if ((freq >= RRule.HOURLY &&\n notEmpty(byhour) &&\n !includes(byhour, counterDate.hour)) ||\n (freq >= RRule.MINUTELY &&\n notEmpty(byminute) &&\n !includes(byminute, counterDate.minute)) ||\n (freq >= RRule.SECONDLY &&\n notEmpty(bysecond) &&\n !includes(bysecond, counterDate.second))) {\n return [];\n }\n return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond);\n}\n//# sourceMappingURL=index.js.map","import { isValidDate } from './dateutil';\nimport IterResult from './iterresult';\nimport CallbackIterResult from './callbackiterresult';\nimport { fromText, parseText, toText, isFullyConvertible } from './nlp/index';\nimport { Frequency, } from './types';\nimport { parseOptions, initializeOptions } from './parseoptions';\nimport { parseString } from './parsestring';\nimport { optionsToString } from './optionstostring';\nimport { Cache } from './cache';\nimport { Weekday } from './weekday';\nimport { iter } from './iter/index';\n// =============================================================================\n// RRule\n// =============================================================================\nexport var Days = {\n MO: new Weekday(0),\n TU: new Weekday(1),\n WE: new Weekday(2),\n TH: new Weekday(3),\n FR: new Weekday(4),\n SA: new Weekday(5),\n SU: new Weekday(6),\n};\nexport var DEFAULT_OPTIONS = {\n freq: Frequency.YEARLY,\n dtstart: null,\n interval: 1,\n wkst: Days.MO,\n count: null,\n until: null,\n tzid: null,\n bysetpos: null,\n bymonth: null,\n bymonthday: null,\n bynmonthday: null,\n byyearday: null,\n byweekno: null,\n byweekday: null,\n bynweekday: null,\n byhour: null,\n byminute: null,\n bysecond: null,\n byeaster: null,\n};\nexport var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n/**\n *\n * @param {Options?} options - see \n * - The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...\n * @constructor\n */\nvar RRule = /** @class */ (function () {\n function RRule(options, noCache) {\n if (options === void 0) { options = {}; }\n if (noCache === void 0) { noCache = false; }\n // RFC string\n this._cache = noCache ? null : new Cache();\n // used by toString()\n this.origOptions = initializeOptions(options);\n var parsedOptions = parseOptions(options).parsedOptions;\n this.options = parsedOptions;\n }\n RRule.parseText = function (text, language) {\n return parseText(text, language);\n };\n RRule.fromText = function (text, language) {\n return fromText(text, language);\n };\n RRule.fromString = function (str) {\n return new RRule(RRule.parseString(str) || undefined);\n };\n RRule.prototype._iter = function (iterResult) {\n return iter(iterResult, this.options);\n };\n RRule.prototype._cacheGet = function (what, args) {\n if (!this._cache)\n return false;\n return this._cache._cacheGet(what, args);\n };\n RRule.prototype._cacheAdd = function (what, value, args) {\n if (!this._cache)\n return;\n return this._cache._cacheAdd(what, value, args);\n };\n /**\n * @param {Function} iterator - optional function that will be called\n * on each date that is added. It can return false\n * to stop the iteration.\n * @return Array containing all recurrences.\n */\n RRule.prototype.all = function (iterator) {\n if (iterator) {\n return this._iter(new CallbackIterResult('all', {}, iterator));\n }\n var result = this._cacheGet('all');\n if (result === false) {\n result = this._iter(new IterResult('all', {}));\n this._cacheAdd('all', result);\n }\n return result;\n };\n /**\n * Returns all the occurrences of the rrule between after and before.\n * The inc keyword defines what happens if after and/or before are\n * themselves occurrences. With inc == True, they will be included in the\n * list, if they are found in the recurrence set.\n *\n * @return Array\n */\n RRule.prototype.between = function (after, before, inc, iterator) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(after) || !isValidDate(before)) {\n throw new Error('Invalid date passed in to RRule.between');\n }\n var args = {\n before: before,\n after: after,\n inc: inc,\n };\n if (iterator) {\n return this._iter(new CallbackIterResult('between', args, iterator));\n }\n var result = this._cacheGet('between', args);\n if (result === false) {\n result = this._iter(new IterResult('between', args));\n this._cacheAdd('between', result, args);\n }\n return result;\n };\n /**\n * Returns the last recurrence before the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.before = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.before');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('before', args);\n if (result === false) {\n result = this._iter(new IterResult('before', args));\n this._cacheAdd('before', result, args);\n }\n return result;\n };\n /**\n * Returns the first recurrence after the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.after = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.after');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('after', args);\n if (result === false) {\n result = this._iter(new IterResult('after', args));\n this._cacheAdd('after', result, args);\n }\n return result;\n };\n /**\n * Returns the number of recurrences in this set. It will have go trough\n * the whole recurrence, if this hasn't been done before.\n */\n RRule.prototype.count = function () {\n return this.all().length;\n };\n /**\n * Converts the rrule into its string representation\n *\n * @see \n * @return String\n */\n RRule.prototype.toString = function () {\n return optionsToString(this.origOptions);\n };\n /**\n * Will convert all rules described in nlp:ToText\n * to text.\n */\n RRule.prototype.toText = function (gettext, language, dateFormatter) {\n return toText(this, gettext, language, dateFormatter);\n };\n RRule.prototype.isFullyConvertibleToText = function () {\n return isFullyConvertible(this);\n };\n /**\n * @return a RRule instance with the same freq and options\n * as this one (cache is not cloned)\n */\n RRule.prototype.clone = function () {\n return new RRule(this.origOptions);\n };\n // RRule class 'constants'\n RRule.FREQUENCIES = [\n 'YEARLY',\n 'MONTHLY',\n 'WEEKLY',\n 'DAILY',\n 'HOURLY',\n 'MINUTELY',\n 'SECONDLY',\n ];\n RRule.YEARLY = Frequency.YEARLY;\n RRule.MONTHLY = Frequency.MONTHLY;\n RRule.WEEKLY = Frequency.WEEKLY;\n RRule.DAILY = Frequency.DAILY;\n RRule.HOURLY = Frequency.HOURLY;\n RRule.MINUTELY = Frequency.MINUTELY;\n RRule.SECONDLY = Frequency.SECONDLY;\n RRule.MO = Days.MO;\n RRule.TU = Days.TU;\n RRule.WE = Days.WE;\n RRule.TH = Days.TH;\n RRule.FR = Days.FR;\n RRule.SA = Days.SA;\n RRule.SU = Days.SU;\n RRule.parseString = parseString;\n RRule.optionsToString = optionsToString;\n return RRule;\n}());\nexport { RRule };\n//# sourceMappingURL=rrule.js.map","import { DateWithZone } from './datewithzone';\nimport { iter } from './iter';\nimport { sort } from './dateutil';\nexport function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {\n var _exdateHash = {};\n var _accept = iterResult.accept;\n function evalExdate(after, before) {\n _exrule.forEach(function (rrule) {\n rrule.between(after, before, true).forEach(function (date) {\n _exdateHash[Number(date)] = true;\n });\n });\n }\n _exdate.forEach(function (date) {\n var zonedDate = new DateWithZone(date, tzid).rezonedDate();\n _exdateHash[Number(zonedDate)] = true;\n });\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (isNaN(dt))\n return _accept.call(this, date);\n if (!_exdateHash[dt]) {\n evalExdate(new Date(dt - 1), new Date(dt + 1));\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n }\n return true;\n };\n if (iterResult.method === 'between') {\n evalExdate(iterResult.args.after, iterResult.args.before);\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n return true;\n };\n }\n for (var i = 0; i < _rdate.length; i++) {\n var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate();\n if (!iterResult.accept(new Date(zonedDate.getTime())))\n break;\n }\n _rrule.forEach(function (rrule) {\n iter(iterResult, rrule.options);\n });\n var res = iterResult._result;\n sort(res);\n switch (iterResult.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n return ((res.length && res[res.length - 1]) || null);\n case 'after':\n default:\n return ((res.length && res[0]) || null);\n }\n}\n//# sourceMappingURL=iterset.js.map","import { __assign } from \"tslib\";\nimport { RRule } from './rrule';\nimport { RRuleSet } from './rruleset';\nimport { untilStringToDate } from './dateutil';\nimport { includes, split } from './helpers';\nimport { parseString, parseDtstart } from './parsestring';\n/**\n * RRuleStr\n * To parse a set of rrule strings\n */\nvar DEFAULT_OPTIONS = {\n dtstart: null,\n cache: false,\n unfold: false,\n forceset: false,\n compatible: false,\n tzid: null,\n};\nexport function parseInput(s, options) {\n var rrulevals = [];\n var rdatevals = [];\n var exrulevals = [];\n var exdatevals = [];\n var parsedDtstart = parseDtstart(s);\n var dtstart = parsedDtstart.dtstart;\n var tzid = parsedDtstart.tzid;\n var lines = splitIntoLines(s, options.unfold);\n lines.forEach(function (line) {\n var _a;\n if (!line)\n return;\n var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value;\n switch (name.toUpperCase()) {\n case 'RRULE':\n if (parms.length) {\n throw new Error(\"unsupported RRULE parm: \".concat(parms.join(',')));\n }\n rrulevals.push(parseString(line));\n break;\n case 'RDATE':\n var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1];\n if (rdateTzid && !tzid) {\n tzid = rdateTzid;\n }\n rdatevals = rdatevals.concat(parseRDate(value, parms));\n break;\n case 'EXRULE':\n if (parms.length) {\n throw new Error(\"unsupported EXRULE parm: \".concat(parms.join(',')));\n }\n exrulevals.push(parseString(value));\n break;\n case 'EXDATE':\n exdatevals = exdatevals.concat(parseRDate(value, parms));\n break;\n case 'DTSTART':\n break;\n default:\n throw new Error('unsupported property: ' + name);\n }\n });\n return {\n dtstart: dtstart,\n tzid: tzid,\n rrulevals: rrulevals,\n rdatevals: rdatevals,\n exrulevals: exrulevals,\n exdatevals: exdatevals,\n };\n}\nfunction buildRule(s, options) {\n var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid;\n var noCache = options.cache === false;\n if (options.compatible) {\n options.forceset = true;\n options.unfold = true;\n }\n if (options.forceset ||\n rrulevals.length > 1 ||\n rdatevals.length ||\n exrulevals.length ||\n exdatevals.length) {\n var rset_1 = new RRuleSet(noCache);\n rset_1.dtstart(dtstart);\n rset_1.tzid(tzid || undefined);\n rrulevals.forEach(function (val) {\n rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n rdatevals.forEach(function (date) {\n rset_1.rdate(date);\n });\n exrulevals.forEach(function (val) {\n rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n exdatevals.forEach(function (date) {\n rset_1.exdate(date);\n });\n if (options.compatible && options.dtstart)\n rset_1.rdate(dtstart);\n return rset_1;\n }\n var val = rrulevals[0] || {};\n return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache);\n}\nexport function rrulestr(s, options) {\n if (options === void 0) { options = {}; }\n return buildRule(s, initializeOptions(options));\n}\nfunction groomRruleOptions(val, dtstart, tzid) {\n return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid });\n}\nfunction initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n keys.forEach(function (key) {\n if (!includes(defaultKeys, key))\n invalid.push(key);\n });\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign(__assign({}, DEFAULT_OPTIONS), options);\n}\nfunction extractName(line) {\n if (line.indexOf(':') === -1) {\n return {\n name: 'RRULE',\n value: line,\n };\n }\n var _a = split(line, ':', 1), name = _a[0], value = _a[1];\n return {\n name: name,\n value: value,\n };\n}\nfunction breakDownLine(line) {\n var _a = extractName(line), name = _a.name, value = _a.value;\n var parms = name.split(';');\n if (!parms)\n throw new Error('empty property name');\n return {\n name: parms[0].toUpperCase(),\n parms: parms.slice(1),\n value: value,\n };\n}\nfunction splitIntoLines(s, unfold) {\n if (unfold === void 0) { unfold = false; }\n s = s && s.trim();\n if (!s)\n throw new Error('Invalid empty string');\n // More info about 'unfold' option\n // Go head to http://www.ietf.org/rfc/rfc2445.txt\n if (!unfold) {\n return s.split(/\\s/);\n }\n var lines = s.split('\\n');\n var i = 0;\n while (i < lines.length) {\n // TODO\n var line = (lines[i] = lines[i].replace(/\\s+$/g, ''));\n if (!line) {\n lines.splice(i, 1);\n }\n else if (i > 0 && line[0] === ' ') {\n lines[i - 1] += line.slice(1);\n lines.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n return lines;\n}\nfunction validateDateParm(parms) {\n parms.forEach(function (parm) {\n if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {\n throw new Error('unsupported RDATE/EXDATE parm: ' + parm);\n }\n });\n}\nfunction parseRDate(rdateval, parms) {\n validateDateParm(parms);\n return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });\n}\n//# sourceMappingURL=rrulestr.js.map","import { __extends } from \"tslib\";\nimport { RRule } from './rrule';\nimport { sort, timeToUntilString } from './dateutil';\nimport { includes } from './helpers';\nimport { iterSet } from './iterset';\nimport { rrulestr } from './rrulestr';\nimport { optionsToString } from './optionstostring';\nfunction createGetterSetter(fieldName) {\n var _this = this;\n return function (field) {\n if (field !== undefined) {\n _this[\"_\".concat(fieldName)] = field;\n }\n if (_this[\"_\".concat(fieldName)] !== undefined) {\n return _this[\"_\".concat(fieldName)];\n }\n for (var i = 0; i < _this._rrule.length; i++) {\n var field_1 = _this._rrule[i].origOptions[fieldName];\n if (field_1) {\n return field_1;\n }\n }\n };\n}\nvar RRuleSet = /** @class */ (function (_super) {\n __extends(RRuleSet, _super);\n /**\n *\n * @param {Boolean?} noCache\n * The same stratagy as RRule on cache, default to false\n * @constructor\n */\n function RRuleSet(noCache) {\n if (noCache === void 0) { noCache = false; }\n var _this = _super.call(this, {}, noCache) || this;\n _this.dtstart = createGetterSetter.apply(_this, ['dtstart']);\n _this.tzid = createGetterSetter.apply(_this, ['tzid']);\n _this._rrule = [];\n _this._rdate = [];\n _this._exrule = [];\n _this._exdate = [];\n return _this;\n }\n RRuleSet.prototype._iter = function (iterResult) {\n return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());\n };\n /**\n * Adds an RRule to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.rrule = function (rrule) {\n _addRule(rrule, this._rrule);\n };\n /**\n * Adds an EXRULE to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.exrule = function (rrule) {\n _addRule(rrule, this._exrule);\n };\n /**\n * Adds an RDate to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.rdate = function (date) {\n _addDate(date, this._rdate);\n };\n /**\n * Adds an EXDATE to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.exdate = function (date) {\n _addDate(date, this._exdate);\n };\n /**\n * Get list of included rrules in this recurrence set.\n *\n * @return List of rrules\n */\n RRuleSet.prototype.rrules = function () {\n return this._rrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of excluded rrules in this recurrence set.\n *\n * @return List of exrules\n */\n RRuleSet.prototype.exrules = function () {\n return this._exrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of rdates\n */\n RRuleSet.prototype.rdates = function () {\n return this._rdate.map(function (e) { return new Date(e.getTime()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of exdates\n */\n RRuleSet.prototype.exdates = function () {\n return this._exdate.map(function (e) { return new Date(e.getTime()); });\n };\n RRuleSet.prototype.valueOf = function () {\n var result = [];\n if (!this._rrule.length && this._dtstart) {\n result = result.concat(optionsToString({ dtstart: this._dtstart }));\n }\n this._rrule.forEach(function (rrule) {\n result = result.concat(rrule.toString().split('\\n'));\n });\n this._exrule.forEach(function (exrule) {\n result = result.concat(exrule\n .toString()\n .split('\\n')\n .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); })\n .filter(function (line) { return !/^DTSTART/.test(line); }));\n });\n if (this._rdate.length) {\n result.push(rdatesToString('RDATE', this._rdate, this.tzid()));\n }\n if (this._exdate.length) {\n result.push(rdatesToString('EXDATE', this._exdate, this.tzid()));\n }\n return result;\n };\n /**\n * to generate recurrence field such as:\n * DTSTART:19970902T010000Z\n * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n */\n RRuleSet.prototype.toString = function () {\n return this.valueOf().join('\\n');\n };\n /**\n * Create a new RRuleSet Object completely base on current instance\n */\n RRuleSet.prototype.clone = function () {\n var rrs = new RRuleSet(!!this._cache);\n this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); });\n this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); });\n this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); });\n this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); });\n return rrs;\n };\n return RRuleSet;\n}(RRule));\nexport { RRuleSet };\nfunction _addRule(rrule, collection) {\n if (!(rrule instanceof RRule)) {\n throw new TypeError(String(rrule) + ' is not RRule instance');\n }\n if (!includes(collection.map(String), String(rrule))) {\n collection.push(rrule);\n }\n}\nfunction _addDate(date, collection) {\n if (!(date instanceof Date)) {\n throw new TypeError(String(date) + ' is not Date instance');\n }\n if (!includes(collection.map(Number), Number(date))) {\n collection.push(date);\n sort(collection);\n }\n}\nfunction rdatesToString(param, rdates, tzid) {\n var isUTC = !tzid || tzid.toUpperCase() === 'UTC';\n var header = isUTC ? \"\".concat(param, \":\") : \"\".concat(param, \";TZID=\").concat(tzid, \":\");\n var dateString = rdates\n .map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })\n .join(',');\n return \"\".concat(header).concat(dateString);\n}\n//# sourceMappingURL=rruleset.js.map","import { RRule, rrulestr } from 'rrule';\r\n\r\nexport default function (scheduler) {\r\n\r\n\tfunction clearMilliseconds(date) {\r\n\t\treturn new Date(\r\n\t\t\tdate.getFullYear(),\r\n\t\t\tdate.getMonth(),\r\n\t\t\tdate.getDate(),\r\n\t\t\tdate.getHours(),\r\n\t\t\tdate.getMinutes(),\r\n\t\t\tdate.getSeconds(),\r\n\t\t\t0\r\n\t\t);\r\n\t}\r\n\r\n\tfunction isDeletedOccurrence(event) {\r\n\t\treturn !!event.deleted;\r\n\t}\r\n\r\n\tfunction isSeries(event) {\r\n\t\treturn !!event.rrule && !event.recurring_event_id;\r\n\t}\r\n\r\n\tfunction clearRecurringProperties(event) {\r\n\t\tevent.rrule = \"\";\r\n\t\tevent.original_start = null;\r\n\t\tevent.recurring_event_id = null;\r\n\t\tevent.duration = null;\r\n\t\tevent.deleted = null;\r\n\t}\r\n\r\n\tfunction createException(ev) {\r\n\t\tlet id = ev.id.split(\"#\");\r\n\r\n\t\tlet nid = scheduler.uid();\r\n\t\tscheduler._not_render = true;\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = id[0];\r\n\r\n\t\tlet timestamp = id[1];\r\n\r\n\t\tnev.original_start = new Date(Number(timestamp));\r\n\r\n\t\tscheduler._add_rec_marker(nev, timestamp);\r\n\t\tscheduler.addEvent(nev);\r\n\t\tscheduler._not_render = false;\r\n\t}\r\n\r\n\tscheduler._rec_temp = [];\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_markers = {};\r\n\tscheduler._add_rec_marker = function (ev, time) {\r\n\t\tev._pid_time = time;\r\n\t\tthis._rec_markers[ev.id] = ev;\r\n\t\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\t\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n\t};\r\n\tscheduler._get_rec_marker = function (time, id) {\r\n\t\tlet ch = this._rec_markers_pull[id];\r\n\t\tif (ch) return ch[time];\r\n\t\treturn null;\r\n\t};\r\n\tscheduler._get_rec_markers = function (id) {\r\n\t\treturn (this._rec_markers_pull[id] || []);\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old_add_event = scheduler.addEvent;\r\n\t\tscheduler.addEvent = function (start_date, end_date, text, id, extra_data) {\r\n\t\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\r\n\t\t\t\tif (ev.start_date) {\r\n\t\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t\t}\r\n\t\t\t\tif (ev.end_date) {\r\n\t\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn ev_id;\r\n\t\t};\r\n\t})();\r\n\r\n\tscheduler.attachEvent(\"onEventLoading\", function (event) {\r\n\r\n\t\tif (event.original_start) {\r\n\t\t\tevent.original_start = scheduler.templates.parse_date(event.original_start);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function (id, new_id) {\r\n\t\tif (this._ignore_call) return;\r\n\t\tthis._ignore_call = true;\r\n\r\n\t\tif (scheduler._rec_markers[id]) {\r\n\t\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\t\tdelete scheduler._rec_markers[id];\r\n\t\t}\r\n\r\n\t\tif (scheduler._rec_markers_pull[id]) {\r\n\t\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\t\tdelete scheduler._rec_markers_pull[id];\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\t\tvar tev = this._rec_temp[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i in this._rec_markers) {\r\n\t\t\tvar tev = this._rec_markers[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\ttev._pid_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar el = scheduler._rec_markers[new_id];\r\n\t\tif (el && el._pid_changed) {\r\n\t\t\tdelete el._pid_changed;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (scheduler.$destroyed) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tdelete this._ignore_call;\r\n\t});\r\n\r\n\tfunction deleteEventFromSeries(idTimestamp, ev) {\r\n\t\tlet id = idTimestamp;\r\n\t\tidTimestamp = id.split(\"#\");\r\n\t\tlet nid = scheduler.uid();\r\n\t\tlet tid = (idTimestamp[1]) ? idTimestamp[1] : (ev._pid_time);\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = ev.recurring_event_id || idTimestamp[0];\r\n\t\tnev.original_start = new Date(Number(tid));\r\n\t\tnev.deleted = true;\r\n\t\tscheduler.addEvent(nev);\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && !isDeletedOccurrence(ev))) {\r\n\t\t\tdeleteEventFromSeries(id, ev);\r\n\t\t} else {\r\n\t\t\tif (isSeries(ev) && this._lightbox_id)\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tid = sub[i].id;\r\n\t\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tif (!this._is_virtual_event(id) && this._is_modified_occurence(ev)) {\r\n\t\t\tif (!scheduler._events[id]) {\r\n\t\t\t\tev.deleted = true;\r\n\t\t\t\tthis.setEvent(id, ev);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function (id, event) {\r\n\t\tif (this._loading) return true;\r\n\r\n\t\tvar ev = this.getEvent(id);\r\n\r\n\t\tif (this._is_virtual_event(id)) {\r\n\t\t\tcreateException(ev);\r\n\r\n\t\t} else {\r\n\t\t\tif (ev.start_date) {\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date) {\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev) && this._lightbox_id) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t\t//scheduler.recurrings.rollbackDates(ev);\r\n\t\t\t}\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\t\tvar isEventFound = false;\r\n\t\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\t\tisEventFound = true;\r\n\t\t\t}\r\n\t\t\tif (!isEventFound)\r\n\t\t\t\tthis._select_id = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\", function (id) {\r\n\t\tif (!this._loading) {\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function (id, data, is_new_event) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev))\r\n\t\t\tthis._select_id = null;\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\tclearRecurringProperties(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCancel\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev)) {\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\t\tthis.render_view_data();\r\n\t\t}\r\n\t});\r\n\tscheduler._roll_back_dates = function (ev) {\r\n\t\t//// !!!!! calc temp properties\r\n\t\tif (ev.start_date) {\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif (ev.end_date) {\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\t\tev.end_date = ev._end_date;\r\n\t\tif (ev._start_date) {\r\n\t\t\tev.start_date.setMonth(0);\r\n\t\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._is_virtual_event = function (id) {\r\n\t\treturn id.toString().indexOf(\"#\") != -1;\r\n\t};\r\n\tscheduler._is_modified_occurence = function (ev) {\r\n\t\treturn (ev.recurring_event_id && ev.recurring_event_id != \"0\");\r\n\t};\r\n\r\n\tscheduler.showLightbox_rec = scheduler.showLightbox;\r\n\tscheduler.showLightbox = function (id) {\r\n\t\tvar locale = this.locale;\r\n\t\tvar c = scheduler.config.lightbox_recurring;\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tvar pid = ev.recurring_event_id;\r\n\t\tvar isVirtual = this._is_virtual_event(id);\r\n\t\tif (isVirtual)\r\n\t\t\tpid = id.split(\"#\")[0];\r\n\r\n\t\t// show series\r\n\t\tvar showSeries = function (id) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tevent._end_date = event.end_date;\r\n\t\t\tevent.end_date = new Date(event.start_date.valueOf() + event.duration * 1000);\r\n\t\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t\t};\r\n\r\n\t\tif ((pid || pid * 1 === 0) && isSeries(ev)) {\r\n\t\t\t// direct API call on series id\r\n\t\t\treturn showSeries(id);\r\n\t\t}\r\n\t\tif (!pid || pid === '0' || ((!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual))) {\r\n\t\t\t// editing instance or non recurring event\r\n\t\t\treturn this.showLightbox_rec(id);\r\n\t\t}\r\n\t\tif (c == 'ask') {\r\n\t\t\tvar that = this;\r\n\t\t\tscheduler.modalbox({\r\n\t\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\t\twidth: \"500px\",\r\n\t\t\t\tposition: \"middle\",\r\n\t\t\t\tbuttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\t\tcallback: function (index) {\r\n\t\t\t\t\tswitch (+index) {\r\n\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tshowSeries(pid);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction groupExceptions() {\r\n\t\tconst exceptions = {};\r\n\t\tfor (const i in scheduler._events) {\r\n\t\t\tconst ev = scheduler._events[i];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tif (!exceptions[ev.recurring_event_id]) {\r\n\t\t\t\t\texceptions[ev.recurring_event_id] = {};\r\n\t\t\t\t}\r\n\t\t\t\texceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn exceptions;\r\n\t}\r\n\r\n\tscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function (only_timed) {\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\t\tdelete this._events[this._rec_temp[i].id];\r\n\t\tthis._rec_temp = [];\r\n\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tvar stack = this.get_visible_events_rec(only_timed);\r\n\t\tvar out = [];\r\n\t\tfor (var i = 0; i < stack.length; i++) {\r\n\t\t\tif (stack[i].deleted || stack[i].recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(stack[i])) {\r\n\t\t\t\tthis.repeat_date(stack[i], out, undefined, undefined, undefined, undefined, exceptions);\r\n\t\t\t} else {\r\n\t\t\t\tout.push(stack[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old = scheduler.isOneDayEvent;\r\n\t\tscheduler.isOneDayEvent = function (ev) {\r\n\t\t\tif (isSeries(ev)) return true;\r\n\t\t\treturn old.call(this, ev);\r\n\t\t};\r\n\t\tvar old_update_event = scheduler.updateEvent;\r\n\t\tscheduler.updateEvent = function (id) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\r\n\t\t\tif (ev && isSeries(ev) && !this._is_virtual_event(id)) {\r\n\t\t\t\tscheduler.update_view();\r\n\t\t\t} else {\r\n\t\t\t\told_update_event.call(this, id);\r\n\t\t\t}\r\n\t\t};\r\n\t})();\r\n\r\n\tconst toIcalString = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\r\n\tscheduler.repeat_date = function (ev, stack, non_render, from, to, maxCount, exceptions) {\r\n\t\tif (!ev.rrule) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id];\r\n\t\tif (!seriesExceptions) {\r\n\t\t\tseriesExceptions = {};\r\n\t\t}\r\n\r\n\t\tif (!from) {\r\n\t\t\tfrom = scheduler._min_date;\r\n\t\t}\r\n\t\tif (!to) {\r\n\t\t\tto = scheduler._max_date;\r\n\t\t}\r\n\r\n\t\tconst utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds()));\r\n\t\tconst parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart/*ev.start_date*/ });\r\n\r\n\t\tconst repeatedDates = parsedRRule.between(from, to).map(date => {\r\n\t\t\tconst adjustedDate = new Date(date);\r\n\t\t\tadjustedDate.setHours(ev.start_date.getHours());\r\n\t\t\tadjustedDate.setMinutes(ev.start_date.getMinutes());\r\n\t\t\tadjustedDate.setSeconds(ev.start_date.getSeconds());\r\n\t\t\treturn adjustedDate;\r\n\t\t});\r\n\t\tlet visibleCount = 0;\r\n\r\n\t\tconst eventDuration = ev.duration;\r\n\r\n\t\tfor (let i = 0; i < repeatedDates.length; i++) {\r\n\t\t\tif (maxCount && visibleCount >= maxCount) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst date = repeatedDates[i];\r\n\r\n\t\t\tlet exception = seriesExceptions[date.valueOf()];\r\n\t\t\tif (exception) {\r\n\t\t\t\tif (exception.deleted) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvisibleCount++;\r\n\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst copy = scheduler._copy_event(ev);\r\n\t\t\t\t//copy._timed = ev._timed;\r\n\t\t\t\tcopy.text = ev.text;\r\n\t\t\t\tcopy.start_date = date;\r\n\t\t\t\tcopy.id = ev.id + \"#\" + Math.ceil(date.valueOf());\r\n\t\t\t\tcopy.end_date = new Date(date.valueOf() + eventDuration * 1000);\r\n\t\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date);\r\n\t\t\t\tcopy._timed = scheduler.isOneDayEvent(copy);\r\n\r\n\r\n\r\n\t\t\t\tif (!copy._timed && !scheduler._table_view && !scheduler.config.multi_day) continue;\r\n\t\t\t\tstack.push(copy);\r\n\r\n\t\t\t\tif (!non_render) {\r\n\t\t\t\t\tscheduler._events[copy.id] = copy;\r\n\t\t\t\t\tscheduler._rec_temp.push(copy);\r\n\t\t\t\t}\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._fix_daylight_saving_date = function (start_date, end_date, ev, counter, default_date) {\r\n\t\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\t\tif (shift) {\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\t// e.g. 24h -> 23h\r\n\t\t\t\treturn new Date(counter.valueOf() + ev.duration * 1000 - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// e.g. 24h -> 25h\r\n\t\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Date(default_date.valueOf());\r\n\t};\r\n\tscheduler.getRecDates = function (id, max) {\r\n\t\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\t\tvar recurrings = [];\r\n\t\tmax = max || 100;\r\n\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\treturn [\r\n\t\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t\t];\r\n\t\t}\r\n\t\tif (ev.deleted) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\t\tvar result = [];\r\n\t\tfor (var i = 0; i < recurrings.length; i++) {\r\n\t\t\tif (!recurrings[i].deleted) {\r\n\t\t\t\tresult.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tscheduler.getEvents = function (from, to) {\r\n\t\tvar result = [];\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tfor (var a in this._events) {\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tif (from && to && ev.start_date < to && ev.end_date > from) {\r\n\t\t\t\t\tvar sev = [];\r\n\t\t\t\t\tthis.repeat_date(ev, sev, true, from, to, undefined, exceptions);\r\n\t\t\t\t\tsev.forEach(function(occurence){\r\n\t\t\t\t\t\tif (occurence.start_date < to && occurence.end_date > from) {\r\n\t\t\t\t\t\t\tresult.push(occurence);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else if(!from && !to){\r\n\t\t\t\t\tresult.push(ev);\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\r\n\t//drop secondary attributes\r\n\tscheduler._copy_dummy = function (ev) {\r\n\t\tvar start_date = new Date(this.start_date);\r\n\t\tvar end_date = new Date(this.end_date);\r\n\t\tthis.start_date = start_date;\r\n\t\tthis.end_date = end_date;\r\n\t\tthis.duration = this.rrule = null;\r\n\t};\r\n\r\n\tscheduler.config.include_end_by = false;\r\n\tscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\tscheduler.config.recurring_workdays = [RRule.MO.weekday,RRule.TU.weekday,RRule.WE.weekday,RRule.TH.weekday,RRule.FR.weekday];\r\n\tscheduler.config.repeat_date = \"%m.%d.%Y\";\r\n\tscheduler.config.lightbox.sections = [\r\n\t\t{ name: \"description\", map_to: \"text\", type: \"textarea\", focus: true },\r\n\t\t{ name: \"recurring\", type: \"recurring\", map_to: \"rec_type\" },\r\n\t\t{ name: \"time\", height: 72, type: \"time\", map_to: \"auto\" }\r\n\t];\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function () {\r\n\t\tscheduler._rec_markers = {}; //clear recurring events data\r\n\t\tscheduler._rec_markers_pull = {};\r\n\t\tscheduler._rec_temp = [];\r\n\t});\r\n\r\n\r\n\tfunction getTopLevelOption(rruleObj, untilDate) {\r\n\t\tconst options = rruleObj.options;\r\n\t\tconst until = options.until || untilDate;\r\n\r\n\t\tconst hasEndCondition = options.count || (until && until.getFullYear() !== 9999);\r\n\r\n\t\tif (hasEndCondition) {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\r\n\t\tif (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'DAILY';\r\n\t\t} else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'WEEKLY';\r\n\t\t} else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'MONTHLY';\r\n\t\t} else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'YEARLY';\r\n\t\t} else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler.config.recurring_workdays.length &&\r\n\t\t\toptions.byweekday.includes(RRule.MO) &&\r\n\t\t\toptions.byweekday.includes(RRule.TU) &&\r\n\t\t\toptions.byweekday.includes(RRule.WE) &&\r\n\t\t\toptions.byweekday.includes(RRule.TH) &&\r\n\t\t\toptions.byweekday.includes(RRule.FR)) {\r\n\t\t\treturn 'WORKDAYS';\r\n\t\t} else {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction getWeekdayOfMonth(date) {\r\n\t\tconst dayOfWeek = date.getDay();\r\n\t\tconst dayOfMonth = date.getDate();\r\n\t\tconst dayNumber = Math.ceil(dayOfMonth / 7);\r\n\t\treturn { dayOfWeek, dayNumber };\r\n\t}\r\n\r\n\r\n\tconst jsDaysToRRULEDays = {\r\n\t\t0: \"SU\",\r\n\t\t1: \"MO\",\r\n\t\t2: \"TU\",\r\n\t\t3: \"WE\",\r\n\t\t4: \"TH\",\r\n\t\t5: \"FR\",\r\n\t\t6: \"SA\"\r\n\t};\r\n\tconst RruleDayNumsToJs = {\r\n\t\t0: 1,\r\n\t\t1: 2,\r\n\t\t2: 3,\r\n\t\t3: 4,\r\n\t\t4: 5,\r\n\t\t5: 6,\r\n\t\t6: 0\r\n\t};\r\n\r\n\tfunction fillCustomDaily(node, rule) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\t}\r\n\r\n\tfunction fillCustomWeekly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`);\r\n\t\tdayCheckboxes.forEach((ch) => ch.checked = false);\r\n\t\tif (rule && rule.byweekday) {\r\n\t\t\trule.byweekday.forEach((day) => {\r\n\t\t\t\tconst dayNum = RruleDayNumsToJs[day.weekday];\r\n\t\t\t\tconst dayLabel = jsDaysToRRULEDays[dayNum];\r\n\t\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst dayLabel = jsDaysToRRULEDays[event.start_date.getDay()];\r\n\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction fillCustomMonthly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfMonth.innerText = scheduler.templates.repeat_monthly_date(event.start_date, event);\r\n\t\tnthWeekDayOfMonth.innerText = scheduler.templates.repeat_monthly_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction formatDayNumber(date){\r\n\t\tswitch (date) {\r\n\t\t\tcase 1:\r\n\t\t\tcase 31:\r\n\t\t\t\treturn `${date}st`;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn `${date}nd`;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn `${date}rd`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${date}th`;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.templates.repeat_monthly_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\treturn `Every ${formatDayNumber(date)}`;\r\n\t};\r\n\tscheduler.templates.repeat_monthly_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`;\r\n\t};\r\n\t\r\n\tscheduler.templates.repeat_yearly_month_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(date)} day of ${monthLabel}`;\r\n\t};\r\n\tscheduler.templates.repeat_yearly_month_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`;\r\n\t};\r\n\r\n\tfunction fillCustomYearly(node, rule, event) {\r\n\t\tconst dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfYear.innerText = scheduler.templates.repeat_yearly_month_date(event.start_date, event);\r\n\t\tnthWeekDayOfYear.innerText = scheduler.templates.repeat_yearly_month_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fillEndRule(node, rule, event) {\r\n\t\tconst countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_after\"]`);\r\n\t\tconst ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_ondate\"]`);\r\n\t\tconst endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`);\r\n\t\tcountInput.value = 1;\r\n\r\n\t\tlet formatter = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tondateInput.value = scheduler.config.repeat_date_of_end;\r\n\r\n\t\tif (rule && rule.count) {\r\n\t\t\tendOptionSelect.value = \"AFTER\";\r\n\t\t\tcountInput.value = rule.count;\r\n\t\t} else if (event._end_date && event._end_date.getFullYear() !== 9999) {\r\n\t\t\tendOptionSelect.value = \"ON\";\r\n\t\t\tondateInput.value = formatter(event._end_date);\r\n\t\t} else {\r\n\t\t\tendOptionSelect.value = \"NEVER\";\r\n\t\t}\r\n\t\tendOptionSelect.dispatchEvent(new Event(\"change\"));\r\n\t}\r\n\r\n\tconst getRecValue = {\r\n\t\tMONTHLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.MONTHLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWEEKLY: function (dates) {\r\n\t\t\tlet day = dates.start.getDay() - 1;\r\n\t\t\tif (day == -1) day = 6;\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: [day]\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tDAILY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.DAILY,\r\n\t\t\t\tinterval: 1\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tYEARLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.YEARLY,\r\n\t\t\t\tbymonth: dates.start.getMonth() + 1,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWORKDAYS: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: scheduler.config.recurring_workdays\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tCUSTOM: function (dates, node) {\r\n\t\t\tconst rrule = {};\r\n\t\t\tconst freq = node.querySelector(`[name=\"repeat_interval_unit\"]`).value;\r\n\t\t\tconst interval = Math.max(1, node.querySelector(`[name=\"repeat_interval_value\"]`).value);\r\n\t\t\tconst monthRepeat = node.querySelector(`[name=\"dhx_custom_month_option\"]`).value;\r\n\t\t\tconst yearRepeat = node.querySelector(`[name=\"dhx_custom_year_option\"]`).value;\r\n\r\n\t\t\trrule.interval = interval;\r\n\t\t\tlet days;\r\n\t\t\tlet day;\r\n\r\n\t\t\tswitch (freq) {\r\n\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\trrule.freq = RRule.DAILY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WEEKLY\": \r\n\t\t\t\t\trrule.freq = RRule.WEEKLY;\r\n\t\t\t\t\tdays = [];\r\n\t\t\t\t\tnode.querySelectorAll(`.dhx_form_repeat_custom_week [name=\"week_day\"]`).forEach((ch) => {\r\n\t\t\t\t\t\tif(ch.checked){\r\n\t\t\t\t\t\t\tdays.push(ch.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trrule.byweekday = days.map((day) => {\r\n\t\t\t\t\t\tswitch (day) {\r\n\t\t\t\t\t\t\tcase \"MO\":\r\n\t\t\t\t\t\t\t\treturn RRule.MO.weekday;\r\n\t\t\t\t\t\t\tcase \"TU\":\r\n\t\t\t\t\t\t\t\treturn RRule.TU.weekday;\r\n\t\t\t\t\t\t\tcase \"WE\":\r\n\t\t\t\t\t\t\t\treturn RRule.WE.weekday;\r\n\t\t\t\t\t\t\tcase \"TH\":\r\n\t\t\t\t\t\t\t\treturn RRule.TH.weekday;\r\n\t\t\t\t\t\t\tcase \"FR\":\r\n\t\t\t\t\t\t\t\treturn RRule.FR.weekday;\r\n\t\t\t\t\t\t\tcase \"SA\":\r\n\t\t\t\t\t\t\t\treturn RRule.SA.weekday;\r\n\t\t\t\t\t\t\tcase \"SU\":\r\n\t\t\t\t\t\t\t\treturn RRule.SU.weekday;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\trrule.freq = RRule.MONTHLY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (monthRepeat === \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\trrule.freq = RRule.YEARLY;\r\n\t\t\t\t\trrule.bymonth = dates.start.getMonth() + 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (yearRepeat == \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tlet until = new Date(9999, 1, 1);\r\n\t\t\tconst endRule = node.querySelector(`[name=\"dhx_custom_repeat_ends\"]`);\r\n\t\t\tif(endRule === \"ON\"){\r\n\t\t\t\tuntil = node.querySelector(`[name=\"dhx_form_repeat_ends_ondate\"]`).value;\r\n\t\t\t} else if(endRule === \"AFTER\") {\r\n\t\t\t\trrule.count = Math.max(1, node.querySelector(`[name=\"dhx_form_repeat_ends_after\"]`).value);\r\n\t\t\t}\r\n\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tNEVER: function () {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction fillInDefaults(node, rule, event) {\r\n\t\tfillCustomDaily(node, rule, event);\r\n\t\tfillCustomWeekly(node, rule, event);\r\n\t\tfillCustomMonthly(node, rule, event);\r\n\t\tfillCustomYearly(node, rule, event);\r\n\t\tfillEndRule(node, rule, event);\r\n\t}\r\n\tscheduler.form_blocks[\"recurring\"] = {\r\n\t\trender: function (sns) {\r\n\t\t\tif (sns.form) {\r\n\t\t\t\tlet rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\t\tlet form = rec._get_node(sns.form);\r\n\t\t\t\tlet html = rec._outer_html(form);\r\n\t\t\t\tform.style.display = 'none';\r\n\t\t\t\treturn html;\r\n\t\t\t}\r\n\t\t\tlet loc = scheduler.locale.labels;\r\n\r\n\t\t\treturn `
\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
${loc.repeat_ends}
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t
\r\n\t
`;\r\n\t\t},\r\n\r\n\t\r\n\t\t_init_set_value: function (node, value, event) {\r\n\t\t\tscheduler.form_blocks[\"recurring\"]._ds = { start: event.start_date, end: event.end_date };\r\n\t\t\tfunction hide(node) {\r\n\t\t\t\tnode.classList.add(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction show(node) {\r\n\t\t\t\tnode.classList.remove(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction onRepeatOptionChange(value) {\r\n\t\t\t\tconst repeat = node.querySelector(\".dhx_form_repeat_custom\");\r\n\t\t\t\tif (value === \"CUSTOM\") {\r\n\t\t\t\t\tshow(repeat);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thide(repeat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatIntervalChange(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tweekly: node.querySelector(\".dhx_form_repeat_custom_week\"),\r\n\t\t\t\t\tmonthly: node.querySelector(\".dhx_form_repeat_custom_month\"),\r\n\t\t\t\t\tyearly: node.querySelector(\".dhx_form_repeat_custom_year\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"WEEKLY\":\r\n\t\t\t\t\t\tshow(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\tshow(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\tshow(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatEndRule(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tafter: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after\"),\r\n\t\t\t\t\ton: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"NEVER\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AFTER\":\r\n\t\t\t\t\t\tshow(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ON\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\tshow(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// repeat section change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").addEventListener(\"change\", function () {\r\n\t\t\t\tonRepeatOptionChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat interval change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_custom_interval [name='repeat_interval_unit']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatIntervalChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat end rule\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatEndRule(this.value);\r\n\t\t\t});\r\n\r\n\t\t\tscheduler._lightbox._rec_init_done = true;\r\n\t\t},\r\n\t\tbutton_click: function(){},\r\n\t\tset_value: function (node, value, ev) {\r\n\t\t\tlet rf = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\t\trf._init_set_value(node, value, ev);\r\n\t\t\tnode.open = !ev.rrule;\r\n\r\n\t\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\t\tlet ds = rf._ds;\r\n\t\t\tds.start = ev.start_date;\r\n\t\t\tds.end = ev._end_date;\r\n\r\n\t\t\tif (ev.rrule) {\r\n\t\t\t\tconst rruleset = rrulestr(ev.rrule);\r\n\t\t\t\tfillInDefaults(node, rruleset.origOptions, ev);\r\n\t\t\t\tconst topOption = getTopLevelOption(rruleset, ev._end_date);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = topOption;\r\n\t\t\t\tif(topOption === \"CUSTOM\"){\r\n\t\t\t\t\tlet customFreq;\r\n\t\t\t\t\tswitch (rruleset.origOptions.freq) {\r\n\t\t\t\t\t\tcase RRule.DAILY:\r\n\t\t\t\t\t\t\tcustomFreq = \"DAILY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.WEEKLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"WEEKLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.MONTHLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"MONTHLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.YEARLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"YEARLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(customFreq){\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).value = customFreq;\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).dispatchEvent(new Event(\"change\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t//\trepeat_interval_unit\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tfillInDefaults(node, null, ev);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = \"NEVER\";\r\n\t\t\t}\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").dispatchEvent(new Event(\"change\"));\r\n\r\n\t\t},\r\n\t\tget_value: function (node, ev) {\r\n\t\t\t\r\n\t\t\tif(!node.blocked && node.querySelector(\".dhx_form_repeat_pattern select\").value !== \"NEVER\") {\r\n\t\t\t\tlet ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\t\tlet actual_dates = {};\r\n\r\n\t\t\t\tlet timeControl = getTimeSection();\r\n\r\n\t\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\t\tds.start = actual_dates.start_date;\r\n\t\t\t\tconst pattern = node.querySelector(\".dhx_form_repeat_pattern select\").value;\r\n\t\t\t\tconst recurrence = getRecValue[pattern](ds, node);\r\n\t\t\t\tev.rrule = new RRule(recurrence.rrule).toString().replace(\"RRULE:\", \"\");\r\n\t\t\t\tds.end = recurrence.until;\r\n\r\n\t\t\t\tev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1000);\r\n\r\n\t\t\t\tif (ds._start) {\r\n\t\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\t\tds._start = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._start_date = null;\r\n\r\n\t\t\t\tev._end_date = ds.end;\r\n\t\t\t}else{\r\n\t\t\t\tev.rrule = ev.rrule = \"\";\r\n\t\t\t\tev._end_date = ev.end_date;\r\n\t\t\t}\r\n\r\n\t\t\treturn ev.rrule;\r\n\t\t},\r\n\r\n\t\tfocus: function (node) {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction getTimeSection() {\r\n\t\tlet timeControl = scheduler.formSection('time');\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('time');\r\n\t\t}\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t\t}\r\n\r\n\r\n\t\tif (!timeControl) {\r\n\t\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\t\t\t\t\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\t\t\t\t\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\t\t\t\t\"\",\r\n\t\t\t\t\"scheduler.config.lightbox.sections = [\",\r\n\t\t\t\t\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n\t\t\t\t.join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\treturn timeControl;\r\n\t}\r\n\r\n\tfunction getFirstSectionOfType(type) {\r\n\t\tfor (let i = 0; i < scheduler.config.lightbox.sections.length; i++) {\r\n\t\t\tlet section = scheduler.config.lightbox.sections[i];\r\n\t\t\tif (section.type === type) {\r\n\t\t\t\treturn scheduler.formSection(section.name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn '
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+loc.repeat_text_week_count+'
'+\r\n\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t\t' '+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\t''+\r\n\t\t\t\t\t\t\t\tloc.select_year_day2+\r\n\t\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t''+loc.repeat_text_occurences_count+'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t\t'
'+\r\n\t\t\t\t\t'
'+\r\n\t\t\t\t'
'+\r\n\t\t\t\t'
';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\"\");\r\n\t}\r\n\treturn (header||\"\")+\"\"+xml.join(\"\\n\")+\"\";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_year_grid= function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += \"
\" + (evs[i]._timed ? this.templates.event_date(evs[i].start_date) : \"\") + \"
\";\r\n\t\t\thtml += \"
 
\";\r\n\t\t\thtml += this.templates.year_tooltip(evs[i].start_date, evs[i].end_date, evs[i]) + \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"
\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport recurring_legacy from \"./recurring_legacy\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\trecurring_legacy,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };"],"names":["dhtmlxHook","dhtmlx","attaches","attachScheduler","day","mode","tabs","scheduler","obj","document","createElement","id","this","_genStr","innerHTML","body","appendChild","firstChild","attachObject","vs","av","sched","schedId","setSizes","updateView","destructor","init","_viewRestore","globalScope","window","global","global$1","dragHighlightPos","dndMarkers","dragStarted","eventNode","event","isEnabled","config","drag_highlight","markTimespan","checkViewName","viewName","viewObj","getView","layout","checkSectionPropertyName","y_property","map_to","setRequiredStylesToMarker","style","top","left","marginLeft","createMarkerConfig","configSettings","sectionId","sections","markerObject","start_date","end_date","css","html","date","add","createViewMarker","settings","markerConfigs","getMonthViewMarkers","getTimelineAndUnitsViewMarkers","getColumnViewMarkers","forEach","cfg","push","columnViewMarkersArray","eventNodes","$container","querySelectorAll","event_attribute","i","length","eventNodeClone","cloneNode","startDate","Date","getAttribute","endDate","dates","monthViewMarkersArray","weekDates","currDate","valueOf","week_start","cells","unitMarkersArray","sectionPropertyName","multisection","String","split","section_delimiter","formatedSections","map","element","elems","attachEvent","e","getEvent","target","closest","getState","cascade_event_display","unselect","getActionData","section","unmarkTimespan","undoDelete","ev","deletedEvent","copy","undo_deleted","new_event","message","text","expire","type","callback","undoBtn","addEvent","render","limitPlugin","mark_now","display_marked_timespans","overwrite_marked_timespans","dhx_time_block","default_timespan_type","fix_options","options","days","zones","get_resulting_options","blockTime","addMarkedTimespan","unblockTime","deleteMarkedTimespan","checkInMarkedTimespan","timespan_type","on_overlap","res","temp_start_date","temp_end_date","timespans","_marked_timespans","date_part","day_value","day_index","getDay","getZones","eventStart","_get_zone_minutes","eventEnd","getDate","markerStart","markerEnd","checkLimitViolation","check_limits","s","c","evs","rec_type","_end_date","seriesEnd","limit_start","limit_end","recEventInLimits","complete_res","p","_timed","isOneDayEvent","allow","_drag_id","_drag_mode","setHours","setMinutes","checkEvent","callEvent","_get_blocked_zones","property","timeline_zones","blocked_timeline_zones","_get_relevant_blocked_zones","_add_timespan_zones","resultZones","concat","containers","_props","matrix","container","view","view_config","linker","_mark_now","hide","dhx_now_time","_els","now","_currentDate","_remove_mark_now","_max_date","_min_date","getHours","first_hour","last_hour","locate_holder_day","_append_mark_now","zone_start","_table_view","_mode","start_index","end_index","units_l","size","position","r_divs","t_day","t_div","_render_marked_timespan","els","div","parent","parentNode","removeChild","getMinutes","_prepare_timespan_options","r_configs","temp_configs","Array","t_days","slice","cloned_config","_lame_clone","apply","undefined","min","max","invert_zones","invertZones","uid","view_key","hasOwnProperty","ids","t_config","_lame_copy","k","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","index","start","end","start_day","delta","t_date","_get_css_classes_by_config","css_classes","join","_get_block_by_config","block","area","blocks","min_date","max_date","date_to_display","min_day","areas","_scales","sday","_cols","_ignores","block_proto","className","height","width","order","inner_index","locate_holder","Math","all_hours_height","hour_size_px","hour_ms","round","_mark_timespans","data","divs","_on_scale_add_marker","len","childNodes","_getClassName","indexOf","configuration","Error","rebuild_els","get_elements","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","offset","splice","_subtract_timespan_zones","is_modified","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","d","dayConfig","day_timespans","d_t","related_zones","arguments","types","t","typedConfig","_get_types_to_render","common","specific","types_to_render","_get_configs_to_render","units","_get_unit_index","unit","_date","dx","day_ind","unitsPerDay","floor","key","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","src","dblclick_create","addEventNow","createMethod","methods","isActive","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","call","restoreMethods","batchUpdatePayload","console","error","$stateProvider","registerProvider","batch_update","batchUpdate","noRedraw","call_dp","_dp","updateMode","dp_mode","setUpdateMode","calls","setModeDate","needRender","needUpdateView","repaintEvents","rememberModeDate","setCurrentView","render_data","render_view_data","updateEvent","sendData","initPlugins","limit","uidSeed","isArray","pop","isStringObject","Function","prototype","toString","constructor","isNumberObject","isBooleanObject","isDate","getFullYear","getMonth","defined","delay","timeout","timer","result","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","utils","mixin","source","force","f","object","Number","Boolean","varType","Object","StateService","stateProviders","name","provider","method","internal","unregisterProvider","assert","check","show_errors","log","extend","commonViews","agenda","grid","timeline","week_agenda","year","anythingElse","requiredExtensions","_commonErrorMessages","unknownView","relatedDoc","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","renderCalendar","exportToPNG","exportToPDF","dhtmlxError","catchError","a","b","responseText","ajax_error","alert","classes","cssClass","classList","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","isCalendarVisible","destroyCalendar","navigation","handler","calendar","html_element","findRenderer","renderer","rows","cols","renderElement","value","align","justifyContent","prepareConfig","renderLayout","fragment","createDocumentFragment","items","next","_init_nav_bar","navBar","querySelector","_update_nav_bar","previousHeight","heightChanged","configChanged","newHeight","xy","nav_height","unset_actions","set_actions","display","isAttachedNode","root","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","equals","listenWindowResize","oldSize","resizeDelay","$destroyed","newSize","triggerSchedulerResize","$root","watchNodeResize","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","addResizeListener","containerStyles","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","salesforce_environment","contentWindow","EventHost","_silent_mode","listeners","createEventStorage","handlers","eventStorage","combinedResult","handlerResult","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","innerId","attachAll","eventArguments","handlerName","detachEvent","list","eventId","detachAllEvents","extend$l","_detachDomEvent","el","removeEventListener","_init_once","scheduler_resize_listener","navbar","header","dataArea","hasSchedulerMarkup","createDefaultHeader","views","nav","_grid","names","optionalViews","_obj","getElementById","wai_aria_application_role","JSON","stringify","rtl","_skin_init","_scroll","init_templates","_init_touch_events","set_sizes","$initialized","min_event_height","bar_height","scale_width","scroll_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","keys","edit_save","edit_cancel","functor","_x","scale_x","materialScalePlaceholder","_is_material_skin","insertBefore","set_xy","offsetTop","_lightbox","_setLbPosition","_data_width","right","node","x","y","prepareValue","val","prepared","isNaN","direction","getElementsByTagName","class_name","attr_value","label","locale","labels","_waiAria","labelAttr","domEventsScope","_createDomEventScope","detachAll","_click","attach","preventDefault","_temp_touch_block","_on_mouse_move","_ignore_next_click","_on_mouse_down","_on_mouse_up","_on_dbl_click","returnValue","_locate_event","select","_select_id","_close_not_saved","editStop","previousSelection","editor_id","_edit_id","lightbox_id","_lightbox_id","_new_event","select_id","expanded","drag_id","drag_mode","dhx_cal_data","cancelBubble","readonly","icon","mask","buttons","replace","dhx_cal_prev_button","dhx_cal_next_button","dummy","step","def_step","dhx_cal_today_button","dhx_cal_tab","deprecated_name","substring","search","delete","confirm_deleting","_dhtmlx_confirm","title","title_confirm_deleting","deleteEvent","ok","icon_delete","edit","save","details","showLightbox","form","cancel","opts","confirm","base","_isObject","_isDate","duration","event_duration","time_step","start_hour","setTime","_loading","_drag_event","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","isIE","pageX","pageY","clientX","scrollLeft","clientLeft","clientY","scrollTop","clientTop","_colsS","$domHelpers","getAbsoluteLeft","getAbsoluteTop","dy","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","confirm_closing","title_confirm_closing","positive_closing","_drag_pos","_correct_shift","back","getTimezoneOffset","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","acc","abs","d_pos","has_moved","_correct_drag_start_date","_start_correction","_end_correction","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","time_part","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","lastHour","maxY","precisePos","minDate","maxDate","preciseDate","cursor","shift","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","_allow_dnd","update_render","sx","update_view","for_rendered","r","srcElement","classname","drag_event_body","fullClass","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","_mobile","moved","_dhx_changed","is_new","edit_on_create","details_on_create","_trigger_dyn_loading","_load_mode","_load","_render_wait","_reset_ignores","_reset_scale","isViewExists","templates","_set_aria_buttons_attrs","buttonGroups","group","j","prev","headerButtonsAttributes","icon_form","icon_edit","oldClass","newClass","dhx_multi_day","prev_scroll","preserve_scroll","multidayScroll","_dy_shift","tab","headerToggleState","remove","_render_x_header","offset_top","head","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","from","to","count","count_n","_get_timeunit_start","_get_view_end","dd","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","parseInt","scales","cls","firstHalf","slotDate","format_date","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","day_start","_getNavDateElement","str","drag_resize","drag_move","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","visibility","totalWidth","col_length","hiddenWidth","c2","cc","content","hour_scale","hourScaleAttr","scroll_hour","now_date","n","preserve","ignore","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","month_day","cellBody","bf1","parse_date","getLabel","lightbox","updateCollection","list_name","collection","serverList","resetLightbox","hideCover","cache","create","n_ev","_focus","focus","getDaysDifference","differenceInTime","getTime","differenceInDays","eventLength","startColumnIndex","endColumnIndex","_get_date_index","last_column","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","fd","start_slot","end_slot","_get_section_property","_is_initialized","state","_is_lightbox_open","defaultDomEvents","addEventListener","eventRemove","createEventScope","domEvents","eventScope","capture","detach","staticArray","_eventRemoveAll","_trim","func","trim","htmlTags","RegExp","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","attr","attributes","setAttributes","values","day_date","role","getHeaderCellAttr","dateString","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","attrs","agendaDetailsBtnString","icon_details","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","month","hour","minute","messageButtonAttrString","buttonLabel","messageInfoAttr","messageModalAttr","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","isDisabled","payload","elementPosition","elem","bottom","getBoundingClientRect","box","docElem","pageYOffset","pageXOffset","offsetLeft","offsetParent","getRelativeEventPosition","getNodePosition","getClassName","baseVal","getTargetNode","trg","tagName","shadowRoot","composedPath","locateCss","strict","ind","charAt","isVisible","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","hasHref","canHaveHref","nodeName","loLowerCase","canDisable","input","textarea","hasAttribute","getFocusableNodes","nodes","nodesArray","$position","sort","isValid","isShadowDomSupported","createShadowRoot","attachShadow","getActiveElement","activeElement","getSelection","focusNode","getRootNode","ShadowRoot","host","hasShadowParent","dom_helpers","htmlObject","getOffset","getOffsetSum","getOffsetRect","test","navigator","userAgent","dummyBox","selector","insertAfter","newNode","referenceNode","nextSibling","isChildOf","child","contains","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isOpera","isChrome","isKHTML","isFF","isIPad","isEdge","isNode","clearAll","serialize$1","serialized","encodeURIComponent","Promise","createConfig","url","async","headers","serialize","ajax","serializeRequestParams","parse","DOMParser","parseFromString","ActiveXObject","loadXML","xmltop","tagname","xhr","status","xml","responseXML","xpath","xpathExp","docObj","selectNodes","first","col","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","query","_call","get","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","match","readyState","xmlDoc","filePath","open","setRequestHeader","toUpperCase","send","urlSeparator","$ajax","generateStringToDate","format","utc","splt","code","csp_date_to_str","to_fixed","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","month_short","month_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","csp_str_to_date","set","temp","month_short_hash","month_full_hash","UTC","cspEnabled","checkIfCSPEnabled","useCsp","csp","old","setSeconds","setMilliseconds","start_on_monday","month_start","setDate","year_start","setMonth","_add_days","inc","ndate","datesDiff","rest","hours","setYear","num","date_to_str","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","isYMDDate","datestr","isMDYDate","isDMYDate","isISO8601","parseYMD","parseMDY","parseDMY","parse_exact_format","nday","first_thursday","year_number","ordinal_date","week_number","convert_to_utc","default_date","month_date","load_date","week_date","hour_date","date_format","api_date","displayed_event_color","displayed_event_text_color","wide_form","day_column_padding","use_select_menu_space","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","server_utc","touch","touch_tip","touch_drag","touch_swipe_dates","quick_info_detached","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","delay_render","timeline_swap_resize","$initial","_helpers","parseDate","xml_date","formatDate","xml_format","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","load_format","event_header","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","_events","_loaded","clear_view","extra_data","event_updated","silent","setEvent","hash","_rendered","changeEventId","new_id","create_getter","create_setter","_changed","is_visible_events","clear_event","in_visible_range","evFirstHour","evLastHour","end_dates_visible","hidden_duration","checkEndDate","get_visible_events","only_timed","stack","filter_event","filter","_is_main_area_event","hold","full","_not_render","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","getEvents","_get_event_bar_pos","widt","x2","_pre_render_events","render_event_bar","max_evs","max_month_events","_sorder","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_line","_pre_render_events_table","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","t_end_date","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","cellIndex","weekCellIndex","out","weeks","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","parentPosition","zIndex","color","setProperty","tplClass","cssText","_editor","shiftKey","keyCode","icons","icons_str","ariaAttr","currentIcon","textColor","highlightEventPosition","contentA","contentB","cs","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","restoreOriginalColors","getSectionTop","posFromDate","_smartRenderingEnabled","scrollTo","_append_drag_marker","m","zone","scale","lastChild","previousSibling","_update_marker_position","_parsers","canParse","topElement","loader","csrfToken","security_key","arr","itms","itm","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","err","events","dhx_security","collections","collections_loaded","option","option_key","ical","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","dh","dm","utcMark","dn","getSerializator","_load_url","prevent_cache","ajaxCallback","response","on_load","lf","cache_line","temp_to","extend$a","extend$9","extend$8","foundParser","parser","_process","_process_loading","_after_call","_tagvalue","_init_date","getSerializableData","createSerializator","dataset","allEvents","exportedEvent","exportValue","rawValue","load","setLoadMode","array","show_loading","_y","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","time","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","dt","last","limit_time_select","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","full_day","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","getLightboxRoot","cspEnvironment","salesforceEnvironment","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","action","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","labelBlock","inputBlock","fallback","inputId","old_id","mobile","MSStream","platform","maxTouchPoints","touchEventsSupported","createEvent","_touch_events","touches","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","accessor","tracker","scroll_mode","action_mode","dblclicktime","attachTouchEvent","passive","check_direction_swipe","s_ev","e_ev","max_dy","scrollable","doMouseMove","dnd","original_render","_update_global_tip","drag_cancel","_pointerDragId","pointerId","fake_event","_block_next_stop","actTask","fakeTask","sourceTask","_show_global_tip","_hide_global_tip","toptip","_global_tip","drag_to_create","drag_to_move","getRootView","tag","hooks","didInsert","cmp","_addThemeClass","skin","_skin_settings","_skin_xy","lightbox_additional_height","checkIfMaterialSkin","themeNameFromFile","links","href","_build_skin_info","monitorThemeChange","styles","themeVar","isCssVarTheme","themeName","cssValues","oldMaterialTheme","_theme_info","theme","cssVarTheme","themeVariables","calculatedMaterial","probe","cachedBorderBoxValue","checkIfBorderBoxStyling","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","newStyling","_configure","setSkin","flatSkinHourScale","monitorIntervalId","clearInterval","setInterval","csstheme","_old_month_day","old_month_day","reorderTabs","specialTabs","tabName","find","firstTab","reverse","jQuery","$","counter","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","self","oldDate","oldMode","updateFlags","lazy_updateView","ars","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","_add_rec_marker","extendScheduler","_is_virtual_event","getUserData","_set_event_text_style","rec_pattern","_dp_change_event_id","_dp_hook_delete","setDp","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","setTransactionMode","total","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","_columns","getSyncState","enableDataNames","enablePartialDataSend","master","rowId","findRow","existing","set_invalid","is_invalid","markRow","_methods","getActionByState","checkBeforeUpdate","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","pref","_applyPayload","dataToSend","_onResolvedCreateUpdate","resultState","sid","tid","afterUpdateCallback","routerMode","actionPromise","update","then","catch","queryParams","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","preprocessedData","_cleanupItemBeforeSend","valid","_forEachUpdatedRow","_getAllData","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","processedData","updatedItem","output","_prepareDataItem","item","processedItem","dataItem","createDataProcessor","tMode","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","which","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","buttonCss","info","timers","pull","getFirstDefined","_boxStructure","contentId","inner","message_ok","message_cancel","btn","_createBox","hidden","alertPopup","confirmPopup","boxPopup","box_params","params","alertBox","confirmBox","focusable","subtype","seed","hideAll","popups","modalbox","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","section_description","section_time","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","repeat_never","repeat_daily","repeat_workdays","repeat_weekly","repeat_monthly","repeat_yearly","repeat_custom","repeat_freq_day","repeat_freq_week","repeat_freq_month","repeat_freq_year","repeat_on_date","repeat_ends","month_for_recurring","day_for_recurring","be","agenda_tab","description","year_tab","week_agenda_tab","ca","cn","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","i18nFactory","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","labelFormat","dayElement","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","dayStart","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","stateProvider","common_errors","schedulerCore","wai_aria","dom","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","event_highlight","dhtmlx_suite_hooks","skins","jquery","dataProcessorExtend","connector","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","addPlugins","ext","activePlugins","plugins","extensionList","getExtensionList","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","ExtensionsManager","_extensions","SchedulerFactory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","calendars","addCalendar","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","_agendaScrollTop","set_full_view","l","rowAttr","dateHeader","descriptionHeader","tableAttr","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","agenda_area","v_border","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","renderEmptyView","renderDay","calendarEvent","renderOneEvent","selectedId","bg","all_timed_month","is_event_short","_safe_copy","proto","event_pid","isPrototypeOf","event_length","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","before","collision_limit","_setTempSection","event_id","checked_mode","checkCollision","edited_ev","_roll_back_dates","_check_sections_collision","second","evs_dates","getRecDates","tevs","concurrent","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","rows_length","year_y","week_agenda_scale_height","cur_height","eventsContainer","g","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","setCookie","cookie_param","getCookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","old_load","notImplemented","daytimeline_restricted","drag_between_restricted","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","all_options","single_option","addOption","getIndexByValue","selectOption","selected_id","disable","setComboValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","grid_view","html_templates","all","keyboard_shortcuts","$keyboardNavigation","shortcuts","createCommand","modifiers","alt","ctrl","meta","shortcut","commands","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","ctrlKey","metaKey","printableKey","fromCharCode","getHashFromEvent","getHash","parts","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","eventhandler","EventHandler","_handlers","findHandler","doAction","unbind","bindAll","initKeys","trap_modal_focus","trapFocus","currentFocus","currentIndex","nextIndex","nextItem","renderMultiple","currentStart","currentEnd","TimeSlot","_modes","_getMode","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","round_position","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","_timeline_getX","tempStart","tempEnd","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","lineHeight","scheduler_node","SchedulerNode","_compose","getDefaultNode","getMode","blur","enable","removeAttribute","_compareEvents","_pickEvent","startId","eventElement","Event","getNode","nextEventHandler","activeNode","dispatcher","nextEvent","currEvent","visibleDates","nextEv","setActiveNode","prevEventHandler","HeaderCell","getNodes","_key_nav_copy_paste","nav_node","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","header_cell","defaultCell","_getSection","_getNodes","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","isMultisectionEvent","keepScrollPosition","_moveToSlot","slot","nextSlot","time_slot","movingDate","getDefaultDate","key_nav_step","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","clone","timeslot","_getMultisectionView","_getNextSection","isInRange","defaultSlot","DataArea","smart_rendering","_pasteDate","_pasteSection","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","minutes","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","minical_button","MinicalButton","globalNode","MinicalCell","minical_cell","_getGrid","_getNode","enabled","newRow","newCol","modals","modalsStack","isModal","afterPopup","startModal","endModal","isTopModal","currentTarget","traceLightbox","_keyNavMessagePopup","focusElement","backupFocus","core","getActiveNode","setDefaultNode","focusGlobalNode","blurNode","editor","keyDownHandler","defaultPrevented","schedulerNode","_timeout","key_nav_legacy","_temp_key_scope","key_nav","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","clear_event_after","copyEvent","_make_pasted_event","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","getSelectedEvent","_buffer_event","new_ev","scheduler_handlers","attachSchedulerHandlers","focusHandler","waitCall","reFocusActiveNode","mousedownHandler","dataAreaClick","listOfScales","arrOfScales","some","focusEvent","evNode","prevState","lastStart","lastEnd","lastSection","minical_handlers","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","td","renderMinical","cal","added","destroyMinical","_def_count","addShortcut","scope","scopeObject","getScope","getShortcutHandler","removeShortcut","disp","scopes","minicalButton","minicalDate","timeSlot","searchMap","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_view","_temp_limit_scope","om","od","nm","nd","isBlocked","date_end","resetDate","is_new_event","data_copy","native_object","_mark_now_timer","GoogleMapAdapter","_markers","zoom","zoom_after_resolve","initial_zoom","lat","lng","setCenter","setZoom","error_position","google","maps","trigger","mapOptions","center","initial_position","mapId","scrollwheel","mapTypeId","Map","__gm","messageOverlay","outerContainer","setOptions","addListener","geocoder","Geocoder","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","event_location","formatted_address","clearInstanceListeners","AdvancedMarkerElement","importLibrary","mapView","createMarker","setMap","infoWindow","close","InfoWindow","maxWidth","info_window_max_width","setContent","map_info_content","anchor","markerInfo","setVisible","setPosition","latlng","LatLng","latitude","longitude","string","address","OpenStreetMapAdapter","openPopup","closeTooltip","setView","mapWrapper","L","tileLayer","addTo","on","fetch","country","myIcon","iconUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupConfig","minWidth","markerPopup","popup","tooltip","markerConfig","bindPopup","bindTooltip","removeLayer","setLatLng","resolveAddress","lon","MapboxAdapter","getPopup","isOpen","togglePopup","mapboxgl","accessToken","lngLat","features","place_name","Popup","focusAfterOpen","setMaxWidth","setHTML","Marker","setLngLat","setPopup","map_view","mapAdapter","eventHandlerIds","adapters","googleMap","openStreetMaps","mapbox","createAdapter","map_view_provider","currentAdapter","_latLngUpdate","_eventLocationChanged","map_settings","resolve_user_location","resolve_event_location","view_provider","map_initial_position","map_error_position","map_date_width","map_icon_width","map_description_width","add_map","map_date","map_time","map_text","map_start","setupMapView","attachSchedulerEvents","addEventWithLocation","coordinates","removeEventMarker","addEventMarker","setUserLocation","adapter","geolocation","getCurrentPosition","coords","dblclick_dhx_map_area","unmodifiedEvent","updateEventMarker","newIdEvent","onEventClick","detachSchedulerEvents","map_initial_zoom","map_zoom_after_resolve","map_infowindow_max_width","map_resolve_user_location","map_type","map_resolve_event_location","fill_map_tab","clearEventMarkers","map_end","mapContainer","_setMapSize","destroy","initialize","elem_id","marginRight","marginTop","_selected_event_id","ariaButtonAttr","_updateEventLocation","_delay","ret","_event_resolve_delay","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","cont","tpos","_get_def_cont","_render_calendar","$dom","cellRoot","dateAttribute","unmarkCalendar","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","refreshOnLoad","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","arrow","dayHeaders","dayCells","inputs","selects","inp","number","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","noHighlight","monthheight","old_s","multisection_restricted","multiselect","parseXMLOptions","parseJSONOptions","_result","_children","_mark_inputs","_ids","delimiter","script_url","divLoading","multisource","backup","mvc","use_id","sanitize","update_timer","_start_ext_load","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","dragger","dhtmlDragAndDropObject","stopDrag","last_event","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","parseFloat","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_start","xml_end","xml_top","profile","footer","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","getPDFData","send_xml","submit","to_pdf","schedulersToPdf","objects","toPDF","toPDFRange","quick_info","show_quick_info","clickedElementPosition","_$quickInfoHandler","getPositionInsideScheduler","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","ontransitionend","fitQIInsideWindow","quickInfoPopup","popupRect","containerRect","offsetBottom","_quick_info_onscroll_handler","$testmode","_qi_button_click","domEv","titleContent","titleDate","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","txt_replace","txts","txtt","originalForm","readonlyForm","_lightbox_r","ALL_WEEKDAYS","Weekday","weekday","fromStr","nth","other","getJsWeekday","isPresent","isNumber","isWeekdayStr","includes","rang","repeat","times","toArray","padStart","targetLength","padString","sep","splits","pymod","divmod","mod","empty","notEmpty","datetime","MONTH_DAYS","ONE_DAY","MAXYEAR","ORDINAL_BASE","PY_WEEKDAYS","isLeapYear","isValidDate","daysBetween","date1","date2","date1ms","date2ms","differencems","toOrdinal","fromOrdinal","ordinal","getMonthDays","getWeekday","monthRange","combine","getMilliseconds","dolly","cloneDates","clones","timeToUntilString","untilStringToDate","until","bits","dateTZtoISO8601","timeZone","dateStr","dateInTimeZone","localTimeZone","Intl","DateTimeFormat","resolvedOptions","dateInLocalTZ","dateInTargetTZ","tzOffset","IterResult","after","accept","tooEarly","tooLate","extendStatics","setPrototypeOf","__proto__","__extends","TypeError","__","__assign","assign","__spreadArray","pack","SuppressedError","suppressed","CallbackIterResult","_super","iterator","_this","ENGLISH","dayNames","monthNames","tokens","SKIP","numberAsText","every","at","the","third","for","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","may","june","july","august","september","october","november","december","comma","defaultGetText","defaultDateFormatter","ToText","rrule","gettext","language","dateFormatter","origOptions","bymonthday","bynmonthday","byweekday","allWeeks","someWeeks","isWeekdays","isEveryDay","sortWeekDays","isFullyConvertible","canConvert","freq","IMPLEMENTED","RRule","FREQUENCIES","plural","HOURLY","MINUTELY","DAILY","bymonth","_bymonth","_bymonthday","_byweekday","byhour","_byhour","WEEKLY","MONTHLY","YEARLY","byyearday","byweekno","weekdaytext","monthtext","npos","wday","finalDelim","delim","delimJoin","finalDelimiter","o","realCallback","Parser","rules","done","nextSymbol","isDone","symbol","best","bestSymbol","rule","name_1","v","acceptNumber","expect","parseText","ttr","S","AT","F","MO","TU","WE","TH","FR","ON","wkd","decodeWKD","MDAYs","decodeM","decodeNTH","Frequency","freqIsDailyOrGreater","fromText","toText","Time","millisecond","DateTime","fromDate","getYear","addYears","years","addMonths","yearDiv","monthMod","addWeekly","wkst","fixDay","addDaily","addHours","filtered","_a","dayDiv","hourMod","addMinutes","byminute","hourDiv","minuteMod","addSeconds","seconds","bysecond","minuteDiv","secondMod","daysinmonth","SECONDLY","initializeOptions","_i","keys_1","defaultKeys","parseOptions","DEFAULT_OPTIONS","byeaster","dtstart","bysetpos","bynweekday","parsedOptions","buildTimeset","millisecondModulo","timeset","parseString","rfcString","parseLine","parseDtstart","line","dtstartWithZone","tzid","parseRrule","strippedLine","Days","parseNumber","optionKey","parseWeekday","parseIndividualNumber","SyntaxError","wdaypart","DateWithZone","RangeError","defineProperty","enumerable","configurable","isUTC","rezonedDate","optionsToString","outValue","buildDtstart","strValues","ruleString","argsMatch","Cache","between","_cacheAdd","what","_value","_cacheGet","cached","argsKeys","findCacheDiff","cachedObject","iterResult","M365MASK","M366MASK","M28","M29","M30","M31","MDAY366MASK","MDAY365MASK","NM28","NM29","NM30","NM31","NMDAY366MASK","NMDAY365MASK","M366RANGE","M365RANGE","WDAYMASK","wdaymask","rebuildYear","firstyday","yearlen","nextyearlen","yearordinal","yearweekday","baseYearMasks","wnomask","firstwkst","wyearlen","no1wkst","numweeks","lnumweeks","lyearweekday","lno1wkst","lyearlen","weekst","mmask","mdaymask","nmdaymask","mrange","rebuildMonth","lastyear","lastmonth","nwdaymask","ranges","easter","yearStart","Iterinfo","rebuild","yearinfo","monthinfo","eastermask","ydayset","mdayset","_","wdayset","ddayset","htimeset","mtimeset","stimeset","getdayset","gettimeset","buildPoslist","ii","dayset","poslist","daypos","timepos","tmp","iter","emitResult","counterDate","makeTimeset","removeFilteredDays","rezoneIfNeeded","currentDay","isFiltered","dayCounter","SA","SU","noCache","_cache","fromString","_iter","isFullyConvertibleToText","iterSet","_rrule","_exrule","_rdate","_exdate","_exdateHash","_accept","evalExdate","zonedDate","unfold","forceset","compatible","parseInput","rrulevals","rdatevals","exrulevals","exdatevals","parsedDtstart","lines","splitIntoLines","_b","breakDownLine","parms","_c","rdateTzid","parseRDate","buildRule","rset_1","RRuleSet","groomRruleOptions","rdate","exrule","exdate","rrulestr","extractName","validateDateParm","parm","rdateval","createGetterSetter","fieldName","field","field_1","_addRule","_addDate","rrules","exrules","rdates","exdates","_dtstart","rdatesToString","rrs","clearMilliseconds","isDeletedOccurrence","isSeries","recurring_event_id","clearRecurringProperties","original_start","createException","nid","nev","_rec_temp","_rec_markers_pull","_rec_markers","_pid_time","_get_rec_marker","ch","_get_rec_markers","old_add_event","ev_id","_ignore_call","tev","_pid_changed","deleteEventFromSeries","idTimestamp","_is_modified_occurence","sub","isEventFound","_start_date","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","groupExceptions","exceptions","get_visible_events_rec","repeat_date","old_update_event","toIcalString","non_render","maxCount","seriesExceptions","utcStart","parsedRRule","repeatedDates","adjustedDate","visibleCount","eventDuration","exception","_fix_daylight_saving_date","recurrings","sev","occurence","include_end_by","recurring_workdays","getTopLevelOption","rruleObj","untilDate","hasEndCondition","getWeekdayOfMonth","dayOfWeek","dayOfMonth","dayNumber","jsDaysToRRULEDays","RruleDayNumsToJs","fillCustomDaily","fillCustomWeekly","dayCheckboxes","dayNum","dayLabel","fillCustomMonthly","dateOfMonth","nthWeekDayOfMonth","repeat_monthly_date","repeat_monthly_weekday","formatDayNumber","nthDayOfMonth","repeat_yearly_month_date","repeat_yearly_month_weekday","fillCustomYearly","dateOfYear","nthWeekDayOfYear","fillEndRule","countInput","ondateInput","endOptionSelect","formatter","repeat_date_of_end","dispatchEvent","getRecValue","WORKDAYS","CUSTOM","monthRepeat","yearRepeat","endRule","NEVER","fillInDefaults","rec","_get_node","_outer_html","loc","_init_set_value","_ds","show","onRepeatOptionChange","onCustomRepeatIntervalChange","weekly","monthly","yearly","onCustomRepeatEndRule","_rec_init_done","rf","blocked","rruleset","topOption","customFreq","actual_dates","timeControl","getTimeSection","recurrence","_start","getFirstSectionOfType","recurring_legacy","occurrence_timestamp_in_utc","outerHTML","getOuterHTML","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","str_date_format","str_date","date_str","register_els","inps","change_current_view","get_repeat_code","get_rcode","get_end_rule","transpose_type","transp","set_end_rule","has_values","_get_repeat_code","get_numeric_value","repeat_precise","start_exists","transpose_day_week","set_rcode","set_repeat_code","MouseEvent","_set_repeat_code","elements","_toggle_block","_get_button","getRecurringSection","_get_form","backgroundPosition","transponse_size","day_week","originalMonth","cday","newMonth","cor","cor2","transposeRecurring","recurringParts","dayDurationMs","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","startHour","ted","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","timeline_restricted","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","viewport","_getViewPortSize","tooltipNode","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","_getViewPort","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","delayShow","utils.default","tooltip_timeout","tooltip_hide_timeout","tooltipManager","tooltips","tooltipFor","touch_tooltip","targetEventId","hideTooltip","treetimeline_restricted","units_restricted","s2d","d2s","select_event","week_agenda_restricted","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_year_grid","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","datepicker","locateEvent","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","add_export_methods","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","fail","_plain_export_copy","$text","_create_hidden_form","_hidden_export_form","_get_export_size","A5","A4","A3","A2","A1","A0","dataX","dataY","headY","multY","cSize","getTimeline","getInitialSizes","smartRendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","setExportSizes","initialSizes","setInitialSizes","gplExtensions","drag_between","factory","$dhx"],"mappings":";;;;AACe,WAAAA,aAAAA;AAEf,eAAWC,UAAU,eAAeA,OAAOC,UAAU;AACpDD,aAAOC,SAASC,kBAAkB,SAAUC,KAAKC,MAAMC,MAAMC,YAAAA;AAC5D,YAAID,OAAOA,QAAQ;AACnB,YAAIE,MAAMC,SAASC,cAAc;AACjCF,YAAIG,KAAK,iBAAiBC,KAAKC,QAAQ,EACvCL;AAAAA,YAAIM,YAAY,cAAcN,IAAIG,KAAK,qPAAqPL,OAAO;AACnSG,iBAASM,KAAKC,YAAYR,IAAIS;AAE9BL,aAAKM,aAAaV,IAAIG,IAAI,OAAO;AAEjCC,aAAKO,GAAGP,KAAKQ,EAAAA,EAAIC,QAAQd;AACzBK,aAAKO,GAAGP,KAAKQ,EAAAA,EAAIE,UAAUd,IAAIG;AAC/BJ,QAAAA,WAAUgB,WAAWhB,WAAUiB;AAC/BjB,QAAAA,WAAUkB,aAAa;;AACvBlB,QAAAA,WAAUmB,KAAKlB,IAAIG,IAAIP,KAAKC;AAE5B,eAAOO,KAAKO,GAAGP,KAAKe,aAAAA,CAAAA,EAAgBN;AAAAA,MACtC;AAAA,IACA;AAAA,EAEA;;ACrBA,MAAIO;AACJ,MAAUC,OAAAA,WAAW,aAAY;AAChCD,kBAAcC;AAAAA,EACf,OAAK;AACJD,kBAAcE;AAAAA,EACf;AAGA,QAAAC,WAAeH;ACVA,WAASI,iBAAiBzB,YACrC;AAAA,QAAI0B,aAAa,CACjB;AAAA,QAAIC,cAAc;AAClB,QAAIC,YAAY;AAChB,QAAIC,SAAQ;AAEZ,aAASC,aACL;AAAA,aAAO9B,WAAU+B,OAAOC,kBAAkBhC,WAAUiC;AAAAA,IACvD;AAED,aAASC,cAAcC;AACnB,YAAMC,UAAUpC,WAAU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AAiBqoD;AAEhC,QAAC3vH,YAAY6vH,QAAQ9/D,qBACrB;AAAA,QAACD,cAAY,EACjB6W,QAAQ3mE,UAAUkjB,KAAK2sG,QAAQlpD,QAAQkpD,OAAAA,EAAAA;AAGxCvuH,SAAOtB,YAAYA;AACnBsB,SAAOwuD,YAAYA;AAEnB,MAAIxuD,CAAAA,OAAOwuH,MAAM;AAChBxuH,WAAOwuH,OAAO;EACf;AAEAxuH,SAAOwuH,KAAK9vH,YAAYA;AACxBsB,SAAOwuH,KAAKhgE,YAAYA;;;;;;","x_google_ignoreList":[126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153]} \ No newline at end of file diff --git a/codebase/sources/less/package.json b/codebase/sources/less/package.json index e375035..358b456 100644 --- a/codebase/sources/less/package.json +++ b/codebase/sources/less/package.json @@ -1,6 +1,6 @@ { "name": "dhtmlx-scheduler-skins", - "version": "7.0.5", + "version": "7.1.0", "description": "Less sources and a build tool for DHTMLXScheduler skins", "scripts": { "build": "node scripts.js --file=theme", diff --git a/codebase/sources/less/src/agenda_legacy.less b/codebase/sources/less/src/agenda_legacy.less index d72c8cd..3daba0f 100644 --- a/codebase/sources/less/src/agenda_legacy.less +++ b/codebase/sources/less/src/agenda_legacy.less @@ -65,4 +65,5 @@ position: absolute; height: 100%; border-left: var(--dhx-scheduler-default-border); + top:0; } \ No newline at end of file diff --git a/codebase/sources/less/src/lightbox.less b/codebase/sources/less/src/lightbox.less index 2fb7252..14b9397 100644 --- a/codebase/sources/less/src/lightbox.less +++ b/codebase/sources/less/src/lightbox.less @@ -474,7 +474,43 @@ max-width: 165px; } - .dhx_lightbox_time_select{ + .dhx_lightbox_time_select { width: 95px; } +} + +.dhx_form_rrule { + display: flex; + flex-direction: column; + gap: 8px; + + .dhx_form_repeat_custom, + .dhx_form_repeat_ends, + .dhx_form_repeat_ends_extra { + display: flex; + flex-direction: column; + gap: 8px; + } + + .dhx_form_repeat_ends_options { + display: flex; + gap: 8px; + } + + label { + display: inline-flex; + align-items: center; + vertical-align: top; + gap: 4px; + } + + input[type="number"] { + width: 80px; + } + + .dhx_form_repeat_custom_week { + display: flex; + flex-wrap: wrap; + gap: 8px; + } } \ No newline at end of file diff --git a/codebase/sources/less/src/misc.less b/codebase/sources/less/src/misc.less index f93c0ee..0689b16 100644 --- a/codebase/sources/less/src/misc.less +++ b/codebase/sources/less/src/misc.less @@ -43,4 +43,48 @@ padding-top: 4px; padding-bottom: 4px; } +} + + +/* undo delete */ + +.scheduler-info.scheduler-popup_after_delete{ + cursor: default ; + border-radius: var(--dhx-scheduler-border-radius); + padding: 0; + width: 225px; + --dhx-scheduler-info-background: var(--dhx-scheduler-undo-delete-background); + --dhx-scheduler-info-color: var(--dhx-scheduler-undo-delete-color); +} + +.dhx_info_message{ + display: flex; + justify-content: space-between; + align-items: center; + padding: 8px 12px; +} + +.undo_popup_text{ + text-align: center; +} + +.undo_button{ + .button; + .button-link; +} + +/* drag_highlight */ + +.dhx_scheduler_month .dhx_marked_timespan.dhx_scheduler_dnd_marker { + display:block; + margin-top: -4px; +} + +.dhx_marked_timespan.dhx_scheduler_dnd_marker { + justify-content: flex-start; + align-items: flex-start; +} + +.dhx_scheduler_dnd_marker{ + opacity: 0.5; } \ No newline at end of file diff --git a/codebase/sources/less/src/themes/contrast_black.less b/codebase/sources/less/src/themes/contrast_black.less index 0bbfc56..1ca0da2 100644 --- a/codebase/sources/less/src/themes/contrast_black.less +++ b/codebase/sources/less/src/themes/contrast_black.less @@ -36,6 +36,8 @@ --dhx-scheduler-scale-color: var(--dhx-scheduler-base-colors-text-light); --dhx-scheduler-popup-background: #1B1B1C; + --dhx-scheduler-undo-delete-background: var(--dhx-scheduler-popup-background); + --dhx-scheduler-undo-delete-color: var(--dhx-scheduler-base-colors-text-base); // --dhx-scheduler-popup-color: var(--dhx-scheduler-base-colors-text-base); --dhx-scheduler-popup-border: 1px solid #4B4B4B; diff --git a/codebase/sources/less/src/themes/dark.less b/codebase/sources/less/src/themes/dark.less index b06433e..30d2b17 100644 --- a/codebase/sources/less/src/themes/dark.less +++ b/codebase/sources/less/src/themes/dark.less @@ -31,4 +31,5 @@ --dhx-scheduler-popup-border: 1px solid #4B4B4B; --dhx-scheduler-btn-font-weight: 600; + --dhx-scheduler-undo-delete-background: var(--dhx-scheduler-popup-background); } \ No newline at end of file diff --git a/codebase/sources/less/src/themes/variables.less b/codebase/sources/less/src/themes/variables.less index cdf32a5..80de6eb 100644 --- a/codebase/sources/less/src/themes/variables.less +++ b/codebase/sources/less/src/themes/variables.less @@ -260,4 +260,7 @@ --dhx-scheduler-modal-width: 320px; --dhx-scheduler-modal-border-radius: var(--dhx-scheduler-popup-border-radius); + /* undo delete */ + --dhx-scheduler-undo-delete-background: var(--dhx-scheduler-base-colors-text-base); + --dhx-scheduler-undo-delete-color: var(--dhx-scheduler-event-color); } \ No newline at end of file diff --git a/package.json b/package.json index ca5f7a4..74ef81f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dhtmlx-scheduler", - "version": "7.0.5", + "version": "7.1.0", "description": "JavaScript event calendar. Allows to manage events and appointments in different views", "main": "codebase/dhtmlxscheduler.es.js", "types": "codebase/dhtmlxscheduler.es.d.ts", diff --git a/whatsnew.md b/whatsnew.md index 44f8cd0..b84c3e1 100644 --- a/whatsnew.md +++ b/whatsnew.md @@ -1,3 +1,19 @@ +### 7.1.0 + +Storing recurring events in the RRULE format +Map view supports different map providers +The ability to undo an event's deletion +The batchUpdate method for updating multiple events at once +Scheduler highlights the original position of a calendar event during the drag and drop +Fix the incorrect height of the Timeline view section when event_dy is set to "full" +Fix the issue when dynamically changing the x_date property of the Timeline view did not affect the template +Fix the header misalignment in the multiday Units view +Fix the script error that occurred after the destructor is called when the drag_between extension is active +Fix the incorrect behavior of the limit extension, which prevented editing recurring series +Fix the performance issue with events drag and drop in the Tree Timeline view when the show_unassigned option is set to true +Fix the incorrect behavior of the scrollable Timeline view when smart_rendering is set to false +Fix the incorrect scroll position after a view change in a scrollable Timeline view + ### 7.0.5 Fix the incorrect height of the Timeline sections when the event_dy:"full" setting is used